Remote sensing data automatic publishing method and system based on administrative division and land class code
By employing dual-database semantic mapping, templated parameter generation, and concurrency control mechanisms, the system addresses the issues of low efficiency and error-proneness in publishing geographic information system layer services. It achieves efficient and automated data publishing of administrative divisions and land use codes, supporting concurrent multi-administrator access and smooth transitions for data changes.
Patent Information
- Application Number
- CN202611694397.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-30
- Publication Date
- 2026-11-27
AI Technical Summary
In existing technologies, the publishing efficiency of geographic information system layer services is low, relying on manual operation is prone to errors, lacks concurrency control, is difficult to expand, and cannot effectively handle data consistency issues when administrative divisions change and land category standards are updated.
The system employs a dual-database semantic mapping mechanism, templated parameter generation, concurrency control mechanisms, and time-range version management to achieve automatic publishing of administrative division and land category codes. Specifically, this includes establishing an administrative division and land category management database, constructing semantic mapping relationships through a joint mapping view, generating publishing parameters using vector publishing templates, implementing concurrency control through database advisory locks, unique index constraints, and row-level locks, and optimizing query performance through GiST spatial indexes.
It achieves zero-code automatic conversion from business selection to technology configuration, improves release efficiency by more than 80%, reduces the configuration error rate to less than 0.2%, optimizes data consistency and query performance in multi-administrator concurrent scenarios, and supports a smooth transition for administrative division changes and land category standard updates.
Smart Images

