A method for spatial compliance analysis of geographic rule engine for simulation evaluation
By digitizing spatial safety regulations into structured logical rules through a geographic rule engine, and combining high-precision spatial computing and visualization, the problem of low efficiency in manual interpretation in existing technologies is solved, and automated, efficient and intuitive spatial compliance analysis is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-03
- Publication Date
- 2026-07-31
AI Technical Summary
Existing simulation evaluation methods rely on manual interpretation of rules, which is inefficient and prone to errors, and cannot achieve automated, high-precision, high-efficiency, and intuitive visualization of spatial compliance analysis.
A geographic rule engine is used to digitize spatial safety specifications in text form into structured logical rules, which are stored and executed through a rule knowledge base. Combined with high-precision spatial computing services and interactive visualization modules, automated compliance judgment and dynamic visualization are achieved.
It achieves automated decoupling and efficient evaluation of rules, improves the efficiency of simulation analysis and the intuitiveness, adaptability and universality of results, and meets the comprehensive needs of simulation evaluation.
Smart Images

Figure CN122489669A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of geographic information systems, spatial data analysis and compliance assessment, and in particular to a spatial compliance analysis method for a geographic rule engine oriented towards simulation assessment. Background Technology
[0002] With the maturity of Geographic Information System (GIS) technology and the increasing abundance of spatial data resources, utilizing digital means to assist in spatial planning and compliance analysis has become an industry trend. In simulation exercises in areas such as land spatial planning, site selection for major projects, hazardous materials transportation, drone flight management, and environmental impact assessment, it is essential to rigorously evaluate the potential impact of simulated activities on surrounding sensitive or protected targets (such as oil and gas pipelines, substations, water sources, nature reserves, and residential areas).
[0003] Traditional simulation evaluation methods primarily rely on manual work by professional technicians. A typical process includes: manually reviewing regulatory documents to understand spatial constraints; manually marking relevant protected targets and their extents on a basic electronic map; estimating the distance or spatial relationship between the simulated activity location and the protected area using measurement tools or simple calculations; and finally drawing conclusions based on personal judgment. Traditional methods suffer from inconsistent rule interpretation, low efficiency, large errors, and an inability to support real-time simulations. In recent years, although some research has attempted to utilize GIS for spatial analysis, these are typically limited to simple buffer zone analysis and static map displays. The core of the rules (i.e., the judgment logic) still requires manual input and interpretation; the system itself lacks the ability to "understand" and "execute" complex, dynamic, and multi-conditional regulatory provisions.
[0004] The aforementioned problems make it difficult for existing technologies to meet the comprehensive requirements of simulation evaluation for automation, high precision, high efficiency, and intuitive visualization. Summary of the Invention
[0005] To address the aforementioned problems, the present invention aims to overcome the shortcomings of existing technologies and provide a spatial compliance analysis method, system, device, and medium for a geographic rule engine oriented towards simulation evaluation. This enables the rules to be digitized, queries to be optimized, spatial calculations to be highly accurate, multiple schemes to be intelligently selected, and risks to be dynamically visualized, thus achieving a technological leap from manual interpretation to automatic system execution in spatial compliance analysis.
[0006] The technical solution adopted by this invention to solve its technical problem is as follows:
[0007] A spatial compliance analysis method for a geographic rule engine oriented towards simulation evaluation, characterized by the following steps:
[0008] S1. Rule digitization steps: Transform the textual spatial security specifications into structured, computable, and executable logical rules, and store them in a rule knowledge base;
[0009] S2. Request Receiving and Rule Matching Steps: Receive an evaluation request containing target space information and target type, match and load the corresponding executable logic rule set from the rule knowledge base according to the target type;
[0010] S3. Spatial data association retrieval step: Based on the spatial constraints contained in the loaded set of executable logic rules, retrieve the geographic facility data associated with the target spatial information from the spatial facility database;
[0011] S4. Rule-driven assessment steps: The executable logical rule set is executed through the geographic rule engine to determine the compliance of the target spatial information and the geographic facility data; during the execution process, an independent high-precision spatial computing service is invoked to complete the required spatial geometric relationship calculations, generating an assessment result containing compliance conclusions and corresponding risk geometric data; the risk geometric data represents the non-compliant spatial area between the target and the geographic facility protection area;
[0012] S5. Risk visualization step: Based on the risk geometric data in the assessment results, dynamically highlight the data on the electronic map.
[0013] Furthermore, in step S1, the conversion into structured, computable, and executable logical rules specifically includes: describing the text rules using a predefined domain-specific language to form a rule expression containing spatial relation predicates, facility attribute conditions, and logical operators.
[0014] Furthermore, in step S3, the retrieval based on the spatial constraints contained in the loaded executable logic rule set specifically includes: extracting the maximum spatial influence range involved in all spatial conditions in the rule set, and performing a one-time spatial range query on the spatial facility database based on this range.
[0015] Furthermore, in step S4, the high-precision spatial calculation service includes at least: a spherical distance calculation service based on the Haversine formula, and a spatial topological relationship judgment and overlay analysis service based on a computational geometry library; the risk geometric data is obtained through the overlay analysis service.
[0016] Furthermore, when the evaluation request contains multiple candidate solutions, an optimization batch processing step is included before step S4:
[0017] S41. Pre-scoring steps: Perform a lightweight risk pre-assessment for each candidate solution and calculate the risk pre-score;
[0018] S42. Sorting Step: Sort all candidate solutions in descending order based on the risk pre-score;
[0019] S43. Sequential evaluation steps: Perform steps S3 to S4 sequentially on the sorted candidate solutions;
[0020] S44. Early Termination Step: When a compliance conclusion of "pass" is obtained for the first time in the sequential evaluation step, the evaluation process for subsequent candidate solutions is terminated.
[0021] Furthermore, the lightweight risk pre-assessment in step S41 calculates a risk pre-score based on one or more factors among the candidate scheme and the proximity of geographical facilities within a preset range, the highest risk level of the facilities, and the number of facilities.
[0022] Furthermore, the dynamic highlighting in step S5 specifically includes: rendering the risk geometry data into a map layer with a specific visual style that is independent of other map elements. The specific visual style includes one or more of the following: highly saturated fill color, semi-transparent effect, and periodic change style.
[0023] A system for implementing a spatial compliance analysis method for a geographic rule engine oriented towards simulation evaluation, characterized in that it includes:
[0024] The rules and data management module is used to store geographic facility data and structured executable logical rules;
[0025] The evaluation workflow engine module is used to receive evaluation requests and coordinate and schedule the evaluation process; the evaluation workflow engine module is configured to support a single-objective real-time evaluation process and a batch processing optimization process that supports risk pre-scoring, sorting, sequential evaluation, and early termination of multiple candidate solutions.
[0026] The geographic rule engine module is used to load and execute the executable logical rules, and generate spatial calculation calls during the execution process;
[0027] A high-precision spatial computing service module is used to respond to the spatial computing call, provide accurate spatial geometric relationship calculation services, and generate risky geometric data; the high-precision spatial computing service module is configured as an independent microservice, providing at least three types of standardized interfaces: spherical distance calculation, spatial topology judgment, and geometric overlay analysis;
[0028] The interactive visualization and interface module is used to provide a human-computer interaction interface and application interface, and to perform dynamic map highlighting rendering based on the risk geometric data; wherein, the evaluation workflow engine module is communicatively connected to the rule and data management module, the geographic rule engine module, the high-precision spatial computing service module and the interactive visualization and interface module.
[0029] An electronic device, characterized in that it includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the method as described in any of the preceding steps.
[0030] A computer-readable storage medium having a computer program stored thereon, characterized in that the computer program, when executed by a processor, implements the method described in any of the steps above.
[0031] The beneficial effects of this invention are:
[0032] 1. Solving the problem of automated rule expression: By using a geographic rule engine and a structured rule knowledge base, text rules are transformed into computable digital logic, effectively decoupling business rules from program code. Rule updates do not require modification of the core system code; only the rule object needs to be adjusted in the knowledge base. Dynamic hot loading is supported, significantly improving the system's adaptability to regulatory changes. It is particularly suitable for the rapid iteration needs of rules in simulation and deduction environments, solving the fundamental defects of traditional methods that rely on manual interpretation and cannot be directly understood and executed by the system.
[0033] 2. Improve simulation analysis efficiency: The evaluation workflow engine automates the entire process, reducing database queries through "one-time spatial range retrieval" and optimizing single-objective analysis processes by combining a microservice architecture with high-precision spatial computing services. For multi-scheme simulation scenarios, the innovative "risk pre-scoring-sorting-early termination" mechanism effectively optimizes the analysis order, significantly improves the efficiency of multi-scheme comparison, and meets the technical requirements of simulation simulation for efficient spatial compliance analysis.
[0034] 3. Enhanced intuitiveness of simulation results: The interactive visualization engine directly utilizes the precise geometric data of risk areas generated by high-precision spatial computing services, dynamically highlighting and rendering them on an electronic map, transforming abstract compliance conclusions into intuitive spatial risk maps. This visualization method based on precise geometric data enables decision-makers to directly locate specific violation locations and extents on the map, significantly improving the efficiency of understanding simulation results and the quality of decision support, achieving a technological leap from "attribute description" to "intuitive spatial positioning."
[0035] 4. Improved System Architecture Scalability: Adopting a layered modular design, the system achieves a loosely coupled architecture through standardized interfaces for communication among components. Without modifying the core code, the system can quickly adapt to simulation and deduction needs in different fields such as land planning, environmental assessment, and aviation management by expanding the rule base and adapting spatial data models. This significantly reduces the technical barriers and implementation costs of cross-domain deployment, enhancing the system's versatility and adaptability.
[0036] This invention represents a technological leap from "manually operating software for offline analysis" to "systems automatically providing intelligent compliance analysis services in a simulation environment," providing efficient, accurate, and intuitive technical support for compliance analysis across multiple domains and meeting the comprehensive requirements of simulation assessment for accuracy, intuitiveness, and flexibility.
[0037] The invention will be further explained in detail below with reference to the accompanying drawings and specific embodiments. Attached Figure Description
[0038] Figure 1 This is a schematic diagram illustrating the steps of the spatial compliance analysis method of the geographic rule engine of this invention;
[0039] Figure 2 This is a schematic diagram of the geographic rule engine and spatial impact analysis system architecture of the present invention;
[0040] Figure 3 This is a digital flowchart of the space safety specifications of this invention;
[0041] Figure 4 This is a flowchart of the single-objective real-time evaluation workflow of the present invention;
[0042] Figure 5 This is a flowchart of the multi-objective batch processing optimization workflow of the present invention;
[0043] Figure 6 This is a flowchart of the geographic rule engine execution process of the present invention;
[0044] Figure 7 This is a schematic diagram illustrating the risk visualization effect of the present invention;
[0045] Figure 8 This is a schematic diagram illustrating the application of the simulation scenario of this invention. Detailed Implementation
[0046] Example 1:
[0047] A spatial compliance analysis method for a geographic rule engine oriented towards simulation evaluation, such as Figure 1 As shown, it includes the following steps:
[0048] S1. Rule digitization steps: Transform the textual spatial security specifications into structured, computable, and executable logical rules, and store them in a rule knowledge base;
[0049] In step S1, the transformation into structured, computable, and executable logical rules specifically includes: describing the text rules using a predefined domain-specific language to form a rule expression containing spatial relation predicates, facility attribute conditions, and logical operators.
[0050] S2. Request Receiving and Rule Matching Steps: Receive an evaluation request containing target space information and target type, match and load the corresponding executable logic rule set from the rule knowledge base according to the target type;
[0051] S3. Spatial data association retrieval step: Based on the spatial constraints contained in the loaded set of executable logic rules, retrieve the geographic facility data associated with the target spatial information from the spatial facility database;
[0052] In step S3, the retrieval based on the spatial constraints contained in the loaded executable logic rule set specifically includes: extracting the maximum spatial influence range involved in all spatial conditions in the rule set, and performing a one-time spatial range query on the spatial facility database based on this range.
[0053] S4. Rule-driven assessment steps: The executable logical rule set is executed through the geographic rule engine to determine the compliance of the target spatial information and the geographic facility data; during the execution process, an independent high-precision spatial computing service is invoked to complete the required spatial geometric relationship calculations, generating an assessment result containing compliance conclusions and corresponding risk geometric data; the risk geometric data represents the non-compliant spatial area between the target and the geographic facility protection area;
[0054] In step S4, the high-precision spatial computing service includes at least: a spherical distance calculation service based on the Haversine formula, and a spatial topological relationship judgment and overlay analysis service based on a computational geometry library; the risk geometric data is obtained through the overlay analysis service.
[0055] When the evaluation request contains multiple candidate solutions, an optimization batch processing step is included before step S4:
[0056] S41. Pre-scoring steps: Perform a lightweight risk pre-assessment for each candidate solution and calculate the risk pre-score;
[0057] In step S41, the lightweight risk pre-assessment calculates a risk pre-score based on one or more factors among the proximity of the candidate scheme to geographical facilities within a preset range, the highest risk level of the facilities, and the number of facilities.
[0058] S42. Sorting Step: Sort all candidate solutions in descending order based on the risk pre-score;
[0059] S43. Sequential evaluation steps: Perform steps S3 to S4 sequentially on the sorted candidate solutions;
[0060] S44. Early Termination Step: When a compliance conclusion of "pass" is obtained for the first time in the sequential evaluation step, the evaluation process for subsequent candidate solutions is terminated.
[0061] S5. Risk visualization step: Based on the risk geometric data in the assessment results, dynamically highlight the data on the electronic map.
[0062] The dynamic highlighting in step S5 specifically includes: rendering the risk geometry data into a map layer with a specific visual style that is independent of other map elements. The specific visual style includes one or more of the following: high saturation fill color, semi-transparent effect, and periodic change style.
[0063] A spatial compliance analysis system based on a geographic rule engine for simulation evaluation, such as Figure 2 As shown, it includes:
[0064] 1. The rules and data management module stores geographic facility data and structured, executable logical rules. This module serves as the "knowledge base" and "map library" of this method, responsible for providing structured and computable basic inputs for the entire evaluation process. It mainly consists of a structured rule knowledge base and a spatial facility database.
[0065] Structured Rule Knowledge Base: This feature pioneered the definition of a Domain-Specific Language (DSL) for describing spatial compliance rules. This DSL supports precise mapping from natural language rules (such as "No hot work within 500 meters of the oil depot") to executable logic like "DISTANCE($target,facility) < 500 AND facility.type='OIL_TANK'". Rules are stored as versioned, composable objects.
[0066] Spatial Facility Database: This database not only stores the basic attributes and precise geometry (points, lines, polygons) of facilities, but also explicitly defines their "protection boundaries" (via the `buffer_distance` field or by directly storing polygons). All spatial data is indexed using high-performance spatial indexes (such as R-Tree, GiST).
[0067] This module addresses the fundamental shortcomings of existing technologies, such as reliance on manual interpretation and the inability of rules to be directly understood and executed by the system, through the digitization and objectification of rules. Using DSL and structured storage, the rules themselves become data objects that can be dynamically loaded, parsed, and executed by the "geographic rule engine," rather than fixed code or human experience. Simultaneously, separating data and rules for management decouples facility spatial data from compliance judgment logic. When regulations are updated, only rule objects need to be added, deleted, or modified in the rule knowledge base; no modification to facility data or core program code is required, significantly improving the system's adaptability and maintainability.
[0068] 2. An evaluation workflow engine module is used to receive evaluation requests and coordinate and schedule the evaluation process; the evaluation workflow engine module is configured to support a single-objective real-time evaluation process and a batch processing optimization process that supports risk pre-scoring, sorting, sequential evaluation, and early termination of multiple candidate solutions.
[0069] This module serves as the "central controller" and "intelligent decision optimizer" of this invention. Its function is to receive and parse external evaluation requests, then orchestrate and drive the collaborative work of the entire system to perform standardized compliance checks and innovatively achieve intelligent optimization and screening of multiple alternative solutions. This module seamlessly integrates the geographic rule engine, spatial computing services, and basic data resources by defining and executing two main workflows—a single-objective real-time evaluation workflow and a multi-objective batch optimization workflow—ultimately outputting a clearly structured evaluation conclusion that includes spatialized risk information.
[0070] Single-objective real-time assessment workflow: Used for immediate compliance assessment of a single objective activity (such as a specific engineering location or a planned route). Its rigorous process and clear steps ensure standardized and automated assessment. Specific steps are as follows:
[0071] First, the target information is parsed and applicable rules are loaded. Second, all potentially relevant facilities are retrieved through a one-time spatial scope search, avoiding multiple queries. Next, an assessment context is constructed and the geographic rule engine is invoked to execute the rules one by one, during which the spatial computing service completes all precise spatial relationship judgments. Finally, the conclusions of each rule are aggregated to generate a structured report containing the overall compliance status, violation details, and geometric data of specific violation areas, providing direct input for risk visualization.
[0072] Multi-objective batch processing optimized workflow: When users provide multiple alternatives (such as multiple site selection points or multiple planning paths), this workflow uses intelligent scheduling to find the first compliant solution in the most efficient way, rather than simply performing parallel or serial full evaluation. Its innovation lies in the "risk pre-assessment - sorting - priority check - early termination" mechanism:
[0073] Lightweight pre-assessment and ranking: Each option is given a rapid risk pre-assessment (based on factors such as proximity and facility level), and ranked from highest to lowest score, so that the option most likely to violate regulations is inspected first.
[0074] Sequential Detailed Evaluation and Early Termination: A complete single-objective evaluation is performed on each solution in order of priority. Once the first fully compliant solution is found, the process immediately terminates, and that solution is output as the result. This method simulates the expert's mindset of prioritizing the identification of high-risk points, avoiding unnecessary full-scale calculations and significantly improving decision-making efficiency.
[0075] The evaluation workflow engine module, acting as the system's command center, effectively coordinates all other modules: it acquires "knowledge" and "maps" from the rules and data management module, delegates specific logical judgment tasks to the geographic rules engine module, relies on the spatial computing service module for precise geometric calculations, and finally delivers the spatially rich evaluation results to the interactive visualization and interface module for presentation. Furthermore, through its two defined main workflows, particularly the innovative multi-objective batch processing optimization algorithm, it not only automates and standardizes the spatial compliance evaluation process but also achieves significant improvements in efficiency and intelligence. This ensures that the invention can meet the needs of different scenarios, from simple instant queries to complex scheme comparisons, and is one of the key differences between this patented method and traditional manual or semi-automated evaluation technologies.
[0076] 3. A geographic rule engine module, used to load and execute the executable logical rules, and generate spatial calculation calls during execution;
[0077] The geographic rule engine module is the "logical brain" and "intelligent inference engine" of this patented methodology. Its function is to dynamically parse, compile, and execute formalized rules described in a domain-specific language (DSL) stored in the rule knowledge base, thereby driving the entire spatial compliance judgment process. It achieves the fundamental goal of enabling computer systems to "understand" and "automatically execute" complex spatial business rules.
[0078] The internal workflow of this module is a sophisticated sequence from rule loading to result adjudication, with the following specific steps:
[0079] Step 1: Rule Loading and Compilation Initialization: During system startup or rule hot updates, the engine reads all enabled rule entries from the structured rule knowledge base. The condition field (DSL code) of each rule is sent to the rule parser. The parser performs lexical and syntactic analysis, converting the DSL code into an internally operable, tree-structured Abstract Syntax Tree (AST). Each node in the AST represents an operator (such as logical comparison or spatial function call) or an operand (such as a variable or constant). This compilation process is completed in one step, and the compiled rule chain is cached for efficient use in subsequent evaluations.
[0080] Step 2: Evaluation Context Construction and Injection: When the evaluation workflow engine initiates an evaluation request, the geographic rules engine receives a constructed runtime context (Evaluation Context). This context is a container containing all necessary data references, mainly including: target: The evaluation target object, including its geometry, business type, and other attributes. facilities: A list of facility objects that may be related to the target, obtained through spatial pre-retrieval. spatialServiceClient: A configured instance of the spatial computing service client. The engine binds this context to the compiled rule chain to be executed.
[0081] Step 3: Traversal and Execution of the Rule Chain: The engine begins traversing the rule chain in priority order. For each rule, the engine interprets and executes its corresponding AST, a process similar to a depth-first tree traversal: 1) Variable Substitution: When encountering a variable node (such as $target.geometry or $facilities[i].buffer), the engine searches for and injects the specific value from the current context. 2) Function Calls and External Computations: When encountering a spatial function node (such as INTERSECTS(geomA,geomB) or DISTANCE(geomA, geomB, 500)), the engine encapsulates this function call and its parameters (already replaced with specific geometric values) into a standardized computation task. Subsequently, it synchronously calls the corresponding interface of the high-precision spatial computation service module (such as / spatial / relationship or / spatial / distance) through the spatialServiceClient in the context and waits for the return of the computation result (boolean or numerical value). 3) Logical judgment: After obtaining the values of all sub-expressions (including the results returned by the spatial function call), the engine performs calculations according to the logical operators (AND, OR, NOT) defined in the AST, and finally obtains the Boolean judgment result of the rule: True (compliant) or False (violation).
[0082] Step 4: Result Generation and Risk Data Encapsulation: If a rule is determined to be in violation (False), the engine not only records the rule ID and risk level, but also performs a crucial operation: requesting the spatial calculation service to return the precise geometric details that caused the violation. For example, for INTERSECTS, it can request the return of the polygons of the intersecting parts; for WITHIN_DISTANCE, it can identify facility points that are too close. This geometric data is encapsulated as a "risk geometry object" and appended to the violation record of that rule.
[0083] Step 5: Result Return: After a single rule is executed, the engine returns the decision result (compliance / violation, risk level, risk geometry) to the evaluation workflow engine. The workflow engine aggregates the execution results of all rules to form the final evaluation report.
[0084] The biggest innovation of this module lies in defining and implementing a domain-specific language (DSL) and its execution engine for describing space compliance rules. For example, a rule can be expressed as:
[0085] IF (ANY facility IN $facilities WHERE
[0086] facility.type == 'ecological red line' AND
[0087] INTERSECTS($target.geometry, BUFFER(facility.geometry, 0))
[0088] THEN VIOLATION(level='CRITICAL', message='Prohibition of encroachment on ecological protection red lines')
[0089] Through its innovative DSL and decoupled execution architecture, the patent transforms written regulations into dynamically executable digital logic, which is an important technology for achieving automated and intelligent compliance assessment.
[0090] 4. A high-precision spatial computing service module, used to respond to the spatial computing call, provide accurate spatial geometric relationship calculation services, and generate risky geometric data; the high-precision spatial computing service module is configured as an independent microservice, providing at least three types of standardized interfaces: spherical distance calculation, spatial topology judgment, and geometric overlay analysis.
[0091] The high-precision spatial computing service module is the "core algorithm toolbox" and "spatial standard" of this patented methodology. As an independent foundational service layer, it provides the upper-level geographic rule engine with professional, standardized, and high-performance spatial geometric computing capabilities. Its main value lies in abstracting complex spatial mathematical calculations into a series of simple, reliable, atomic APIs, ensuring the accuracy, efficiency, and consistency of the entire system's spatial analysis.
[0092] This module is designed as a set of stateless, horizontally scalable microservices. It encapsulates all the underlying geospatial algorithms, hiding their complexity from upper-layer business modules (primarily the geospatial rule engine). Its design follows these key principles:
[0093] Precision First: All calculations are based on geodesy principles to ensure that the results are accurate on the real Earth sphere or in a specified projected coordinate system, meeting the stringent requirements of land use, planning and other fields.
[0094] Standardized Interfaces: Provides a unified and concise application programming interface (API) with clear input and output formats (such as widely supported Well-Known Text or GeoJSON formats) for easy integration and invocation.
[0095] Performance and reliability: Through algorithm optimization, connection pool management, and caching of hot calculation results, we ensure rapid response and service stability in high-concurrency evaluation scenarios.
[0096] This module primarily provides the following three types of computing services, each specifically addressing key computing needs in spatial compliance assessment:
[0097] Spherical Distance Calculation Service: Accurately calculates the shortest arc distance between any two points on the Earth's surface. It uses the Haversine formula. This formula directly uses the latitude and longitude of the two points (WGS84 coordinate system) for calculation, avoiding the distance distortion caused by projecting coordinates to a planar coordinate system, making it particularly suitable for long-distance calculations. For extremely high-frequency calls, the service can internally optimize trigonometric function values through pre-calculation or caching.
[0098] Spatial topology relationship calculation service: Determining the spatial positional relationship between two geometric objects (points, lines, surfaces) is the foundation for logic such as "intersection" and "containment" in rule-based judgments. It integrates and encapsulates mature and stable computational geometry libraries such as Java Topology Suite or GEOS. The service converts input geometric data into Geometry objects from the library and then calls their native methods for judgment. This ensures the robustness of the algorithm in geometrically singular cases.
[0099] Spatial Geometry Analysis and Processing Service: This service performs more complex spatial geometry operations, generating new geometric objects. This service is the primary data source for risk visualization. It mainly includes:
[0100] Buffer analysis: Generates buffer polygons at specified distances for point, line, and surface geometry, used to convert the safety distance of a facility or the influence range of a target from "numerical" to "spatial area".
[0101] Overlay Analysis: This is one of the key innovative services in this module. It accurately calculates the common area where two geometric objects intersect. After the geographic rule engine determines a violation, it calls this service to obtain the precise intersection geometry of the "target impact area" and the "facility protection area." This intersection geometry is the specific risk space area that needs to be highlighted in the subsequent visualization module.
[0102] Geometric simplification and validation: ensuring the validity of geometric data
[0103] The high-precision spatial computing service module is the arithmetic foundation that supports the transformation of this patented method from "business rules" to "spatial intelligence." By providing accurate, efficient, and standardized spatial computing atomic capabilities and deeply collaborating with the rule engine, it not only completes compliance judgments but also produces spatial data for intuitively expressing risks. It is an indispensable underlying pillar for the entire system to achieve automated and visualized assessments.
[0104] 5. An interactive visualization and interface module, used to provide a human-computer interaction interface and application programming interface, and to perform dynamic map highlighting rendering based on the risk geometric data; wherein, the evaluation workflow engine module is communicatively connected to the rule and data management module, the geographic rule engine module, the high-precision spatial computing service module and the interactive visualization and interface module respectively;
[0105] The interactive visualization and interface module serves as the "unified entry and exit point" and "intelligent cockpit" of this patented methodology. It performs a dual function: first, as a standardized service interface for the system, it receives various evaluation requests and returns machine-readable results; second, as a user-facing human-computer interaction interface, it transforms complex spatial compliance data and evaluation conclusions into intuitive, dynamic, and explorable visual situational maps. This module is a crucial link in the final presentation and delivery of the patented technology's value.
[0106] The specific implementation details of this module include: API interface: providing standardized interfaces for assessment requests and result returns, facilitating integration with other business systems. Web visualization console: based on WebGIS technology, rendering elements such as facilities, targets, and protection areas onto a map. Its innovative feature lies in receiving and specifically rendering the "risk area geometry" (i.e., the actual intersection of the target and the protection area) calculated by the spatial computing service module, and highlighting it with effects such as highlighting and flashing. Unlike existing technologies that only overlay static layers on the map, this invention can dynamically generate and highlight specific locations and ranges of violations. For example, it can accurately show which section of the boom swing range of a construction tower crane is too close to a high-voltage line. This achieves a leap from "attribute description" to "intuitive spatial positioning" in risk assessment conclusions, greatly enhancing the intuitiveness and accuracy of decision support.
[0107] The interactive visualization and interface module serves as a bridge between this patented method and the user and the external world. It transforms the complex rule calculations and spatial analysis results in the background into an intuitive and dynamic "spatial risk map" on the front end, achieving a qualitative leap in the assessment conclusions from "readable" to "visible" and from "abstract" to "concrete." This not only significantly improves the understandability of the results and the strength of decision support, but also makes the entire patented method a complete, closed-loop technical solution from data input and intelligent analysis to graphical output.
[0108] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform a method for implementing any of the steps described above.
[0109] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps described in any of the preceding claims.
[0110] Example 2:
[0111] This embodiment is a refinement based on Embodiment 1. This embodiment elaborates on the specific implementation path of the compliance assessment method based on a geographic rule engine, such as... Figure 1 , Figure 2 As shown, following the technical logic flow of "rule digitization → request processing → spatial retrieval → rule evaluation → risk visualization," the implementation details of the five modules are described sequentially, including multilingual code examples and reasons for technology selection, fully covering all technical features of the claims, and ensuring that the technical solution is fully disclosed and implementable.
[0112] 1. Implementation of the rules and data management module, such as... Figure 3 As shown:
[0113] 1.1 Implementation of Structured Rule Knowledge Base
[0114] This module implements the key step of transforming unstructured spatial security specifications into computable logic. A domain-specific language (DSL) was chosen over simple regular expressions or natural language processing techniques because spatial compliance rules have a strict logical structure and spatial semantics, requiring precise expression of complex spatial relationships and combinations of conditions.
[0115] JSON script:
[0116] {
[0117] "rule_id": "rule_001",
[0118] "version": "1.0",
[0119] "title": "Rules for Safe Distances to Oil and Gas Facilities",
[0120] Description: Hot work is prohibited within 500 meters of the oil depot.
[0121] "type": "DISTANCE",
[0122] "condition": "ANY facility IN $facilities WHERE facility.type == 'OIL_TANK' AND DISTANCE($target.geometry, facility.geometry) < 500",
[0123] "action": "VIOLATION(level='CRITICAL', message='Violation of safety distance regulations for oil and gas facilities')",
[0124] "valid_from": "2023-01-01",
[0125] "tags": ["energy", "safety"]
[0126] }
[0127] The rule parser employs a two-stage process of lexical analysis and syntax analysis, a design that ensures the accuracy and maintainability of rule parsing. Compared to hard-coding rules into the program, the DSL method makes rules dynamically manageable data objects. When regulations are updated, only the rule base needs to be modified without redeploying the system, solving the flexibility problem caused by the tight coupling between rules and code in traditional GIS systems.
[0128] 1.2 Implementation of Space Facility Database
[0129] Spatial facility data is stored in a PostgreSQL database extended with PostGIS. PostGIS was chosen over other spatial databases because of its mature open-source ecosystem and good compatibility with mainstream GIS tools.
[0130] SQL script:
[0131] CREATE TABLE facilities (
[0132] id SERIAL PRIMARY KEY,
[0133] name VARCHAR(255),
[0134] type VARCHAR(50) NOT NULL,
[0135] geometry GEOMETRY NOT NULL,
[0136] buffer_distance INTEGER,
[0137] protection_polygon GEOMETRY,
[0138] attributes JSONB );
[0140] -- Create a spatial index
[0141] CREATE INDEX idx_facilities_geometry ON facilities USING GIST(geometry);
[0142] The GIST spatial index is used instead of the traditional B-tree index because GIST is designed specifically for multidimensional spatial data and can efficiently support spatial range queries. Storing the protection range in both buffer_distance (distance value) and protection_polygon (geometric polygon) formats is to balance storage efficiency and query performance: numerical calculation is more efficient for simple distance rules, while pre-calculated geometric polygons are used directly for complex protection areas.
[0143] 2. Evaluate the implementation of the workflow engine module.
[0144] 2.1 Single-objective real-time evaluation workflow, such as Figure 4 As shown:
[0145] JAVA code:
[0146] public AssessmentResult evaluateSingleTarget(EvaluationRequestrequest) {
[0147] / / Step 1: Parse target information and load applicable rules
[0148] Target target = parseTarget(request);
[0149] List <rule>applicableRules = ruleManager.getApplicableRules(request.getTargetType());
[0150] / / Step 2: One-time spatial range search
[0151] SpatialQuery query = buildSpatialQuery(applicableRules, target);
[0152] List <facility>facilities = spatialDataRepository.query(query);
[0153] / / Step 3: Build the evaluation context and execute the rules
[0154] EvaluationContext context = new EvaluationContext(target,facilities, spatialServiceClient);
[0155] List <ruleresult>ruleResults = ruleEngine.executeRules(applicableRules, context);
[0156] / / Step 4: Aggregation Results
[0157] return resultAggregator.aggregate(ruleResults);
[0158] }
[0159] The "one-time spatial range retrieval" design, rather than the traditional method of querying each rule separately, is adopted because spatial queries are I / O-intensive operations, and multiple queries will significantly degrade performance. By extracting the maximum influence range involved by all spatial conditions in the rule set, the system merges multiple queries into one, which can reduce database I / O overhead. This is a key technical measure to achieve "real-time evaluation".
[0160] 2.2 Multi-objective batch processing optimization workflow, such as Figure 5 As shown:
[0161] JAVA code:
[0162] public AssessmentResult evaluateMultipleTargets(EvaluationRequestrequest) {
[0163] List <target>targets = request.getTargets();
[0164] / / Step 1: Preliminary Scoring
[0165] Map<Target, Double> riskScores = targets.stream()
[0166] .collect(Collectors.toMap(
[0167] target -> target,
[0168] target -> preEvaluator.calculateRiskScore(target) ));
[0170] / / Step 2: Sort
[0171] List <target>sortedTargets = targets.stream()
[0172] .sorted(Comparator.comparingDouble(riskScores::get).reversed())
[0173] .collect(Collectors.toList());
[0174] / / Step 3: Sequential Evaluation and Early Termination
[0175] for (Target target : sortedTargets) {
[0176] AssessmentResult result = evaluateSingleTarget(
[0177] new EvaluationRequest(target, request.getTargetType()) );
[0179] if (result.isCompliant()) {
[0180] return result;
[0181] }
[0182] }
[0183] / / All proposals are non-compliant
[0184] return AssessmentResult.allNonCompliant();
[0185] }
[0186] The "risk pre-scoring-ranking-early termination" mechanism is inspired by expert decision-making behavior: when evaluating multiple options, professionals prioritize checking high-risk options. By prioritizing the most likely non-compliant options through lightweight pre-assessment, the system can find compliant options more quickly and reduce computational load, especially when there are a large number of candidate options.
[0187] 3. Implementation of the geographic rule engine module, such as... Figure 6 As shown:
[0188] 3.1 Rule Execution Logic
[0189] JAVA code:
[0190] public RuleResult executeRule(Rule rule, EvaluationContext context) {
[0191] / / 1. The parsing rule DSL is an AST
[0192] RuleAST ast = ruleParser.parse(rule.getCondition());
[0193] / / 2. Execute AST
[0194] boolean result = evaluateAST(ast, context);
[0195] / / 3. Generating Results
[0196] if (result) {
[0197] return RuleResult.compliant(rule.getId());
[0198] } else {
[0199] / / 4. Obtain risk geometry data
[0200] Geometry riskGeometry = getRiskGeometry(rule, context);
[0201] return RuleResult.violation(rule.getId(), rule.getSeverity(), riskGeometry);
[0202] }
[0203] }
[0204] The Abstract Syntax Tree (AST) is used instead of directly interpreting DSL strings because the AST provides a structured representation of the rule logic, facilitating optimized execution and error localization. This design enables the rule engine to handle complex nested logic while laying the foundation for future support for rule debugging and visualization.
[0205] 3.2 Implementation of Spatial Function Calls
[0206] JAVA code:
[0207] private boolean evaluateSpatialFunction(RuleAST ast,EvaluationContext context) {
[0208] String funcName = ast.getFunctionName();
[0209] List <object>args = ast.getArguments().stream()
[0210] .map(arg -> evaluateAST(arg, context))
[0211] .collect(Collectors.toList());
[0212] / / Call the spatial computing service
[0213] return spatialServiceClient.invoke(funcName, args);
[0214] }
[0215] By separating the spatial computing service from the rules engine, the business logic and spatial algorithms are decoupled. This separation not only improves system maintainability but also allows for the use of different spatial computing implementations to meet varying precision requirements; for example, lightweight algorithms can be used on mobile devices, while high-precision computing can be used on the server side.
[0216] 4. Implementation of the High-Precision Spatial Computing Service Module
[0217] 4.1 Spherical Distance Calculation Service
[0218] JAVA code:
[0219] public double calculateDistance(Point point1, Point point2) {
[0220] / / The Haversine formula is used instead of plane geometry calculations because the Earth is a sphere.
[0221] / / Planar calculations can produce significant errors over long distances.
[0222] double lat1 = Math.toRadians(point1.getLatitude());
[0223] / / ...formula implementation...
[0224] }
[0225] The Haversine formula was chosen over planar geometry calculations because the curvature of the Earth can cause significant errors in planar calculations in large-scale spatial assessments, which is unacceptable in high-precision scenarios such as land planning.
[0226] 4.2 Spatial Overlay Analysis Service
[0227] JAVA code:
[0228] public Geometry calculateIntersection(Geometry geom1, Geometry geom2){
[0229] / / Using the JTS library for precise geometric overlay analysis
[0230] return geom1.intersection(geom2);
[0231] }
[0232] Risk geometry data is generated through an overlay analysis service, a crucial technology for achieving "risk visualization." Compared to traditional methods that only return Boolean results, accurately calculating the geometry of violation areas allows the system to visually display the location of risks, which is the key innovation that distinguishes this invention from existing technologies.
[0233] 5. Implementation of interactive visualization and interface modules
[0234] 5.1 Risk visualization implementation, such as... Figure 7 As shown:
[0235] Javascript code:
[0236] function renderRiskAreas(riskGeometries) {
[0237] riskGeometries.forEach(risk => {
[0238] const layer = L.geoJSON(risk.geometry, {
[0239] style: {
[0240] fillColor: '#ff0000',
[0241] fillOpacity: 0.5,
[0242] color: '#cc0000',
[0243] weight: 2,
[0244] dashArray: '5, 10'
[0245] }
[0246] });
[0247] / / Add blinking effect to enhance visual cues
[0248] Let opacity = 0.5;
[0249] setInterval(() => {
[0250] opacity = opacity === 0.5 ? 1.0 : 0.5;
[0251] layer.setStyle({fillOpacity: opacity});
[0252] }, 1000);
[0253] map.addLayer(layer);
[0254] });
[0255] }
[0256] The use of highly saturated colors, semi-transparent effects, and periodically changing patterns in risk area rendering aims to highlight violation areas against complex map backgrounds. This design is based on human-computer interaction research: dynamic visual cues are more effective at attracting user attention than static markers, and can significantly improve risk identification efficiency, especially in multi-element maps.
[0257] 6. Complete Workflow Example
[0258] 6.1 Scenario: Compliance analysis of simulation scenarios, such as... Figure 8 As shown:
[0259] 1) Request reception: The operator submits a simulation path analysis request through the web interface, which includes the simulation path coordinates and height parameters.
[0260] 2) Rule Matching: The system matches and loads relevant rules based on the "Scenario" type, including:
[0261] Airport no-fly zone rules;
[0262] Safety distance rules for power facilities;
[0263] Rules restricting densely populated areas.
[0264] 3) Spatial data retrieval: Based on the maximum influence range defined in the rules, retrieve all relevant geographic facilities within that range in one go.
[0265] 4) Rule evaluation:
[0266] The rules engine executes no-fly zone rules by calling the spatial topology service to determine whether a path intersects with a no-fly zone.
[0267] Enforce safe distance rules: Invoke the distance calculation service to determine the distance relationship between the path and the facility;
[0268] Execute restricted area rules: Call the overlay analysis service to obtain the intersection of the path and the restricted area.
[0269] 5) Result generation: For non-compliant parts, the system generates precise risk geometry data (such as specific line segments that are too close to the facility).
[0270] 6) Visualization: Highlight risk areas on the electronic map and use dynamic visual effects to identify specific risk locations.
[0271] 6.2 Multi-option evaluation scenario
[0272] When a user submits multiple alternative simulation paths:
[0273] 1) The system first calculates a pre-score for each path (based on proximity to known facilities, facility risk level, etc.).
[0274] 2) Sort by pre-score from high to low (high-risk paths are evaluated first).
[0275] 3) Evaluate each path in turn, and terminate the analysis process immediately once a compliant path is found.
[0276] 4) Return the first compliant path as the recommended solution.
[0277] This embodiment demonstrates the application of the present invention in a simulation environment, highlighting how the system automatically performs spatial compliance analysis and provides real-time, intuitive risk assessment support for simulation decisions.
[0278] This invention transforms unstructured spatial security regulations into computable, executable, and manageable structured logical rules through a "geographic rule engine," and uses these rules as a driving engine to seamlessly connect spatial data retrieval, high-precision geographic calculation, intelligent decision optimization, and dynamic visualization, forming an automated intelligent evaluation closed loop.
[0279] The above description is only used to illustrate the technical solution of the present invention and is not intended to limit it. Various changes and modifications can be made to the present invention without departing from the spirit and scope of the present invention, and all such changes and modifications should be included within the protection scope of the present invention.< / object> < / target> < / target> < / ruleresult> < / facility> < / rule>
Claims
1. A spatial compliance analysis method for a geographic rule engine oriented towards simulation evaluation, characterized in that, Includes the following steps: S1. Rule digitization steps: Transform the textual spatial security specifications into structured, computable, and executable logical rules, and store them in a rule knowledge base; S2. Request Receiving and Rule Matching Steps: Receive an evaluation request containing target space information and target type, match and load the corresponding executable logic rule set from the rule knowledge base according to the target type; S3. Spatial data association retrieval step: Based on the spatial constraints contained in the loaded set of executable logic rules, retrieve the geographic facility data associated with the target spatial information from the spatial facility database; S4. Rule-driven assessment steps: Execute the executable logical rule set through the geographic rule engine to determine the compliance of the target spatial information and the geographic facility data; During execution, an independent high-precision spatial computing service is invoked to complete the required spatial geometric relationship calculations, generating an assessment result that includes compliance conclusions and corresponding risk geometric data; the risk geometric data represents the non-compliant spatial area between the target and the geographical facility protection area; S5. Risk visualization step: Based on the risk geometric data in the assessment results, dynamically highlight the data on the electronic map.
2. The method according to claim 1, characterized in that, In step S1, the transformation into structured, computable, and executable logical rules specifically includes: describing the text rules using a predefined domain-specific language to form a rule expression containing spatial relation predicates, facility attribute conditions, and logical operators.
3. The method according to claim 1 or 2, characterized in that, In step S3, the retrieval based on the spatial constraints contained in the loaded executable logic rule set specifically includes: extracting the maximum spatial influence range involved in all spatial conditions in the rule set, and performing a one-time spatial range query on the spatial facility database based on this range.
4. The method according to claim 1, characterized in that, In step S4, the high-precision spatial computing service includes at least: a spherical distance calculation service based on the Haversine formula, and a spatial topological relationship judgment and overlay analysis service based on a computational geometry library; the risk geometric data is obtained through the overlay analysis service.
5. The method according to claim 1, characterized in that, When the evaluation request contains multiple candidate solutions, an optimization batch processing step is included before step S4: S41. Pre-scoring steps: Perform a lightweight risk pre-assessment for each candidate solution and calculate the risk pre-score; S42. Sorting Step: Sort all candidate solutions in descending order based on the risk pre-score; S43. Sequential evaluation steps: Perform steps S3 to S4 sequentially on the sorted candidate solutions; S44. Early Termination Step: When a compliance conclusion of "pass" is obtained for the first time in the sequential evaluation step, the evaluation process for subsequent candidate solutions is terminated.
6. The method according to claim 5, characterized in that, The lightweight risk pre-assessment in step S41 calculates a risk pre-score based on one or more factors among the candidate scheme and the proximity of geographical facilities within a preset range, the highest risk level of the facilities, and the number of facilities.
7. The method according to claim 1, characterized in that, The dynamic highlighting in step S5 specifically includes: rendering the risk geometry data into a map layer with a specific visual style that is independent of other map elements. The specific visual style includes one or more of the following: highly saturated fill color, semi-transparent effect, and periodic change style.
8. A system for implementing a spatial compliance analysis method for a geographic rule engine oriented towards simulation evaluation, characterized in that, include: The rules and data management module is used to store geographic facility data and structured executable logical rules; The evaluation workflow engine module is used to receive evaluation requests and coordinate and schedule the evaluation process; the evaluation workflow engine module is configured to support a single-objective real-time evaluation process and a batch processing optimization process that supports risk pre-scoring, sorting, sequential evaluation, and early termination of multiple candidate solutions. The geographic rule engine module is used to load and execute the executable logical rules, and generate spatial calculation calls during the execution process; A high-precision spatial computing service module is used to respond to the spatial computing call, provide accurate spatial geometric relationship calculation services, and generate risk geometric data; The high-precision spatial computing service module is configured as an independent microservice, providing at least three types of standardized interfaces: spherical distance calculation, spatial topology judgment, and geometric overlay analysis. The interactive visualization and interface module is used to provide a human-computer interaction interface and application interface, and to perform dynamic map highlighting rendering based on the risk geometric data; wherein, the evaluation workflow engine module is communicatively connected to the rule and data management module, the geographic rule engine module, the high-precision spatial computing service module and the interactive visualization and interface module.
9. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 7.