Data processing method and device, equipment, storage medium and program product
By using distributed spatial indexing and hierarchical optimization algorithms, the problem of low efficiency in associating GPS latitude and longitude data with three-tier administrative regions in financial big data scenarios is solved, achieving efficient and accurate data processing and supporting minute-level parsing and downstream services.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA UNIONPAY
- Filing Date
- 2026-01-16
- Publication Date
- 2026-05-12
AI Technical Summary
In the context of financial big data, existing technologies struggle to efficiently correlate massive amounts of GPS latitude and longitude data with three levels of administrative regions to form structured data, resulting in low processing efficiency and an inability to meet timeliness requirements.
By employing a distributed spatial index and hierarchical optimization algorithm, and constructing global and local spatial indexes, the administrative regions corresponding to GPS feature points are quickly filtered out, generating structured data, including the latitude and longitude data of GPS feature points and the administrative data of the three levels of provincial, municipal, and district administrative regions.
It enables minute-level parsing and calculation of tens of millions and hundreds of millions of GPS latitude and longitude data, improving the efficiency and accuracy of data association and supporting downstream services such as risk identification and regional service analysis.
Smart Images

Figure CN122019623A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of computer technology, and in particular relates to a data processing method, apparatus, device, storage medium and program product. Background Technology
[0002] In financial big data scenarios such as payment risk control, transaction geographic statistics, and merchant location matching, it is usually necessary to process hundreds of millions of GPS latitude and longitude data, such as point of sale (POS) machine location data and user device location data. The core requirement is to map each GPS point to a three-tiered administrative region of province-city-district, forming structured data including administrative regions to support downstream services such as risk identification and geographic service analysis.
[0003] Therefore, how to improve the efficiency of linking massive GPS latitude and longitude data with three levels of administrative regions to form structured data including administrative region data in the context of financial big data has become a concern. Summary of the Invention
[0004] This application provides a data processing method, system, apparatus, device, storage medium, and program product that can improve the efficiency of forming structured data including administrative region data by associating massive GPS latitude and longitude data with three-level administrative regions in financial big data scenarios.
[0005] In a first aspect, embodiments of this application provide a data processing method, the method comprising: Retrieve the GPS data set and the administrative region geometric object set corresponding to the query statement. The administrative region geometric object set is a set of polygonal geometric objects representing the three levels of administrative regions: province, city, and district. Based on GPS datasets and administrative region geometric object sets, a distributed spatial index is constructed. The distributed spatial index includes a global spatial partition index and a local spatial index. The global spatial partition index is an index of geographic range partitions across GPS datasets and administrative region geometric object sets, while the local spatial index is an index of a tree-like space within a single partition, organized according to geographic spatial adjacency relationships and formed by the minimum bounding rectangle. Based on the local spatial index of a single partition, the administrative regions corresponding to GPS feature points in the GPS dataset are filtered out, and the GPS feature points in the GPS dataset do not overlap. Based on the administrative regions corresponding to the GPS feature points, structured data is generated. The structured data includes the latitude and longitude data of the GPS feature points and the administrative data of the three levels of administrative regions: province, city, and district.
[0006] Secondly, embodiments of this application provide a data processing apparatus, including: The acquisition module is used to acquire the GPS data set and the administrative region geometric object set corresponding to the query statement. The administrative region geometric object set is a set of polygonal geometric objects representing the three levels of administrative regions: province, city, and district. The building module is used to construct a distributed spatial index based on the GPS data set and the set of administrative region geometric objects. The distributed spatial index includes a global spatial partition index and a local spatial index. The global spatial partition index is an index of the geographic range partition across the GPS data set and the set of administrative region geometric objects. The local spatial index is an index of the tree-like space formed by organizing the minimum bounding rectangle according to the geographic spatial adjacency relationship within a single partition. The filtering module is used to filter out administrative regions that correspond to GPS feature points in the GPS dataset based on the local spatial index of a single partition, provided that the GPS feature points in the GPS dataset do not overlap. The generation module is used to generate structured data based on the administrative regions corresponding to GPS feature points. The structured data includes the latitude and longitude data of the GPS feature points and the administrative data of the three levels of administrative regions (province, city, and district).
[0007] Thirdly, embodiments of this application provide a computer device, which includes: a processor and a memory storing computer program instructions; When the processor executes computer program instructions, it implements the data processing method as described in the first aspect.
[0008] Fourthly, embodiments of this application provide a computer storage medium storing computer program instructions, which, when executed by a processor, implement the data processing method as described in the first aspect.
[0009] Fifthly, embodiments of this application provide a chip, which includes a processor and a communication interface. The communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the data processing method as shown in the first aspect.
[0010] In a sixth aspect, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the data processing method as described in the first aspect.
[0011] The data processing method, apparatus, device, storage medium, and program product of this application embodiment obtain a GPS data set and an administrative region geometric object set corresponding to a query statement. The administrative region geometric object set is a set of polygonal geometric objects representing the three levels of administrative regions (province, city, and district). Based on the GPS data set and the administrative region geometric object set, a distributed spatial index is constructed. The distributed spatial index includes a global spatial partition index and a local spatial index. The global spatial partition index is an index of geographical range partitions across the GPS data set and the administrative region geometric object set. The local spatial index is an index of a tree-like space formed by organizing the minimum bounding rectangles according to the geographical spatial adjacency relationship within a single partition. Based on the local spatial index of a single partition, administrative regions corresponding to GPS feature points in the GPS data set are selected, and the GPS feature points in the GPS data set do not overlap. According to the administrative regions corresponding to the GPS feature points, structured data is generated. The structured data includes the latitude and longitude data of the GPS feature points and the administrative data of the three levels of administrative regions (province, city, and district). In this way, the geographical scope of the GPS dataset and the administrative region geometric object set is divided through a global spatial partition index. The full data in the two sets is decomposed into multiple partitions that are processed in parallel, avoiding the performance bottleneck of a single node processing massive amounts of data. Based on the local spatial index within a single partition, a tree-like space is formed by organizing the minimum bounding rectangle based on the geographic spatial adjacency relationship. This can quickly filter out the administrative regions corresponding to GPS feature points, exclude areas without spatial association, and significantly reduce the amount of computation for subsequent accurate matching. Compared with full traversal matching, the matching efficiency is greatly improved. Moreover, the GPS feature points in the GPS dataset do not overlap, which can also reduce duplicate matching. This effectively improves the efficiency of associating massive GPS latitude and longitude data with three-level administrative regions to form structured data including administrative regions in financial big data scenarios. Furthermore, the structured data generated based on the administrative regions corresponding to GPS feature points can uniformly integrate the latitude and longitude data of GPS feature points with the three-level administrative data of provinces, cities, and districts. It can be directly connected to downstream storage, analysis, or visualization systems without additional format conversion, and can support downstream services such as risk identification and regional service analysis. Attached Figure Description
[0012] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 This is a schematic diagram of a data processing system according to an embodiment of the data processing method provided in this application; Figure 2 This is a flowchart of a data processing method according to an embodiment of the data processing method provided in this application; Figure 3 This is a schematic diagram of the structure of a data processing apparatus provided in one embodiment of this application; Figure 4 This is a schematic diagram of the structure of a data processing device provided in one embodiment of this application. Detailed Implementation
[0014] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.
[0015] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.
[0016] The acquisition, storage, use, and processing of data (including but not limited to features and information mentioned in this document) in the technical solution of this application all comply with the relevant provisions of national laws and regulations.
[0017] In related technologies, structured data including administrative regions can be generated through the following two types of solutions: one is to use a standalone Geographic Information System (GIS) tool, such as the Quantum Geographic Information System (QGIS), combined with a PostgreSQL database and / or the PostGIS GIS; the other is a lightweight distributed solution based on Hadoop MapReduce and custom spatial implementation.
[0018] However, one type of solution is suitable for small-scale data scenarios. For large-scale spatial matching operations, its efficiency is extremely low. Furthermore, conventional GIS libraries, such as JTS and Shapefile tools, cannot fully utilize distributed index structures, resulting in low spatial indexing efficiency. Because it relies too heavily on fixed data patterns, it lacks spatial expression and interaction capabilities, making it difficult to handle multi-level nested relationships at the provincial, municipal, and district levels, and unable to accurately associate GPS latitude and longitude data with three-tiered administrative regions. The second type of solution is based on spatial databases for spatial data storage and computation. Lacking distributed capabilities, all computations rely on single-node resources, resulting in the following limitations: First, PostgreSQL takes several hours to process millions of GPS latitude and longitude data points; processing hundreds of millions of GPS latitude and longitude data points triggers an Out of Memory (OOM) error, making it completely unable to support associating hundreds of millions of GPS latitude and longitude data points with three-tiered administrative regions. Secondly, the second type of solution mainly uses the distributed capabilities of the MapReduce computing framework to compensate for the insufficient performance of a single machine. Its implementation logic can be roughly divided into the Map phase, where each Map task processes fragmented GPS latitude and longitude data, calling a custom ray casting method to achieve the covered (COVERED_BY) logic for each GPS latitude and longitude data, matching all regions that meet the conditions. In the Reduce phase, the GPS latitude and longitude data is grouped, receiving the GPS points and multi-region matching pairs output from the Map phase, and custom logic filters the finest-grained regions, such as sorting by district, city, and province priority. This approach has the following limitations: for example, the MapReduce phase lacks spatial indexing, each GPS point needs to traverse all regions; for example, with over 3000 districts nationwide, processing hundreds of millions of GPS latitude and longitude data takes more than 10 hours, failing to meet hourly or even minute-level timeliness requirements. Furthermore, for different GPS computing scenarios, MapReduce Map and / or Reduce functions need to be manually written, resulting in high maintenance costs. Therefore, the aforementioned two types of solutions cannot meet the needs of accurately and efficiently associating massive amounts of GPS latitude and longitude data with three-tiered administrative regions in financial big data scenarios.
[0019] To address this pain point, this application provides a data processing method, apparatus, device, storage medium, and program product. Through distributed spatial indexing and hierarchical optimization algorithms, it automatically extracts multi-level administrative affiliation information (province, city, district) from massive GPS latitude and longitude data, and supports automatic data correction and partitioned storage. Compared with traditional solutions, it achieves minute-level parsing and calculation of massive GPS latitude and longitude data (tens or hundreds of millions of data points), effectively improving the efficiency and accuracy of associating massive GPS latitude and longitude data with three levels of administrative regions to form structured data including administrative region data in financial big data scenarios.
[0020] The following will be combined with the appendix Figures 1 to 4This application describes in detail the data processing methods, apparatus, computer equipment, storage media, and program products of the embodiments thereof. It should be noted that these embodiments are not intended to limit the scope of this application.
[0021] First, the data processing system of the data processing method provided in the embodiments of this application will be described.
[0022] like Figure 1 As shown, the data processing system 10 includes a parameter parsing module 101, a data loading module 102, a distributed spatial index construction module 103, a multi-level optimization module 104, and a structured data writing module 105. Specifically, the data loading module 102 may include an initial GPS data source loading module, a GPS data set generation module, and an administrative region geometric object set generation module.
[0023] The following sections will provide a detailed description of each module in its data processing system.
[0024] The parameter parsing module 101 is used to acquire user input data. In this embodiment, user input data refers to the set of all configuration parameters passed by the user to the parameter parsing module 101 through the command line or task scheduling system. It is the basic input source driving the entire process of matching GPS feature points with administrative regions. The parameter parsing module 101 will verify and parse these input contents and convert them into standardized configuration parameters to support the execution of all subsequent steps.
[0025] Specifically, user input data may include at least one of the following: N first query statements, the administrative region data storage path, the latitude and longitude field names in the first query statements, the target table, and the number of preset partitions, where N is an integer greater than or equal to 2. The first query statements are SQL statements and can be marked with the `sql` tag. The administrative region data storage path can be, for example, geospatial (Geographic, Geo) JSON format regional data and can be marked with the `geojson` tag. The latitude and longitude field names can be marked with `latField` for latitude fields and `lonField` for longitude fields. The target table is a structured data writing table and can be marked with the `targetTable` tag. The number of preset partitions can be marked with `mapPartitionNum`.
[0026] It should be noted that the latitude and longitude field names in the user input data are used to record the field name identifiers passed by the user. They belong to the parameter level and only record what the latitude field is called and what the longitude field is called. For example, if the user passes in latField wd and lonField jd, it means that the latitude field name is wd and the longitude field name is jd. They do not contain any latitude and longitude data themselves.
[0027] The initial GPS data source loading module in the data loading module 102 is used to parse N first query statements to obtain the initial GPS data source.
[0028] The administrative region geometric object set generation module in data loading module 102 is responsible for loading administrative division data and forming a three-tiered relationship between provinces, cities, and districts. Specifically, it obtains administrative region division data according to the administrative region division data storage path. The administrative region division data includes data used to represent the three-tiered administrative region division relationship between provinces, cities, and districts. Based on the administrative region division data, it determines the administrative region geometric object set.
[0029] The GPS dataset generation module in the data loading module 102 is used to extract longitude and latitude fields from the GPS dataset output by the parameter parsing module 101. It forms point geometry objects by calling the geospatial standard set transformation function (ST_Point) (lon,lat) of the distributed spatial data computing engine (Sedona), and uses the distinct function of the Spark framework to remove duplicate points, forming a deduplicated point geometry and constructing a GPS dataset. The GPS feature points in the GPS dataset do not overlap.
[0030] In this application's embodiments, Sedona is a Spark-based distributed geospatial computing framework for processing large-scale spatial data, such as points, lines, polygons, GeoJSON, and other spatial data. It extends Spark's RDD and DataFrame structures with spatial data types and spatial operation functions.
[0031] In this application embodiment, Spark refers to the Apache distributed in-memory computing framework. Apache Spark is a general-purpose distributed in-memory computing engine (Unified Analytics Engine). It improves upon the Hadoop MapReduce model, supports in-memory parallel computing, and significantly reduces disk I / O, thereby achieving high performance and versatility in fields such as big data batch processing, stream processing, machine learning, and graph computing.
[0032] In this application's embodiments, MapReduce refers to a mapping-reduction computation model, a distributed parallel computing model and programming framework for large-scale datasets. This model decomposes complex data processing tasks into two main stages: mapping (Map) and reduction (Reduce).
[0033] The distributed spatial index construction module 103 is used to construct a distributed spatial index (SpatialIndex) based on a GPS dataset and a set of geometric objects representing administrative regions. The distributed spatial index includes a global spatial partition index and local spatial indexes. The global spatial partition index is an index for geographically partitioned areas spanning the GPS dataset and the set of geometric objects representing administrative regions. The local spatial index is an index for a tree-like space within a single partition, organized according to the minimum bounding rectangles of geographic spatial adjacency. The distributed spatial index is an efficient retrieval structure built from spatial objects, i.e., points, lines, and polygons, used for quickly querying spatial relationships such as containment and intersection. In this embodiment, the partitioning is spatial partitioning, which can divide spatial data by geographical region or grid for parallel computing or distributed storage.
[0034] The multi-level optimization module 104 is used to generate structured data based on the administrative regions corresponding to GPS feature points. The structured data includes the latitude and longitude data of the GPS feature points and the administrative data of the three levels of administrative regions (province, city, and district). In this way, the latitude and longitude data of the GPS feature points can be correlated with the three levels of administrative data (province, city, and district) to obtain the GPS feature points and additional information such as the province, city, and district of the GPS feature points.
[0035] The structured data writing module 105 is used to write the structured data of each feature point output by the multi-level optimization module 104 into the target table. Specifically, it uses JSON format to encapsulate the complete hierarchy and original encoding of provinces, cities, and districts, and has the ability to dynamically expand the field structure, thereby better compatibility with different business scenarios.
[0036] In this embodiment of the application, taking the financial risk control transaction geographic verification scenario as an example, the first SQL statement containing the latitude and longitude fields of the daily transaction records is input. After parameter parsing, data loading, distributed spatial indexing and partition optimization, the result data including the latitude and longitude data of each GPS feature point and the administrative data of the three-level administrative regions of provinces, cities and districts is formed. Finally, the first SQL statement of each transaction adds a region append (region_inf) field for use in the risk control model.
[0037] Therefore, the data processing system provided in this application, through a distributed two-layer spatial indexing collaboration mechanism, can improve spatial matching performance, enabling geospatial parsing of GPS latitude and longitude data to be completed within minutes. The multi-level administrative division algorithm can improve the conflict problem of GPS feature points falling into multiple regions in traditional spatial matching, ensuring the uniqueness and accuracy of administrative division attribution. Furthermore, by utilizing geospatial data legalization and fault-tolerant repair mechanisms, the stability and accuracy of geospatial calculations can be guaranteed, improving adaptability to real and complex geographic data. The multi-level GeoJSON self-connection construction mechanism enables rapid reconstruction of multi-level administrative boundaries, supporting multi-scale spatial matching and hierarchical mapping. Moreover, by extracting and deduplicating GPS feature points from the initial GPS data source, removing duplicates and null points, and reducing redundant calculations and memory consumption, the system effectively improves the efficiency of associating massive GPS latitude and longitude data with three-level administrative regions to form structured data including administrative regions in financial big data scenarios.
[0038] It should be noted that the data processing system provided in this application embodiment can be applied to at least one of the following application scenarios: the scenario of administrative division mapping and statistical analysis of large-scale GPS latitude and longitude data; the scenario of using the Apache Spark distributed computing engine, combined with the Apache Sedona spatial computing library, to achieve high-performance spatial matching of geographic coordinate points with millions of data points or more.
[0039] Based on the above data processing system, the following will be combined with Figure 2 The data processing method provided in the embodiments of this application will be described in detail.
[0040] Figure 2 This is a flowchart of a data processing method provided in an embodiment of this application.
[0041] like Figure 2 As shown, this data processing method can be applied to, for example... Figure 1 The data processing system shown may include the following steps in its data processing method: Step 210: Obtain the GPS data set and the administrative region geometric object set corresponding to the query statement. The administrative region geometric object set is a set of polygonal geometric objects representing the three levels of administrative regions (province, city, district, and county). Step 220: Based on the GPS data set and the administrative region geometric object set, construct a distributed spatial index. The distributed spatial index includes a global spatial partition index and a local spatial index. The global spatial partition index is an index of geographical range partitions across the GPS data set and the administrative region geometric object set. The local spatial index is an index of a tree-like space formed by organizing the minimum bounding rectangles according to the geographical adjacency relationship within a single partition. Step 230: Based on the local spatial index of a single partition, filter out the administrative regions corresponding to the GPS feature points in the GPS data set. The GPS feature points in the GPS data set do not overlap. Step 240: Generate structured data based on the administrative regions corresponding to the GPS feature points. The structured data includes the latitude and longitude data of the GPS feature points and the administrative data of the three levels of administrative regions (province, city, district, and county).
[0042] In this way, the geographical scope of the GPS dataset and the administrative region geometric object set is divided through a global spatial partition index. The full data in the two sets is decomposed into multiple partitions that are processed in parallel, avoiding the performance bottleneck of a single node processing massive amounts of data. Based on the local spatial index within a single partition, a tree-like space is formed by organizing the minimum bounding rectangle based on the geographic spatial adjacency relationship. This can quickly filter out the administrative regions corresponding to GPS feature points, exclude areas without spatial association, and significantly reduce the amount of computation for subsequent accurate matching. Compared with full traversal matching, the matching efficiency is greatly improved. Moreover, the GPS feature points in the GPS dataset do not overlap, which can also reduce duplicate matching. This effectively improves the efficiency of associating massive GPS latitude and longitude data with three-level administrative regions to form structured data including administrative regions in financial big data scenarios. Furthermore, the structured data generated based on the administrative regions corresponding to GPS feature points can uniformly integrate the latitude and longitude data of GPS feature points with the three-level administrative data of provinces, cities, and districts. It can be directly connected to downstream storage, analysis, or visualization systems without additional format conversion, and can support downstream services such as risk identification and regional service analysis.
[0043] The steps described above are explained in detail below.
[0044] First, regarding step 210, in this embodiment of the application, the GPS data set and the administrative region geometric object set can be determined before step 210, as detailed below.
[0045] In some embodiments of this application, the data processing method may further include steps 2501 to 2505 before step 210.
[0046] Step 2501: Obtain user input data. The user input data includes N first query statements and administrative region division data storage paths, where N is an integer greater than or equal to 2.
[0047] Step 2502: Parse the N first query statements to obtain the initial GPS data source.
[0048] Step 2503: Construct a GPS dataset based on the initial GPS data source.
[0049] Step 2504: Obtain administrative region division data according to the administrative region division data storage path. The administrative region division data includes data used to represent the relationship between the three levels of administrative regions: province, city, and district.
[0050] Step 2505: Determine the set of geometric objects for administrative regions based on the administrative region division data.
[0051] In this embodiment of the application, step 2502 may specifically include steps 25021 to 25023.
[0052] Step 25021: Using flag variables, identify the feature objects in each of the N first query statements to obtain the semantic boundary of each first query statement. The flag variables include at least one of the following: unterminated quotation mark flag (hasUnterminatedQuote) and leading escape character flag (wasPrevEscape). The feature objects include at least one of the following: quotation marks, comments, and escape characters.
[0053] Step 25022: Based on the semantic boundary of each first query statement, delete the annotation content related to the feature object in each first query statement to obtain the second query statement corresponding to each first query statement.
[0054] Step 25023: According to the order of identifying query statements, take the tabular data structure of the last second query statement among the N second query statements as the initial GPS data source.
[0055] The following is combined Figure 1Steps 25021 to 25023 above will be explained. In this embodiment of the application, SQL can contain multiple first SQL statements. The data loading module 102 can be used to call the state machine scanner to identify the feature objects in each of the N first query statements through flag variables, and obtain the semantic boundary of each first query statement. Based on the semantic boundary of each first query statement, quotation marks, comments, and escape characters are detected line by line. The comment content related to the feature objects in each first query statement is deleted. That is, when parsing the first SQL statement in the SQL parameters, the content starting with -- (line comment) or # (comment character) can be detected line by line. However, these comments will only be deleted if they appear outside the quotation marks (single quotation mark ' / double quotation mark "). If -- / # appears inside the quotation marks (belonging to string content), it will be completely retained and not removed, thus obtaining the second query statement corresponding to each first query statement. According to the order of identifying the query statements, the tabular data structure DataFrame of the last second query statement in the N second query statements is used as the initial GPS data source.
[0056] Through the above processing steps, it can automatically tolerate newlines, semicolons, quotation marks, and escape characters in the first SQL statement, thereby providing better SQL parsing robustness and adaptability.
[0057] In this embodiment of the application, the user input data also includes the latitude and longitude field name, and the above step 2503 may specifically include steps 25031 to 25033.
[0058] Step 25031: Extract M sets of latitude and longitude fields from the initial GPS data source according to the latitude and longitude field names, where M is an integer greater than or equal to 2.
[0059] For example, based on the latitude and longitude field names, the two key fields "longitude" and "latitude" are extracted from a massive initial GPS data source.
[0060] It should be noted that the M sets of latitude and longitude fields extracted from the initial GPS data source include the actual latitude and longitude data.
[0061] Step 25032: Convert each set of latitude and longitude fields in the M sets of latitude and longitude fields into point geometric objects using the geospatial standard set conversion function.
[0062] For example, the ST_Point(lon,lat) function of Sedona can be called to convert the plain data pairs of longitude and latitude values into point geometric objects that can be recognized by the GIS system. These point geometric objects can have spatial attributes and can participate in operations such as boundary matching and distance calculation.
[0063] Step 25033: Perform deduplication and invalid data filtering operations on the converted point geometry objects using the redundant service field filtering function to obtain the GPS data set.
[0064] For example, Spark's distinct function can be used to remove duplicate point geometries, such as multiple transactions from the same POS machine corresponding to the same latitude and longitude, as well as null points, such as invalid data without valid latitude and longitude.
[0065] In this embodiment of the application, step 2504 may specifically include: obtaining the storage path of the original administrative division data from the GEOJSON tag parameters, and then loading the original GeoJSON format administrative division data according to the storage path, and parsing it to obtain administrative division data including data used to represent the three-level administrative division relationship of provinces, cities and districts.
[0066] In this embodiment of the application, step 2505 may specifically include steps 25051 to 25055.
[0067] Step 25051: Extract the boundary coordinate data corresponding to each administrative region in the three-tiered administrative region (province, city, district) from the administrative region division data. The boundary coordinate data is used to indicate the spatial boundary range of the administrative region. The boundary coordinate data can be represented by a boundary coordinate string.
[0068] In this step, administrative region division data is loaded. Taking GeoJson as an example, spatial elements are extracted to establish a three-tiered relationship of province, city, and district, and a set of geometric objects representing administrative regions is constructed. Specific steps may include: parsing the administrative region division data and extracting the region code (adcode), region name (name), level, and parent region code (parent_adc). Based on different values of the level, the data is split into three sets: province, city, and district. The relationship between adcode and parent_adc is used to perform three self-associations, forming a hierarchical relationship of district->city->province. The three sets of data may include a provincial set, a city set, and a district set. The provincial set may include the province code (province_code) and province name (province_name), the city set may include the city code (city_code) and city name (city_name), and the district set may include the district code (district_code) and district name (district_name). Then, based on the three sets of data and the level, the boundary coordinate data corresponding to each administrative region can be obtained.
[0069] For example, from the administrative region division data in GeoJson format, the geometry field corresponding to Xuanwu District is located, and the boundary coordinate string under its coordinates attribute is extracted. The boundary coordinate string consists of multiple sets of latitude and longitude pairs, which describe the regional boundary in clockwise and / or counterclockwise order.
[0070] Step 25052: According to the validity correction rules, the boundary coordinate data corresponding to each administrative region is corrected to obtain the corrected boundary coordinate data corresponding to each administrative region. The validity correction rules include at least one of the following: rules for correcting coordinates that exceed the geographical range, and rules for correcting overlapping boundaries.
[0071] For example, the extracted coordinate data is validated according to two rules: correcting coordinates exceeding the geographical range and correcting overlapping boundaries. For instance, the original abnormal coordinates exceeding the geographical range, such as [181.2000, 91.5000], are invalid because the maximum longitude should be 180° and the maximum latitude should be 90°. Coordinates exceeding ±180° (longitude) and ±90° (latitude) are corrected to reasonable values within the corresponding geographical range, i.e., by interpolating with surrounding coordinates. The corrected coordinates are: [118.8050, 32.0350], which matches the reasonable range of coordinates surrounding Xuanwu District.
[0072] It should be noted that this step can perform validity checks on the extracted boundary coordinate strings, identify and correct invalid coordinates, such as coordinates that exceed the geographical range, overlapping boundaries such as repeated boundary segments of adjacent areas, to ensure the accuracy of the boundary data.
[0073] Step 25053: Convert the corrected boundary coordinate data corresponding to each administrative region to obtain the polygonal geometric object of each administrative region.
[0074] For example, calling the ST_Polygon function of the Sedona geocomputing framework can convert the corrected closed boundary coordinate string into a standardized polygonal geometric object (Polygon), which can be recognized by spatial indexing and spatial matching logic.
[0075] Step 25054: Using a geometric range statistical algorithm, determine the minimum bounding rectangle (MBR) of each administrative region based on the polygonal geometric objects of each administrative region.
[0076] For example, by using a geometric range statistical algorithm, all coordinate points of the polygon are traversed, the extreme values of latitude and longitude are extracted, and the minimum bounding rectangle that can completely enclose the polygon of the Xuanwu area is calculated. For example, the MBR range is [118.7800, 32.0250, 118.8100, 32.0500], and its format is [minimum longitude, minimum latitude, maximum longitude, maximum latitude].
[0077] Step 25055: Associate the minimum bounding rectangle of each administrative region with the corresponding administrative attribute data of each administrative region to obtain a set of geometric objects of administrative regions. The administrative attribute data includes the hierarchical identifier of each administrative region in the province, city, and district levels, the administrative data of each administrative region, and the hierarchical relationship data of each administrative region in the province, city, and district levels. The administrative data includes the administrative code and administrative name.
[0078] For example, the polygonal geometric objects and MBR of Xuanwu District are bound to the corresponding administrative attribute data to form a complete entry in the set of administrative region geometric objects; similarly, Jiangsu Province and Nanjing City also generate entries according to this logic, and finally aggregated into a set covering the three levels of province, city, and district. For example, the level identifier is: district level (tag: LEVEL_3); the administrative data is: administrative code: 320102, administrative name: Xuanwu District, city: Nanjing City; the hierarchical relationship is: superior level: Nanjing City (administrative code 320100), top level: Jiangsu Province (administrative code 320000).
[0079] Therefore, by correcting coordinates and transforming geometric objects, the accuracy and standardization of administrative region data can be guaranteed, the efficiency of subsequent spatial matching can be improved, the integrity of matching results can be ensured, and the accuracy of matching massive GPS feature points with provincial, municipal, and district-level administrative regions can be enhanced.
[0080] Regarding step 220, in some embodiments of this application, step 220 may specifically include steps 2201 to 2203, that is, the global spatial partition index is constructed through the aforementioned steps.
[0081] Step 2201: Based on the GPS data set and the set of administrative region geometric objects, determine a first-class index object and a second-class index object. The first-class index object is the minimum bounding rectangle of a single point of GPS feature points, and the second-class index object is the minimum bounding rectangle of the polygon of each administrative region in the set of administrative region geometric objects.
[0082] In this step, the minimum bounding rectangle of a single GPS feature point and the minimum bounding rectangle of a polygon for each administrative region can be constructed using a geometric range statistical algorithm. This yields one type of index object: the single-point MBR of the GPS feature point has no range expansion, and its minimum or maximum latitude and longitude are equal to the latitude and longitude of the point itself, i.e., (point longitude, point latitude). The second type of index object can reuse the results of step 25054. The single-point MBR of a GPS feature point can be represented as GPS feature point 1 [118.7900, 32.0400, 118.7900, 32.0400] and GPS feature point 2 [118.8050, 32.0450, 118.8050, 32.0450]. For example, the minimum bounding rectangle of the polygon for each administrative region is [116.3800, 30.6500, 121.9000, 35.5000] for Jiangsu Province, [118.2100, 31.1400, 119.2100, 32.3200] for Nanjing City, and [118.7800, 32.0250, 118.8100, 32.0500] for Xuanwu District.
[0083] Step 2202: Using a multidimensional balanced partitioning tree (KDBTree) partitioner, the index objects of type I and type II are geographically partitioned according to geographical partitioning rules to obtain at least one partition. Within the same partition, the minimum bounding rectangle of a single point and the minimum bounding rectangle of an administrative region's polygon are located within the same geographical area.
[0084] In this step, the KDBTree partitioner is selected, with a preset partition number of mapPartitionNum=2, meaning the index is divided into 2 partitions. Specifically, the partitions can be based on longitude ranges: Partition 1: All index objects with a maximum MBR longitude ≤ 118.8000; Partition 2: All index objects with a maximum MBR longitude > 118.8000. Partition determination is performed separately for Category I and Category II index objects.
[0085] It should be noted that, in this embodiment of the application, if the user input data includes the number of preset partitions, then the partitions can be divided according to the number of preset partitions in the user input data. If the user input data does not include the number of preset partitions, then the number of preset partitions can be determined based on the number of first query statements. For example, if there are 10,000 first query statements, the number of preset partitions is 1; if there are 20,000 first query statements, the number of preset partitions is 2, and so on.
[0086] Step 2203: Construct a global spatial partition index based on at least one partition and the minimum bounding rectangle of a single point and the minimum bounding rectangle of a polygon in each partition.
[0087] In this step, the global spatial partition index is a KDBTree index spanning GPS and administrative region data. Its structure is that the partition identifier is the key, and the list of Class I and Class II index objects under that partition is the value. The index construction logic is to organize the partitioning results from step 2202 into a tree structure of KDBTree, with the parent node MBR wrapping the MBRs of all child partitions to form a global index that can quickly retrieve the partition to which a GPS point and administrative region belong.
[0088] For example, partition 1 can be represented as GPS1, with no index objects of type 1. Partition 2 can be represented as GPS2, with Jiangsu Province, Nanjing City, and Xuanwu District as index objects of type 2.
[0089] Therefore, GPS feature points can be converted into two types of index objects: a single-point MBR and a reusable administrative region index object. A unified index object format is achieved, and the KDBTree partitioner divides these two types of index objects into multiple partitions based on longitude range, enabling distributed data decomposition. By constructing a cross-data type KDBTree global index, and using a tree structure of root nodes and sub-partitions, the partition to which GPS points and administrative regions belong can be quickly located, laying the foundation for subsequent local index construction and distributed matching.
[0090] In some embodiments of this application, step 220 may specifically include steps 2204 to 2205, that is, a local spatial index is constructed through the aforementioned steps.
[0091] Step 2204: For a single partition, based on the GPS data set and the set of geometric objects of administrative regions, determine a first type of sub-index object and a second type of sub-index object. The first type of sub-index object is the minimum bounding rectangle of each GPS feature point in a single partition, and the second type of sub-index object is the minimum bounding rectangle of each administrative region in the three-level administrative regions of province, city and district in a single partition.
[0092] In this step, only GPS feature points within the current partition (e.g., partition 2) are selected to extract their single-point MBRs. Furthermore, only the provincial, municipal, and district-level administrative regions within the current partition 2 are selected to extract their polygonal MBRs. The sub-index object is a subset of the global index object within a single partition, focusing only on valid data within the current partition to avoid cross-partition interference.
[0093] Step 2205: Using a rectangular tree indexing structure algorithm, indexes are constructed for both the first-class and second-class sub-index objects to obtain local spatial (RectangleTree, RTree) indexes. The local spatial indexes include rectangular tree indexes corresponding to the first-class and second-class sub-index objects. The RTree index is a spatial index tree based on the minimum bounding rectangle, used for fast range queries and spatial joins. Spatial joins refer to matching operations between two spatial datasets based on geographical location relationships, such as points within a polygon.
[0094] In this step, independent local spatial indexes are constructed for the first-class and second-class sub-index objects within partition 2, namely GPS single-point RTree and administrative region MBRRTree, forming the local spatial index of this partition.
[0095] For example, a GPS single-point RTree is constructed for a class of sub-index objects. Since there is only one GPS point, GPS2, in partition 2, the RTree structure is extremely simple, i.e., there are no intermediate nodes, as shown below: Root node (partition 2 GPS single point RTree); Leaf node 1-MBR range: [118.8050, 32.0450, 118.8050, 32.0450]; - Associated object: GPS2 feature point.
[0096] As can be seen, the parent node MBR and the leaf node MBR completely overlap, and only one layer of structure is needed to locate all GPS points in this partition.
[0097] For the second type of sub-index objects, an RTree (Administrative Region MBRRTree) is constructed. Partition 2 contains three administrative regions: province, city, and district. The RTree is organized according to geographical adjacency and / or containment relationships, where the parent node MBR wraps the child nodes, as shown below: Root node (Partition 2 Administrative Region MBRRTree); MBR range: [116.3800, 30.6500, 121.9000, 35.5000] (encompassing all child nodes); Intermediate node 1; MBR range: [118.2100, 31.1400, 119.2100, 32.3200] (including Nanjing City and Xuanwu District). Leaf node 1 (Nanjing City); MBR range: [118.2100, 31.1400, 119.2100, 32.3200]; Related object: Nanjing City (municipal level); Leaf node 2 (Xuanwu area); MBR range: [118.7800, 32.0250, 118.8100, 32.0500]; Related object: Xuanwu District (district level); Leaf node 3 (Jiangsu Province); MBR range: [116.3800, 30.6500, 121.9000, 35.5000]; Related object: Jiangsu Province (provincial level).
[0098] As can be seen, the Jiangsu Province MBR includes the Nanjing City MBR, and the Nanjing City MBR includes the Xuanwu District MBR. Therefore, it is hierarchically structured according to the spatial inclusion relationship of province, city, and district. The root node MBR covers the entire Jiangsu Province, the intermediate nodes cover the Nanjing City and Xuanwu District, and the leaf nodes precisely associate with individual administrative regions. Based on this, during subsequent searches, administrative regions spatially adjacent to GPS2 can be quickly located through the root node, intermediate nodes, and leaf nodes. For example, if Xuanwu District is located first, it is not necessary to traverse all administrative regions, which can improve matching efficiency.
[0099] Based on this, the index structure of one type of sub-index object RTree is a single-level structure, i.e., from root to leaf. The index structure of the other type of sub-index object RTree is a two-level structure, i.e., from root to middle to leaf.
[0100] Therefore, the MBR can be organized into a tree structure with root nodes, intermediate nodes, and leaf nodes according to spatial adjacency. The parent node MBR completely encloses all child node MBRs, and the leaf nodes are directly associated with specific index objects such as GPS single points or administrative region polygon MBRs, so as to achieve the goal of quickly retrieving spatially adjacent objects.
[0101] Therefore, in this embodiment, a two-layer indexing mechanism is constructed based on KDBTree and RTree. KDBTree is used for macro-level partitioning, and RTree is used for local filtering. During the Join process, the data is highly balanced, that is, the values of the point set and the region set are unique, and there are no duplicate or skewed data records, thereby significantly reducing Sparkshuffle overhead. Under GeoJson regions and hundreds of millions of query statements, the performance improvement can reach 5 to 10 times.
[0102] It should be noted that, in order to ensure the accuracy of the local spatial index, each type of sub-index object constructed in this embodiment can be verified. If the verification passes, the final local spatial index can be obtained. Based on this, step 2205 can specifically include steps 22051 to 22054, as shown below.
[0103] Step 22051: Using the rectangular tree index structure algorithm, indexes are constructed for the first type of sub-index objects and the second type of sub-index objects respectively, to obtain the first candidate rectangular tree index corresponding to the first type of sub-index objects and the second candidate rectangular tree index corresponding to the second type of sub-index objects.
[0104] In this step, the RTree algorithm can be used to initialize and build a first candidate RTree index, i.e., an unverified initial version, by using the rectangular tree index structure algorithm to perform the RTree algorithm initialization and construction on a first type of sub-index object in partition 2; and the RTree algorithm can be used to initialize and build a second candidate RTree index, i.e., an unverified initial version, by performing the RTree algorithm initialization and construction on a second type of sub-index object in partition 2.
[0105] Step 22052: Based on the geographic spatial adjacency relationship, construct the first tree structure corresponding to the first candidate rectangular tree index and the second tree structure corresponding to the second candidate rectangular tree index.
[0106] In this step, the first tree structure can be based on the spatial inclusion relationship between a single GPS point and an administrative region, i.e., GPS2 is within the MBR of Xuanwu District. It optimizes the node organization of the first candidate RTree, retaining only the hierarchical structure of the single GPS point. The second tree structure can be based on the geographic spatial inclusion and adjacency relationships between administrative regions, such as Xuanwu District. Nanjing In Jiangsu Province, the node hierarchy of the second candidate RTree was adjusted to ensure that the parent node corresponds to the containing party and the child node corresponds to the contained party.
[0107] Step 22053: According to the integrity verification rules, the first tree structure and the second tree structure are verified respectively; wherein, the integrity verification rules include verifying whether the minimum bounding rectangle of the parent node in the tree structure completely wraps the minimum bounding rectangle of the child node corresponding to the parent node, and verifying whether all minimum bounding rectangles in each partition are in the tree structure.
[0108] In this step, the first and second tree structures are checked one by one according to the two types of integrity verification rules. Specifically, the COVERED_BY check can be used to verify whether the minimum bounding rectangle of the parent node in the tree structure completely wraps the minimum bounding rectangle of the child node corresponding to the parent node, and to verify whether all minimum bounding rectangles in each partition are in the tree structure. If the verification passes, proceed to the next step 22054. If the verification fails, for example, assuming that the second tree structure omits the Xuanwu area MBR: rule 2 verification fails, it is necessary to return to step 22051 to rebuild the candidate RTree.
[0109] Step 22054: If the verification passes, the first candidate rectangular tree index is used as the rectangular tree index corresponding to the first type of sub-index object, and the second candidate rectangular tree index is used as the rectangular tree index corresponding to the second type of sub-index object.
[0110] In this step, since both the first and second tree structures have passed the integrity check, the candidate RTree index is officially determined as the final local spatial index, serving as the basis for subsequent distributed spatial matching retrieval.
[0111] Therefore, unverified candidate RTree indexes can be constructed for the two types of sub-index objects within the partition, completing the basic structure construction. The tree structure of the candidate indexes is optimized according to geospatial inclusion and / or adjacency relationships to ensure that the hierarchy conforms to the real geographic logic. Furthermore, the structural integrity is verified by two rules: parent node wrapping child node and no MBR omissions. After verification, the candidate indexes are determined as the final local spatial indexes, providing a usable retrieval structure for subsequent accurate matching of GPS points and administrative regions. This improves the accuracy of associating massive GPS latitude and longitude data with three-level administrative regions to form structured data including administrative regions in financial big data scenarios.
[0112] Regarding step 230, in some embodiments of this application, step 230 may specifically include steps 2301 to 2303, as shown below.
[0113] Step 2301: Based on the local spatial index of a single partition, extract the minimum bounding rectangle of the single point of GPS feature points in a single partition and the minimum bounding rectangle of the polygon adjacent to the administrative region in geospatial space, to obtain the set of candidate minimum bounding rectangles of the polygon for a single partition.
[0114] In this step, for a single partition 2, the single-point MBR of all GPS feature points within the partition can be located through a rapid RTree search. Based on the spatial adjacency relationship of the RTree, administrative region polygon MBRs that are geographically close to the single-point MBR are selected, i.e., the single-point MBR falls within the polygon MBR's range or is adjacent to the polygon MBR's boundary. These polygon MBRs are then summarized to form the candidate polygon MBR set for the partition.
[0115] Step 2302: Filter the target administrative region from the set of candidate polygon minimum bounding rectangles of a single partition. The polygon minimum bounding rectangle of the target administrative region includes the single-point minimum bounding rectangle of the complete GPS feature points.
[0116] In this step, for each partition's candidate polygon MBR, the JoinQuery.SpatialJoinQueryFlat method is called to perform point-polygon precise matching according to the SpatialPredicate.COVERED_BY logic, filtering out target administrative regions whose polygon MBR completely contains the GPS single-point MBR. Here, complete containment is a requirement of COVERED_BY, which requires that all latitude and longitude values of the single-point MBR fall within the extreme value range of the polygon MBR.
[0117] It should be noted that a single point has no defined range; it only needs to have its latitude and longitude within the polygon MBR. Furthermore, if a candidate region does not satisfy the COVERED_BY condition, for example, if the Gulou District MBR exists (i.e., [118.8100, 32.0300, 118.8300, 32.0600]), it will be included in the candidate set for partition 2: GPS2 longitude 118.8050 < Gulou District MBR minimum longitude 118.8100 → does not satisfy COVERED_BY → will not be selected as the target administrative region.
[0118] Step 2303: Traverse all partitions in the global spatial partition index, summarize the target administrative regions selected from all partitions, and obtain the administrative regions corresponding to GPS feature points in the GPS dataset.
[0119] In this step, all partitions in the global spatial partition index are traversed, such as partition 1 and partition 2, and the pairing results of GPS feature points and target administrative regions selected from each partition are collected. These are then aggregated to form the final result set of all GPS feature points and their corresponding administrative regions.
[0120] Regarding step 240, in some embodiments of this application, step 240 may specifically include steps 2401 to 2403, as shown below.
[0121] Step 2401: Sort the administrative regions corresponding to GPS feature points according to the priority of the three-tier administrative regions of provinces, cities and districts.
[0122] In this step, the administrative regions matched by each GPS feature point are sorted according to their priority: district level, city level, and province level.
[0123] For example, GPS feature point: GPS1; initial matching administrative region: Jiangsu Province, Nanjing City, Xuanwu District; administrative regions sorted by priority: Xuanwu District (LEVEL_3) → Nanjing City (LEVEL_2) → Jiangsu Province (LEVEL_1). GPS feature point: GPS2; initial matching administrative region: Nanjing City, Jiangsu Province; administrative regions sorted by priority: Nanjing City (LEVEL_2) → Jiangsu Province (LEVEL_1).
[0124] Step 2402: If the sorted administrative regions are missing at least one of the three levels of provinces, cities, and districts, the administrative regions corresponding to the GPS feature points are completed based on the hierarchical relationship data of the sorted administrative regions in the three levels of provinces, cities, and districts.
[0125] In this step, it is checked whether the sorted administrative regions cover the provincial, municipal, and district levels. If at least one level is missing, it is completed based on the hierarchical relationship data. Specifically, if the lower level is known, the higher level is derived, such as if Xuanwu District is known, then Nanjing City and Jiangsu Province are completed; or if the higher level is known, the lower level is attempted to be derived. If no exact match is found, a default value is marked; or all missing levels are uniformly marked with a preset default value, i.e., administrative code "000000" and name "unknown".
[0126] For example, GPS1, a complete three-level match, requires no completion. After sorting: Xuanwu District → Nanjing City → Jiangsu Province; completion result: no missing levels, directly retain the original sorting result. GPS2, missing district level, completes the default district level, i.e., after sorting: Nanjing City → Jiangsu Province (missing district level); completion result: "District level (000000, unknown)" → Nanjing City (320100) → Jiangsu Province (320000).
[0127] Step 2403: Generate structured data based on the completed administrative data of the administrative regions corresponding to the GPS feature points.
[0128] In this step, the latitude and longitude data of GPS feature points are integrated with the completed administrative data of the three-level administrative regions to generate standardized structured data. The fields of this structured data are: GPS longitude, GPS latitude, district-level administrative code, district-level name, city-level administrative code, city-level name, provincial-level administrative code, and provincial-level name.
[0129] In some embodiments of this application, the data processing method may further include steps 2404 and 2405 before step 2402 described above.
[0130] Step 2404: If the sorted administrative regions include at least two first administrative regions of the same level and the first administrative region is the highest priority administrative region, calculate the straight-line distance between the GPS feature point and the center point of each first administrative region.
[0131] In this step, the highest priority after sorting is the two district-level areas of the same level, such as Xuanwu District and Gulou District; then the straight-line distance between the GPS feature point and the center point of each first administrative region can be calculated using the approximate formula of latitude and longitude straight-line distance.
[0132] Step 2405: Administrative regions with a straight-line distance less than or equal to a preset threshold are designated as the highest priority administrative regions among the administrative regions corresponding to the GPS feature points.
[0133] In this step, a preset distance threshold, such as 500 meters, is retrieved and compared with the distance calculated in step 2404 to filter out administrative regions whose distance is ≤ the threshold. If multiple regions meet the criteria, the threshold can be further narrowed or other rules such as area ratio can be combined for filtering; if no regions meet the criteria, the threshold can be adjusted or they can be marked as regions with pending boundary determination.
[0134] It should be noted that the priority of the three-tiered administrative regions of provinces, municipalities, and autonomous regions includes the priority of provincial-level administrative regions, the priority of municipal-level administrative regions, and the priority of district-level administrative regions; among them, the priority of district-level administrative regions is higher than that of municipal-level administrative regions, and the priority of municipal-level administrative regions is higher than that of provincial-level administrative regions.
[0135] Therefore, this application provides a distributed two-layer spatial indexing collaboration mechanism, which constructs a dual spatial index of a GPS dataset and an administrative region geometric object set (GeoJson). It automatically selects either a KDBTree or RTree as the primary partition index based on the data scale. Point data and region data share the same partitioner, achieving local spatial joins and avoiding full Cartesian computation. It defines the priority of province, city, and district levels, compares the matching results of multiple overlapping regions, and automatically filters the most accurate administrative unit. When loading GeoJson, it detects invalid geometry, such as self-intersections and multiple boundary gaps, ensuring the stability and accuracy of spatial calculations. Furthermore, it allows GeoJson data to contain polygon data of different levels, automatically generating parent-child hierarchical relationship tables, and storing and reusing regional hierarchical structures. Additionally, it allows users to define GPS datasets through custom SQL. Besides essential elements such as GPS coordinates, GPS datasets can provide any redundant fields and information. The final generated dataset adds province, city, and district fields to the GPS dataset, thus greatly expanding the applicability of this proposal.
[0136] The following uses GPS points in Shanghai and polygons representing Shanghai's three-level administrative regions as examples to demonstrate the process of partitioning, indexing, and matching these two types of data. The specific steps are as follows.
[0137] Set up pre-processed regional data, such as polygonal geometric objects of 16 districts (district level) including Shanghai (provincial level), Shanghai (municipal level), Pudong New Area, and Huangpu District. GPS data can include unique GPS points of 1,000 transactions in a business district in Shanghai, with a total of 8 points after deduplication, corresponding to 8 POS machines, and the latitude and longitude are concentrated in Pudong New Area and Huangpu District.
[0138] First, the KDBTree global partition for both types of data is set to mapPartitionNum=2, divided by longitude range: Partition 1: Longitude 121.4°~121.5°, covering core urban areas such as Huangpu District and Jing'an District; Partition 2: Longitude 121.5°~121.6°, covering eastern areas such as Pudong New Area and Minhang District. Regional data partitioning: Partition 1 loads polygons including Huangpu District and Jing'an District, meaning the MBR longitude falls within 121.4°~121.5°; Partition 2 loads polygons including Pudong New Area and Minhang District, meaning the MBR longitude falls within 121.5°~121.6°. Four GPS points in Huangpu District (around 121.45° longitude) enter Partition 1. Four GPS points in Pudong New Area (around 121.55° longitude) enter Partition 2. It is important to note that points and areas within the same geographic range fall within the same partition; subsequent matching only requires within that partition, with no cross-partition data transmission.
[0139] Next, the local indexes, or RTrees, for the two types of data are constructed. For example, in partition 1, the RTree for the core urban area is constructed. Specifically, the MBRs of polygons such as Huangpu District and Jing'an District are organized into RTrees. For instance, the parent node encompasses all MBRs of the core urban area, and the child nodes respectively encompass the MBRs of Huangpu District and Jing'an District. On the GPS point side, the coordinates of four GPS points in Huangpu District are organized into an RTree for quick association with the corresponding polygonal MBRs. For partition 2, the RTree for the eastern region is constructed as follows: On the regional side, the MBRs of polygons such as Pudong New Area and Minhang District are organized into RTrees; on the GPS point side, the coordinates of four GPS points in Pudong New Area are organized into an RTree.
[0140] Furthermore, index-linked matching quickly locates the region to which a point belongs. Taking a GPS point in Pudong New Area (longitude 121.55°, latitude 31.23°) in partition 2 as an example: Global positioning directly determines that the point is in partition 2 through the KDBTree index, without needing to traverse the regional data of partition 1; Local filtering: Using the coordinates of the point, the regional RTree of partition 2 is queried to quickly filter out candidate polygons containing the point in the MBR, only three polygons are selected: Pudong New Area (district level), Shanghai (city level), and Shanghai (provincial level). This excludes areas such as Minhang District where the MBR does not contain the point. For the three candidate polygons, it is verified whether the point truly falls within its boundary (COVERED_BY logic), confirming that all polygons contain the point.
[0141] Then, based on the priority of district > city > province, it was finally determined that the point belongs to Pudong New Area. Based on this, the administrative data of the GPS feature point at the provincial, municipal, and district levels is "Pudong New Area - Shanghai - Shanghai".
[0142] Therefore, if a traditional method is used, the GPS feature point needs to traverse the polygons of more than 3,000 districts across the country, requiring more than 3,000 boundary matches for each GPS feature point. However, the data processing device provided in this application embodiment can partition the data using KDBTree, searching only partition 2, and filter the data using RTree, searching only 3 candidates. Each point only requires 3 boundary matches, effectively improving the efficiency of associating massive GPS latitude and longitude data with three-level administrative regions to form structured data including administrative regions in financial big data scenarios.
[0143] Based on the same inventive concept, this application also provides a data processing device. (Specifically combined with...) Figure 3 Please provide a detailed explanation.
[0144] Figure 3 This is a schematic diagram of the structure of a data processing apparatus provided in one embodiment of this application.
[0145] In some embodiments of this application, Figure 3 The data processing device shown can be set in, for example Figure 1 The stealth alliance shown.
[0146] like Figure 3 As shown, the data processing device 30 may specifically include: The acquisition module 301 is used to acquire the GPS data set and the administrative region geometric object set corresponding to the query statement. The administrative region geometric object set is a set of polygonal geometric objects representing the three levels of administrative regions of provinces, cities and districts. Module 302 is used to construct a distributed spatial index based on a GPS data set and a set of administrative region geometric objects. The distributed spatial index includes a global spatial partition index and a local spatial index. The global spatial partition index is an index of geographical range partitions across the GPS data set and the set of administrative region geometric objects. The local spatial index is an index of a tree-like space formed by organizing the minimum bounding rectangles according to the geographical spatial adjacency relationship within a single partition. The filtering module 303 is used to filter out administrative regions corresponding to GPS feature points in the GPS dataset based on the local spatial index of a single partition, provided that the GPS feature points in the GPS dataset do not overlap. The generation module 304 is used to generate structured data based on the administrative regions corresponding to the GPS feature points. The structured data includes the latitude and longitude data of the GPS feature points and the administrative data of the three levels of administrative regions (province, city, and district).
[0147] In this embodiment, the data processing device 30 can divide the geographical scope across GPS datasets and administrative region geometric object sets using a global spatial partition index. It decomposes the full data in both sets into multiple parallel-processing partitions, avoiding the performance bottleneck of a single node processing massive amounts of data. Based on the local spatial index within a single partition, a tree-like space is formed by organizing the minimum bounding rectangle based on geographic spatial adjacency relationships. This allows for rapid filtering of administrative regions corresponding to GPS feature points, excluding areas without spatial association, significantly reducing the computational load for subsequent precise matching. Compared to full-scale traversal matching, this greatly improves matching efficiency. Furthermore, the non-overlapping GPS feature points in the GPS dataset also reduce redundant matching, effectively improving the efficiency of associating massive GPS latitude and longitude data with three-tiered administrative regions to form structured data including administrative regions in financial big data scenarios. Moreover, the structured data generated based on the administrative regions corresponding to GPS feature points can uniformly integrate the latitude and longitude data of GPS feature points with the three-tiered administrative data of provinces, cities, and districts. This data can be directly connected to downstream storage, analysis, or visualization systems without additional format conversion, supporting downstream services such as risk identification and regional service analysis.
[0148] The data processing device 30 in the embodiments of this application will be described in detail below.
[0149] In one or more optional embodiments, the acquisition module 301 can also be used to acquire user input data, which includes N first query statements and administrative region division data storage paths, where N is an integer greater than or equal to 2. In this embodiment, the data processing device 30 may further include a parsing module for parsing N first query statements to obtain an initial GPS data source; Module 302 can also be used to build a GPS dataset based on the initial GPS data source; The acquisition module 301 can also be used to acquire administrative region division data according to the data storage path of administrative regions. The administrative region division data includes data used to represent the relationship between the three levels of administrative regions of provinces, cities and districts. In this embodiment, the data processing device 30 may further include a determination module, used to determine the set of geometric objects of administrative regions based on the administrative region division data.
[0150] In one or more optional embodiments, the data processing device 30 in this application embodiment may further include an identification module, which is used to identify the feature objects in each of the N first query statements through flag variables to obtain the semantic boundary of each first query statement, wherein the flag variables include at least one of the following: unterminated quotation mark flag variable, leading escape character flag; In this embodiment of the application, the data processing device 30 may further include a deletion module, which is used to delete the annotation content related to the feature object in each first query statement based on the semantic boundary of each first query statement, so as to obtain a second query statement corresponding to each first query statement; In this embodiment, the data processing device 30 may further include a determining module, which is used to take the tabular data structure of the last second query statement among the N second query statements as the initial GPS data source according to the order of the identified query statements.
[0151] In one or more optional embodiments, the data processing device 30 in this application embodiment may further include an extraction module, used to extract M sets of latitude and longitude fields from the initial GPS data source according to the latitude and longitude field names when the user input data also includes latitude and longitude field names, where M is an integer greater than or equal to 2. In this embodiment of the application, the data processing device 30 may further include a conversion module, which is used to convert each set of latitude and longitude fields in the M sets of latitude and longitude fields into point geometric objects through a geospatial standard set conversion function; In this embodiment, the data processing device 30 may further include a processing module, which is used to perform deduplication and invalid data filtering operations on the converted point geometry object through a redundant service field filtering function to obtain a GPS data set.
[0152] In one or more optional embodiments, the data processing device 30 in this application embodiment may further include an extraction module, used to extract the boundary coordinate data corresponding to each administrative region in the three-level administrative regions of provinces, cities and districts from the administrative region division data, and the boundary coordinate data is used to indicate the spatial boundary range of the administrative region; In this embodiment, the data processing device 30 may further include a correction module, which is used to correct the boundary coordinate data corresponding to each administrative region according to the validity correction rules, so as to obtain the corrected boundary coordinate data corresponding to each administrative region. The validity correction rules include at least one of the following: rules for correcting coordinates that exceed the geographical range, and rules for correcting overlapping boundaries. In this embodiment of the application, the data processing device 30 may further include a conversion module, which is used to convert the corrected boundary coordinate data corresponding to each administrative region to obtain a polygonal geometric object of each administrative region; In this embodiment of the application, the data processing device 30 may further include a determination module, which is used to determine the minimum bounding rectangle of each administrative region based on the polygonal geometric objects of each administrative region through a geometric range statistical algorithm; In this embodiment, the data processing device 30 may further include an association module, which is used to associate the minimum bounding rectangle of each administrative region with the administrative attribute data corresponding to each administrative region to obtain a set of geometric objects of administrative regions. The administrative attribute data includes the hierarchical identifier of each administrative region in the three levels of province, city, and district, the administrative data of each administrative region, and the hierarchical relationship data of each administrative region in the three levels of province, city, and district.
[0153] In one or more optional embodiments, the data processing device 30 in this application embodiment may further include a determination module, used to determine a first type of index object and a second type of index object based on the GPS data set and the administrative region geometric object set. The first type of index object is the minimum bounding rectangle of a single point of GPS feature points, and the second type of index object is the minimum bounding rectangle of the polygon of each administrative region in the administrative region geometric object set. The data processing device 30 in this embodiment may further include a partitioning module, which is used to perform geographical range partitioning on a type I index object and a type II index object according to geographical partitioning rules through a multidimensional balanced partitioning tree partitioner, to obtain at least one partition. Module 302 can also be used to construct a global spatial partition index based on at least one partition and the minimum bounding rectangle of a single point and the minimum bounding rectangle of a polygon in each partition.
[0154] In one or more optional embodiments, the data processing device 30 in this application embodiment may further include a determination module, which is used to determine a type of sub-index object and a type of sub-index object for a single partition based on a GPS data set and an administrative region geometric object set. The type of sub-index object is the minimum bounding rectangle of a single point of each GPS feature point in the single partition, and the type of sub-index object is the minimum bounding rectangle of a polygon of each administrative region in the three-level administrative regions of provinces, cities and districts in the single partition. The construction module 302 can also be used to construct indexes for a first-class sub-index object and a second-class sub-index object respectively using a rectangular tree index structure algorithm to obtain a local spatial index; wherein, the local spatial index includes a rectangular tree index corresponding to the first-class sub-index object and a rectangular tree index corresponding to the second-class sub-index object.
[0155] In one or more optional embodiments, the construction module 302 can also be used to construct indexes for a first type of sub-index object and a second type of sub-index object respectively through a rectangular tree index structure algorithm, so as to obtain a first candidate rectangular tree index corresponding to the first type of sub-index object and a second candidate rectangular tree index corresponding to the second type of sub-index object. The construction module 302 can also be used to construct a first tree structure corresponding to the first candidate rectangular tree index and a second tree structure corresponding to the second candidate rectangular tree index according to the geospatial adjacency relationship. The data processing device 30 in this embodiment may further include a verification module, used to verify the first tree structure and the second tree structure according to the integrity verification rules; wherein, the integrity verification rules include verifying whether the minimum bounding rectangle of the parent node in the tree structure completely encloses the minimum bounding rectangle of the child node corresponding to the parent node, and verifying whether all minimum bounding rectangles in each partition are in the tree structure; The data processing device 30 in this embodiment may further include a determining module, configured to, if the verification passes, use the first candidate rectangular tree index as the rectangular tree index corresponding to a type of sub-index object, and use the second candidate rectangular tree index as the rectangular tree index corresponding to a type of sub-index object.
[0156] In one or more optional embodiments, the data processing device 30 in this application embodiment may further include an extraction module, which is used to extract the minimum bounding rectangle of a single point of GPS feature points in a single partition and the minimum bounding rectangle of the polygon adjacent to the administrative region in geographic space based on the local spatial index of a single partition, so as to obtain a set of candidate minimum bounding rectangles of polygons for a single partition. The filtering module 303 can also be used to filter target administrative regions from the set of candidate polygon minimum bounding rectangles for a single partition, wherein the polygon minimum bounding rectangles of the target administrative regions include the single-point minimum bounding rectangles of complete GPS feature points; The data processing device 30 in this embodiment may further include a summarization module, which is used to traverse all partitions in the global spatial partition index, summarize the target administrative regions selected from all partitions, and obtain the administrative regions corresponding to GPS feature points in the GPS dataset.
[0157] In one or more optional embodiments, the data processing device 30 in this application embodiment may further include a sorting module for sorting the administrative regions corresponding to GPS feature points according to the priority of the three-level administrative regions of provinces, cities and districts. The data processing device 30 in this embodiment may further include a completion module, which is used to complete the administrative regions corresponding to GPS feature points based on the hierarchical relationship data of the sorted administrative regions in the three levels of provinces, cities and districts when at least one level of administrative regions is missing in the sorted administrative regions. The generation module 304 can also be used to generate structured data based on the completed administrative data of the administrative regions corresponding to GPS feature points.
[0158] In one or more optional embodiments, the data processing device 30 in this application embodiment may further include a calculation module for calculating the straight-line distance between GPS feature points and the center point of each first administrative region when the sorted administrative regions include at least two first administrative regions of the same level and the first administrative region is the administrative region with the highest priority among the priority regions. The data processing device 30 in this embodiment may further include a determination module, which is used to identify administrative regions with a straight-line distance less than or equal to a preset threshold as the highest priority administrative regions among the administrative regions corresponding to the GPS feature points.
[0159] In one or more optional embodiments, the priority of the three-tiered administrative regions (province, city, district, and municipal) includes the priority of the provincial-level administrative region, the priority of the municipal-level administrative region, and the priority of the district-level administrative region; wherein, District-level administrative regions have a higher priority than city-level administrative regions, and city-level administrative regions have a higher priority than provincial-level administrative regions.
[0160] Based on the same inventive concept, this application also provides a computer device. (Specifically combined with...) Figure 4 Please provide a detailed explanation.
[0161] Figure 4 This is a schematic diagram of the structure of a computer device provided in one embodiment of this application.
[0162] like Figure 4 As shown, the computer device may include at least one of the following as described in the embodiments of this application: an electronic device, a server. The computer device may include a processor 401 and a memory 402 storing computer program instructions.
[0163] Specifically, the processor 401 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0164] Memory 402 may include a large-capacity memory for data or instructions. For example, and not limitingly, memory 402 may include a hard disk drive (HDD), a floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or a Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 402 may include removable or non-removable (or fixed) media. Where appropriate, memory 402 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 402 is non-volatile solid-state memory. In a particular embodiment, memory 402 includes solid-state storage (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or flash memory, or a combination of two or more of these.
[0165] The processor 401 implements any of the data processing methods described in the above embodiments by reading and executing computer program instructions stored in the memory 402.
[0166] In one example, the computer device may also include a communication interface 403 and a bus 410. Wherein, as... Figure 4 As shown, the processor 401, memory 402, and communication interface 403 are connected through bus 410 and complete communication with each other.
[0167] The communication interface 403 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.
[0168] Bus 410 includes hardware, software, or both, that couples components of a flow control device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 410 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, any suitable bus or interconnect is contemplated herein.
[0169] The computer device can execute the data processing method described in the embodiments of this application, thereby achieving the combination Figures 1 to 4 The data processing methods and apparatus described.
[0170] Furthermore, in conjunction with the data processing methods in the above embodiments, this application embodiment can provide a computer-readable storage medium for implementation. This computer-readable storage medium stores computer program instructions; when executed by a processor, these computer program instructions implement any of the data processing methods in the above embodiments.
[0171] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.
[0172] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.
[0173] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0174] The above are merely specific embodiments of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.
Claims
1. A data processing method, characterized in that, include: Obtain the GPS data set and the administrative region geometric object set corresponding to the query statement. The administrative region geometric object set is a set of polygonal geometric objects representing the three levels of administrative regions: province, city, and district. Based on the GPS data set and the set of administrative region geometric objects, a distributed spatial index is constructed. The distributed spatial index includes a global spatial partition index and a local spatial index. The global spatial partition index is an index of geographical range partitions across the GPS data set and the set of administrative region geometric objects. The local spatial index is an index of a tree-like space formed by organizing the minimum bounding rectangles according to the geographical spatial adjacency relationship within a single partition. Based on the local spatial index of a single partition, administrative regions corresponding to GPS feature points in the GPS dataset are selected, where the GPS feature points in the GPS dataset do not overlap. Based on the administrative regions corresponding to the GPS feature points, structured data is generated. The structured data includes the latitude and longitude data of the GPS feature points and the administrative data of the three-tiered administrative regions of provinces, cities, and districts.
2. The method according to claim 1, characterized in that, Before obtaining the GPS data set and the set of administrative region geometric objects corresponding to the query statement, the method further includes: Obtain user input data, which includes N first query statements and administrative region division data storage paths, where N is an integer greater than or equal to 2; The initial GPS data source is obtained by parsing the N first query statements; Based on the initial GPS data source, the GPS dataset is constructed; According to the administrative region division data storage path, obtain the administrative region division data, which includes data used to characterize the three-level administrative region division relationship of provinces, municipalities and districts. Based on the administrative region division data, determine the set of geometric objects for the administrative region.
3. The method according to claim 2, characterized in that, The process of parsing the N first query statements to obtain the initial GPS data source includes: By using flag variables, the feature objects in each of the N first query statements are identified to obtain the semantic boundary of each first query statement. The flag variables include at least one of the following: unterminated quotation mark flag variable and leading escape character flag. Based on the semantic boundary of each first query statement, delete the annotation content related to the feature object in each first query statement to obtain the second query statement corresponding to each first query statement; According to the order of the identified query statements, the tabular data structure of the last second query statement among the N second query statements is used as the initial GPS data source.
4. The method according to claim 2 or 3, characterized in that, The user input data also includes latitude and longitude field names; the construction of the GPS data set based on the initial GPS data source includes: According to the latitude and longitude field names, extract M sets of latitude and longitude fields from the initial GPS data source, where M is an integer greater than or equal to 2; The geospatial standard set conversion function is used to convert each of the M groups of latitude and longitude fields into point geometric objects. The GPS data set is obtained by performing deduplication and invalid data filtering operations on the converted point geometry objects through the redundant service field filtering function.
5. The method according to claim 2, characterized in that, The step of determining the set of geometric objects of the administrative region based on the administrative region division data includes: Extract the boundary coordinate data corresponding to each administrative region in the three-tiered administrative region of the province, city, and district from the administrative region division data. The boundary coordinate data is used to indicate the spatial boundary range of the administrative region. According to the validity correction rules, the boundary coordinate data corresponding to each administrative region is corrected to obtain the corrected boundary coordinate data corresponding to each administrative region. The validity correction rules include at least one of the following: rules for correcting coordinates that exceed the geographical range, and rules for correcting overlapping boundaries. The corrected boundary coordinate data corresponding to each administrative region is transformed to obtain a polygonal geometric object of each administrative region. Using a geometric range statistical algorithm, the minimum bounding rectangle of each administrative region is determined based on the polygonal geometric objects of each administrative region. By associating the minimum bounding rectangle of each administrative region with the administrative attribute data corresponding to each administrative region, a set of geometric objects of the administrative regions is obtained. The administrative attribute data includes the hierarchical identifier of each administrative region in the three levels of province, city, and district, the administrative data of each administrative region, and the hierarchical relationship data of each administrative region in the three levels of province, city, and district.
6. The method according to claim 1, characterized in that, The construction of a distributed spatial index based on the GPS data set and the set of administrative region geometric objects includes: Based on the GPS data set and the set of administrative region geometric objects, a first type of index object and a second type of index object are determined. The first type of index object is the minimum bounding rectangle of a single point of the GPS feature point, and the second type of index object is the minimum bounding rectangle of the polygon of each administrative region in the set of administrative region geometric objects. By using a multidimensional balanced partitioning tree partitioner, the first type of index object and the second type of index object are geographically partitioned according to geographical partitioning rules to obtain at least one partition; The global spatial partition index is constructed based on the at least one partition and the minimum bounding rectangle of a single point and the minimum bounding rectangle of a polygon in each partition.
7. The method according to claim 1 or 6, characterized in that, The construction of a distributed spatial index based on the GPS data set and the set of administrative region geometric objects includes: For a single partition, based on the GPS data set and the set of administrative region geometric objects, a first type of sub-index object and a second type of sub-index object are determined. The first type of sub-index object is the minimum bounding rectangle of a single point for each GPS feature point within a single partition, and the second type of sub-index object is the minimum bounding rectangle of a polygon for each administrative region within the three-tiered administrative region of the province, city, and district within a single partition. Using a rectangular tree indexing structure algorithm, indexes are constructed for the first type of sub-index objects and the second type of sub-index objects respectively, to obtain the local spatial index. The local spatial index includes a rectangular tree index corresponding to the first type of sub-index object and a rectangular tree index corresponding to the second type of sub-index object.
8. The method according to claim 7, characterized in that, The step of constructing indexes for the first type of sub-index objects and the second type of sub-index objects using a rectangular tree indexing structure algorithm to obtain the local space index includes: Using a rectangular tree indexing structure algorithm, indexes are constructed for the first type of sub-index objects and the second type of sub-index objects respectively, to obtain a first candidate rectangular tree index corresponding to the first type of sub-index objects and a second candidate rectangular tree index corresponding to the second type of sub-index objects; Based on the geographic spatial adjacency relationship, a first tree structure corresponding to the first candidate rectangular tree index and a second tree structure corresponding to the second candidate rectangular tree index are constructed respectively; According to the integrity verification rules, the first tree structure and the second tree structure are verified respectively; wherein, the integrity verification rules include verifying whether the minimum bounding rectangle of the parent node in the tree structure completely wraps the minimum bounding rectangle of the child node corresponding to the parent node, and verifying whether all minimum bounding rectangles in each partition are in the tree structure; If the verification passes, the first candidate rectangular tree index is used as the rectangular tree index corresponding to the first type of sub-index object, and the second candidate rectangular tree index is used as the rectangular tree index corresponding to the second type of sub-index object.
9. The method according to claim 1, characterized in that, The step of filtering out administrative regions corresponding to GPS feature points in the GPS dataset based on a local spatial index of a single partition includes: Based on the local spatial index of a single partition, the minimum bounding rectangle of a single point of GPS feature points within a single partition is extracted, and the minimum bounding rectangle of the polygon adjacent to the administrative region in geographic space is obtained, thus obtaining a set of candidate minimum bounding rectangles of the polygon for a single partition. Target administrative regions are selected from the set of candidate polygon minimum bounding rectangles for a single said partition, wherein the polygon minimum bounding rectangles of the target administrative regions include the single-point minimum bounding rectangles of complete GPS feature points; Traverse all partitions in the global spatial partition index, summarize the target administrative regions selected from all partitions, and obtain the administrative regions corresponding to the GPS feature points in the GPS dataset.
10. The method according to claim 1, characterized in that, The step of generating structured data based on the administrative regions corresponding to the GPS feature points includes: The administrative regions corresponding to the GPS feature points are sorted according to the priority of the three-tiered administrative regions of provinces, municipalities, and autonomous regions. If the sorted administrative regions are missing at least one of the three levels of provinces, municipalities, and autonomous regions, the administrative regions corresponding to the GPS feature points are completed based on the hierarchical relationship data of the sorted administrative regions in the three levels of provinces, municipalities, and autonomous regions. The structured data is generated based on the completed administrative data of the administrative regions corresponding to the GPS feature points.
11. The method according to claim 10, characterized in that, Before completing the administrative regions corresponding to the GPS feature points based on the sorted hierarchical relationship data of administrative regions in the three levels of provinces, municipalities, and autonomous regions, the method further includes: If the sorted administrative regions include at least two first administrative regions of the same level and the first administrative region is the administrative region with the highest priority among the priority regions, calculate the straight-line distance between the GPS feature point and the center point of each first administrative region. Administrative regions whose straight-line distance is less than or equal to a preset threshold are designated as the highest priority administrative regions corresponding to the GPS feature points.
12. The method according to claim 10 or 11, characterized in that, The priority of the three-tiered administrative regions (province, city, district, and municipality) includes the priority of the provincial-level administrative region, the priority of the municipal-level administrative region, and the priority of the district-level administrative region; among which... The priority of the district-level administrative region is higher than that of the city-level administrative region, and the priority of the city-level administrative region is higher than that of the province-level administrative region.
13. A data processing apparatus, characterized in that, The acquisition module is used to acquire the GPS data set and the administrative region geometric object set corresponding to the query statement. The administrative region geometric object set is a set of polygonal geometric objects representing the three levels of administrative regions: province, city, and district. A construction module is used to construct a distributed spatial index based on the GPS data set and the set of administrative region geometric objects. The distributed spatial index includes a global spatial partition index and a local spatial index. The global spatial partition index is an index of a geographical range partition across the GPS data set and the set of administrative region geometric objects. The local spatial index is an index of a tree-like space formed by organizing the minimum bounding rectangles according to the geographical adjacency relationship within a single partition. The filtering module is used to filter out administrative regions corresponding to GPS feature points in the GPS dataset based on the local spatial index of a single partition, wherein the GPS feature points in the GPS dataset do not overlap. The generation module is used to generate structured data based on the administrative regions corresponding to the GPS feature points. The structured data includes the latitude and longitude data of the GPS feature points and the administrative data of the three-tiered administrative regions of provinces, cities, and districts.
14. A computer device, characterized in that, The computer device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, it implements the data processing method as described in any one of claims 1-12.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions, which, when executed by a processor, implement the data processing method as described in any one of claims 1-12.
16. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the data processing method as described in any one of claims 1-12.