Figure CN123178408A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of geographic information systems and remote sensing data service publishing technology, specifically to an automatic remote sensing data publishing method and system based on administrative divisions and land category codes, applicable to service-oriented publishing scenarios of large-scale geospatial data such as natural resource supervision and farmland change monitoring. Background Technology
[0002] With the deepening of remote sensing monitoring of natural resources, natural resources authorities at all levels need to publish massive amounts of remote sensing imagery and vector monitoring patches as map services for use in business systems and public access. Taking provincial-level farmland change monitoring as an example, it is typically necessary to publish remote sensing interpretation results as WMS (Web Map Service) and WFS (Web Feature Service) services according to two dimensions: administrative divisions (province, city, and county levels) and land use classifications (farmland, orchard, forest, etc.). A medium-sized province may involve hundreds of districts and counties and dozens of land use categories, resulting in thousands of layer services that need to be published.
[0003] In existing technologies, the publishing of geographic information system (GIS) layer services mainly relies on manual operation. As pointed out in "Design and Implementation of a Real-time Publishing System for Geospatial Data Services" (authors: Huang Huadong, Ma Hongyang, Fan Chuan, published in *Modern Surveying and Mapping*, 2024, No. 01), traditional geospatial data service publishing requires manual map compilation and parameter configuration, which is cumbersome, involves numerous parameters, and requires a significant amount of time to generate tiles. This process is not only time-consuming and labor-intensive but also prone to errors. Taking the GeoServer map server as an example, "An Automatic Publishing Algorithm for Marine Environmental Maps Based on GeoServer" (authors: Li Junjie, Fan Chong, Zhao Dandan, published in *Surveying and Mapping Geographic Information*, 2025, No. 2) points out that as the number of publishing layers increases, the publishing rate gradually decreases, necessitating an automated publishing solution.
[0004] Chinese patent document CN114020756A discloses a "Real-time Map Service Publishing Method and Apparatus for Remote Sensing Images," which achieves real-time publishing of remote sensing images by creating map service information based on a map tile service information database. Chinese patent document CN114398456A discloses a "Geographic Service Publishing System and Method Based on Full Data," which uses heterogeneous platform combination technology to achieve unified publishing of geographic information. However, neither of these existing technologies solves the data consistency problem in scenarios with multiple concurrent administrators, nor does it address the smooth transition during changes in administrative divisions and updates to land use standards.
[0005] Therefore, how to achieve automatic mapping between administrative divisions and land category codes and generate templated parameters while taking into account concurrency security control and query performance optimization has become a technical problem that urgently needs to be solved in this field; how to further support the smooth adaptation when administrative divisions change and land category standards are updated is also a technical problem that this field hopes to further solve. Summary of the Invention
[0006] To address the technical problems of inefficiency, error-prone configuration, lack of concurrency control, and difficulty in expansion in existing geographic information system (GIS) layer service publishing technologies, this invention provides a method and system for automatic publishing of remote sensing data based on administrative divisions and land use codes. The aim is to achieve the following technical objectives: First, through a dual-database semantic mapping mechanism, the business semantics of administrative divisions and land use codes are automatically converted into the technical parameters required for map service publishing, eliminating manual configuration. Second, through a templated parameter generation mechanism, publishing parameters are standardized and automated, eliminating configuration errors. Third, through the collaboration of a concurrency control mechanism combining database advisory locks, unique index constraints, and row-level locks, and the GiST (Generalized Search Tree) spatial index, data consistency and query performance optimization are achieved in multi-administrator concurrent scenarios. Furthermore, this invention can also achieve a smooth transition when administrative divisions change and land use standards are updated through a time-interval version management mechanism.
[0007] The technical solution adopted by this invention to solve its technical problem is as follows: On the one hand, a method for automatically publishing remote sensing data based on administrative divisions and land category codes is provided, including the following steps: S1: Establish an administrative division management database and a land category management database. The administrative division management database stores the name, hierarchical identifier, unique identifier, and parent-level identifier hierarchical relationship of administrative divisions, and uses a multi-level administrative division tree index structure to store the hierarchical relationship. Each administrative division node includes the parent node identifier, hierarchical depth, valid start time, and valid end time. When an administrative division changes, data migration is achieved through node splitting or merging operations, and the valid time interval of historical data is marked, supporting querying the valid administrative division definition at that time point. The land category management database stores the unique code and name of the land category. The administrative division management database and the land category management database establish a joint mapping view (a database view built based on the business association table) through a business association table to construct a semantic mapping relationship between administrative divisions and land categories. S2: Preset vector publishing template, which includes workspace, repository type, coordinate system, style reference parameters, and dynamically replaceable variable placeholders; S3: In response to the operation of selecting the administrative division name, land category name, and vector type, the system reads the unique identifier of the administrative division from the administrative division management database through the joint mapping view, and reads the unique code of the land category from the land category management database through the joint mapping view. According to a preset concatenation rule, the system generates a unique layer identifier by combining the unique identifier, the unique code, the vector type, the year corresponding to the data, and the version number. After generating the unique layer identifier, the system performs an application layer pre-check by querying the business association table to determine if the identifier is already in use. If it is, the system automatically increments the version number until an unused identifier is generated. The system then replaces the variable placeholders in the vector publishing template with the unique identifier, the unique code, the vector type, the year corresponding to the data, and the version number to generate a complete publishing parameter set. S4: Based on the unique layer identifier, perform concurrency security control in the spatial database: regardless of whether the configuration record exists, request a database consultation lock using the unique layer identifier as the lock identifier. If the request fails, return a concurrency conflict prompt. After successful request, insert the configuration record identified by the unique layer identifier into the business association table. The business association table has a unique index constraint on the unique layer identifier field. If the insertion is successful, add a row-level lock to the inserted configuration record. If the insertion fails due to a unique index conflict, add a row-level lock to the existing configuration record. Create a GiST spatial index for the spatial geometry column in the vector data table corresponding to the unique layer identifier and pre-stored vector monitoring data. S5: Call the map service interface, send the published parameter set to the map server to complete the publication of the vector layer, and after the publication is completed, submit the transaction to release the consultation lock and the row lock, and store the unique layer identifier with the corresponding administrative division identifier and land category identifier; wherein, after the administrative division changes, the newly published layer generates the identifier according to the new division logic, and the original published layer retains the historical identifier for retrospection.
[0008] In one embodiment of the present invention, the method for automatically publishing remote sensing data based on administrative divisions and land category codes further includes: S6: Establish an automatic mapping rule base between land use codes and SLD (Styled Layer Descriptor) styles. Automatically match the corresponding colors, fill patterns, and annotation methods based on the land use codes. Automatically apply the styles when publishing vector layers and complete visualization rendering when loading layers. The automatic mapping rule base supports multi-level style matching, prioritizing the matching of the exclusive styles corresponding to the land use codes. If the exclusive styles do not exist, the general styles corresponding to the major categories to which the land use belongs are matched. If none of the styles exist, the system default styles are used.
[0009] In one embodiment of the present invention, the method for automatically publishing remote sensing data based on administrative divisions and land category codes further includes: S7: Perform full-link monitoring of the service health of published layers. The service health includes map service interface response time, error rate, and concurrent request count. When the monitoring indicators exceed the preset threshold, trigger automatic alarms and automatic recovery mechanisms. The automatic recovery mechanism includes: automatically restarting the layer service when service unavailability is detected, automatically scaling up service instances when response time exceeds the threshold, and automatically switching to a backup data source when error rate exceeds the threshold.
[0010] In one embodiment of the present invention, after generating a unique layer identifier, the system calculates the SHA-256 hash value of the unique layer identifier and compares it with the stored hash value set for initial uniqueness screening: if the hash values are different, the identifiers are determined to be different; if the hash values are the same, the unique index constraint of the business association table is used as the final basis for uniqueness determination, thereby reducing the query overhead of uniqueness determination while ensuring the correctness of the determination.
[0011] In one embodiment of the present invention, the land category records in the land category management database are associated with version numbers, and the mapping relationship between the old and new land category codes is stored; when the land category standard is updated, a new land category record corresponding to the new version is added to the land category management database, and the mapping relationship between the old and new land category codes is established; the newly released layer uses the new version of the land category code to generate a unique layer identifier and applies the corresponding style and metadata, while the old version of the released layer retains the original land category code, style and metadata unchanged, so as to achieve the coexistence of the old and new standard data.
[0012] In one embodiment of the present invention, when a new administrative division is added, a new administrative division record is inserted into the administrative division management database. When the system receives the selection operation for adding a new administrative division, it automatically completes the publication of the raster base map and the initialization of the associated vector layer. The publication of the raster base map adopts a preset raster publication template. The raster publication template includes a workspace, a raster data repository name, a layer name prefix, a coordinate system identifier, tile pyramid level parameters, and a default style reference. After replacing the variable placeholders in the raster publication template with unique identifiers of administrative divisions, the map service interface is called to complete the publication of the raster layer.
[0013] On the other hand, an automatic remote sensing data publishing system based on administrative divisions and land category codes is provided, including: The dual-database mapping module is used to establish an administrative division management database and a land category management database. The administrative division management database stores the name, hierarchical identifier, unique identifier, and parent identifier hierarchical relationship of the administrative divisions. The land category management database stores the unique code and name of the land category. The administrative division management database and the land category management database establish a joint mapping view (a database view built based on the business association table) through a business association table, thereby constructing a semantic mapping relationship between administrative divisions and land categories. The template configuration module is used to preset vector publishing templates. The vector publishing templates include workspace, repository type, coordinate system, style reference parameters, and dynamically replaceable variable placeholders. The parameter generation module is used to respond to the selection of administrative division name, land category name and vector type. It reads the corresponding unique identifier and unique code from the administrative division management database and the land category management database respectively through the joint mapping view. According to the preset splicing rules and combined with the year and version number of the data, it generates a unique layer identifier. The module then replaces the variable placeholders in the vector publishing template with the unique identifier, the unique code, the vector type, the year of the data and the version number to generate a complete set of publishing parameters. The concurrency and index creation module is used to perform concurrency safety control in the spatial database based on the unique layer identifier: regardless of whether the configuration record exists, a database consultation lock is requested using the unique layer identifier as the lock identifier; if the request fails, a concurrency conflict prompt is returned; after successful request, a configuration record identified by the unique layer identifier is inserted into the business association table. The business association table has a unique index constraint on the unique layer identifier field. If the insertion is successful, a row-level lock is added to the inserted configuration record; if the insertion fails due to a unique index conflict, a row-level lock is added to the existing configuration record; and a GiST spatial index is created for the spatial geometry column in the vector data table corresponding to the unique layer identifier and which pre-stores vector monitoring data. The publishing execution module is used to call the map service interface, send the publishing parameter set to the map server to complete the publishing of the vector layer, and after the publishing is completed, submit the transaction to release the consultation lock and the row lock, and associate and store the unique layer identifier with the corresponding administrative division identifier and land category identifier.
[0014] In one embodiment of the present invention, the remote sensing data automatic publishing system based on administrative divisions and land category codes further includes: The automatic style mapping module is used to establish an automatic mapping rule base between land use codes and SLD styles. It automatically matches the corresponding colors, fill patterns, and annotation methods according to the land use code, automatically applies the styles when the vector layer is published, and completes the visualization rendering when the layer is loaded. The automatic mapping rule base supports multi-level style matching, prioritizing the matching of the exclusive style corresponding to the land use code. If the exclusive style does not exist, it matches the general style corresponding to the major category to which the land use belongs. If it still does not exist, it uses the system default style. The end-to-end monitoring module is used to monitor the service health of published layers across the entire process. The service health includes map service interface response time, error rate, and concurrent request count. When the monitoring indicators exceed preset thresholds, an automatic alarm and automatic recovery mechanism are triggered. The automatic recovery mechanism includes: automatically restarting the layer service when service unavailability is detected; automatically scaling up service instances when response time exceeds a threshold; and automatically switching to a backup data source when error rate exceeds a threshold.
[0015] One of the above technical solutions has the following advantages or beneficial effects: (1) Through the dual-database semantic mapping mechanism, the business semantics of administrative division and land category codes are automatically converted into the technical parameters required for map service publishing, realizing zero-code automatic conversion from business selection to technical configuration. The administrator only needs to select three business parameters: administrative division name, land category name and vector type, and the system can automatically complete all publishing configurations. The publishing efficiency is improved by more than 80% compared with the manual method, and the configuration error rate is reduced to less than 0.2%.
[0016] (2) The configuration of publishing parameters is standardized and automated through a template-based parameter generation mechanism. The vector publishing template is stored in JSON format and contains dynamically replaceable variable placeholders. The system automatically fills the business parameters into the template during publishing, generating a set of publishing parameters that conforms to the map service interface specification. This mechanism ensures the consistency of configuration between different layers and eliminates problems such as non-standard naming and incorrect coordinate system settings caused by manual operation.
[0017] (3) By combining database query locks, unique index constraints, and row-level locks into a concurrency control mechanism, and through the collaboration of GiST spatial indexes, data consistency and query performance optimization in multi-administrator concurrent scenarios are achieved. Query locks use unique layer identifiers as the locking key and are independent of whether configuration records exist, allowing concurrent requests to be intercepted at the entry point of the release process; unique index constraints serve as the final guarantee at the database level, ensuring that at most one configuration record exists for the same unique layer identifier; row-level locks protect existing records from concurrent modification, and the three mechanisms work together to cover all concurrent time-series scenarios of initial release, repeated release, and update release. Row-level locks are implemented using row-level lock statements that support NOWAIT (No Wait, meaning that if lock acquisition fails, it returns immediately without blocking and waiting) mode. When a concurrent conflict is detected, a prompt is returned immediately to avoid long-term blocking of transactions. The GiST spatial index is automatically created when the layer is published, which reduces the time complexity of spatial range queries from O(n) to O(logn). In actual tests, the query response time for millions of data points has been reduced from seconds (3 to 5 seconds) to sub-seconds (less than 0.5 seconds), with a performance improvement of about 6 to 10 times.
[0018] (4) Through the time interval version management mechanism, a smooth transition is achieved when administrative divisions change and land category standards are updated. Each administrative division node and land category record contains a valid start time and a valid end time. When a change occurs, data migration is achieved through node splitting or merging operations. The original published layers retain historical identifiers for retrospection, and the newly published layers generate identifiers according to the new division logic, ensuring that the old and new standard data coexist without conflict.
[0019] (5) The present invention integrates and coordinates the dual-database mapping, templated parameter generation, consultation lock, unique index constraint and row-level lock concurrency control, GiST index, time interval version management and other technical means to form a three-layer collaborative system of data layer, logic layer and infrastructure layer: dual-database mapping provides a standardized correspondence between business semantics and technical parameters (data layer); the templated mechanism transforms this correspondence into executable release instructions (logic layer); the concurrency control mechanism and GiST index ensure the system robustness in large-scale concurrency scenarios from the two dimensions of data consistency and query performance (infrastructure layer); and time interval version management realizes smooth adaptation of changes from the dimension of data life cycle. The three-layer collaborative effect enables the system to automatically complete identifier migration, template adaptation and index reconstruction when administrative division changes or land category standards are updated, realizing the full automation of the complex process that traditional solutions require manual configuration item by item. This fully automated capability is impossible to achieve when each technology is used individually. A standalone dual-database mapping cannot resolve concurrency conflicts; a standalone row-level lock cannot achieve zero-code extension and cannot handle scenarios where configuration records are missing during the initial release; a standalone GiST index cannot guarantee configuration consistency; and standalone time interval management cannot automatically trigger template adaptation. Comparative experiments further demonstrate that when only dual-database mapping and templated parameter generation are used without a concurrency control mechanism, the concurrent release conflict rate is approximately 15.3%, which cannot meet the needs of multi-administrator concurrent scenarios. With all four technologies working in tandem, the system simultaneously achieves "second-level concurrent secure release," "zero-code extension," and "automatic adaptation to zoning changes," with each of these effects predicated on the remaining technologies. Attached Figure Description
[0020] Figure 1 This is a flowchart illustrating an automatic remote sensing data publishing method based on administrative divisions and land category codes, according to an exemplary embodiment. Figure 2 This is a schematic diagram of a joint mapping view structure of an administrative division management database and a land category management database, according to an exemplary embodiment. Figure 3 This is a schematic diagram illustrating a multi-administrator concurrent publishing and row-level lock control process according to an exemplary embodiment; Figure 4 This is a schematic diagram illustrating the automatic mapping relationship between land use codes and SLD styles according to an exemplary embodiment; Figure 5 This is a schematic diagram illustrating the structure of an automatic remote sensing data publishing system based on administrative divisions and land category codes, according to an exemplary embodiment. Figure 6 This is a schematic diagram illustrating a grid publishing template structure and an automatic grid data publishing process according to an exemplary embodiment. Detailed Implementation
[0021] To more clearly illustrate the technical features of the present invention, the invention will be described in detail below through specific embodiments and in conjunction with the accompanying drawings. The following disclosure provides many different embodiments or examples for implementing different structures of the present invention. To simplify the disclosure of the present invention, the components and arrangements of specific examples are described below. Of course, these are merely examples and are not intended to limit the invention.
[0022] Example 1 like Figure 1 As shown in the figure, an embodiment of the present invention provides a method for automatically publishing remote sensing data based on administrative divisions and land category codes, which includes the following steps: S1: Establish an administrative division management database and a land category management database. The administrative division management database stores the name, hierarchical identifier, unique identifier, and parent identifier hierarchical relationship of the administrative division. The land category management database stores the unique code and name of the land category. The administrative division management database and the land category management database form a joint mapping view through a business association table to construct a semantic mapping relationship between administrative divisions and land categories.
[0023] The administrative division management database uses a multi-level administrative division tree index structure to store hierarchical relationships. Each administrative division node includes a parent node identifier, level depth, valid start time, and valid end time. When an administrative division changes, data migration is achieved through node splitting or merging operations, and the valid time interval of historical data is marked. It supports querying the valid administrative division definition at that time by time point. Newly published layers generate identifiers according to the new division logic, while existing published layers retain historical identifiers for retrospection.
[0024] The land category records in the land category management database are associated with version numbers, and the mapping relationship between the old and new land category codes is stored. When the land category standard is updated, a new land category record corresponding to the new version is added to the land category management database, and the mapping relationship between the old and new land category codes is established. Newly released layers use the new version of the land category code to generate a unique layer identifier and apply the corresponding style and metadata. Old version layers that have been released retain the original land category code, style and metadata unchanged, so as to achieve the coexistence of old and new standard data.
[0025] For example, the specific process of establishing the administrative division management database and the land category management database is as follows: This embodiment of the invention uses PostgreSQL 14 and PostGIS 3.2 as the underlying spatial database. For example... Figure 2As shown, the administrative division management database table (sys_region) contains the following fields: id (primary key), parent_id (parent identifier), region_name (Chinese name), region_code (GB / T 2260 administrative code), pinyin (pinyin abbreviation), level (level: 1 province, 2 city, 3 county, 4 township), valid_start (valid start time), and valid_end (valid end time). The land type management database table (sys_land_type) contains the following fields: id, type_code (GB / T 21010 land type code), type_name (land type name, such as paddy field, dry land, irrigated land), color_hex (default rendering color), version (version number), and style_ref (style reference). The two databases form a joint mapping view (a database view built based on this business association table) through the business association table (region_land_mapping). This association table contains the following fields: mapping_id, region_code, land_code, layer_identifier, publish_url, status, and create_time. A unique index constraint is set on the layer_identifier field to ensure the global uniqueness of the unique layer identifier at the database level, serving as the final guarantee for the concurrency control mechanism (see step S4 for details).
[0026] It should be noted that in this embodiment, the region_code adopts the 6-digit administrative division code specified in GB / T 2260. The administrative codes and unique layer identifiers in the following examples are represented in complete code form.
[0027] For example, if a new farmland change monitoring layer for a certain county needs to be added, the system first queries the administrative division management database to find the county's administrative code (370131, example) using a joint mapping view, and then queries the land category management database to find the corresponding land category code for farmland (0101). Following the concatenation rule {unique administrative division identifier}_{unique land category code}_{vector type}_{corresponding year of data}_{version number}, a unique layer identifier 370131_0101_change_2026_v1 is automatically generated. This identifier conforms to national standard code specifications and is human-readable. Through the joint mapping view, the system can perform bidirectional searches based on administrative division names or land category names to quickly locate the corresponding layer service.
[0028] Example of a combined mapped view query: SELECT r.region_name, l.type_name, m.layer_identifier FROM sys_region r JOIN region_land_mapping m ON r.region_code = m.region_code JOIN sys_land_type l ON m.land_code = l.type_code WHERE r.region_name = 'County' AND l.type_name = 'Farmland'; Query results: region_name=a certain county, type_name=farmland, layer_identifier=370131_0101_change_2026_v1.
[0029] S2: Preset vector publishing template, which includes workspace, repository type, coordinate system, style reference parameters, and dynamically replaceable variable placeholders.
[0030] The vector publishing template is stored in the system configuration table in JSON (JavaScript Object Notation) format and includes the following preset parameters: workspace name template, data storage connection parameters, layer name suffix rules, coordinate system SRS (Spatial Reference System) identifier, spatial index type, and concurrency lock strategy; the vector publishing template is associated with a template version number, which automatically increments when the template content is updated.
[0031] For example, the detailed configuration of the vector publishing template is as follows: The vector publishing template is stored in the system configuration table in JSON format. Typical content includes the following: The template contains the following fields: workspace (value: agri_monitor), store (value: postgis_db), layer_name (containing placeholder variables such as region_code_land_code_vector_type_year_version), srs (value: EPSG:4490, EPSG is the spatial reference system coding standard maintained by the European Petroleum Survey Group, EPSG:4490 corresponds to the CGCS2000 national geodetic coordinate system), default_style (containing placeholder variable land_code_style), attributes (defining the layer's attribute structure), and metadata_links (recording publishing version information). The template also includes SLD style mapping relationships. For example, land use code 0101 (paddy field) corresponds to green fill (#66CC66) and black stroke, while land use code 0102 (irrigated land) corresponds to light green fill (#99CC99) and black stroke. These example color values correspond to the style mapping table in Example 2. Figure 4 The color values for the labels should remain consistent.
[0032] The template includes placeholders for the following variables: administrative division identifier (region_code), land category code (land_code), vector type (vector_type), year (year), and version number (version). The system dynamically replaces these placeholders based on the business parameters selected by the administrator during publishing. The vector type refers to the business type of the vector monitoring data, including but not limited to change monitoring patch data (change), status patch data (status), and administrative boundary data (boundary). When the system calls the REST API (Application Programming Interface), it automatically replaces the placeholders in the template with actual values and encapsulates them into an HTTP POST request body conforming to the GeoServer REST specification. When the map server requires data type names to conform to XML naming conventions (i.e., names cannot begin with a number), the system automatically adds a predefined letter prefix (such as "l_") to the layer names during publishing to ensure compatibility with such server naming constraints. The template also includes a version number field; the version number automatically increments when the template content is updated, ensuring that historical publishing records can be traced back to the corresponding version of the template configuration.
[0033] S3: In response to the operation of selecting the administrative division name, land category name, and vector type, the unique identifier of the administrative division is read from the administrative division management database through the joint mapping view, and the unique code of the land category is read from the land category management database through the joint mapping view. According to the preset splicing rules, the unique identifier, the unique code, the vector type, the year and version number corresponding to the data are used to generate a unique layer identifier. The variable placeholders in the vector publishing template are replaced with the unique identifier, the unique code, the vector type, the year and version number corresponding to the data to generate a complete publishing parameter set.
[0034] The concatenation rule for the unique layer identifier is: {Unique Administrative Division Identifier}_{Unique Land Category Code}_{Vector Type}_{Year Corresponding to Data}_{Version Number}, where the year is the year to which the data belongs, in four-digit format; the version number is an incrementing integer starting from 1. After generating the unique layer identifier, the system uses it as an application-layer pre-check to query the business association table to determine whether the identifier has been occupied. If it has been occupied, the version number is automatically incremented until an unoccupied identifier is generated. The vector types include change monitoring patch data, current status patch data, and administrative boundary data.
[0035] The application layer pre-detection also includes a uniqueness screening step: calculating the SHA-256 hash value of the generated unique layer identifier and comparing it with the hash value set of stored unique layer identifiers; if the hash value of the generated unique layer identifier is different from all hash values in the hash value set, it is determined that the generated unique layer identifier is definitely not occupied; if the hash value of the generated unique layer identifier is the same as a certain hash value in the hash value set, the unique index constraint of the business association table on the unique layer identifier field is used as the final basis for determining uniqueness.
[0036] S4: Based on the unique layer identifier, perform concurrency security control in the spatial database: regardless of whether the configuration record exists, request a database consultation lock using the unique layer identifier as the lock identifier. If the request fails, return a concurrency conflict prompt. After successful request, insert the configuration record identified by the unique layer identifier into the business association table. The business association table has a unique index constraint on the unique layer identifier field. If the insertion is successful, add a row-level lock to the inserted configuration record. If the insertion fails due to a unique index conflict, add a row-level lock to the existing configuration record. Create a GiST spatial index for the spatial geometry column in the vector data table corresponding to the unique layer identifier and pre-stored vector monitoring data.
[0037] S5: Call the map service interface, send the published parameter set to the map server to complete the vector layer publication, and after publication, submit the transaction to release the consultation lock and the row-level lock, and associate and store the unique layer identifier with the corresponding administrative division identifier and land category identifier.
[0038] When the map service interface is called to send the published parameter set to the map server to complete the vector layer publication, the system constructs a JSON payload that conforms to the REST (Representational State Transfer) architecture specification. The payload includes at least the workspace, data store, layer name, layer title, and spatial reference system (srs) fields, and sends it to the map server via an HTTP POST request.
[0039] For example, the implementation process of a map service REST API call is as follows: The backend uses the Java Spring Boot framework and sends REST requests via HttpURLConnection. Taking vector layer publishing as an example, after the administrator submits a request, the system constructs the following JSON payload and sends it to GeoServer: the request path is / geoserver / rest / workspaces / agri_monitor / datastores / postgis_db / featuretypes, the request method is POST, and the Content-Type is application / json. The featureType object in the payload body contains the following fields: name (value is 370131_0101_change_2026_v1), title (value is a farmland change monitoring patch in a certain county), srs (value is EPSG:4490), attributes (gid is defined as Integer type, change_area as Double type, change_type as String type), and metadataLinks (records the publishing version as 2026-08-21). Before sending a REST request, the system performs parameter validation: checking whether the administrative division identifier and land category code exist and are valid in the database, whether the vector type is a system-supported type (such as change, status, boundary, etc.), and whether the coordinate system identifier conforms to the EPSG specification. After successful validation, the system replaces the variable placeholders in the template with the actual values, generates a complete JSON payload, and sends it to the map server via an HTTP connection. Upon receiving a successful response from the server, the system records the publishing URL and publishing time; if an error response is returned, the system records the error information and triggers a retry mechanism.
[0040] For example, the implementation process of concurrency safety control (step S4) is as follows: This invention employs a three-layer concurrency control mechanism: "database advisory lock + unique index constraint + row-level lock". The reason why row-level locks alone cannot achieve concurrency control is that when executing a SELECT...FOR UPDATE statement on a unique layer identifier that does not yet exist in the configuration record, the database does not throw a lock conflict exception, but only returns an empty result set. This cannot prevent two concurrent transactions from simultaneously determining "record does not exist" and each executing the insertion, thus generating duplicate layer records. Therefore, a locking mechanism independent of record existence and a database-level uniqueness constraint must be introduced. The responsibilities of each mechanism are as follows: the application layer pre-check avoids using already occupied identifiers during the generation of unique layer identifiers; the database advisory lock uses the unique layer identifier as the locking key to intercept concurrent requests at the entry point of the release process; the unique index constraint serves as the final fallback guarantee at the database level, ensuring that even if two concurrent transactions attempt to insert configuration records with the same identifier simultaneously under extreme timing conditions, at most one insertion will succeed; and the row-level lock protects existing configuration records from concurrent modification by other transactions during the release process. The above mechanisms collectively cover all three types of concurrency scenarios: "record does not exist (first publication)," "record already exists (duplicate publication / update publication)," and "insertion race condition (extreme concurrency sequence)." Taking PostgreSQL as an example, the core process's SQL implementation is as follows: BEGIN; -- First layer: Request a database query lock (the lock key is the value converted by a hash function from the unique layer identifier, regardless of whether the configuration record exists). SELECT pg_try_advisory_lock(hashtext('370131_0101_change_2026_v1')); -- Returning true acquires the consultation lock and continues execution; returning false indicates that the publication of the same identifier is in progress, immediately returns a prompt and rolls back. -- Second layer: Unique index constraint as a fallback (insert a placeholder configuration record into the business relation table; if RETURNING returns a row, the insertion was successful; if no row is returned, it means the configuration record already exists) INSERT INTO region_land_mapping (layer_identifier, region_code, land_code, status, create_time) VALUES ('370131_0101_change_2026_v1', '370131', '0101', 'publishing',now()) ON CONFLICT (layer_identifier) DO NOTHING RETURNING mapping_id; -- Third level: Row-level locking (If the insertion is successful, the inserted configuration record is locked; if the insertion fails due to a unique index conflict, the existing configuration record is locked; in NOWAIT mode, it returns immediately upon failure) SELECT layer_identifier FROM region_land_mapping WHERE layer_identifier = '370131_0101_change_2026_v1' FOR UPDATENOWAIT; -- Create GiST spatial index CREATE INDEX idx_370131_0101_change_2026_v1_geom ON t_370131_0101_change_2026_v1 USING GiST(geom); COMMIT; SELECT pg_advisory_unlock(hashtext('370131_0101_change_2026_v1')); -- Release the consultation lock.
[0041] Furthermore, the row-level lock is implemented using a row-level lock statement that supports NOWAIT mode. When lock acquisition fails, an error message is returned immediately to avoid prolonged transaction blocking. After successful row-level lock acquisition, the business association table is queried again to confirm that the unique layer identifier was not created by another transaction during lock acquisition. If it has been created and not by this transaction, the lock is released and an error message is returned, thus achieving double checking through a post-lock query. As an optional implementation, when using the default blocking wait mode (instead of NOWAIT mode), the system can configure a lock wait timeout parameter for the transaction (e.g., lock_timeout is set to 5 seconds). When the waiting time exceeds the threshold, lock acquisition is automatically abandoned and a timeout message is returned. When NOWAIT mode is used, lock acquisition failure returns immediately without waiting.
[0042] For example, the implementation process of concurrent publishing by multiple administrators and row-level locking is as follows: like Figure 3As shown, before sending a REST request, the system first performs the following database operations: It starts a transaction (BEGIN), and uses the unique layer identifier converted by a hash function as the lock key to request a database advisory lock (e.g., pg_try_advisory_lock in PostgreSQL). If the request fails, it immediately returns a concurrency conflict warning and rolls back. If the request succeeds, it inserts a placeholder configuration record identified by the unique layer identifier into the business association table (region_land_mapping) (e.g., INSERT…ON CONFLICT DO NOTHING…RETURNING statement in PostgreSQL). If the insertion is successful (RETURNING returns the inserted row), it uses a row-level lock statement that supports NOWAIT mode (e.g., SELECT…FOR UPDATE in PostgreSQL). NOWAIT locks the configuration record being inserted. If the insertion fails due to a unique index conflict (RETURNING returns no rows), it indicates that the configuration record already exists. A row-level lock is then added to the existing configuration record using a NOWAIT-enabled row-level lock statement to prevent modification by other concurrent transactions. A double check is then performed: the business association table is queried again to confirm whether the unique layer identifier has been recreated by other concurrent operations outside the current transaction while the advisory lock is held. If so, ROLLBACK is executed and a prompt is returned. If the query result indicates that the identifier is merely a legacy configuration record (i.e., it existed before the advisory lock was held), no rollback is triggered, and subsequent release steps continue. Finally, the transaction is committed.
[0043] It's important to note that concurrency interception is implemented at different levels of mechanisms in different scenarios: When a configuration record already exists, and an insertion fails due to a unique index conflict, adding a row-level lock (NOWAIT mode) to the existing configuration record will cause the database to throw a lock conflict exception if another concurrent transaction already holds that row-level lock. For concurrent scenarios where the configuration record does not exist (initial publication), since row-level locks cannot intercept non-existent records, concurrency interception is achieved through advisory locks and unique index constraints, independent of the existence of the configuration record. After the system catches a lock exception or unique index conflict, it prompts that the layer is being published and requests a retry later, effectively preventing configuration data overwriting and concurrency errors. The double-checked mechanism further ensures that no other transaction will successfully create the same layer during the gap between lock acquisition and transaction commit. The use of NOWAIT instead of the default WAIT mode aims to avoid prolonged transaction blocking and improve system responsiveness in high-concurrency scenarios.
[0044] Complete Implementation of a Concurrency Scenario: Administrator A and Administrator B simultaneously attempt to publish layer 371600_0101_change_2026_v1. Administrator A successfully requests a consultation lock and acquires a row-level lock, entering the publishing process. Administrator B fails to obtain a consultation lock and receives a message indicating that the layer is being published and to retry later. After completing the publishing, Administrator A commits the transaction and releases the lock. At this point, Administrator B attempts to publish again. Since the unique layer identifier already exists in the business association table, the system triggers the automatic version number increment mechanism (e.g., v1 becomes v2), and Administrator B successfully publishes layer 371600_0101_change_2026_v2. This process requires no manual intervention; the system automatically handles concurrency control and naming conflict resolution.
[0045] Simultaneously, the system creates a GiST spatial index for the spatial geometry column (geom) of the vector layer in PostGIS. The index creation statement is: `CREATE INDEX idx_layer_identifier_geom ON table_name USING GiST(geom)`. The GiST index efficiently supports spatial range queries and spatial join operations, offering significant advantages in query response performance after layer publication. Index creation is completed during the lock holding period, ensuring consistency between the index and the data.
[0046] Process Description: When Administrator A and Administrator B simultaneously request to publish the same unique layer identifier (371600_0101_change_2026_v1), the following steps will be taken: Figure 3 The sequence shown is executed sequentially: Administrator B's initial request for a consultation lock fails because Administrator A holds the lock, and a prompt is immediately returned (NOWAIT semantics, no blocking); Administrator A completes the insertion of placeholder records, row-level locking and double-checked locking, GiST index creation and map service interface calls in sequence, and executes COMMIT after publication and releases the consultation lock and row-level lock; After that, Administrator B re-initiates the request, the system detects that the original identifier has been occupied, generates a new identifier through the version number auto-increment mechanism (v1 increments to v2), and then retryes successfully, realizing concurrency security control and automatic resolution of naming conflicts.
[0047] After generating a unique layer identifier, the system calculates the SHA-256 hash value of the unique layer identifier and compares it with the stored set of hash values for initial uniqueness screening: if the hash values are different, the identifiers are determined to be different; if the hash values are the same, the unique index constraint of the business association table is used as the final basis for uniqueness determination, thereby reducing the query overhead of uniqueness determination while ensuring the correctness of the determination.
[0048] When a new administrative division (such as a new city) needs to be added, a new administrative division record is inserted into the administrative division management database. When the system receives a selection operation for adding a new administrative division, it automatically completes the publication of the raster base map and the initialization of the associated vector layer. When a new land category needs to be added, a new land category record is inserted into the land category management database. When the system receives a selection operation for adding a new land category, it automatically generates the corresponding vector layer service. The publication of the raster base map uses a preset raster publication template. The raster publication template includes a workspace, a raster data repository name, a layer name prefix, a coordinate system identifier, tile pyramid level parameters, and a default style reference. After replacing the variable placeholders in the raster publication template with unique administrative division identifiers, the map service interface is called to complete the publication of the raster layer.
[0049] Example 2 Unlike Embodiment 1, after step S5, the automatic remote sensing data publishing method based on administrative divisions and land use codes provided in this embodiment of the invention further includes step S6: establishing an automatic mapping rule base between land use codes and SLD styles, automatically matching the corresponding colors, fill patterns, and annotation methods according to the land use codes, automatically applying the styles when publishing vector layers, and completing visualization rendering when the layers are loaded; the automatic mapping rule base supports multi-level style matching, prioritizing matching the exclusive styles corresponding to the land use codes, matching the general styles corresponding to the major categories to which the land use belongs if the exclusive styles do not exist, and using the system default styles if they still do not exist.
[0050] For example, the process of automatically mapping land types to SLD styles is as follows: like Figure 4 As shown, this invention establishes an automatic mapping rule base between land use codes and SLD styles. Each land use record in the land use management database is associated with a style reference (style_ref). When publishing a vector layer, the system automatically reads this reference and applies the corresponding style. The style mapping table includes: land use code 0101 (paddy field) corresponds to the paddy_style.sld style file with a fill color of #66CC66; land use code 0102 (irrigated land) corresponds to the irrigated_style.sld style file with a fill color of #99CC99; land use code 0103 (dry land) corresponds to the dryland_style.sld style file with a fill color of #CCCC66; and land use code 0201 (orchard) corresponds to the orchard_style.sld style file with a fill color of #98FB98. Figure 4 The fill color values marked next to the category code nodes in the text correspond one-to-one with the color values in this embodiment.
[0051] When publishing a vector layer, the system searches for the corresponding SLD style file in the mapping table based on the land use code and sets the `defaultStyle` field in the GeoServer publishing parameters to reference that style file, thus achieving automatic style binding. The automatic mapping rule base supports multi-level style matching: it prioritizes matching the exclusive style corresponding to the land use code; if the exclusive style does not exist, it matches the general style corresponding to the major category to which the land use belongs (e.g., 01 corresponds to the cultivated land category); if it still does not exist, it uses the system default style. This multi-level matching mechanism ensures that even if a new land use has not yet been configured with an exclusive style, the system can automatically select a reasonable default style for rendering.
[0052] Example 3 Unlike Embodiment 2, after step S6, the method for automatically publishing remote sensing data based on administrative divisions and land category codes provided in this embodiment of the invention further includes step S7: performing full-link monitoring of the service health of the published layers. The service health includes map service interface response time, error rate, and number of concurrent requests. When the monitoring indicators exceed preset thresholds, an automatic alarm and automatic recovery mechanism are triggered. The automatic recovery mechanism includes: automatically restarting the layer service when service unavailability is detected; automatically expanding the service instance when the response time exceeds the threshold; and automatically switching to a backup data source when the error rate exceeds the threshold.
[0053] For example, the process of end-to-end monitoring and quality assessment is as follows: The system performs end-to-end monitoring of the service health of published layers, including WMS / WFS interface response time, error rate, and concurrent request count. A release quality assessment model is established, using the following formula to score layers: , in, Quality rating (range of values) (If you need a percentage-based representation, multiply by 100). The response satisfaction score (range) calculated based on the APDEX (Application Performance Index, an open standard developed and maintained by the Apdex Alliance) standard. ); Error rate (range of values) ); This is a service availability indicator function (value 1 when the service is available, and value 0 when the service is unavailable). , , For the weighting coefficients, satisfying The evaluation weights are dynamically adjusted based on the real-time response time and error rate of the monitoring system. In this embodiment, the preferred approach is to adjust the weights accordingly. , , The weighting coefficients in this group are set based on operational experience and system fault tolerance requirements, and can be adjusted by the administrator to reflect the flexibility of the project.
[0054] The formula for calculating the APDEX satisfaction score is: , in, The number of satisfactory responses (response time less than or equal to target response time) (number of requests); Tolerable number of responses (response time greater than) and less than or equal to (number of requests); Total number of requests; The target response time threshold is defined as 2000 milliseconds. This calculation method is based on the APDEX open standard and has a mature theoretical foundation and extensive engineering practice validation.
[0055] When monitoring metrics exceed preset thresholds, the system triggers an automatic recovery mechanism: automatically restarting the layer service when service unavailability is detected; automatically scaling up service instances when response time exceeds a threshold (e.g., 2000 milliseconds); and automatically switching to a backup data source when the error rate exceeds a threshold (e.g., 5%). This automatic recovery mechanism achieves elastic scaling of service instances through a container orchestration platform (such as Kubernetes), ensuring system availability under high load scenarios.
[0056] Example 4 like Figure 5 As shown in the figure, an embodiment of the present invention provides an automatic remote sensing data publishing system based on administrative divisions and land category codes, comprising: The dual-database mapping module is used to establish an administrative division management database and a land category management database. The administrative division management database stores the name, hierarchical identifier, unique identifier, and parent identifier hierarchical relationship of administrative divisions. The land category management database stores the unique code and name of land categories. The administrative division management database and the land category management database form a joint mapping view through a business association table to construct a semantic mapping relationship between administrative divisions and land categories. The administrative division management database uses a multi-level administrative division tree index structure to store hierarchical relationships. Each administrative division node includes a parent node identifier, hierarchical depth, valid start time, and valid end time. When an administrative division changes, data migration is achieved through node splitting or merging operations, and the valid time interval of historical data is marked. It supports querying the valid administrative division definition at that time point by time. Newly published layers generate identifiers according to the new division logic, while existing published layers retain historical identifiers for retrospective purposes.
[0057] The template configuration module is used to preset vector publishing templates. The vector publishing template includes workspace, repository type, coordinate system, style reference parameters, and dynamically replaceable variable placeholders. The vector publishing template is stored in the system configuration table in JSON format and includes the following preset parameters: workspace name template, data storage connection parameters, layer name suffix rules, coordinate system SRS identifier, spatial index type, and concurrency lock strategy. The vector publishing template is associated with a template version number, which automatically increments when the template content is updated.
[0058] The parameter generation module, in response to the selection of administrative division name, land category name, and vector type, reads the unique identifier of the administrative division from the administrative division management database through the joint mapping view, and reads the unique code of the land category from the land category management database through the joint mapping view. It then generates a unique layer identifier by combining the unique identifier, the unique code, the vector type, the corresponding year of the data, and the version number according to preset concatenation rules. This identifier serves as an application layer pre-check. The module queries the business association table to determine if the identifier is already in use. If it is, the version number is automatically incremented until an unused identifier is generated. Finally, the module replaces the variable placeholders in the vector publishing template with the unique identifier, the unique code, the vector type, the corresponding year of the data, and the version number, generating a complete set of publishing parameters.
[0059] The concurrency and index creation module is used to perform concurrency safety control in the spatial database based on the unique layer identifier: regardless of whether the configuration record exists, a database query lock is requested using the unique layer identifier as the lock identifier; if the request fails, a concurrency conflict prompt is returned; after successful request, a configuration record identified by the unique layer identifier is inserted into the business association table. The business association table has a unique index constraint on the unique layer identifier field. If the insertion is successful, a row-level lock is added to the inserted configuration record; if the insertion fails due to a unique index conflict, a row-level lock is added to the existing configuration record; and in the vector data table corresponding to the unique layer identifier, which pre-stores vector monitoring data, a... The spatial geometry column creates a GiST spatial index; the concurrency and index creation module uses a row-level locking statement that supports NOWAIT mode to implement the row-level lock. When the lock acquisition fails, an error message is returned immediately to avoid the transaction being blocked for a long time; the concurrency and index creation module also implements a double-check mechanism: after the row-level lock is successfully acquired, the business association table is queried again to confirm that the unique layer identifier has not been created by other transactions during the lock acquisition period. If it has been created and not by the current transaction, the lock is released and an error message is returned; when a concurrent publish request fails due to lock occupation, a new unique layer identifier is generated through an automatic version number increment mechanism and the publish process is automatically re-executed, thereby automatically resolving concurrency conflicts.
[0060] The publish execution module is used to call the map service interface, send the publish parameter set to the map server to complete the vector layer publish, and commit the transaction to release the consultation lock and the row-level lock after the publish is completed. It also associates and stores the unique layer identifier with the corresponding administrative division identifier and land category identifier. The publish execution module is configured to construct a JSON payload conforming to the GeoServer REST API specification. The payload includes at least the workspace, store, layer, title, and srs fields, and sends it to the GeoServer server via an HTTP POST request.
[0061] Furthermore, the automatic remote sensing data publishing system based on administrative divisions and land category codes also includes: The automatic style mapping module is used to establish an automatic mapping rule base between land use codes and SLD styles. It automatically matches the corresponding colors, fill patterns, and annotation methods according to the land use code, automatically applies the styles when the vector layer is published, and completes the visualization rendering when the layer is loaded. The automatic mapping rule base supports multi-level style matching, prioritizing the matching of the exclusive style corresponding to the land use code. If the exclusive style does not exist, it matches the general style corresponding to the major category to which the land use belongs. If it still does not exist, it uses the system default style. The end-to-end monitoring module is used to monitor the service health of published layers across the entire process. The service health includes map service interface response time, error rate, and concurrent request count. When the monitoring indicators exceed preset thresholds, an automatic alarm and automatic recovery mechanism are triggered. The automatic recovery mechanism includes: automatically restarting the layer service when service unavailability is detected; automatically scaling up service instances when response time exceeds a threshold; and automatically switching to a backup data source when error rate exceeds a threshold.
[0062] Example 5 This invention provides a method for a smooth transition between changes in administrative divisions and updates to land category standards.
[0063] (I) Administrative Division Change Scenario (Taking the merger of City A into City B as an example): The administrator sets the valid_end of the original City A record to the effective date of the change (e.g., 2026-01-01), and simultaneously adds a sub-record or adjusts the parent identifier under City B. The system automatically filters historical invalid data through time interval queries, and the original published layers (e.g., 370191_0101_change_2025_v1) are retained for historical retrospection. If a new publication request selects the City A region, the system automatically identifies that the administrative division has expired based on the valid time interval and prompts the administrator to select the new division logic under City B; if a new division under City B that includes the original City A region is selected, the system generates a unique layer identifier (e.g., 370192_0101_change_2026_v1) according to the new division logic to achieve a smooth transition.
[0064] (II) Land Category Standard Update Scenario (GB / T 21010 Version Upgrade): The administrator adds a version record (e.g., version=2025) to the land category management database and establishes a mapping relationship between the old and new codes (e.g., old code 0101 maps to new code 0101A). When publishing, the system selects the appropriate style and metadata based on the currently valid version. For older versions of the layer that have already been published, the system retains their original styles and metadata; for newly published layers, the system automatically uses the new version's land category code and corresponding style, ensuring that the old and new standard data coexist without conflict.
[0065] Example 6 like Figure 6 As shown, the automatic raster data publishing process and the automatic vector data publishing process provided in this embodiment of the invention share the dual-database mapping module and the map service interface calling module, but there are differences in the publishing template structure and data processing process.
[0066] (I) Raster Publishing Template Structure: Raster publishing templates are stored in the system configuration table in JSON format, existing alongside vector publishing templates. Raster publishing templates include the following preset parameters: workspace field (workspace name, e.g., agri_monitor), store field (raster data repository name, e.g., raster_db), layer_name field (containing administrative division identifier placeholders, e.g., region_code_raster_base), srs field (coordinate system identifier, e.g., EPSG:4490), coverage_type field (raster data type, e.g., GeoTIFF), pyramid_levels field (tile pyramid level parameters, e.g., {min:0,max:12}), tile_size field (tile size, e.g., 256x256 pixels), default_style field (default style reference, e.g., raster_base_style.sld), and interpolation field (resampling interpolation method, e.g., bilinear). Raster publishing templates also have a version number field, which automatically increments when the template content is updated.
[0067] (ii) Storage format and processing flow of raster data: Raster data is stored in the file system or object storage in GeoTIFF format and published through GeoServer's ImageMosaic or GeoTIFF data storage plugin. When the system receives a selection operation for adding an administrative division, it automatically executes the following raster publishing process: First, it reads the unique identifier of the administrative division (e.g., administrative code 370131) from the administrative division management database. Second, it replaces the variable placeholders in the raster publishing template with this unique identifier, generating a publishing parameter set containing the workspace, raster data repository name, and layer name. Third, it constructs a JSON payload conforming to the GeoServer REST API specification and sends it to the GeoServer server via an HTTP POST request. The coverage object in the payload body contains a name field (e.g., 370131_raster_base), a title field (e.g., a remote sensing base map of a county), an srs field (e.g., EPSG:4490), a nativeBounds field (defining the geographical extent of the raster data), and a parameters field (defining parameters such as the number of bands and data type). Fourth, after the server returns a successful response, the system records the publishing URL and publishing time of the raster layer and establishes a record linking the administrative division and the raster base map in the business association table.
[0068] (III) Collaborative Mechanism for Raster and Vector Publishing: After the raster base map is published, the system automatically triggers the initialization process of the associated vector layers. Specifically, the system generates vector layer publishing tasks in batches based on all valid class records under the administrative division, and each publishing task is executed according to the vector publishing process described in Examples 1 to 4. This collaborative publishing mechanism of "raster base map first, vector layers follow" ensures the consistency between the base map and the thematic layer after the addition of an administrative division, and avoids problems such as mismatch between the coordinate system of the base map and the vector layer and inconsistent coverage that may be caused by manual step-by-step publishing.
[0069] (iv) Raster Layer Pyramid Level Settings: The `pyramid_levels` parameter in the raster publishing template defines the pyramid level range. When publishing a raster layer, the system automatically calculates the pyramid levels based on the original resolution of the raster data and the target display scale: the minimum level (min) corresponds to the minimum display scale (e.g., 1:1,000,000), and the maximum level (max) corresponds to the maximum display scale (e.g., 1:1,000). After receiving the publishing request, GeoServer automatically generates a tile cache of the specified levels for the raster data, ensuring fast rendering at different scaling levels.
[0070] Example 7 The embodiments of the present invention provide verification of the mathematical model and efficiency.
[0071] (a) Layer identifier uniqueness hash verification: Define the layer identifier set For any two layer identifiers ,like Then there must be The inference in this direction always holds true; while when When the two hash values collide (i.e.) The probability of () does not exceed: ,in Use the SHA-256 hash function. When the newly generated layer identifier is compared with the already stored... When comparing a set of hash values, the cumulative probability of a new identifier colliding with any of the already stored identifiers does not exceed [a certain value]. After generating a unique layer identifier, the system calculates its SHA-256 hash value and compares it with the stored hash value set. Based on the principle that "different hash values mean different identifiers," it performs an initial uniqueness screening, quickly eliminating the vast majority of different identifiers. For cases where hash values are the same, the unique index constraint on the `layer_identifier` field of the business-related table is used as the final basis for uniqueness determination. This mechanism, while ensuring strict and correct determination (based on the database's unique index), reduces the average query cost of uniqueness determination from a full table comparison to a hash set comparison, balancing efficiency and accuracy. The SHA-256 hash function is collision-resistant, meaning that the probability of generating the same hash value for different inputs is extremely low (i.e.,...). , approximately Therefore, the probability of missed detections in this initial uniqueness screening mechanism can be ignored. This hash collision probability model is used to guide the specific technical design of the uniqueness verification process in the concurrent release of spatial databases, namely a two-level verification architecture that uses hash set comparison for initial screening and database unique index constraints as the final judgment basis, thereby reducing the query overhead of uniqueness determination.
[0072] (II) Spatial Index Query Efficiency Model: After using the GiST spatial index, the time complexity of spatial range queries is reduced from... Reduce to This complexity analysis is based on the balanced tree structure of the GiST index: the GiST index uses a balanced multi-way search tree structure, each index node contains multiple entries, and the tree depth is... ,in The maximum number of entries per node. Let the total amount of data be . Assume the dataset size is . The query range is The query time after using the GiST index meets the following requirements: ,in, This is the index traversal constant (representing the average time required to traverse each index level, typically ranging from 0.01 to 0.1 milliseconds, depending on disk I / O speed and buffer pool hit rate). Returns a constant for the data (representing the average time required to return each result record, typically ranging from 0.001 to 0.01 milliseconds, depending on the record size and network transmission speed). This represents the size of the query result set. This formula is a qualitative and order-of-magnitude analysis model based on the characteristics of the GiST index's balanced tree structure, used to describe the trend of query time changing with data size and result set size. Actual query time is also affected by factors such as index depth, page hit rate, and buffer pool size. When dealing with millions of data points, retrieve... millisecond, millisecond, , (Conservative value), then the depth of the tree Substituting, we can get Milliseconds. In the model, the query time for the unindexed scenario, used as a control, is estimated at approximately 5000 milliseconds based on the pessimistic assumption of "record-by-record scanning." It should be noted that this theoretical estimate differs from the measured value: the actual database engine's sequential scan has batch page read optimizations, and the measured query time without an index is approximately 3 to 5 seconds; after using the GiST index, the query time drops to below 0.5 seconds (including network transmission and application layer overhead), representing a performance improvement of approximately 6 to 10 times under the above experimental conditions. The model correctly portrays the trend of "query time increasing only logarithmically with the total data volume and linearly with the result set size" and the order of magnitude leap from seconds to sub-seconds; the difference between the theoretical estimate and the measured value mainly stems from the model's failure to account for network transmission overhead, result set serialization overhead, and database engine scan optimizations, which falls within the normal error range of engineering analysis models. This complexity model is used to guide the selection of spatial index types and the configuration of specific technical parameters for query performance evaluation in spatial databases. Specifically, it provides a quantitative basis for selecting GiST indexes for the spatial geometry columns of vector data tables and estimating their query response time under different data scales.
[0073] (III) Concurrent Conflict Probability Model: Assume the system has concurrent conflicts. There are 1 concurrent publish channel, and the average duration of each publish operation is 1. Seconds, the total number of requests issued by the system per unit time is (Times / Minute). The arrival process of published requests is modeled as a Poisson process, that is, the number of requests arriving per unit time follows a parameter of... The Poisson distribution. Within the time window. Within, the number of arriving requests follows the parameter. The Poisson distribution. When the system has With multiple concurrent channels, the average arrival rate per channel is [missing information]. (times / second), therefore, the average duration of a single channel in a release operation The probability that at least one other request arrives is the concurrency conflict probability. The derivation of this formula is as follows: Based on the properties of the Poisson process, over a time period... Arrival The probability of each event is: , Therefore, in time The probability of reaching at least one event is: , In this invention, Take the duration of the publish operation, and the arrival rate is the effective arrival rate of a single channel. (because (each channel shares the total arrival rate), therefore: ,parameter The physical meaning of is the traffic intensity of a single channel in the system, that is, the utilization rate of a single channel per unit time. When (10 publish requests per minute) Second, hour, ,but In other words, without a concurrency control mechanism, approximately 15.3% of publish requests will experience concurrency conflicts. Through the advisory lock, unique index constraint, and row-level locking mechanism of this invention, the system can effectively handle conflicts and ensure data consistency: conflicting requests are intercepted and flagged immediately, and naming conflicts are automatically resolved with the automatic version number increment mechanism. Under the above experimental conditions, the negative impact of concurrency conflicts is reduced to near zero, resulting in an effective concurrent throughput increase of approximately 40% in actual deployments. This concurrency conflict probability model is used to guide the configuration and evaluation of specific technical parameters in spatial database concurrent publishing, such as the number of concurrent channels, locking strategies (database advisory locks and row-level locks supporting NOWAIT mode), and the automatic version number increment retry mechanism.
[0074] Comparative experiments were conducted under identical hardware conditions. The experimental environment configuration was as follows: Hardware-wise, the CPU was an Intel Xeon Gold 6248R (8 cores, 3.0GHz), memory was 32GB DDR4 ECC, storage was an NVMe SSD (read speed exceeding 3000MB / s), and network bandwidth was Gigabit Ethernet; Software-wise, the operating system was CentOS 7.9, the spatial database was PostgreSQL 14.5 and PostGIS 3.2.0, the map server was GeoServer 2.20.3, and the runtime environment was OpenJDK 11.0.15; The dataset included 50 cities, 30 land categories, and a total of 1500 layers. Each layer had an average of approximately 50,000 spatial feature records, and the average data file size was approximately 50MB. The testing method involved executing three consecutive rounds of deployment operations and taking the average value. Each round deployed all 1500 layers, and the total deployment time, number of configuration errors, and number of concurrent conflicts were recorded. The comparison objects include: traditional manual methods (manual deployment via the GeoServer management console) and the closest existing technology (semi-automatic deployment method based on configuration files). The experimental results are as follows: For adding a new city, the traditional manual method takes 2-4 hours, the closest existing technology takes 30-60 minutes, and this invention takes 2-5 minutes; for configuration error rate, the traditional manual method is 12-18%, the closest existing technology is 5-8%, and this invention is less than 0.2%; for concurrent deployment conflict rate, neither the traditional manual method nor the closest existing technology supports concurrency, while this invention ensures near-zero conflict rate through a concurrency control mechanism using consultative locks, unique index constraints, and row-level locks; for spatial query response time (millions of data points), the closest existing technology takes 3-5 seconds (without index), while this invention takes less than 0.5 seconds (with GiST index); for administrative division change adaptation, both the traditional manual method and the closest existing technology require manual reconfiguration, while this invention automatically adapts through a time interval mechanism. The above experimental data are typical values obtained under the above experimental conditions; actual performance may vary depending on hardware configuration and data scale.
[0075] The comparative experiment also verified the necessity of synergy among various technical means: under the same concurrent load ( times / minute Under the current conditions, the control scheme that only uses dual-database mapping and templated parameter generation without concurrency control mechanisms has a concurrent release conflict rate of approximately 15.3%, consistent with the predicted value of the Poisson model mentioned above, which cannot meet the requirements of multi-administrator concurrent scenarios. The control scheme that only uses row-level locking without dual-database mapping still requires manual configuration of release parameters when adding administrative divisions, and the extension time is comparable to the closest existing technology, making zero-code extension impossible. The control scheme that only uses time interval version management without templated mechanisms requires manual adaptation of release parameters item by item after administrative division changes. Only when all four technical means—dual-database mapping, templated parameter generation, concurrency control and GiST indexing, and time interval version management—work in concert can the system simultaneously achieve "second-level concurrent secure release," "zero-code extension," and "automatic adaptation to administrative division changes."
[0076] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the protection scope of the claims of the present invention.
Claims
1. A method for automatically publishing remote sensing data based on administrative divisions and land category codes, characterized in that, Includes the following steps: S1: Establish an administrative division management database and a land category management database. The administrative division management database stores the name, hierarchical identifier, unique identifier, and parent identifier hierarchical relationship of the administrative division. The land category management database stores the unique code and name of the land category. The administrative division management database and the land category management database establish a joint mapping view through a business association table, thereby constructing a semantic mapping relationship between administrative divisions and land categories. S2: Preset vector publishing template, which includes workspace, repository type, coordinate system, style reference parameters, and dynamically replaceable variable placeholders; S3: In response to the selection of administrative division name, land category name and vector type, the corresponding unique identifier and unique code are read from the administrative division management database and the land category management database respectively through the joint mapping view. A unique layer identifier is generated according to the preset splicing rules and combined with the year and version number corresponding to the data. The variable placeholders in the vector publishing template are replaced with the unique identifier, the unique code, the vector type, the year corresponding to the data and the version number to generate a complete publishing parameter set. S4: Based on the unique layer identifier, perform concurrent security control in the spatial database: regardless of whether the configuration record exists, request a database query lock using the unique layer identifier as the lock identifier; if the request fails, return a concurrent conflict prompt. After the application is successful, a configuration record identified by the unique layer identifier is inserted into the business association table. The business association table has a unique index constraint on the unique layer identifier field. If the insertion is successful, a row-level lock is added to the inserted configuration record. If the insertion fails due to a unique index conflict, a row-level lock is added to the existing configuration record. And create a GiST spatial index for the spatial geometry column in the vector data table that corresponds to the unique layer identifier and pre-stores vector monitoring data; S5: Call the map service interface, send the published parameter set to the map server to complete the vector layer publication, and after publication, submit the transaction to release the consultation lock and the row-level lock, and associate and store the unique layer identifier with the corresponding administrative division identifier and land category identifier.
2. The method for automatically publishing remote sensing data based on administrative divisions and land category codes according to claim 1, characterized in that, The administrative division management database uses a multi-level administrative division tree index structure to store hierarchical relationships. Each administrative division node includes a parent node identifier, level depth, valid start time, and valid end time. When an administrative division changes, data migration is achieved through node splitting or merging operations, and the valid time interval of historical data is marked. It supports querying the valid administrative division definition at that time by time point. After the administrative division changes, newly published layers generate identifiers according to the new division logic, while existing published layers retain historical identifiers for retrospective purposes.
3. The method for automatically publishing remote sensing data based on administrative divisions and land category codes according to claim 1, characterized in that, The vector publishing template is stored in the system configuration table in JSON format and includes the following preset parameters: workspace name template, data storage connection parameters, layer name suffix rules, coordinate system SRS identifier, spatial index type, and concurrency lock strategy; the vector publishing template is associated with a template version number, which automatically increments when the template content is updated.
4. The method for automatically publishing remote sensing data based on administrative divisions and land category codes according to claim 1, characterized in that, Step S3 specifically includes: In response to the operation of selecting the administrative division name, land category name and vector type, the unique identifier of the administrative division is read from the administrative division management database through the joint mapping view, and the unique code of the land category is read from the land category management database through the joint mapping view. The unique identifier, the unique code, the vector type, the year and version number corresponding to the data are generated into a unique layer identifier according to the preset splicing rules. After generating a unique layer identifier, as an application layer pre-check, the business association table is queried to determine whether the identifier has been used. If it has been used, the version number is automatically incremented until an unused identifier is generated. Based on the variable placeholders in the vector publishing template, the unique identifier, the unique code, the vector type, the year corresponding to the data, and the version number are dynamically replaced to automatically generate a complete set of publishing parameters. The unique layer identifier is concatenated according to the following rules: {unique administrative division identifier}_{unique land category code}_{vector type}_{year corresponding to the data}_{version number}, where the year is the year to which the data belongs and is in the format of a four-digit number; the version number is an incrementing integer starting from 1; the vector type includes change monitoring patch data, current status patch data, and administrative boundary data.
5. The method for automatically publishing remote sensing data based on administrative divisions and land category codes according to claim 1, characterized in that, Step S4 specifically includes: performing concurrency security control in the spatial database for the unique layer identifier: regardless of whether the configuration record exists, a database query lock is requested using the unique layer identifier as the lock identifier. If the request fails, a concurrency conflict prompt is returned. If the request succeeds, a configuration record identified by the unique layer identifier is inserted into the business association table. The business association table has a unique index constraint on the unique layer identifier field. If the insertion is successful, a row-level lock is added to the inserted configuration record. If the insertion fails due to a unique index conflict, it indicates that the configuration record already exists, and a row-level lock is added to the existing configuration record to prevent other concurrent transactions from modifying it. A GiST spatial index is created for the spatial geometry column in the vector data table corresponding to the unique layer identifier and which pre-stores vector monitoring data.
6. The method for automatically publishing remote sensing data based on administrative divisions and land category codes according to claim 1, characterized in that, The row-level lock is implemented using a row-level lock statement that supports NOWAIT mode. When the lock acquisition fails, an error message is returned immediately to avoid the transaction being blocked for a long time. After successfully acquiring the row-level lock, the business association table is queried again to confirm that the unique layer identifier was not created by other transactions during the lock acquisition period. If it has been created and not by this transaction, the lock is released and a prompt is returned, thus achieving double checking by querying again after the lock is acquired. When a concurrent release request fails due to lock holding, a new unique layer identifier is generated through an auto-incrementing version number mechanism, and the release process is automatically re-executed, thereby automatically resolving the concurrent conflict.
7. The method for automatically publishing remote sensing data based on administrative divisions and land use codes according to any one of claims 1-6, characterized in that, Following step S5, step S6 is also included: establishing an automatic mapping rule base between land use codes and SLD styles, automatically matching the corresponding colors, fill patterns, and annotation methods according to the land use codes, automatically applying the styles when the vector layer is published, and completing the visualization rendering when the layer is loaded; the automatic mapping rule base supports multi-level style matching, prioritizing the matching of the exclusive styles corresponding to the land use codes, matching the general styles corresponding to the major categories to which the land use belongs if the exclusive styles do not exist, and using the system default styles if they still do not exist.
8. The method for automatically publishing remote sensing data based on administrative divisions and land category codes according to claim 7, characterized in that, After step S6, step S7 is also included: performing full-link monitoring of the service health of the published layers. The service health includes map service interface response time, error rate and number of concurrent requests. When the monitoring indicators exceed the preset threshold, an automatic alarm and automatic recovery mechanism are triggered. The automatic recovery mechanism includes: automatically restarting the layer service when service unavailability is detected, automatically scaling up service instances when response time exceeds a threshold, and automatically switching to a backup data source when error rate exceeds a threshold.
9. An automatic remote sensing data publishing system based on administrative divisions and land category codes, characterized in that, include: The dual-database mapping module is used to establish an administrative division management database and a land category management database. The administrative division management database stores the name, hierarchical identifier, unique identifier, and parent identifier hierarchical relationship of the administrative division. The land category management database stores the unique code and name of the land category. The administrative division management database and the land category management database establish a joint mapping view through a business association table, thereby constructing a semantic mapping relationship between administrative divisions and land categories. The template configuration module is used to preset vector publishing templates. The vector publishing templates include workspace, repository type, coordinate system, style reference parameters, and dynamically replaceable variable placeholders. The parameter generation module is used to respond to the selection of administrative division name, land category name and vector type. It reads the corresponding unique identifier and unique code from the administrative division management database and the land category management database respectively through the joint mapping view. According to the preset splicing rules and combined with the year and version number of the data, it generates a unique layer identifier. The module then replaces the variable placeholders in the vector publishing template with the unique identifier, the unique code, the vector type, the year of the data and the version number to generate a complete set of publishing parameters. The concurrency and index creation module is used to perform concurrency safety control in the spatial database based on the unique layer identifier: regardless of whether the configuration record exists, the database query lock is requested using the unique layer identifier as the lock identifier; if the request fails, a concurrency conflict prompt is returned. After the application is successful, a configuration record identified by the unique layer identifier is inserted into the business association table. The business association table has a unique index constraint on the unique layer identifier field. If the insertion is successful, a row-level lock is added to the inserted configuration record. If the insertion fails due to a unique index conflict, a row-level lock is added to the existing configuration record. And create a GiST spatial index for the spatial geometry column in the vector data table that corresponds to the unique layer identifier and pre-stores vector monitoring data; The publishing execution module is used to call the map service interface, send the publishing parameter set to the map server to complete the publishing of the vector layer, and after the publishing is completed, submit the transaction to release the consultation lock and the row lock, and associate and store the unique layer identifier with the corresponding administrative division identifier and land category identifier.
10. The remote sensing data automatic publishing system based on administrative division and land category codes according to claim 9, characterized in that, Also includes: The automatic style mapping module is used to establish an automatic mapping rule base between land use codes and SLD styles. It automatically matches the corresponding colors, fill patterns, and annotation methods according to the land use code, automatically applies the styles when the vector layer is published, and completes the visualization rendering when the layer is loaded. The automatic mapping rule base supports multi-level style matching, prioritizing the matching of the exclusive style corresponding to the land use code. If the exclusive style does not exist, it matches the general style corresponding to the major category to which the land use belongs. If it still does not exist, it uses the system default style. The end-to-end monitoring module is used to monitor the service health of published layers throughout the entire process. The service health includes map service interface response time, error rate, and number of concurrent requests. When the monitoring indicators exceed the preset threshold, an automatic alarm and automatic recovery mechanism are triggered. The automatic recovery mechanism includes: automatically restarting the layer service when service unavailability is detected, automatically scaling up service instances when response time exceeds a threshold, and automatically switching to a backup data source when error rate exceeds a threshold.
Citation Information
Patent Citations
Remote sensing image real-time map service publishing method and device
CN114020756A
Geographic service publishing system and method based on total data
CN114398456A
