An AI-based security risk analysis method
By using AI multimodal processing and dynamic risk partitioning technology, the problems of weak natural language processing capabilities and insufficient spatial analysis in traditional fire safety risk analysis methods have been solved, achieving efficient and accurate risk analysis and intuitive risk distribution display.
Patent Information
- Application Number
- CN202511088513.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-05
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2045-08-05
AI Technical Summary
Traditional fire safety risk analysis methods are unable to meet the requirements of accuracy and real-time performance. They have weak natural language processing capabilities, limited spatial analysis capabilities, and low levels of intelligence and automation, resulting in low efficiency of human-computer interaction and inaccurate analysis results.
An AI-based safety risk analysis method is adopted. The natural language request is intelligently converted by the AI multimodal processing model to generate standardized text. The risk analysis objectives and spatial constraints are extracted by combining the semantic parsing rule base of the safety domain. Risk partitions are dynamically generated and the grid deformation gradient tensor is calculated to generate spatial risk heat map data points.
It improves the convenience of human-computer interaction and the accuracy of semantic understanding, enhances the precision and automation of risk analysis, and can intuitively present the characteristics and trends of risk distribution, while reducing manual intervention and operational complexity.
Smart Images

Figure CN120634819B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to an AI-based fire safety risk analysis method. Background Art
[0002] In the field of production safety and fire safety (hereinafter referred to as "production safety and fire safety"), production safety and fire safety risk factors are characterized by wide spatial distribution and rapid dynamic changes. However, traditional risk analysis methods can no longer meet the needs of precision and real-time analysis.
[0003] In existing technologies, fire safety risk analysis mostly relies on manual experience or static models. Therefore, some of them have the following deficiencies:
[0004] For example, natural language processing capabilities are weak, making it difficult to directly parse complex risk analysis requests submitted by users in natural language, resulting in inefficient human-computer interaction and the targeted nature of the analysis being easily affected by semantic understanding deviations.
[0005] For example, spatial analysis capabilities are limited. Fixed boundary division methods are often used in risk zoning, and the zoning range cannot be dynamically adjusted according to real-time business data. The discretization of spatial units does not consider the impact of geometric deformation on risk distribution, making it difficult to accurately reflect the subtle differences and dynamic changes in risks in space. The degree of intelligence and automation is low, and business data queries involving spatial coordinates require manual structured query statements. The risk result outputs are mostly static reports or simple distribution maps, and it is impossible to generate thermal data that intuitively reflects changes in spatial risk gradients. Summary of the Invention
[0006] The technical problem to be solved by the present invention is to provide an AI-based fire safety risk analysis method that can accurately extract risk analysis targets, key entities and spatial constraints, thereby improving the convenience of human-computer interaction and the accuracy of semantic understanding.
[0007] In order to solve the above technical problems, the technical solutions of the present invention are as follows:
[0008] An AI-based fire safety risk analysis method, the method comprising:
[0009] Step 1: Receive a natural language safety and fire risk analysis request text, intelligently convert the voice, text, or rich media input using an AI multimodal processing model, perform text standardization and validity verification, and generate a standardized request text.
[0010] Step 2: Based on the standardized request text, the request text is processed using a semantic parsing rule library preset in the field of fire safety to extract risk analysis objectives, key entities, and spatial constraints to generate structured semantic information.
[0011] Step 3: Based on the structured semantic information, matching professional knowledge fragments from the fire safety knowledge base to generate a knowledge enhancement context;
[0012] Step 4: Analyze the structured semantic information. If there is a data query requirement, generate SQL statements through the conversion rules from natural language to structured query language to obtain business data results with spatial coordinates from the security and fire protection platform database;
[0013] Step 5: Based on the spatial coordinates in the business data results, dynamically determine three spatial reference positions using a spatial topological relationship analysis algorithm; generate dynamic risk partitions based on the spatial reference positions; perform spatial meshing operations on the dynamic risk partitions to form discretized spatial analysis units; and calculate mesh deformation gradient tensors based on the geometric deformation parameters of the spatial analysis units as risk distribution adjustment values.
[0014] Step 6: Generate spatial risk thermal data points describing spatial risk distribution based on the structured semantic information, the knowledge enhancement context, the business data results, and the risk distribution adjustment value.
[0015] An AI-based fire safety risk analysis system, including:
[0016] The receiving module is used to receive natural language safety and fire risk analysis request text, intelligently convert voice, text or rich media input through the AI multimodal processing model, perform text standardization and validity verification, and generate standardized request text;
[0017] A processing module is used to process the standardized request text using a semantic parsing rule library preset in the field of fire safety, extract risk analysis objectives, key entities, and spatial constraints, and generate structured semantic information;
[0018] A generation module, configured to match professional knowledge fragments from the fire safety knowledge base based on the structured semantic information to generate a knowledge enhancement context;
[0019] An acquisition module is configured to analyze the structured semantic information and, if a data query is required, generate an SQL statement using natural language to structured query language conversion rules to obtain business data results with spatial coordinates from the fire safety platform database; dynamically determine three spatial reference positions based on the spatial coordinates in the business data results using a spatial topological relationship analysis algorithm; generate dynamic risk partitions based on the spatial reference positions; perform spatial meshing operations on the dynamic risk partitions to form discretized spatial analysis units; and calculate a mesh deformation gradient tensor based on the geometric deformation parameters of the spatial analysis units as a risk distribution adjustment value;
[0020] A fusion module is used to generate spatial risk thermal data points describing spatial risk distribution based on the structured semantic information, the knowledge enhancement context, the business data results and the risk distribution adjustment value.
[0021] The above solution of the present invention includes at least the following beneficial effects:
[0022] Through the preset semantic parsing rule library in the field of fire safety, it is possible to directly process risk analysis requests made by users in natural language, accurately extract risk analysis targets, key entities and spatial constraints, improve the convenience of human-computer interaction and the accuracy of semantic understanding, and solve the problem of weak natural language processing capabilities of traditional methods.
[0023] By generating knowledge-enhanced context, the professional knowledge in the field of fire safety is organically combined with the business data obtained from the database, so that the risk analysis process has both solid theoretical support and is closely aligned with actual business scenarios, effectively improving the professionalism and reliability of the analysis results.
[0024] Based on the spatial topological relationship analysis algorithm, the spatial reference position is dynamically determined and dynamic risk partitions are generated, breaking through the limitations of traditional fixed boundary partitions and being able to respond to changes in business data in real time. At the same time, by calculating the grid deformation gradient tensor as the risk distribution adjustment value, the impact of the geometric deformation of the spatial unit on the risk distribution is fully considered, making the risk assessment of the discretized spatial analysis unit more in line with the actual spatial characteristics, thereby improving the accuracy of spatial risk analysis.
[0025] By integrating structured semantic information, knowledge-enhanced context, business data results, and risk distribution adjustment values, thermal data points describing the spatial risk distribution are generated, which intuitively presents the spatial distribution characteristics and changing trends of risks and improves decision-making efficiency.
[0026] Automatic conversion of natural language to SQL statements enables rapid query of business data, reduces manual intervention and lowers operational complexity. At the same time, dynamic adjustment and data fusion of the entire analysis process are automatically completed through algorithms, improving the automation and intelligence level of fire safety risk analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 This is a flow chart of an AI-based fire safety risk analysis method provided by an embodiment of the present invention.
[0028] Figure 2 This is a schematic diagram of an AI-based fire safety risk analysis system provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0029] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0030] like Figure 1 As shown, an embodiment of the present invention proposes an AI-based fire safety risk analysis method, which includes the following steps:
[0031] Step 1: Receive a natural language safety and fire risk analysis request text, intelligently convert the voice, text, or rich media input using an AI multimodal processing model, perform text standardization and validity verification, and generate a standardized request text.
[0032] Step 2: Based on the standardized request text, the request text is processed using a semantic parsing rule library preset in the field of fire safety to extract risk analysis objectives, key entities, and spatial constraints to generate structured semantic information.
[0033] Step 3: Based on the structured semantic information, matching professional knowledge fragments from the fire safety knowledge base to generate a knowledge enhancement context;
[0034] Step 4: Analyze the structured semantic information. If there is a data query requirement, generate SQL statements through the conversion rules from natural language to structured query language to obtain business data results with spatial coordinates from the security and fire protection platform database;
[0035] Step 5: Based on the spatial coordinates in the business data results, dynamically determine three spatial reference positions using a spatial topological relationship analysis algorithm; generate dynamic risk partitions based on the spatial reference positions; perform spatial meshing operations on the dynamic risk partitions to form discretized spatial analysis units; and calculate mesh deformation gradient tensors based on the geometric deformation parameters of the spatial analysis units as risk distribution adjustment values.
[0036] Step 6: Generate spatial risk thermal data points describing spatial risk distribution based on the structured semantic information, the knowledge enhancement context, the business data results, and the risk distribution adjustment value.
[0037] In this embodiment of the present invention, a pre-defined semantic parsing rule base for the fire safety field enables direct processing of risk analysis requests submitted by users in natural language, accurately extracting risk analysis objectives, key entities, and spatial constraints. This significantly improves the convenience of human-computer interaction and the accuracy of semantic understanding, addressing the weak natural language processing capabilities of traditional methods. By generating knowledge-enhanced context, this approach organically combines fire safety domain expertise with business data retrieved from a database, ensuring that the risk analysis process is both theoretically robust and closely aligned with actual business scenarios, effectively enhancing the professionalism and reliability of the analysis results. Based on the spatial topological relationship analysis algorithm, the spatial reference position is dynamically determined and dynamic risk partitions are generated, breaking through the limitations of traditional fixed boundary partitions and being able to respond to changes in business data in real time. At the same time, by calculating the grid deformation gradient tensor as the risk distribution adjustment value, the influence of the geometric deformation of the spatial unit on the risk distribution is fully considered, making the risk assessment of the discretized spatial analysis unit more in line with the actual spatial characteristics, significantly improving the accuracy of spatial risk analysis. By integrating structured semantic information, knowledge-enhanced context, business data results and risk distribution adjustment values, thermal data points describing the spatial risk distribution are generated, intuitively presenting the spatial distribution characteristics and changing trends of risks. Through the automatic conversion of natural language to SQL statements, rapid query of business data is achieved, which reduces manual intervention and reduces the complexity of operations. At the same time, the dynamic adjustment and data fusion of the entire analysis process are automatically completed by the algorithm, improving the automation and intelligence level of fire safety risk analysis.
[0038] In step 1 above, an AI multimodal processing model is used to achieve unified understanding and conversion of multi-channel inputs, including voice, text, and rich media (such as images and short videos containing text), ultimately outputting text content that complies with safety and fire protection standards. Its construction and training process must be closely integrated with the professional characteristics of the safety and fire protection field (such as terminology and risk scenario expression habits). The specific process is as follows:
[0039] The AI multimodal processing model adopts a layered architecture consisting of "multimodal input submodule → feature extraction layer → cross-modal fusion layer → domain adaptation layer → text generation layer". Each module is customized for security and firefighting scenarios:
[0040] 1. Multimodal input submodule design
[0041] Design dedicated processing interfaces for different input types to ensure effective reception and preliminary analysis of raw data:
[0042] The voice input submodule receives audio signals (sampling rate 16kHz) and converts the continuous waveform into discrete frames (20ms per frame, 10ms frame shift) through an audio preprocessing interface (supporting .wav, .mp3, and other formats). It also integrates hardware-level noise reduction circuits for signal preprocessing (filtering 50Hz power frequency interference and ambient noise).
[0043] Text input submodule: Receives text streams from instant messaging platforms (such as DingTalk and WeChat for Business) and emails, parses the protocol formats of different platforms (such as DingTalk's XML message structure and WeChat for Business's JSON data packets), and extracts the original text content (including location markers for special symbols and emoticons).
[0044] Rich media input submodule:
[0045] For images containing text (such as handwritten risk record photos and screenshots of equipment hazards): Use the OCR interface (based on the CNN architecture) to locate the text area in the image (supporting tilt correction and blur repair);
[0046] For short videos (such as on-site risk videos): obtain key frames through the frame extraction interface (one frame every 2 seconds), give priority to frames with text overlays or voice narration, and synchronously separate the audio track (for combined processing with the voice sub-module).
[0047] 2. Modal feature extraction layer design
[0048] Extract "security and fire protection field-specific features" for each modal data, taking into account both universality and field specificity:
[0049] Speech feature extraction:
[0050] Basic acoustic features: Calculate the Mel spectrum (40-dimensional Mel coefficient), fundamental frequency (F0), and spectral entropy (reflecting speech clarity) of each frame;
[0051] Domain-enhanced features: Based on the pronunciation characteristics of safety and fire protection terminology (such as "fire hydrant" and "electrical short circuit"), we add "term pronunciation feature vectors" (phoneme embeddings pre-trained through the safety and fire protection term pronunciation dictionary, such as the phoneme encoding [xiao, fang, shuan] for "fire hydrant") to improve the term recognition weight.
[0052] Text feature extraction:
[0053] Common features: BERT-based Chinese pre-trained model is used to generate word vectors (768 dimensions) to capture contextual semantics;
[0054] Domain characteristics: A "domain term mask" is constructed through the safety and fire protection domain dictionary (including 5,000+ professional terms). Exclusive tags (such as "[risk]" and "[equipment]") are added to terms such as "risk type" and "equipment name" to enhance the model's sensitivity to key domain information.
[0055] Rich media feature extraction:
[0056] Image text features: For text recognized by OCR, the same feature extraction logic as the text submodule is used;
[0057] Image visual features: For risk scene images without text (such as smoke and equipment damage), 2048-dimensional visual features are extracted using a pre-trained ResNet-50 model. Scene label features (100 dimensions, corresponding to 100 common fire safety scenarios) are then generated using a fire safety scene classifier (such as "smoke area" and "equipment abnormality").
[0058] 3. Cross-modal fusion layer design
[0059] Through the "attention mechanism + dynamic allocation of modal weights", the effective fusion of multimodal features is achieved to solve the redundancy and complementarity problems of different modal information:
[0060] Cross-modal attention module: Using text features as "anchors", it calculates the similarity between speech / image features and text features (such as the cosine similarity between the phoneme vector in speech features and the term vector in text features), and generates attention weights (the higher the weight, the more relevant the modal information is to the safety and fire risk request).
[0061] Modal conflict resolution: When multimodal information conflicts (for example, the voice says "Warehouse A" and the image text is labeled "Warehouse B"), the entity relationship graph in the safety and fire protection field (including association rules for places and equipment) is called for verification, and information with a high degree of match with historical data is retained first (for example, the rationality of "Warehouse A" is verified through warehouse numbering rules).
[0062] Fusion feature output: The weighted features of each modality are concatenated to generate a 512-dimensional "cross-modal fusion feature vector" that contains the complete semantics of the input information.
[0063] 4. Domain Adaptation Layer Design
[0064] Feature optimization is performed based on the particularities of the fire safety field (rigorous terminology and fixed scenarios):
[0065] Introducing "Knowledge Distillation in the Fire Safety Field": Convert the analysis logic of fire safety experts for risk requests (such as "'congestion' must be associated with entities such as 'channel' and 'exit'") into rule constraints, and optimize the fusion features through the knowledge distillation loss function (to make the model output distribution close to the expert analysis results).
[0066] Add "error case penalty item": For historical conversion error cases (such as mistakenly converting "smoke detector" to "smoke rod detector"), add penalty weights at the feature layer to reduce the probability of similar errors.
[0067] 5. Text generation layer design
[0068] The goal is to generate standardized text (which meets the "validity verification" requirements of step 1) using the "autoregressive generation + constrained decoding" architecture:
[0069] Generation model: Based on the Transformer decoder (6 layers, 8-head attention), taking the fused feature vector as input, generating a text sequence word by word;
[0070] Constrained decoding:
[0071] Term constraint: During the decoding process, terms in the safety and fire protection domain dictionary are preferred (e.g., "fire hydrant" instead of the colloquial expression "fire hose stand").
[0072] Format constraint: Through a finite state machine (FSM), ensure that the output text contains no special symbols, emoji marks, and conforms to the basic structure of "[location] + [risk type]" (e.g., "Electrical overload risk in Workshop B").
[0073] Training process of the AI multi-modal processing model:
[0074] The training is divided into three stages: "general pre-training → domain fine-tuning → scenario adaptation" to achieve high precision and robustness of the AI multi-modal processing model in the safety and fire protection domain:
[0075] 1. Dataset construction (premise):
[0076] Construct a "multi-modal parallel corpus for the safety and fire protection domain", including 3 types of data and corresponding annotations:
[0077] Speech-text parallel data (100,000 pieces):
[0078] Input: Speech recorded by safety and fire protection personnel (including different accents, speaking speeds, and background containing equipment noise), with the content being a risk analysis request (e.g., "Check the risk of insufficient pressure in the fire hydrant in Warehouse No. 3").
[0079] Annotation: The corresponding standardized text (removing colloquial words, e.g., marking "Check if the pressure of the fire hydrant in Warehouse No. 3 is sufficient" as "Check the risk of insufficient pressure in the fire hydrant in Warehouse No. 3").
[0080] Text-standardized text data (200,000 pieces):
[0081] Input: Non-standardized text collected from the historical records of the safety and fire protection platform (including emojis, special symbols, and platform format marks, e.g., "@Safety Officer There seems to be a problem with the wires in Workshop A").
[0082] Annotation: Standardized text after removing redundant information (e.g., "Analyze the hidden danger risk of the electrical circuit in Workshop A").
[0083] Rich media-text parallel data (50,000 pieces):
[0084] Input: Images / short videos containing risk information (e.g., a photo of a handwritten note saying "Warehouse C is leaking" or a video of an equipment failure with voice narration);
[0085] Annotation: The core risk request text extracted from the rich media (e.g., “Assess the water leakage risk at Warehouse C”).
[0086] 2. General pre-training (basic ability training)
[0087] Data: We use public multimodal datasets (such as CLIP and COCOCaptions) and general speech recognition datasets (such as AISHELL-1), with a total size of 5 million records.
[0088] Goal: To enable the model to master basic cross-modal mapping capabilities (such as the correspondence between speech and text, and the matching of image content and text descriptions);
[0089] Training: Contrastive learning is used to bring different modal features with the same semantics closer together in the vector space (for example, the distance between the speech and text features of "fire hydrant" is smaller than that between the speech and text features of "fire extinguisher"). The optimizer is Adam, the learning rate is 5e-5, and the training is repeated for 100 epochs.
[0090] 3. Field fine-tuning (security and fire feature adaptation)
[0091] Based on the general pre-trained model, fine-tuning is performed using security and firefighting datasets to enhance domain capabilities:
[0092] Fine-tuning in stages:
[0093] First, freeze the fusion layer and the generation layer, and only fine-tune the feature extraction layer of each modality (using security and firefighting voice / text / rich media data to train separately to ensure accurate domain feature extraction);
[0094] Unfreeze all layers, jointly train with a cross-modal parallel corpus, and focus on optimizing the attention weights of the fusion layer (making the model pay more attention to key entities such as "risk type" and "location").
[0095] Loss function design:
[0096] Main loss: Cross-Entropy Loss for text generation, ensuring the accuracy of generated text;
[0097] Auxiliary loss:
[0098] Cross-modal consistency loss (making the results of speech→text and image→text semantically consistent);
[0099] Domain term loss (increase penalties for samples that do not correctly generate domain terms. For example, when "fire hydrant" is miswritten as "fire plug", the loss is doubled).
[0100] Training configuration: batchsize = 32, learning rate 1e-5 (lower than the pre-training stage to avoid damaging the basic capabilities), train for 50 epochs, and adopt the early stopping strategy (stop when the validation set accuracy does not improve for 5 consecutive epochs).
[0101] 4. Scenario adaptation (extreme case optimization):
[0102] Conduct special training for special inputs in the fire and safety scenarios (such as strong noise speech, blurred images, mixed modality inputs):
[0103] Noise robustness training: Add factory background noise (machine roar, people talking) to the speech data, and reduce the signal-to-noise ratio (SNR) from 30 dB to 5 dB to train the model's recognition ability at low SNR;
[0104] Blurred text adaptation: Add spelling mistakes (such as "electrical short circuit") and mixed simplified and traditional Chinese (such as "fire extinguisher") to the text data to train the model's fault tolerance and correction ability;
[0105] Mixed modality enhancement: Construct "speech + image" mixed inputs (such as speech saying "warehouse is smoking" + corresponding smoke picture) to train the model's ability to fuse multi-modal evidence.
[0106] 5. Model evaluation and iteration:
[0107] Evaluation metrics:
[0108] Speech → Text: Word Error Rate (WER) ≤ 5% (WER for professional terms ≤ 3%);
[0109] Text → Standardized Text: Accuracy ≥ 95% (integrity after removing invalid information);
[0110] Rich Media → Text: Recognition accuracy of key entities (places, risk types) ≥ 90%;
[0111] Cross-modal consistency: Semantic similarity (cosine similarity) of conversion results for different modality inputs ≥ 0.9.
[0112] Iterative optimization: Collect error cases in actual applications (such as unrecognized new terms like "intelligent smoke detector"), update the dataset monthly and fine-tune the model to ensure adaptation to new scenarios and new terms in the fire and safety domain.
[0113] Through the above construction and training process, the model has achieved three major capabilities:
[0114] Modality independence: Regardless of whether the input is voice, text, or rich media, unified standardized text can be output, solving the heterogeneity problem of multi-channel input;
[0115] Domain Specialization: Through in-depth training on safety and fire protection data, the recognition accuracy of specialized terms such as "fire hydrant" and "electrical hazard" is over 30% higher than that of general multimodal models.
[0116] Robustness: It can maintain stable output even in extreme scenarios such as strong noise and fuzzy input, meeting the complex environmental requirements of security and firefighting scenarios (such as factories and warehouses).
[0117] Ultimately, the model provides technical support for the "intelligent conversion" in step 1, ensuring that users' natural language requests (regardless of their form) can be accurately parsed into standardized text, laying the foundation for subsequent semantic analysis and risk assessment.
[0118] In specific applications, the system receives natural language safety and fire risk analysis request text, intelligently converts voice, text, or rich media input through an AI multimodal processing model, performs text standardization and validity verification, and generates standardized request text. AI technology runs through the entire process of input processing, text standardization, and validity verification. The specific process is as follows:
[0119] In the multi-channel input adaptation link, AI realizes intelligent conversion of different input forms through pre-trained multimodal processing models; for voice input, the AI speech recognition model first extracts features from the audio signal, captures the frequency and tone changes in the voice, and combines it with a dedicated corpus in the safety and fire protection field (containing a large number of voice samples of professional terms such as "fire hydrants" and "electrical hazards") for pattern matching, converting the voice waveform into a text sequence, and at the same time filtering out background noise through a noise reduction algorithm to ensure that colloquial expressions such as "the risk of congestion in the fire escape on the east side of the warehouse" can be accurately converted into text; for text input in instant messaging tools or emails, the AI text extraction model will scan the character encoding in the content, automatically remove non-text information such as emoticons and special symbols, retaining only valid text content, and can also recognize formatting tags of different platforms (such as DingTalk's @ symbol and enterprise WeChat's reference mark) and strip them off to extract the core request text.
[0120] During the text standardization processing stage, the AI natural language understanding model plays a key role; faced with garbled characters and repeated spaces in the original text, AI performs anomaly detection based on character encoding rules, automatically deletes characters that do not conform to the UTF-8 encoding standard, and merges consecutive repeated spaces through contextual semantic coherence analysis. In terms of punctuation unification, AI uses a trained punctuation recognition model to distinguish the usage scenarios of English commas and Chinese commas in context. For example, when "risk," appears in the Chinese sentence "Assess the fire risk in the workshop, the equipment needs to be checked", it will be automatically converted to "Assess the fire risk in the workshop, the equipment needs to be checked"; for case conversion, AI uses named entity recognition technology to identify proper nouns such as "XX Building" and "Fire Protection Law", retaining their first letter capitalized format, and converting the capital letters of non-proper nouns at the beginning of the sentence to lowercase, such as adjusting "Analyze the fire risk of XX Factory" to "analyze the fire risk of XX Factory"; when processing long texts, AI uses a semantic segmentation model to analyze the dependencies between sentences. When punctuation marks such as ";" and "." and conjunctions such as "in addition" and "in addition" are detected, they are determined to be semantic breakpoints and automatically marked as segmented to ensure that long texts are split into multiple independent semantic units.
[0121] In the preliminary effectiveness verification phase, the AI entity recognition model scans the standardized text word by word based on the entity annotation dataset in the field of safety and fire protection (including entity categories and corresponding vocabulary such as "place", "risk type", and "equipment", and identifies key entities in the text through word vector matching and context feature analysis; for example, in "Check the electrical short circuit risk of warehouse B", the model will label "warehouse B" as a "place entity" and "electrical short circuit risk" as a "risk type entity"; if no entity is identified after scanning the entire text, or only entities unrelated to the field of safety and fire protection are identified (such as "weather", "date", etc.), AI will trigger the preset feedback mechanism and generate guidance prompts based on the user's historical input habits. For example, when the user has queried for "workshop" related risks many times, the prompt information will be more inclined to "Please add the specific place, such as 'Analyze the risks of workshop No. 3'".
[0122] Through the in-depth application of AI technology, this invention achieves accurate processing of diverse input forms. Users can naturally express their needs without learning specific formats, greatly improving the efficiency of human-computer interaction. AI's accurate recognition of professional terms and standardized processing of text reduce analysis errors caused by non-standard input. Intelligent guidance prompts reduce the difficulty of user operation and ensure that the obtained request text is more in line with risk analysis needs.
[0123] In a preferred embodiment of the present invention, step 2, based on the standardized request text, is processed using a semantic parsing rule base preset in the field of fire safety to extract risk analysis objectives, key entities, and spatial constraints to generate structured semantic information, including:
[0124] Step 21: Process the standardized request text, perform word segmentation and part-of-speech tagging using a domain dictionary preset in the security and fire protection field, and obtain a word segmentation sequence containing domain term tags;
[0125] Step 22: Process the word segmentation sequence, perform pattern matching through an entity relationship graph preset in the security and fire protection field, and identify and output a set of key entities in the request text;
[0126] Step 23: Process the context dependency between the key entity set and the word segmentation sequence, derive and output a computable spatial constraint expression through a set of spatial constraint parsing rules preset in the security and fire protection field;
[0127] Step 24: Process the semantic framework of the key entity set, the spatial constraint expression, and the word segmentation sequence, and infer and output a core risk analysis target description through a target intent recognition rule set preset in the security and fire protection field;
[0128] Step 25, processing the key entity set, the spatial constraint expression and the core risk analysis target description, encoding them according to the preset structured information, and generating a structured semantic information object containing the risk analysis target, key entities and spatial constraints.
[0129] In an embodiment of the present invention, the above-mentioned step 21 receives the standardized request text generated in step 1 (for example, "Assess the overload risk of electrical equipment in the warehouse on the west side of Factory A") and performs basic cleaning on the text: removing invalid symbols remaining in the text (such as extra spaces and special punctuation marks), and ensuring that the text character encoding is unified (such as UTF-8 format) to avoid affecting subsequent processing due to formatting issues.
[0130] Call the preset domain dictionary in the security and fire protection field, which contains three core contents:
[0131] Fire safety professional terminology database: such as "electrical equipment", "overload risk", "warehouse", "factory area" and other field-specific terms;
[0132] Term category label: bind each professional term to a category within the field (e.g., "warehouse" corresponds to "location term," "electrical equipment" corresponds to "equipment term," "overload risk" corresponds to "risk type term");
[0133] Term priority rule: This rule prioritizes specialized terms over general terms (e.g., the overall term "electrical equipment" has a higher priority than the general terms "electrical" and "equipment").
[0134] Word segmentation operation based on domain dictionary:
[0135] Use the "longest match first" principle to segment the standardized text:
[0136] Starting from the beginning of the text, scan word by word and compare with the terms in the domain dictionary, giving priority to matching the longest professional terms (for example, when scanning "electrical equipment", it is directly matched as a whole term instead of being split into "electrical" and "equipment"); for content that is not matched in the domain dictionary (such as general words such as "assessment", "inside", and "of"), it is split into basic words according to general word segmentation rules (for example, splitting "assessment" into independent verbs and "inside" into directional words); and finally forming a preliminary word segmentation result (for example, the preliminary word segmentation of the above example text is: "assessment", "factory A", "west side", "warehouse", "inside", "electrical equipment", "of", and "overload risk").
[0137] Double mark the word segmentation results:
[0138] General part-of-speech tagging adds general grammatical parts of speech to each word (such as "assessment" is marked as "verb", "west side" is marked as "directional word", and "of" is marked as "particle"); combined with the domain dictionary, domain category labels are added to the matched professional terms (such as "A factory area" is marked as "place type term", "warehouse" is marked as "sub-place type term", "electrical equipment" is marked as "equipment type term", and "overload risk" is marked as "risk type term"); for non-domain words (such as "assessment", "west side", "inside", and "of"), only general part-of-speech tagging is retained, and no domain category labels are added.
[0139] Verify the marked word segmentation sequence:
[0140] Check whether there are any cases where professional terms are incorrectly split (for example, if "fire hydrant" is split into "fire fighting" and "hydrant", the correction mechanism will be triggered, and it will be merged into "fire hydrant" according to the domain dictionary and labeled as "equipment term"); confirm the consistency of the domain term category annotation and the text context (for example, "warehouse" is correctly labeled as "sub-site term" in the context of "within the factory area" rather than other categories), and after correction, form the final "word segmentation sequence containing domain term annotation" (for example, the final word segmentation sequence of the above example is: "evaluation (verb)", "factory area A (site term)", "west side (directional word)", "warehouse (sub-site term)", "inside (directional word)", "electrical equipment (equipment term)", "of (particle)", "overload risk (risk type term)").
[0141] In step 22 above, a preset entity relationship graph for the field of fire safety is loaded (the graph includes entity types such as "place", "equipment", "risk source", "protective facilities", etc., as well as association relationships between entities such as "include", "adjacent", "trigger", etc.), and word-by-word matching is performed on the word sequence obtained in step 21.
[0142] During the matching process, domain terms in the segmented word sequence are compared with entity types in the graph. The terms' context within the text is also considered (for example, in "Warehouse A of Factory XX," "Warehouse A" belongs to the "place" category and is included in "Factory XX") to identify key entities with practical safety and fire safety significance. For example, from the query "Please assess the short-circuit risk of the power distribution room in Factory B and the capacity of the surrounding fire escapes," the following key entity set can be identified: {"Factory B [place]," "Power distribution room [place]," "Short-circuit risk [risk source]," "Fire escape [protective facility]"}.
[0143] In step 23 above, the spatial constraint parsing rule set preset in the field of fire safety is called (this rule set contains the parsing logic for spatial terms such as directional words, range words, and distance descriptions, such as "surrounding", "east side", and "no more than X meters away from XX"). The spatial description in natural language is parsed by combining the key entity set obtained in step 22 above and the contextual dependency relationship of the word sequence (such as the connection relationship such as "in..." and "near...").
[0144] For example, for "analyzing the storage risks of flammable materials within 30 meters of Warehouse C", the system will use rules to analyze the spatial association between "within 30 meters" and the key entity "Warehouse C", and derive a computable spatial constraint expression: "within the circular area with a radius of 30 meters based on the coordinates of the center point of Warehouse C".
[0145] In step 24 above, the target intent recognition rule set preset in the field of fire safety is loaded (this rule set associates key entities, spatial constraints, and common risk analysis target types, such as "risk level assessment," "hazard investigation scope," and "accident spread prediction"). Combined with the key entity set in step 22 above, the spatial constraint condition expression in step 23 above, and the semantic framework of the word sequence (i.e., the logical relationship between terms, such as "analyze the risk of..." where "analyze" is the action and "risk" is the object), the core risk analysis target is inferred.
[0146] For example, combining the key entities "distribution room [location]" and "short circuit risk [risk source]", the spatial constraint "working days 8:00-18:00", and the semantic framework "assess the possibility of...", it can be inferred that the core risk analysis objective is "assess the possibility of short circuit risk in the distribution room between 8:00-18:00 on working days".
[0147] In step 25 above, according to the preset structured information template (the template contains three core fields: "risk analysis objectives", "key entity list" and "spatial constraints", each field has specific information format requirements), the key entity set of step 22, the spatial constraint expression of step 23, and the core risk analysis objective description of step 24 are coded and integrated.
[0148] For example, the list of key entities is organized in the form of "entity type: entity name", spatial constraints are described in standardized text, and risk analysis objectives are presented in concise declarative sentences. Finally, a structured semantic information object (such as a structured data unit containing the above three fields) is generated to provide semantic input in a unified format for subsequent steps.
[0149] The present invention uses tools such as domain dictionaries and entity relationship graphs to specifically process security and fire protection terminology, avoid ambiguity in general semantic analysis, and ensure accurate extraction of key information; convert unstructured natural language requests into structured data containing targets, entities, and spatial constraints, which can reduce the complexity of subsequent processing; and derive computable spatial constraint expressions and core goals through rule sets, so that abstract natural language descriptions are converted into specific parameters that can be directly used for analysis.
[0150] In a preferred embodiment of the present invention, step 3, based on the structured semantic information, matching professional knowledge fragments from the fire safety knowledge base to generate a knowledge enhancement context, includes:
[0151] Step 31: Based on the structured semantic information object, the risk analysis target description, key entity set, and spatial constraint condition expression contained therein are parsed to generate a multi-dimensional search query vector adapted to the fire safety knowledge base;
[0152] Step 32: Execute the multi-dimensional search query vector to perform a parallel search on the text knowledge items, graph relationship nodes, and case fragments stored in the fire safety knowledge base to obtain an initial set of matching knowledge fragments;
[0153] Step 33: Process the initial set of matching knowledge fragments and the structured semantic information object, calculate the semantic relevance of each knowledge fragment with the risk analysis target description and key entities using a preset relevance sorting algorithm, and generate a sequence of selected knowledge fragments sorted in descending order of relevance;
[0154] Step 34 , processing the selected knowledge fragment sequence, structurally reorganizing the contents of the top N knowledge fragments in the sequence and connecting them with the context, to generate a knowledge-enhanced context data object containing professional knowledge support.
[0155] In an embodiment of the present invention, the above step 31 parses the core elements in the structured semantic information object: extracts key intent keywords (such as "short circuit risk assessment" and "fire spread prediction") from the "core risk analysis target description"; extracts entity types and attribute labels (such as "distribution room [location type], short circuit [risk source type]") from the "key entity set"; and extracts spatial feature parameters (such as "30-meter range [distance parameter], warehouse perimeter [orientation feature]") from the "spatial constraint expression".
[0156] These elements are then mapped into multidimensional search dimensions (including "semantic intent," "entity type," and "spatial feature") that are compatible with the fire safety knowledge base. Key information from each dimension is then converted into components of a search vector. For example, if the risk analysis objective is "assess the short-circuit risk in the distribution room," the key entities are "distribution room, short circuit," and the spatial constraint is "within plant B," the multidimensional search vector would include dimensions such as "short-circuit risk assessment" (semantic intent), "distribution room - location, short circuit - risk source" (entity type), and "plant B scope" (spatial feature), ensuring compatibility with the knowledge base's indexing system.
[0157] In step 32, the multi-dimensional search query vector generated in step 31 is called to perform a parallel search on the fire safety knowledge base. The fire safety knowledge base contains three core categories of content:
[0158] Text knowledge items (such as safety and fire regulations, equipment operating procedures, risk assessment standards, etc., such as the determination clauses on short-circuit risks in distribution rooms in the "Guidelines for Electrical Fire Risk Assessment"); graph relationship nodes (such as association rules between entities, such as "short-circuit risk-related equipment-circuit breaker" and "distribution room-includes-cable lines" and other relationships); case snippets (such as historical risk analysis cases of similar scenarios, such as "2023 short-circuit risk assessment case of a distribution room in a certain factory area").
[0159] During the retrieval process, the fragments related to each dimension of the retrieval vector are matched simultaneously in the above three types of content (for example, matching the relevant standards of "short circuit in distribution room" in text entries, matching the equipment nodes associated with "short circuit risk" in the atlas, and matching the relevant cases of "distribution room in factory area" in the case). Finally, all matching results are summarized to form an initial set of matching knowledge fragments.
[0160] In step 33 above, a preset relevance ranking algorithm is loaded, and the relevance of each knowledge fragment is calculated from three dimensions by combining the initial matching knowledge fragment set and the structured semantic information object:
[0161] Semantic relevance determines whether the content of the knowledge segment is consistent with the intention of the risk analysis goal (for example, the relevance of the “short circuit risk assessment” goal to the “short circuit cause analysis” segment is higher than that to the “fire fighting process” segment).
[0162] Entity matching degree, which counts the number of key entities contained in the knowledge fragment and the degree of type matching (for example, the matching degree of the fragment containing "distribution room" and "short circuit" entities is higher than that of the fragment containing only "warehouse" entities).
[0163] Spatial fit: if the knowledge fragment involves spatial description, evaluate its matching degree with the spatial constraint conditions (e.g., the fragment related to “within 30 meters of the factory area” has a higher fit with the spatial constraint “within factory area B”).
[0164] Based on the comprehensive evaluation of the above dimensions, the knowledge fragments in the initial set are scored and sorted from high to low according to the relevance score to generate a sequence of selected knowledge fragments.
[0165] In step 34 above, a threshold N is set (e.g., N=5, which can be adjusted dynamically according to the scenario) to select the top N fragments in the sequence of selected knowledge fragments. Subsequently, these fragments are structurally reorganized: first, the core ideas of each fragment are extracted (e.g., the basis for judgment in standard clauses, key conclusions in cases), and then contextual connections are made according to the logical order of risk analysis objectives (e.g., "risk causes → assessment indicators → prevention and control measures") to ensure that the expressions between fragments are coherent and non-repetitive.
[0166] For example, if the first three fragments are "Distribution room short circuit risk assessment standards", "Correlation map between short circuit and cable aging", and "Case analysis of short circuit in a certain factory area", after reorganization, they will form the following coherent content: "According to the "Guidelines for Electrical Fire Risk Assessment", the short circuit risk in the distribution room needs to assess the degree of cable aging (standard clause); entity association shows that cable aging is the main cause of short circuit (map relationship); in a case in 2023, the probability of short circuit in a similar factory area due to cable aging reached 30% (case data)", and finally generate a knowledge-enhanced context data object with professional knowledge support.
[0167] The present invention uses multi-dimensional retrieval vectors and relevance sorting to ensure that professional knowledge that is highly relevant to the analysis target and key entities is screened out from the knowledge base, avoiding interference from irrelevant information; through structured reorganization and logical connection, scattered knowledge fragments are transformed into coherent contexts, which can reduce information integration costs.
[0168] In a preferred embodiment of the present invention, step 4 analyzes the structured semantic information. If there is a data query requirement, an SQL statement is generated by converting natural language to structured query language, and business data results with spatial coordinates are obtained from the security and fire protection platform database, including:
[0169] Step 41: parsing the structured semantic information object, extracting the spatial constraint expression and the key entity set therein, and generating computable spatial query elements;
[0170] Step 42: Analyze the spatial query element. If it contains a valid spatial range definition and an associated entity identifier, it is determined that there is a data query demand, and the SQL generation process is triggered.
[0171] Step 43: In response to the data query requirement, the spatial constraint expression and the entity identifiers in the key entity set are mapped into database operation logic through a preset natural language to structured query language conversion rule to generate a target SQL query statement;
[0172] Step 44: execute the target SQL query statement, access the spatial business data table of the security and fire protection platform database, and obtain the original business data set containing the spatial coordinate field;
[0173] Step 45 : Process the original business data set, perform format conversion and coordinate system calibration on the spatial coordinates according to preset spatial data standardization rules, and generate a business data result set with unified spatial coordinates.
[0174] In an embodiment of the present invention, the above step 41 parses the core content of the structured semantic information object: extracts specific spatial range parameters (such as "a circular area with a radius of 30 meters centered on warehouse C" and "within the east boundary of factory area B") from the "spatial constraint expression" to determine the spatial boundary of the query; extracts the unique identification information of the entity from the "key entity set" (such as "distribution room ID: P0012" and "fire passage number: F007", etc., which correspond to the storage ID of the entity in the security and fire platform database); then, integrates the spatial range parameters with the entity identification to form a spatial query element that can be directly used for database query; for example, if the spatial constraint is "50 meters around XX workshop" and the key entity is "workshop ID: W003", the spatial query element will include information such as "spatial range: 50 meters outward from the center point of W003" and "associated entity ID: W003".
[0175] In step 42, the validity of the spatial query element generated in step 41 is checked. First, the completeness of the spatial range definition is checked (e.g., whether it contains the determined center coordinates, distance, or boundary range), and then the entity identifier matching the database is confirmed in the key entity set (e.g., whether the ID exists in the entity list of the database). If both are valid (e.g., "there is a determined 30-meter range definition and the associated entity ID is searchable in the database"), it is determined that there is a data query requirement, and the SQL generation process is automatically triggered. If the spatial range is uncertain (e.g., only the "surrounding area" is described without marking the distance) or the entity identifier is invalid (e.g., the ID does not exist), the query is not triggered for the time being, and information is supplemented in subsequent steps.
[0176] In step 43 above, a preset natural language to SQL conversion rule is called (the rule includes a mapping relationship between spatial query logic and SQL syntax, such as "within a circular area" corresponds to the "ST_Within(coordinates, ST_Buffer(center point, radius))" spatial function, and "associated entity" corresponds to the "WHERE entity ID = 'XXX'" condition), to convert the spatial constraint expression and entity identifier into an operation logic executable by the database.
[0177] For example, to query the fire hydrant data within 30 meters of the distribution room in Factory B, the conversion rule will map "within Factory B" to the filtering condition of "Factory ID = 'B001'" and "30 meters around the distribution room" to the spatial condition of "ST_Distance(fire hydrant coordinates, distribution room coordinates) ≤ 30". Finally, a complete SQL query statement is generated that includes entity filtering and spatial range restrictions, ensuring compatibility with the database's spatial data query syntax.
[0178] In step 44 above, the generated target SQL query statement is executed to access the dedicated data tables in the fire safety platform database that store spatial business data (these tables contain spatial coordinate fields for various entities, such as the "firefighting facilities table" containing "longitude and latitude" fields, and the "equipment installation table" containing "X / Y plane coordinates" fields, etc.); during the query process, the database filters according to the conditions of the SQL statement and returns all records that meet the spatial range and entity association requirements to form the original business data set; for example, when querying "fire hydrants within 30 meters around the distribution room", the returned data set will contain information such as the fire hydrant's ID, type, status, and corresponding latitude and longitude coordinates.
[0179] In step 45 above, the spatial coordinates in the original business data set are processed according to the preset spatial data standardization rules: first, coordinates in different formats (e.g., some records in the "degrees, minutes, seconds" format and some in the "decimal degrees" format) are uniformly converted to the database default coordinate format (e.g., decimal degrees); then, a coordinate system calibration tool is used (e.g., converting local plane coordinates to the national unified geographic coordinate system) to ensure that all coordinates are in the same spatial reference system; the resulting business data result set contains both entity attribute information (e.g., equipment status, installation time) and spatial coordinates in a unified format, which can be directly used for subsequent spatial topology analysis and risk zoning.
[0180] The present invention eliminates the need for manual SQL statement compilation and automatically generates query instructions through rule mapping, significantly improving data acquisition efficiency and lowering the operational threshold. Through coordinate standardization and calibration, spatial data from different sources are placed in the same coordinate system, providing accurate basic data for subsequent spatial analysis and avoiding analysis errors caused by coordinate differences. Data is filtered based on spatial constraints and entity identifiers in structured semantic information to ensure that the acquired business data is highly relevant to risk analysis objectives and reduce interference from invalid data.
[0181] In a preferred embodiment of the present invention, step 5, based on the spatial coordinates in the business data result, dynamically determining three spatial reference positions by a spatial topological relationship analysis algorithm, includes:
[0182] Step 51: Based on the business data result set, extract a set of spatial coordinate points and calculate the kernel density estimation value of each point to generate a set of coordinate points with density attributes;
[0183] Step 52: Process the set of coordinate points with density attributes, filter out coordinate points with density values greater than a preset threshold, and obtain a high-density coordinate point subset;
[0184] Step 53: Based on the high-density coordinate point subset, points whose mutual Euclidean distance is less than a connectivity threshold are grouped into the same region; a weighted average density value calculation is performed on the points in each region to generate a density core region centroid coordinate set;
[0185] Step 54, processing the density core area centroid coordinate set, calculating the distance matrix between all centroid coordinates; selecting three centroid coordinate combinations that meet the minimum spacing constraint, with the goal of maximizing the number of original coordinate points covered by the combination, and outputting the final three spatial reference position coordinates.
[0186] In an embodiment of the present invention, the above step 51 extracts all spatial coordinate points (these coordinate points correspond to the actual locations of safety and fire protection related entities, such as equipment installation points, hidden danger occurrence points, etc.) from the business data result set to form an original coordinate point set; then, the density of point distribution around each coordinate point is analyzed by the kernel density estimation method, that is, the distance between each point and other surrounding points is calculated. The closer the distance and the more surrounding points, the higher the density attribute value of the point; finally, a corresponding density value is assigned to each original coordinate point to generate a coordinate point set with density attributes containing "coordinate position and density attributes" to reflect the density of entity distribution in different areas.
[0187] In step 52 above, a preset density threshold is set (this threshold is set based on historical data or scenario requirements, for example, "the point density in the area is 1.5 times higher than the average density"), and the set of coordinate points with density attributes generated in step 51 is filtered. Coordinate points with density values greater than the threshold are retained, and sparse points with density values lower than the threshold are removed. Through this operation, the area with the densest entity distribution is focused on, and a high-density coordinate point subset is obtained, laying the foundation for the subsequent determination of the core area.
[0188] In step 53, the high-density coordinate point subset is region-merged. This involves calculating the Euclidean distance (i.e., straight-line distance) between any two points in the subset. If the distance between the two points is less than a preset connectivity threshold (e.g., 50 meters, adjusted based on the scene scale), the two points are merged into the same region. This process is repeated until all points are assigned to corresponding regions, forming multiple independent dense regions.
[0189] For each dense area, the density value weighted average calculation is performed on the coordinates of all points in the area. That is, the higher the density value of the point, the greater the weight in the calculation. The final coordinates are the "center of gravity coordinates" of the area (which can be understood as the most representative center position in the area). The center of gravity coordinates of all areas are summarized to generate the center of gravity coordinate set of the density core area.
[0190] In step 54 above, the distances between all the centroids in the set of centroid coordinates of the density core area (i.e., the distance matrix) are calculated to ensure that the distance between any two centroids meets the preset minimum distance constraint (e.g., not less than 200 meters to avoid excessive concentration of the reference positions). From all the three centroid combinations that meet the distance constraint, the combination with the largest number of original coordinate points covered is selected, i.e., the total number of original coordinate points that can be covered by the three centroids of each combination is counted (i.e., the number of original points that fall within a certain range around the three centroids). The combination with the largest number of covered points is selected as the final result, and the coordinates of the three centroids are output as the spatial reference positions.
[0191] Through kernel density analysis and high-density screening, the present invention ensures that the benchmark positions focus on the core area with dense entity distribution, reflecting the key spatial range of risk analysis; through minimum spacing constraints and maximum coverage, the three benchmark positions are evenly dispersed in space and cover as many original data points as possible; the entire process is based on the coordinate point calculation of real-time business data, and the benchmark positions can be automatically adjusted as the data is updated, avoiding the static deviation caused by fixed benchmarks and improving the dynamic adaptability of spatial analysis.
[0192] In a preferred embodiment of the present invention, based on the spatial reference position, dynamic risk partitions are generated; and spatial grid division operations are performed on the dynamic risk partitions to form discretized spatial analysis units, including:
[0193] Step 55, based on the three spatial reference position coordinates, using them as spatial topological connection points, generates an initial spatial topological unit set, including:
[0194] Step 551: construct a spatial topological connection relationship matrix based on the three spatial reference position coordinates, wherein each reference position serves as a matrix vertex;
[0195] Step 552: Process the spatial topological connection relationship matrix, calculate the minimum radius of the circumscribed circle that satisfies the empty circle characteristic, and generate spatial topological edges that connect the three reference positions and do not intersect with each other to obtain an initial spatial topological unit set.
[0196] Step 56: Process the initial spatial topological unit set and the business data result set, analyze the density distribution of spatial coordinate points contained in each topological unit, aggregate adjacent topological units whose spatial continuity is higher than a merging threshold, and construct a risk partition spatial topological structure;
[0197] Step 57 : Process the spatial topology of the risk partitions, use the Voronoi space discretization algorithm to divide the internal space of the partitions into independent units with consistent geometric properties, and output a set of discretized space analysis units.
[0198] In an embodiment of the present invention, in the above step 551, the coordinates of the three spatial reference positions are regarded as three vertices (denoted as A, B, and C), and a matrix that records the connection relationship between the vertices is constructed; the matrix will mark the potential connection possibility between each vertex and other vertices (such as "A and B can be connected", "B and C can be connected", "A and C can be connected"), which serves as the basis for the subsequent generation of topological edges and determines the spatial association framework between the three reference positions.
[0199] In step 552, the potential connecting edges between the three vertices are analyzed, and the optimal topological edge is selected through the "empty circle feature", that is, the circumscribed circle corresponding to the edge formed by each pair of vertices is calculated (that is, the smallest circle that can contain this edge). If the circumscribed circle does not contain other business data coordinate points (empty circle feature), then the edge is a valid candidate edge; then, three edges with the smallest circumscribed circle radius are selected from the valid candidate edges (ensuring that the length of the edges is reasonable and there is no intersection), and the three vertices are connected to form a closed initial spatial topological unit (usually a triangular unit), and finally the initial spatial topological unit set is output.
[0200] In step 56 above, the spatial coordinate point density distribution of each unit in the initial spatial topological unit set is first analyzed. This involves counting the number of business data coordinate points contained in each topological unit and their uniformity of distribution, and calculating a "spatial continuity" index (i.e., whether the density changes between adjacent units are smooth; the smaller the change, the higher the continuity). Subsequently, a merging threshold (e.g., "spatial continuity ≥ 80%) is set, and adjacent initial topological units are evaluated. If the spatial continuity of two adjacent units exceeds the merging threshold, indicating similar density distribution characteristics, they are aggregated into a larger unit. This process is repeated until all adjacent units no longer meet the merging criteria, ultimately forming a risk zone spatial topological structure composed of aggregated units, with the zone boundaries consistent with the actual density distribution trend.
[0201] In step 57, for each partition in the risk partition spatial topology, key points (such as vertices and turning points) on its boundary are extracted as "generators". Subsequently, the Voronoi space discretization algorithm is applied, that is, based on these generators, the internal space of each partition is divided into multiple independent units. The distance from any point in each unit to the generator to which it belongs is smaller than the distance to other generators. Through this division, the geometric properties (such as shape and size) of each discretized spatial analysis unit are ensured to be relatively consistent, and the unit boundary matches the spatial distribution characteristics within the partition. Finally, a discretized spatial analysis unit set containing all independent units is output.
[0202] Through topological edge screening and unit aggregation, the present invention dynamically adjusts the risk partition boundaries according to the business data density distribution, avoiding the limitations of fixed partitions and being more in line with the actual spatial risk characteristics. The discretization processing based on the Voronoi algorithm ensures the uniformity of the geometric properties of each analysis unit, reduces the risk calculation deviation caused by unit shape differences, and improves the stability of subsequent analysis. The topological structure of the risk partition retains the adjacent relationship between units, providing a structured basis for the subsequent analysis of the propagation and association of risks in space, and enhancing the logic of spatial analysis.
[0203] In a preferred embodiment of the present invention, calculating a grid deformation gradient tensor as a risk distribution adjustment value based on the geometric deformation parameters of the spatial analysis unit includes:
[0204] Step 58: Process the discretized spatial analysis unit set, calculate the deformation displacement and displacement direction angle of each unit relative to the reference spatial structure, and generate a unit deformation feature data set; based on the unit deformation feature data set, perform deformation gradient calculation between adjacent units and output a set of spatial deformation gradient vectors;
[0205] Step 59: Process the set of spatial deformation gradient vectors and perform the following operations on each spatial analysis unit:
[0206] Step 591 , calculating the deformation gradient tensor component at the center of the spatial analysis unit based on the spatial deformation gradient vectors of the spatial analysis unit and its adjacent units;
[0207] Step 592: performing an eigenvalue decomposition operation on the deformation gradient tensor component to extract the maximum eigenvalue representing the deformation intensity and the corresponding main deformation direction vector;
[0208] Step 593: Combine the maximum eigenvalues and main deformation direction vectors of all spatial analysis units to generate a global risk distribution adjustment value matrix.
[0209] In an embodiment of the present invention, the above-mentioned step 58 takes the initial state of the discretized spatial analysis unit when the meshing is just completed as a reference (i.e., the state in which the mesh is not affected by external factors and the geometric shape is stable), and records the basic geometric information such as the vertex coordinates, boundary direction, and center position of each unit at this time to form a reference spatial structure database as the "original template" for subsequent deformation comparison.
[0210] Calculate unit deformation features (generate unit deformation feature dataset):
[0211] For each discretized spatial analysis unit, its current actual geometric state (including real-time vertex coordinates, boundary position, and center position) is obtained through the spatial monitoring data of the fire safety platform (such as the real-time positioning system and position information collected by structural sensors).
[0212] Compare the current geometric state to a reference spatial structure:
[0213] Calculate the "deformation displacement" by measuring the straight-line distance between the unit center position and the reference center position to determine the degree to which the unit as a whole deviates from its original position (for example, if the center of a unit is at point A in the reference state and is currently at point B, the straight-line length from A to B is the deformation displacement of the unit).
[0214] To calculate the "displacement direction angle," use the reference center position as the origin and measure the azimuth angle (e.g., true north is 0° and clockwise is the positive direction) to determine the deflection angle of the current center position relative to the reference center (e.g., if the center of a unit moves 30° east-southeast from the reference position, the displacement direction angle is 120°).
[0215] The deformation displacement and displacement direction angle of each unit are associated with the unit's unique identifier (such as the unit number) and integrated into a unit deformation feature dataset to fully record the deformation degree and direction of each unit.
[0216] Calculate the deformation gradient of adjacent units (generate a set of spatial deformation gradient vectors):
[0217] Determine the "adjacent cells" and identify the adjacent cells of each cell through spatial topological relationships, that is, cells that share a boundary or a vertex with the current cell and whose physical distance is within a preset threshold (such as 10 meters, adjusted according to the grid accuracy), to form an "adjacent cell list" for each cell.
[0218] Calculate the deformation difference between adjacent units. For each unit, extract the deformation displacement and displacement direction angle of the adjacent unit from its adjacent unit list and compare them with the deformation characteristics of the current unit:
[0219] If the deformation displacement of the adjacent unit is greater than that of the current unit, it means that the deformation of the adjacent area is more significant, and the difference between the two is the "deformation intensity gradient" (the larger the difference, the greater the gradient).
[0220] Combining the displacement direction angles of the two, the direction of the deformation difference is determined (for example, the current unit deforms toward the east, and the adjacent unit deforms toward the northeast. The direction difference between the two is the gradient direction).
[0221] The deformation gradient of each unit and its adjacent units is recorded in the form of a "vector". The length of the vector represents the magnitude of the deformation intensity gradient (i.e., the displacement difference), and the direction of the vector represents the direction of the deformation difference (i.e., the orientation corresponding to the angular difference). Such vectors of all units are integrated to form a set of spatial deformation gradient vectors, which reflects the deformation change trend between adjacent units in the entire domain.
[0222] The above step 591, calculating the deformation gradient tensor component of the center of the spatial analysis unit, includes:
[0223] The deformation gradient vectors of the current unit and each adjacent unit are collected, and the components of these vectors in different spatial directions (such as east-west and south-north) (i.e., the projections of the vectors on each coordinate axis) are counted. These components are combined through weighted calculation (the closer the adjacent units are, the greater the weight) to obtain a value that reflects the rate of deformation change of the center position of the current unit in each spatial direction, namely the "deformation gradient tensor component". These components correspond to the "rate of change" of the tensor in different directions (for example, the east-west component reflects the speed of deformation change in the east-west direction, and the south-north component reflects the speed of deformation change in the north-south direction).
[0224] The above step 592, extracting the maximum eigenvalue and the main deformation direction vector, includes:
[0225] Perform eigenvalue decomposition on the deformation gradient tensor components of each unit. This process essentially extracts the "key indicators" that best represent the overall deformation characteristics from the complex tensor information:
[0226] "Maximum eigenvalue" will obtain multiple eigenvalues after decomposition, among which the eigenvalue with the largest value directly reflects the "intensity" of the unit deformation. The larger the eigenvalue, the more severe the deformation of the unit and its surroundings (for example, the maximum eigenvalue of a unit is 5, and that of another unit is 2, which means that the deformation intensity of the former is 2.5 times that of the latter).
[0227] The "main deformation direction vector" is the eigenvector corresponding to the maximum eigenvalue, and its direction is consistent with the most significant deformation direction of the unit (for example, the main deformation direction vector of a unit points to the southeast, indicating that the main deformation of the unit is stretching or compressing in the southeast direction).
[0228] The above step 593, generating a global risk distribution adjustment value matrix, includes:
[0229] Based on the actual distribution position of the spatial analysis unit, the maximum eigenvalue (reflecting the deformation intensity) and the main deformation direction vector (reflecting the dominant direction of deformation) of all units are integrated into a matrix according to the grid arrangement order (such as from left to right, from top to bottom):
[0230] The rows and columns of the matrix correspond to the row and column positions of the cells in space (e.g., row 3, column 5 corresponds to cell 3, row 5, and cell 5 in the grid).
[0231] Each element of the matrix contains two pieces of information: the maximum eigenvalue of the location unit (used to quantify the impact of deformation on risk) and the main deformation direction vector (used to determine the directional weight of risk adjustment); the final generated global risk distribution adjustment value matrix completely covers the entire analysis area and realizes the accurate recording of the risk adjustment parameters of each discretized spatial analysis unit.
[0232] The present invention calculates the deformation displacement, direction angle and gradient of adjacent units in steps, comprehensively characterizing the changes in spatial structure from "single unit deformation" to "adjacent unit deformation difference", avoiding risk assessment deviation caused by ignoring subtle deformation; extracting the maximum eigenvalue and main deformation direction vector through eigenvalue decomposition, and refining key influencing factors from multi-dimensional deformation information, which not only simplifies the calculation dimension of risk adjustment, but also ensures that the core deformation characteristics are not lost, making the adjustment logic clearer; the global risk distribution adjustment value matrix directly links the deformation characteristics of each unit with the risk adjustment parameters, so that the risk analysis can dynamically correct the assessment results according to the real-time changes of the spatial structure (such as the risk weight of the severely deformed area is automatically increased), greatly improving the spatial adaptability and accuracy of risk assessment.
[0233] In a preferred embodiment of the present invention, step 6, generating spatial risk thermal data points describing spatial risk distribution based on the structured semantic information, the knowledge enhancement context, the business data results, and the risk distribution adjustment value, includes:
[0234] Step 61: Process the structured semantic information object, knowledge-enhanced context data object, business data result set, and risk distribution adjustment value matrix to perform multi-source data spatial alignment:
[0235] Parsing the spatial constraint expressions in the structured semantic information object to determine the boundaries of the target analysis area; mapping the professional rules in the knowledge-enhanced context data object to spatial coordinates; establishing a reference grid coordinate system based on the spatial coordinates of the business data result set to generate a spatially aligned multidimensional risk data cube;
[0236] Step 62: Based on the multi-dimensional risk data cube, perform risk factor fusion calculation:
[0237] The risk distribution adjustment value matrix is weighted as a deformation factor to the business data result set; the weighted result is modified by the professional rules in the knowledge enhancement context; the fusion weight is set according to the risk analysis target in the structured semantic information object to generate a spatial risk intensity distribution matrix;
[0238] Step 63: Map each unit in the spatial risk intensity distribution matrix to a spatial coordinate point, determine the risk intensity value and confidence parameter of the coordinate point, and obtain a set of thermal data points describing the spatial risk distribution.
[0239] In the embodiment of the present invention, the above step 61 is to determine the boundary of the target analysis area:
[0240] Parse the spatial constraint expressions in structured semantic information (such as "30 meters around the warehouse in the XX factory area"), and use the spatial coordinate conversion tool (based on preset geocoding rules) to convert the text description into a specific boundary coordinate range (such as the polygon area formed by X1-X2 east longitude and Y1-Y2 north latitude) to determine the spatial scope of the risk analysis.
[0241] Knowledge rules are associated with spatial coordinates:
[0242] Extract knowledge to enhance professional rules in context (such as "the storage volume of flammable materials exceeds 50kg / m 2 The risk level increases when the distance between fire hydrants exceeds 50 meters, and the coverage is insufficient). Through key entity matching (such as the "flammable material storage area" in the rule corresponds to the "warehouse A" in the business data), each rule is bound to a specific spatial coordinate area (such as the coordinate range of warehouse A), so that the abstract rules can be implemented in the actual spatial location.
[0243] Establish a reference grid coordinate system:
[0244] Based on the spatial coordinates in the business data result set (such as the latitude and longitude of equipment installation points and hidden danger locations), the target analysis area is divided into equal-scale grids (such as 10 meters × 10 meters / grid, and the grid size is dynamically adjusted according to the regional scale). Each grid is assigned a unique spatial index (such as "row number-column number").
[0245] Generate a multidimensional risk data cube:
[0246] Structured semantic information (such as "assessing the risk of fire spread"), knowledge rules (rule content bound to the grid), and business data (such as the number of equipment in each grid and the number of hidden dangers) are mapped to the corresponding grids respectively, forming a multidimensional data cube containing "spatial dimension (grid index) + semantic target + knowledge rules + business data". Each grid cell contains all the associated information of the location.
[0247] In step 62 above, the deformation factor weights the service data:
[0248] Extract the deformation gradient tensor (the tensor that reflects the impact of mesh geometric deformation on risk; greater deformation indicates a higher adjustment value) for each mesh in the risk distribution adjustment matrix. This tensor is then used as a weight and multiplied by the mesh's business data (such as the number of hidden dangers and equipment failures) to obtain a preliminary weighted result. For example, if a mesh's business data shows "three equipment failures" and the deformation adjustment value is 1.2 (a significant deformation), the preliminary result is 3 × 1.2 = 3.6.
[0249] Knowledge rule modifier weighted results:
[0250] The knowledge rules bound to each grid are used to correct the preliminary results. For example, if the rule is "Risk doubles when fire escapes are blocked," and the business data for that grid indicates "fire escapes are blocked," the preliminary result is multiplied by 2. If the rule is "Equipping an automatic fire extinguishing system reduces risk by 40%," and the grid has an automatic fire extinguishing system, the preliminary result is multiplied by 0.6. The corrected result = preliminary result multiplied by the rule correction factor (the factor is preset by the knowledge rule, e.g., "double" corresponds to 2, and "reduce" corresponds to 40%).
[0251] Dynamically assign weights based on analysis objectives:
[0252] According to the risk analysis objectives in the structured semantic information (such as "fire spread risk" and "equipment failure risk"), the fusion weight of each element is determined through the preset target-element association rules (based on safety and fire protection standards). For example:
[0253] If the target is "fire spread risk", the weight of "flammable material density" is 0.4, the weight of "firefighting facility coverage" is 0.3, and the weight of "deformation adjustment value" is 0.3;
[0254] If the target is "equipment failure risk", the weight of "equipment service life" is 0.5, the weight of "maintenance times" is 0.3, and the weight of "deformation adjustment value" is 0.2.
[0255] Generate a risk intensity distribution matrix:
[0256] For each grid, the "corrected weighted results" are summed according to the above target weights to obtain the risk intensity value of the grid; for example: after correction, the "combustible material density contribution is 2.5", "fire protection facility coverage contribution is 1.8", and "deformation adjustment contribution is 1.2" of a certain grid, and the target weights are 0.4, 0.3, and 0.3 respectively. Then the risk intensity value = 2.5×0.4+1.8×0.3+1.2×0.3=1.0+0.54+0.36=1.9; the risk intensity values of all grids are integrated into a risk intensity distribution matrix (rows / columns correspond to grid indices, and values are risk intensities).
[0257] Step 63 above, mapping of grid to space coordinates:
[0258] The coordinates of the center point of each grid (calculated based on the grid boundaries, such as the center point of a 10m×10m grid is the "coordinates of the upper left corner of the grid + 5m offset") are taken as the spatial coordinates of the thermal data point, where each data point corresponds to a unique physical location.
[0259] Determine the risk intensity value of the coordinate point:
[0260] The risk intensity value of each grid in the risk intensity distribution matrix is directly assigned to the coordinates of the grid center point as the risk intensity value of the thermal data point (for example, if the grid risk intensity is 1.9, the risk value of the corresponding coordinate point is 1.9).
[0261] Calculate the confidence parameter:
[0262] The confidence level reflects the reliability of the risk value and is determined by calculation based on three dimensions: data integrity, rule matching, and deformation data validity:
[0263] Data integrity: Count the total number of core data items that the grid should contain (dynamically determined based on the analysis objectives and grid type) and the number of core data items actually obtained. The ratio of the two is the data integrity index (for example, if 5 core data items are required and 4 are actually obtained, the data integrity is 4 / 5).
[0264] Rule matching degree: Extract the total number of rules that are strongly relevant to the current analysis target (filtered from the knowledge enhancement context), and count the number of strongly relevant rules actually matched in the grid. The ratio of the two is the rule matching degree index (for example, if there are 4 strongly relevant rules in total and 2 are actually matched, the rule matching degree is 2 / 4).
[0265] Deformation data validity: Combine the ratio of the number of coordinate points involved in the deformation adjustment value calculation to the theoretical minimum valid sample size, as well as the spatial distribution uniformity of these coordinate points (measured by calculating the distribution entropy or dispersion coefficient of the point set), and combine the two according to weights (e.g., 60% for number and 40% for distribution uniformity) to form the deformation data validity indicator (for example, if the actual number of points is 1.2 times the minimum sample size and the distribution uniformity is 0.8, then the validity is 1.2×0.6+0.8×0.4).
[0266] The total confidence is the weighted sum of the above three indicators (the weights are set according to the degree of influence of each dimension on the risk assessment, such as data integrity accounts for 30%, rule matching accounts for 30%, and deformation data validity accounts for 40%). The final result is presented in the form of a percentage (for example, data integrity is 0.8, rule matching accounts for 0.5, and deformation data validity is 0.9, then the total confidence is 0.8×0.3+0.5×0.3+0.9×0.4=0.75, that is, 75%).
[0267] Generate a set of thermal data points:
[0268] Integrate the "spatial coordinates + risk intensity value + confidence level" of each coordinate point to form a set of thermal data points that describe the spatial risk distribution, for example: (east longitude X, north latitude Y, risk value 1.9, confidence level 75%).
[0269] The present invention spatially aligns multi-source data to unify structured semantic information, professional knowledge rules, business data, and risk-adjusted values under the same spatial reference, resolving spatial misalignment and format conflicts among data from different sources and avoiding analytical biases caused by data inconsistencies. The risk factor fusion calculation in step 62 considers the impact of spatial deformation on risk (weighted deformation factors) and incorporates professional rules in the field of fire safety (knowledge correction). Weights are dynamically adjusted based on specific analysis objectives, achieving the integration of multidimensional risk factors. This fusion approach avoids the one-sidedness of single data or rule dominance, enabling the risk intensity distribution matrix to more realistically reflect the actual risk situation and improving the comprehensiveness and accuracy of the assessment. Step 63 maps the risk intensity matrix into thermal data points with spatial coordinates and quantifies the reliability of the results using confidence parameters. This transforms abstract risk data into intuitive and locatable spatial distribution information, enabling users to quickly identify the location and intensity of high-risk areas. The resulting set of thermal data points fully describes the distribution characteristics, intensity differences, and reliability of spatial risks, thereby improving the efficiency of fire safety management.
[0270] like Figure 2 As shown, an AI-based fire safety risk analysis system includes:
[0271] The receiving module is used to receive natural language safety and fire risk analysis request text, intelligently convert voice, text or rich media input through the AI multimodal processing model, perform text standardization and validity verification, and generate standardized request text;
[0272] A processing module is used to process the standardized request text using a semantic parsing rule library preset in the field of fire safety, extract risk analysis objectives, key entities, and spatial constraints, and generate structured semantic information;
[0273] A generation module, configured to match professional knowledge fragments from the fire safety knowledge base based on the structured semantic information to generate a knowledge enhancement context;
[0274] An acquisition module is configured to analyze the structured semantic information and, if a data query is required, generate an SQL statement using natural language to structured query language conversion rules to obtain business data results with spatial coordinates from the fire safety platform database; dynamically determine three spatial reference positions based on the spatial coordinates in the business data results using a spatial topological relationship analysis algorithm; generate dynamic risk partitions based on the spatial reference positions; perform spatial meshing operations on the dynamic risk partitions to form discretized spatial analysis units; and calculate a mesh deformation gradient tensor based on the geometric deformation parameters of the spatial analysis units as a risk distribution adjustment value;
[0275] A fusion module is used to generate spatial risk thermal data points describing spatial risk distribution based on the structured semantic information, the knowledge enhancement context, the business data results and the risk distribution adjustment value.
[0276] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.
Claims
1. An AI-based fire safety risk analysis method, characterized in that: The method comprises: Step 1: Receive a natural language safety and fire risk analysis request text, intelligently convert the voice, text, or rich media input using an AI multimodal processing model, perform text standardization and validity verification, and generate a standardized request text. Step 2: Based on the standardized request text, the request text is processed using a semantic parsing rule library preset in the field of fire safety to extract risk analysis objectives, key entities, and spatial constraints to generate structured semantic information. Step 3: Based on the structured semantic information, matching professional knowledge fragments from the fire safety knowledge base to generate a knowledge enhancement context; Step 4: Analyze the structured semantic information. If there is a data query requirement, generate SQL statements through the conversion rules from natural language to structured query language to obtain business data results with spatial coordinates from the security and fire protection platform database; Step 5: Based on the spatial coordinates in the business data results, dynamically determine three spatial reference positions using a spatial topological relationship analysis algorithm; generate dynamic risk partitions based on the spatial reference positions; perform spatial meshing operations on the dynamic risk partitions to form discretized spatial analysis units; and calculate mesh deformation gradient tensors based on the geometric deformation parameters of the spatial analysis units as risk distribution adjustment values. Step 6: Generate spatial risk thermal data points describing spatial risk distribution based on the structured semantic information, the knowledge enhancement context, the business data results, and the risk distribution adjustment value.
2. The AI-based fire safety risk analysis method according to claim 1 is characterized in that: Step 2: Based on the standardized request text, the request text is processed using a semantic parsing rule base preset in the field of fire safety to extract risk analysis objectives, key entities, and spatial constraints, generating structured semantic information, including: Step 21: Process the standardized request text, perform word segmentation and part-of-speech tagging using a domain dictionary preset in the security and fire protection field, and obtain a word segmentation sequence containing domain term tags; Step 22: Process the word segmentation sequence, perform pattern matching through an entity relationship graph preset in the security and fire protection field, and identify and output a set of key entities in the request text; Step 23: Process the context dependency between the key entity set and the word segmentation sequence, derive and output a computable spatial constraint expression through a set of spatial constraint parsing rules preset in the security and fire protection field; Step 24: Process the semantic framework of the key entity set, the spatial constraint expression, and the word segmentation sequence, and infer and output a core risk analysis target description through a target intent recognition rule set preset in the security and fire protection field; Step 25, processing the key entity set, the spatial constraint expression and the core risk analysis target description, encoding them according to the preset structured information, and generating a structured semantic information object containing the risk analysis target, key entities and spatial constraints.
3. The AI-based fire safety risk analysis method according to claim 2 is characterized in that: Step 3, based on the structured semantic information, matching professional knowledge fragments from the fire safety knowledge base to generate a knowledge enhancement context, including: Step 31: Based on the structured semantic information object, the risk analysis target description, key entity set, and spatial constraint condition expression contained therein are parsed to generate a multi-dimensional search query vector adapted to the fire safety knowledge base; Step 32: Execute the multi-dimensional search query vector to perform a parallel search on the text knowledge items, graph relationship nodes, and case fragments stored in the fire safety knowledge base to obtain an initial set of matching knowledge fragments; Step 33: Process the initial set of matching knowledge fragments and the structured semantic information object, calculate the semantic relevance of each knowledge fragment with the risk analysis target description and key entities using a preset relevance sorting algorithm, and generate a sequence of selected knowledge fragments sorted in descending order of relevance; Step 34 , processing the selected knowledge fragment sequence, structurally reorganizing the contents of the top N knowledge fragments in the sequence and connecting them with the context, to generate a knowledge-enhanced context data object containing professional knowledge support.
4. The AI-based fire safety risk analysis method according to claim 3 is characterized in that: Step 4: Analyze the structured semantic information. If there is a data query requirement, generate SQL statements based on the natural language to structured query language conversion rules to obtain business data results with spatial coordinates from the security and fire protection platform database, including: Step 41: parsing the structured semantic information object, extracting the spatial constraint expression and the key entity set therein, and generating computable spatial query elements; Step 42: Analyze the spatial query element. If it contains a valid spatial range definition and an associated entity identifier, it is determined that there is a data query demand, and the SQL generation process is triggered. Step 43: In response to the data query requirement, the spatial constraint expression and the entity identifiers in the key entity set are mapped into database operation logic through a preset natural language to structured query language conversion rule to generate a target SQL query statement; Step 44: execute the target SQL query statement, access the spatial business data table of the security and fire protection platform database, and obtain the original business data set containing the spatial coordinate field; Step 45 : Process the original business data set, perform format conversion and coordinate system calibration on the spatial coordinates according to preset spatial data standardization rules, and generate a business data result set with unified spatial coordinates.
5. The AI-based fire safety risk analysis method according to claim 4 is characterized in that: Step 5: Based on the spatial coordinates in the business data result, three spatial reference positions are dynamically determined by a spatial topology relationship analysis algorithm, including: Step 51: Based on the business data result set, extract a set of spatial coordinate points and calculate the kernel density estimation value of each point to generate a set of coordinate points with density attributes; Step 52: Process the set of coordinate points with density attributes, filter out coordinate points with density values greater than a preset threshold, and obtain a high-density coordinate point subset; Step 53: Based on the high-density coordinate point subset, points whose mutual Euclidean distance is less than a connectivity threshold are grouped into the same region; a weighted average density value calculation is performed on the points in each region to generate a density core region centroid coordinate set; Step 54, processing the density core area centroid coordinate set, calculating the distance matrix between all centroid coordinates; selecting three centroid coordinate combinations that meet the minimum spacing constraint, with the goal of maximizing the number of original coordinate points covered by the combination, and outputting the final three spatial reference position coordinates.
6. The AI-based fire safety risk analysis method according to claim 5 is characterized in that: generating dynamic risk zones based on the spatial reference positions; Performing a spatial grid division operation on the dynamic risk partition to form a discretized spatial analysis unit includes: Step 55, based on the three spatial reference position coordinates, use them as spatial topological connection points to generate an initial spatial topological unit set; Step 56: Process the initial spatial topological unit set and the business data result set, analyze the density distribution of spatial coordinate points contained in each topological unit, aggregate adjacent topological units whose spatial continuity is higher than a merging threshold, and construct a risk partition spatial topological structure; Step 57 : Process the spatial topology of the risk partitions, use the Voronoi space discretization algorithm to divide the internal space of the partitions into independent units with consistent geometric properties, and output a set of discretized space analysis units.
7. The AI-based fire safety risk analysis method according to claim 6, characterized in that: Step 55, based on the three spatial reference position coordinates, using them as spatial topological connection points, generates an initial spatial topological unit set, including: Step 551: construct a spatial topological connection relationship matrix based on the three spatial reference position coordinates, wherein each reference position serves as a matrix vertex; Step 552 : Process the spatial topological connection relationship matrix, calculate the minimum radius of the circumscribed circle that satisfies the empty circle characteristic, and generate spatial topological edges that connect the three reference positions and do not intersect each other to obtain an initial spatial topological unit set.
8. The AI-based fire safety risk analysis method according to claim 7 is characterized in that: Calculating a grid deformation gradient tensor as a risk distribution adjustment value based on the geometric deformation parameters of the spatial analysis unit includes: Step 58: Process the discretized spatial analysis unit set, calculate the deformation displacement and displacement direction angle of each unit relative to the reference spatial structure, and generate a unit deformation feature data set; based on the unit deformation feature data set, perform deformation gradient calculation between adjacent units and output a set of spatial deformation gradient vectors; Step 59: Process the set of spatial deformation gradient vectors and perform the following operations on each spatial analysis unit: Step 591 , calculating the deformation gradient tensor component at the center of the spatial analysis unit based on the spatial deformation gradient vectors of the spatial analysis unit and its adjacent units; Step 592: performing an eigenvalue decomposition operation on the deformation gradient tensor component to extract the maximum eigenvalue representing the deformation intensity and the corresponding main deformation direction vector; Step 593: Combine the maximum eigenvalues and main deformation direction vectors of all spatial analysis units to generate a global risk distribution adjustment value matrix.
9. The AI-based fire safety risk analysis method according to claim 8, characterized in that: Step 6, generating spatial risk thermal data points describing spatial risk distribution based on the structured semantic information, the knowledge enhancement context, the business data results, and the risk distribution adjustment value, including: Step 61: Process the structured semantic information object, knowledge-enhanced context data object, business data result set, and risk distribution adjustment value matrix to perform multi-source data spatial alignment: Parsing the spatial constraint expressions in the structured semantic information object to determine the boundaries of the target analysis area; mapping the professional rules in the knowledge-enhanced context data object to spatial coordinates; establishing a reference grid coordinate system based on the spatial coordinates of the business data result set to generate a spatially aligned multidimensional risk data cube; Step 62: Based on the multi-dimensional risk data cube, perform risk factor fusion calculation: The risk distribution adjustment value matrix is weighted as a deformation factor to the business data result set; the weighted result is modified by the professional rules in the knowledge enhancement context; the fusion weight is set according to the risk analysis target in the structured semantic information object to generate a spatial risk intensity distribution matrix; Step 63: Map each unit in the spatial risk intensity distribution matrix to a spatial coordinate point, determine the risk intensity value and confidence parameter of the coordinate point, and obtain a set of thermal data points describing the spatial risk distribution.
10. An AI-based fire safety risk analysis system, characterized by: The system is used to perform the method according to any one of claims 1 to 9, comprising: The receiving module is used to receive natural language safety and fire risk analysis request text, intelligently convert voice, text or rich media input through the AI multimodal processing model, perform text standardization and validity verification, and generate standardized request text; A processing module is used to process the standardized request text using a semantic parsing rule library preset in the field of fire safety, extract risk analysis objectives, key entities, and spatial constraints, and generate structured semantic information; A generation module, configured to match professional knowledge fragments from the fire safety knowledge base based on the structured semantic information to generate a knowledge enhancement context; An acquisition module is configured to analyze the structured semantic information and, if a data query is required, generate an SQL statement using natural language to structured query language conversion rules to obtain business data results with spatial coordinates from the fire safety platform database; dynamically determine three spatial reference positions based on the spatial coordinates in the business data results using a spatial topological relationship analysis algorithm; generate dynamic risk partitions based on the spatial reference positions; perform spatial meshing operations on the dynamic risk partitions to form discretized spatial analysis units; and calculate a mesh deformation gradient tensor based on the geometric deformation parameters of the spatial analysis units as a risk distribution adjustment value; A fusion module is used to generate spatial risk thermal data points describing spatial risk distribution based on the structured semantic information, the knowledge enhancement context, the business data results and the risk distribution adjustment value.
Citation Information
Patent Citations
Automatic interpretation method for spatial relationship rule in fire safety field based on ontology enhanced natural language processing
CN118296103A
Safety production detection data processing method and system based on digitization
CN119989244A