A semantic understanding-based intelligent retrieval method and system for security specifications

By constructing a knowledge graph of safety regulations and multi-dimensional weighted ranking, combined with dense vector indexes and full-text inverted indexes, the problem of insufficient semantic understanding and source tracing in construction safety regulations retrieval is solved, achieving highly accurate and reliable retrieval results.

CN123115392APending Publication Date: 2026-11-17CHINA HYDROELECTRIC ENGINEERING CONSULTING GROUP CHENGDU RESEARCH HYDROELECTRIC INVESTIGATION DESIGN AND INSTITUTE +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611442178.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-17
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing technologies for retrieving construction safety specifications suffer from insufficient semantic understanding, low cross-expression matching accuracy, a simplistic ranking mechanism, and difficulty in tracing the source.

Method used

By constructing a security specification knowledge graph, extracting structured metadata, establishing synonym mapping relationships, combining dense vector indexes and full-text inverted indexes, introducing multi-dimensional weighted sorting, and performing domain-adaptive fine-tuning on the large language model, a two-layer verification mechanism is achieved.

Benefits of technology

It improves the accuracy of cross-expression matching, accurately matches the normative requirements of actual engineering scenarios, ensures the accuracy and traceability of generated answers, and avoids security and compliance risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123115392A_ABST
    Figure CN123115392A_ABST
Patent Text Reader

Abstract

This invention primarily relates to the field of information retrieval technology. To address the issues of low accuracy and efficiency in retrieval of safety regulations for construction site hazard identification, this invention provides an intelligent retrieval method and system for safety regulations based on semantic understanding. First, the regulatory document is broken down into clauses with structured metadata. A safety regulation knowledge graph is constructed, and a synonym mapping between colloquial terms and regulatory terminology is established. A dense vector index and a full-text inverted index are also constructed. During retrieval, geographical location and hazard entities are extracted from the user's query request. These are expanded through the synonym mapping to generate preprocessed query features, which are then input into the dense vector index and the full-text inverted index for recall. The scores from both sources are merged to obtain a basic relevance score, yielding candidate clauses. These candidate clauses are then reordered based on their effectiveness level, regional applicability, timeliness, and hazard level based on the graph hop distance to obtain the target clauses. These target clauses, along with the query request, are fed into a large language model, outputting accurate, reliable, and traceable query results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of information retrieval technology, and in particular to a security-compliant intelligent retrieval method and system based on semantic understanding. Background Technology

[0002] In construction engineering, water conservancy engineering, and power engineering, safety regulations are the core legal basis for guiding on-site construction, preventing safety accidents, and issuing rectification opinions. Currently, my country's system of standards and regulations related to engineering safety is extremely vast and complex, encompassing national standards (GB series, such as GB 50720 "Code for Fire Protection at Construction Sites"), industry standards (JGJ series, such as JGJ59 "Standard for Safety Inspection of Building Construction", SL water conservancy standards, DL power standards), local standards (DB series), and internal management systems of various enterprises. Statistics show that the total number of relevant standards and regulations exceeds ten thousand, involving tens of thousands of semantic blocks of regulatory clauses. When conducting hazard identification, on-site safety management personnel need to accurately identify the mandatory regulatory clauses applicable to the current project location, current engineering type, and current hazard level from this massive and constantly updated set of regulations. This is an extremely demanding and labor-intensive task in actual engineering practice.

[0003] In recent years, with the development of information technology and artificial intelligence, the field of engineering safety supervision has begun to introduce electronic retrieval and intelligent question-answering technologies. Currently, retrieval technologies in the industry are mainly evolving along three stages: "literal matching," "general semantic matching," and "generative question answering." These mainly include the following three categories:

[0004] (1) Traditional keyword retrieval system based on full-text inverted index. This scheme divides the safety specification document into paragraphs and stores them in a relational database or a search engine such as Elasticsearch. After the user enters the query terms, the system uses algorithms such as TF-IDF or BM25 to build an inverted index for exact word matching and returns the search results based on the word frequency relevance score. This type of scheme is the default retrieval method built into most construction enterprise information systems.

[0005] (2) Retrieval methods based on general deep semantic networks and basic safety specification knowledge graphs. This type of approach uses general deep learning models to transform specification texts into dense vectors, or constructs engineering safety specification knowledge graphs for specific scenarios. When a user queries, the system calculates the cosine similarity between the query text vector and the specification text vector, or performs node matching in the graph to retrieve results.

[0006] (3) Question answering system based on general RAG large language model. With the popularization of large language models, some enterprises have begun to adopt the RAG architecture of "vector database + general large language model". The common process is as follows: use general embedding model to directly divide long standard PDF documents into blocks and put them into the database; when the user asks a question, the system retrieves the Top-K document blocks through simple semantic similarity, and then directly inputs them as context into the general large language model, which then summarizes and generates natural language answers.

[0007] However, existing technologies have the following main drawbacks in practical applications.

[0008] (1) The basic retrieval algorithm lacks semantic understanding and has low cross-expression matching accuracy. Traditional keyword retrieval systems rely on literal matching after word segmentation, which makes it difficult to handle the semantic differences between colloquial descriptions of potential hazards and academic expressions in standard texts during actual investigations, and is prone to missed detections. At the same time, general deep semantic models lack targeted fine-tuning for a large number of safety standard terms and engineering corpora, making it difficult to accurately capture the mapping relationship of professional terms.

[0009] (2) The existing sorting mechanism is too simplistic and lacks differentiation between the level of legal effect and the applicable region. Existing solutions usually rely solely on the surface similarity of the texts for sorting, ignoring the multidimensional constraints unique to safety regulations, such as the level of legal effect, regional applicability, and the level of hazard. This single-dimensional sorting method is prone to placing regulations that have no legal effect or are not located in the project area at the top, affecting the accuracy of rectification decisions.

[0010] (3) The general-purpose RAG question-answering system suffers from the "big language model illusion" problem during the generation stage, and its source is difficult to trace. In the absence of a system-level constraint mechanism, the big language model is easily affected by pre-training parameters, generating fictitious specification numbers or specification clauses. In safety supervision scenarios where accuracy is extremely important, such erroneous generation without traceable evidence can lead to serious safety and compliance risks. Summary of the Invention

[0011] This invention provides a method and system for intelligent retrieval of safety regulations based on semantic understanding, aiming to solve the problems of existing construction safety regulations retrieval being prone to missed detections, having low accuracy, and being difficult to trace.

[0012] The technical solution adopted by the present invention to solve the above-mentioned technical problems is as follows:

[0013] On the one hand, this invention provides a method for intelligent retrieval of security specifications based on semantic understanding, comprising the following steps:

[0014] S1: Break down the safety specification document into specification clauses, and extract the structured metadata of the specification clauses. The structured metadata includes the level of effectiveness, regional label, year of publication, specification number, and associated hazard type.

[0015] S2: Construct a safety standard knowledge graph based on the standard clauses; During the construction of the safety standard knowledge graph, extract the hazard classification nodes and standard term nodes from the standard clauses, and establish a synonym mapping relationship between non-standard words and standard terms. Store the synonym mapping relationship as a dictionary attribute in the safety standard knowledge graph.

[0016] S3: Encode each normative clause into a dense vector based on a semantic model to construct a dense vector index, and construct a full-text inverted index based on the text content of each normative clause;

[0017] S4: Extract the geographic location features and potential hazard entities from the user's input query request, expand the terminology of the potential hazard entities based on the synonym mapping relationship in the safety specification knowledge graph, and use the geographic location features and the expanded potential hazard entities together as preprocessed query features;

[0018] S5: Input the preprocessed query features into the dense vector index and the full-text inverted index respectively for recall, normalize and fuse the scores of the two recalls to obtain the basic relevance scores of each normative clause, and select the candidate clause set according to the set confidence threshold.

[0019] S6: Determine the validity weight, regional weight, and timeliness weight of each normative clause in the candidate clause set based on structured metadata; calculate the graph hop distance between each normative clause and the hidden danger entity based on the safety norm knowledge graph; determine the danger level weight of each normative clause; calculate the priority score of each normative clause based on the basic relevance score of each normative clause and the validity weight, regional weight, timeliness weight, and danger level weight; and sort and extract the target clause set according to the priority score.

[0020] S7: Combine the target terms set and the user's input query request into a prompt word context, inject structured constraints that limit the output format into the large language model, and drive the large language model to answer the user's input query request based on the original text of the normative terms set in the target terms set.

[0021] Furthermore, the semantic model described in S3 undergoes domain-adaptive fine-tuning. It uses colloquial descriptions of potential hazards from historical hazard investigation records as queries, the original text of corresponding normative clauses as positive samples, and normative clauses recalled based on a temporary BM25 corpus that are literally similar to the query but semantically unrelated as difficult negative samples. The InfoNCE loss function is then used to optimize the semantic model.

[0022] Furthermore, in S4, extracting the geographic location features and potential hazards from the user-input query request includes: when the user-input query request contains an image, extracting the location coordinates from the image and parsing them into geographic location features, while simultaneously calling a visual model to identify potential hazards in the image and converting them into text labels; when the user-input query request does not contain an image, extracting the geographic location features and potential hazards from the text of the user-input query request using a named entity recognition model.

[0023] Furthermore, the basic relevance score mentioned in S5 is:

[0024] ;

[0025] ;

[0026] ;

[0027] In the formula, Basic relevance score, These are the weighting coefficients. Cosine similarity score for dense vector indices. The BM25 score for the full-text inverted index. and They are respectively and The normalized value, and These represent the minimum and maximum scores, respectively.

[0028] Furthermore, the weighting coefficients It is 0.7.

[0029] Furthermore, when the regulatory clause is a mandatory regulation, its weight is greater than 1; when the regulatory clause is a recommended regulation, its weight is equal to 1; and when the regulatory clause is a repealed regulation, its weight is 0.

[0030] When the regional label of a standard clause perfectly matches the geographical location feature, the regional weight is greater than 1; when the standard clause is a nationally applicable standard, the regional weight is equal to 1; when the regional label of a standard clause and the geographical location feature belong to a local standard in another region, the regional weight is less than 1.

[0031] The closer the year of publication of the regulatory clauses is to the present time, the greater the weight of timeliness.

[0032] When the distance between the standard clause and the hazard entity in the safety standard knowledge graph is 1, the hazard level weight is greater than 1; when the distance between the standard clause and the hazard entity is greater than or equal to 2, the hazard level weight is greater than 1 and less than the hazard level weight when the distance between the standard clause and the hazard entity is 1; when there is no hazard association, the hazard level weight is equal to 1.

[0033] Furthermore, the priority score described in S6 is:

[0034] ;

[0035] in, Score based on priority. Basic relevance score, For effectiveness weight, As a weight for the risk level, For regional weight, Timeliness weighting.

[0036] Furthermore, S6 also includes: when the highest priority score after descending sorting is lower than a preset threshold, reducing the confidence threshold in S5 or increasing the recall quantity to expand the scope of the candidate clause set for degenerate query retry; when the degenerate query retry exceeds a preset number of times, canceling the exclusion penalty of regional weight, forcibly recalling out-of-region standard clauses and attaching a prompt label.

[0037] Furthermore, S7 also includes: performing consistency comparison and verification between the standard number in the large language model's response content and the standard number in the target clause set, and performing fidelity comparison and verification between the original text of the standard clause in the large language model's response content and the corresponding original standard clause text in the target clause set. When any verification fails, it triggers error correction retry or downgrades the display of the original standard clause.

[0038] On the other hand, the present invention also provides a security specification intelligent retrieval system based on semantic understanding, the system comprising:

[0039] The document parsing module is used to break down the safety specification document into specification clauses and extract the structured metadata of the specification clauses. The structured metadata includes the level of effectiveness, regional label, year of publication, specification number and associated hazard type.

[0040] The safety specification knowledge graph construction module is used to construct a safety specification knowledge graph based on specification clauses. During the construction of the safety specification knowledge graph, hazard classification nodes and specification terminology nodes are extracted from the specification clauses. At the same time, a synonym mapping relationship between non-standard words and specification terms is established, and the synonym mapping relationship is stored as a dictionary attribute in the safety specification knowledge graph.

[0041] The index building module is used to encode each specification clause into a dense vector based on a semantic model to build a dense vector index, and to build a full-text inverted index based on the text content of each specification clause;

[0042] The multimodal parsing module is used to extract geographic location features and potential hazard entities from the user's input query request. Based on the synonym mapping relationship in the safety specification knowledge graph, the potential hazard entities are expanded into terms. The geographic location features and the expanded potential hazard entities are used together as preprocessed query features.

[0043] The hybrid retrieval engine is used to input preprocessed query features into the dense vector index and the full-text inverted index for recall, normalize and fuse the scores of the two recalls to obtain the basic relevance scores of each normative clause, and filter out the candidate clause set according to the set confidence threshold.

[0044] The target specification clause filtering module is used to determine the validity weight, regional weight, and timeliness weight of each specification clause in the candidate clause set based on structured metadata, calculate the graph hop distance between each specification clause and the hidden danger entity based on the safety specification knowledge graph, determine the hazard level weight of each specification clause, calculate the priority score of each specification clause based on the basic relevance score of each specification clause and the validity weight, regional weight, timeliness weight, and hazard level weight, and sort and extract the target clause set according to the priority score;

[0045] The constraint generation module combines the target clause set and the user's input query request into a prompt word context, injects structured constraints that limit the output format into the large language model, and drives the large language model to answer the user's input query request based on the original text of the normative clauses in the target clause set.

[0046] The beneficial effects of this invention are:

[0047] (1) By combining the domain-adaptive fine-tuning semantic model with the synonym mapping of the safety standard knowledge graph, the semantic gap between colloquial descriptions of hidden dangers and professional standard texts can be effectively bridged, the accuracy of cross-expression matching can be greatly improved, the number of missed and false detections can be reduced, the retrieval efficiency can be improved, and reliable standard basis support can be provided for the rectification of hidden dangers at construction sites.

[0048] (2) By introducing multiple dimensions of weights such as effectiveness level, regional applicability, release timeliness, and risk level to re-rank the search results, the applicable requirements of the norms in the actual project scenario can be accurately matched, and invalid norms can be avoided from interfering with the rectification decision.

[0049] (3) By implementing a two-layer verification mechanism and structured generation constraints on the output of the large language model, the illusion problem of the large language model is suppressed from the root. All generated answers can be traced back to the original normative clauses, which meets the high accuracy requirements of the safety supervision scenario and effectively avoids safety compliance risks. Attached Figure Description

[0050] Figure 1 This is a flowchart of a security specification intelligent retrieval method based on semantic understanding as described in this invention. Detailed Implementation

[0051] Existing construction safety specification retrieval methods suffer from issues such as easy omissions, fixed hierarchical levels of safety specifications, the illusion of a large language model, and difficulty in tracing the source of information. To address these issues, this invention first breaks down the specification document into clauses with structured metadata, constructs a safety specification knowledge graph, and establishes a synonym mapping between colloquial vocabulary and specification terminology; simultaneously, it constructs a dense vector index and a full-text inverted index. During retrieval, geographical location and potential hazard entities are extracted from the user's input text or image. These are then expanded using the synonym mapping to generate preprocessed query features, which are input into a dual-channel index for parallel recall. The scores from both channels are normalized and fused to obtain a basic relevance score. Furthermore, a four-dimensional weighted approach is introduced, considering effectiveness level, regional applicability, timeliness, and hazard level based on the graph hop distance, to reorder candidate clauses. Finally, the target clause is combined with the user's original question and fed into a large language model, with dual validation constraints based on specification number and original text to ensure accurate, reliable, and traceable output results.

[0052] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings. These embodiments are only used to more clearly illustrate the technical solutions of the present invention and should not be construed as limiting the scope of protection of the present invention.

[0053] like Figure 1 As shown, the intelligent retrieval method for security specifications based on semantic understanding according to the present invention includes the following steps.

[0054] S1. Security specification document splitting and structured metadata extraction.

[0055] The safety specification document consists of two parts: one part is the safety standard document obtained from the Ministry of Housing and Urban-Rural Development and industry standard websites, and the other part is the unstructured real investigation record text accumulated in the company's internal historical safety hazard investigation database.

[0056] Using OCR and layout analysis technologies, plain text was extracted from security standard documents and investigation records containing complex tables and layouts. Then, a technique combining deep learning-based text structure parsing and regular expressions was used to strictly split the extracted plain text into independent normative clauses according to the fine-grained splitting standard of "chapter-section-article-clause".

[0057] Each individual specification clause, after being split, is transformed into a Metadata (MD) file with an accompanying metadata header. Each MD file is required to include structured metadata and the body of the specification clause, converting unstructured long text into semi-structured specification semantic blocks that are easy for machine computation. The structured metadata includes the validity level, regional label, publication year, specification number, and associated potential risks of each individual specification clause.

[0058] S2. Construction of a security specification knowledge graph based on specification entity extraction.

[0059] Named entity recognition (NAME) and relation extraction techniques are used to extract hazard classification nodes and standard terminology nodes from MD files, establishing a safety standard knowledge graph. The graph hop distance between hazard classification nodes and standard clause nodes in the safety standard knowledge graph is used to characterize the hazard hazard level. Specifically, core safety red line documents such as the "Standards for Judging Major Accident Hazards in Housing Construction and Municipal Infrastructure Projects" are strongly associated with super nodes in the safety standard knowledge graph to facilitate subsequent hazard level penetration calculations. Simultaneously, a thesaurus attribute for non-standard or colloquial terms such as engineering slang is extracted and constructed, mapping them to standard standard terms. For example, "scaffolding pipe" is mapped to "scaffolding" and "disc-locked support system," and "irregular electrical box connection" is mapped to the standard requirement of "one machine, one switch." This thesaurus attribute is stored in the safety standard knowledge graph. The safety standard knowledge graph and its mapping relationships serve as prior business logic storage, which will be used for subsequent intent reasoning and recall result expansion.

[0060] S3, Domain Adaptive Semantic Model Fine-tuning.

[0061] The domain-adaptive fine-tuning of the semantic model employs a contrastive learning approach. It uses colloquial descriptions of potential hazards from historical hazard investigation records as queries, and the corresponding official regulatory clauses as positive samples. For negative sample construction, in-batch-negative random sampling is used. Regulatory clauses that are literally similar to the query but semantically unrelated, recalled from a temporary BM25 corpus, are used as hard negative samples. The InfoNCE loss function is applied as follows. Optimize the semantic model:

[0062] ;

[0063] in For query, As a positive sample, For the first Difficult negative samples Where is the number of negative samples, and sim is the similarity function. This refers to temperature hyperparameters.

[0064] The semantic model uses a lightweight pre-trained Chinese model, such as bge-smal-lzh. After fine-tuning, the text of the specification clauses in all structured metadata (MD) files is extracted. High-dimensional dense vectors are generated using the fine-tuned semantic model and stored in a vector database using the HNSW hierarchical navigable small-world algorithm. A dense vector index is then built to support efficient approximate nearest neighbor search for millions of data points. The specification clause MD files, containing complete structured metadata and text, are parsed using a Chinese word segmentation tool adapted for engineering domains and then stored in Elasticsearch to construct an inverted full-text index based on the BM25 algorithm.

[0065] S4. Receive and process multimodal query input to generate preprocessed query features.

[0066] This step is triggered at the application front end, serving as the interaction entry point for the search engine. Its input comes directly from a single multimodal question generated by on-site safety supervisors. Specifically, the question data typically includes unstructured, conversational text descriptions, as well as optional real-life images of potential hazards on-site.

[0067] Upon receiving multimodal input data, the system first initiates multimodal feature extraction logic based on spatiotemporal perception and visual understanding. For the incoming real-world images of potential hazards, a dual-track parallel processing mechanism is employed.

[0068] Geographic location feature extraction: GPS coordinates are extracted from the image's exchangeable file format and parsed into geographic location features. Specifically, based on the underlying image parsing component, specific byte areas in the image file header are read to accurately extract latitude and longitude label data under the GPS information field in the EXIF ​​metadata. After being converted into the standard WGS84 coordinate system, a reverse geocoding service is called to parse out the precise administrative division entity features.

[0069] Hazard entity extraction: The visual model is used to identify hazard entities in the image and convert them into text labels. The visual model identifies the construction scene and visible safety hazard entities in the image (such as identifying the absence of guardrails at the edge or workers not wearing safety helmets). The visual features in the image are converted into text labels and directly added to the user's initial question, realizing the fusion of visual and textual features.

[0070] When a user uploads only an image without any text description, the text tags extracted by the visual model are directly converted into pseudo-natural language questions and passed downstream. If the user does not upload an image or the image's EXIF ​​data is missing, the Named Entity Recognition (NER) model is invoked to directly extract geographic location features and potential entities from the user's input text.

[0071] Based on the synonym mapping relationship in the safety specification knowledge graph constructed in S2, the extracted hidden danger entities are expanded in terms of terminology, and the geographical location features and the expanded hidden danger entities are used together as preprocessing query features.

[0072] S5, dual-channel hybrid retrieval and candidate set recall.

[0073] Upon receiving the trigger command, the preprocessed query features are simultaneously distributed to the internally constructed dual-channel parallel retrieval engine for retrieval and scoring. In the dense vector retrieval channel, the preprocessed query features are first encoded into high-dimensional dense vectors in real time using the loaded fine-tuned semantic model. Then, an approximate nearest neighbor search is performed in the HNSW index of the vector database using inner product or cosine similarity to capture canonical terms that are semantically identical but literally inconsistent due to colloquial descriptions. Finally, the top-K1 matching canonical terms are retrieved, and each canonical term is assigned a cosine similarity score from the dense vector index. In the sparse keyword retrieval channel, the same query features expanded with synonyms are input into the Elasticsearch engine. A multi-field joint retrieval strategy is applied, assigning different computational weights to the text of the specification clauses, associated hazard types, and specification names in the MD file structure. For example, the weight of a hazard tag hit is higher than that of a text hit. By executing the BM25 scoring algorithm, exact matches of specific engineering terms and numerical parameters are captured, the Top-K2 specification clauses are retrieved, and each specification clause is assigned a BM25 score from a full-text inverted index. .

[0074] After independent recall via dual channels, the process moves to cross-channel data aggregation and normalization fusion. To address... and For problems involving two sets of scores with drastically different dimensions, MinMax normalization is performed on all raw scores within the union, i.e., the semantic raw scores are normalized. And the original score Normalization is performed separately. After normalization, a dynamic linear interpolation formula is used for mixed scoring:

[0075] ;

[0076] ;

[0077] ;

[0078] In the formula, Basic relevance score, These are the weighting coefficients. Cosine similarity score for dense vector indices. The BM25 score for the full-text inverted index. and They are respectively and The normalized value, and These represent the minimum and maximum scores, respectively.

[0079] In this embodiment, in order to maximize the balance between semantic generalization ability and terminological rigidity, the weight coefficient α is fixed at 0.7 through massive ablation experiments, that is, semantic features account for 70% and literal features account for 30%.

[0080] Finally, a truncation mechanism based on a confidence threshold θ is introduced to remove low-relevance noisy normative clause data with a basic relevance score less than the confidence threshold θ, and output a candidate clause set. This set contains the text of normative clauses with high confidence and their corresponding fused basic relevance scores, and carries all structured metadata attributes inherited from S1.

[0081] S6: Multi-level weighted sorting and filtering.

[0082] For each normative clause in the candidate clause set, the effectiveness weight, geographical weight, and timeliness weight of each clause are determined based on structured metadata. The hop distance between each clause and the potential hazard entity is calculated using the safety norms knowledge graph to determine the hazard level weight of each clause. Based on the basic relevance scores of the effectiveness weight, geographical weight, timeliness weight, and hazard level weight of each clause, a priority score is calculated for each clause. The target clause set is then extracted based on the priority scores.

[0083] Priority Score The calculation formula is:

[0084] ;

[0085] in, Score based on priority. Basic relevance score, For effectiveness weight, As a weight for the risk level, For regional weight, Timeliness weighting.

[0086] The determination of the validity weight includes: when the validity level of the normative clause is mandatory, the validity weight is greater than 1; when it is a recommended norm, the validity weight is equal to 1; and when it is a repealed norm, the validity weight is 0.

[0087] The determination of regional weights includes: when the regional label of the normative clause completely matches the extracted geographical location feature, the regional weight is greater than 1; when the normative clause is a nationally applicable standard, the regional weight is equal to 1; when the regional label of the normative clause and the extracted geographical location feature belong to a local standard in another region, the regional weight is less than 1.

[0088] The determination of timeliness weight includes: the closer the publication year is to the current time, the greater the timeliness weight.

[0089] The methods for determining the hazard level weight include: when the distance between the standard clause and the hazard entity in the safety standard knowledge graph is 1, the hazard level weight is greater than 1; when the distance between the distance between the distance between the distance between the distance between the distance between the distance between the distance between the distance between the distance between the distance between the distance between the distance between the distance between the distance between the distances ...

[0090] Finally, the priority scores are reordered in descending order and the Top-N terms are dynamically truncated and extracted as the target terms set.

[0091] As a preferred option, this step also includes a retrieval degradation mechanism to prevent over-filtering: if the score of the top-ranked normative clause after priority score downgrading is still abnormally low, for example, if all recalled results have been penalized by region, it means that no high-quality normative clause applicable to the province or the whole country has been found. The current truncation is automatically abandoned, and a degradation query signal is triggered instead. The recall scope of the candidate clause set is expanded by dynamically reducing the confidence threshold θ or increasing the number of recalls.

[0092] To prevent query loops caused by the lack of relevant standards, an exit condition is set: if the degraded query is retried more than the preset number of times, the regional exclusivity penalty is dynamically canceled, the query is forcibly recalled and the off-site standard clauses are recommended, and a reference label for off-site standard clauses is prominently displayed on the front end to ensure the robustness and usability of the results.

[0093] S7: Result generation based on mandatory reference constraints.

[0094] Structured constraint pre-injection: The target clause set output by S6 and the user-input query request are packaged into a restricted context, and system instructions with JSON Schema verification descriptions are forcibly injected into the large language model. This strictly prohibits the large language model from using external memory from pre-trained parameters and requires it to output a JSON object containing analysis reasoning fields, a specification number field, and an exact quote field: {"analysis_reasoning":"...","regulation_id":"...","exact_quote":"..."}. By restricting the output topology of the large language model from the bottom layer, the probability space for its free interpretation and fabrication of false specification clauses is greatly compressed.

[0095] Dual-channel consistency post-verification: After the large language model generates a JSON stream and it is intercepted by the system's underlying code, it is not immediately rendered to the user's front-end interface. Instead, it enters a local verification sandbox to perform strict ID entity authentication and original text fidelity verification.

[0096] ID entity authentication: In the consistency check of specification number, the specification number and specification clause number are extracted by parsing the JSON. The structured metadata group in the target clause set passed in by S6 is traversed. If no completely matching characters are found in this array, it is determined that the specification number is a fabricated illusion.

[0097] Original text fidelity verification: In the original text fidelity verification of the specification clauses, the exact reference fields in the JSON are extracted and matched with the corresponding MD file of S6 using the longest common substring matching or the substring inclusion rate calculation based on the sliding window. If the calculated local inclusion rate or core term coverage is lower than the set value, it is judged as a content tampering illusion.

[0098] When any of the above verification channels triggers a phantom alarm, the current data is actively intercepted, and a progressive backup rollback process is initiated.

[0099] Automatically generate error correction prompts (such as "Error, the specification number you cited does not appear in the context, or the original text of the specification clause is not accurately cited, please try again strictly"), and at the same time lower the temperature parameter of the large language model to 0.1, and initiate the generation request again.

[0100] If the retry still fails the double verification, the current state of the large language model is deemed unreliable. Communication with the large language model is severed, the generative results are completely discarded, and the original specification clause text with the highest score in S6 is directly extracted and forcibly displayed using a fixed user interface template. A prominent message is displayed on the front end: "System generation error. To ensure rigor, we are directly showing you the unprocessed original document specification clause summary: [MD original text]". Finally, a zero-illusion intelligent compliance solution report with mandatory traceability identification and 100% fidelity to the real specification document is output to the front-end system, providing decision-making basis with legal and safety supervision reference value for the engineering site.

[0101] This invention also provides a security specification intelligent retrieval system based on semantic understanding, the system comprising:

[0102] The document parsing module is used to split the security specification document into independent specification clauses and extract the structured metadata of the split specification clauses. The structured metadata includes the validity level, regional tag, publication year, specification number and associated hazard type of the specification clause;

[0103] The safety specification knowledge graph construction module is used to build a safety specification knowledge graph based on the specification clauses and establish a synonym mapping relationship between non-standard terms and standard terms.

[0104] The index building module is used to encode the normative clauses into dense vectors based on the semantic model and build a dense vector index, and to build a full-text inverted index using the keyword retrieval algorithm;

[0105] The multimodal parsing module is used to extract geographic location features and potential hazard entities from the user's input query request, expand the terminology of the potential hazard entities based on the synonym mapping relationship, and use the geographic location features and the expanded potential hazard entities together as preprocessed query features.

[0106] A hybrid retrieval engine is used to input the preprocessed query features into a dense vector index and a full-text inverted index for recall, normalize and fuse the scores of the two recalls to obtain the basic relevance scores of each normative clause, and filter to form a candidate clause set according to the set confidence threshold.

[0107] The target normative clause filtering module is used to determine the effectiveness weight, regional weight, timeliness weight, and risk level weight of each normative clause in the candidate clause set based on structured metadata, and calculate the priority score of each normative clause in combination with the basic relevance score of each normative clause. The target clause set is then extracted by sorting the clauses in descending order of priority scores.

[0108] The constraint generation module combines the target clause set and the user's input query request into a prompt word context, injects structured constraints that limit the output format into the large language model, and drives the large language model to answer the user's input query request based on the original text of the normative clauses in the target clause set.

Claims

1. A method for intelligent retrieval of security specifications based on semantic understanding, characterized in that, Includes the following steps: S1: Break down the safety specification document into specification clauses, and extract the structured metadata of the specification clauses. The structured metadata includes the level of effectiveness, regional label, year of publication, specification number, and associated hazard type. S2: Construct a safety standard knowledge graph based on the standard clauses; During the construction of the safety standard knowledge graph, extract the hazard classification nodes and standard term nodes from the standard clauses, and establish a synonym mapping relationship between non-standard words and standard terms. Store the synonym mapping relationship as a dictionary attribute in the safety standard knowledge graph. S3: Encode each normative clause into a dense vector based on a semantic model to construct a dense vector index, and construct a full-text inverted index based on the text content of each normative clause; S4: Extract the geographic location features and potential hazard entities from the user's input query request, expand the terminology of the potential hazard entities based on the synonym mapping relationship in the safety specification knowledge graph, and use the geographic location features and the expanded potential hazard entities together as preprocessed query features; S5: Input the preprocessed query features into the dense vector index and the full-text inverted index respectively for recall, normalize and fuse the scores of the two recalls to obtain the basic relevance scores of each normative clause, and select the candidate clause set according to the set confidence threshold. S6: Determine the validity weight, regional weight, and timeliness weight of each normative clause in the candidate clause set based on structured metadata; calculate the graph hop distance between each normative clause and the hidden danger entity based on the safety norm knowledge graph; determine the danger level weight of each normative clause; calculate the priority score of each normative clause based on the basic relevance score of each normative clause and the validity weight, regional weight, timeliness weight, and danger level weight; and sort and extract the target clause set according to the priority score. S7: Combine the target terms set and the user's input query request into a prompt word context, inject structured constraints that limit the output format into the large language model, and drive the large language model to answer the user's input query request based on the original text of the normative terms set in the target terms set.

2. The intelligent retrieval method for security specifications based on semantic understanding according to claim 1, characterized in that, The semantic model described in S3 undergoes domain-adaptive fine-tuning. It uses colloquial descriptions of potential hazards from historical hazard investigation records as queries, the original text of corresponding normative clauses as positive samples, and normative clauses recalled based on a temporary BM25 corpus that are similar in wording to the query but semantically unrelated as difficult negative samples. The InfoNCE loss function is used to optimize the semantic model.

3. The intelligent retrieval method for security specifications based on semantic understanding according to claim 1, characterized in that, S4 extracts the geographic location features and potential hazards from the user-input query request, including: when the user-input query request contains an image, extracting the location coordinates from the image and parsing them into geographic location features, while calling a visual model to identify potential hazards in the image and converting them into text labels; when the user-input query request does not contain an image, extracting the geographic location features and potential hazards from the text of the user-input query request using a named entity recognition model.

4. The intelligent retrieval method for security specifications based on semantic understanding according to claim 1, characterized in that, The basic relevance score mentioned in S5 is: ; ; ; In the formula, Basic relevance score, These are the weighting coefficients. Cosine similarity score for dense vector indices. The BM25 score for the full-text inverted index. and They are respectively and The normalized value, and These represent the minimum and maximum scores, respectively.

5. The intelligent retrieval method for security specifications based on semantic understanding according to claim 4, characterized in that, Weighting coefficient It is 0.

7.

6. The intelligent retrieval method for security specifications based on semantic understanding according to claim 1, characterized in that, When a normative clause is a mandatory norm, its weight is greater than 1; when a normative clause is a recommended norm, its weight is equal to 1; and when a normative clause is a repealed norm, its weight is 0. When the regional label of a standard clause perfectly matches the geographical location feature, the regional weight is greater than 1; when the standard clause is a nationally applicable standard, the regional weight is equal to 1; when the regional label of a standard clause and the geographical location feature belong to a local standard in another region, the regional weight is less than 1. The closer the year of publication of the regulatory clauses is to the present time, the greater the weight of timeliness. When the distance between the standard clause and the hazard entity in the safety standard knowledge graph is 1, the hazard level weight is greater than 1; when the distance between the standard clause and the hazard entity is greater than or equal to 2, the hazard level weight is greater than 1 and less than the hazard level weight when the distance between the standard clause and the hazard entity is 1. When there is no dangerous association, the danger level weight is equal to 1.

7. The intelligent retrieval method for security specifications based on semantic understanding according to claim 1, characterized in that, The priority score described in S6 is: ; in, Score based on priority. Basic relevance score, For effectiveness weight, As a weight for the risk level, For regional weight, Timeliness weighting.

8. The intelligent retrieval method for security specifications based on semantic understanding according to claim 1, characterized in that, S6 also includes: when the highest priority score after descending sorting is lower than the preset threshold, reduce the confidence threshold in S5 or increase the recall quantity to expand the scope of the candidate clause set for degenerate query retry; when the degenerate query retry exceeds the preset number, cancel the exclusion penalty of regional weight, forcibly recall the off-site standard clauses and attach a prompt label.

9. The intelligent retrieval method for security specifications based on semantic understanding according to claim 1, characterized in that, S7 also includes: performing consistency comparison and verification between the standard number in the large language model's answer content and the standard number in the target clause set, and performing fidelity comparison and verification between the original text of the standard clause in the large language model's answer content and the corresponding original standard clause text in the target clause set. When any verification fails, it triggers error correction retry or downgrades the display of the original standard clause.

10. A security specification intelligent retrieval system based on semantic understanding, used to implement the security specification intelligent retrieval method based on semantic understanding as described in any one of claims 1-9, characterized in that, The system includes: The document parsing module is used to break down the safety specification document into specification clauses and extract the structured metadata of the specification clauses. The structured metadata includes the level of effectiveness, regional label, year of publication, specification number and associated hazard type. The safety specification knowledge graph construction module is used to construct a safety specification knowledge graph based on specification clauses. During the construction of the safety specification knowledge graph, hazard classification nodes and specification terminology nodes are extracted from the specification clauses. At the same time, a synonym mapping relationship between non-standard words and specification terms is established, and the synonym mapping relationship is stored as a dictionary attribute in the safety specification knowledge graph. The index building module is used to encode each specification clause into a dense vector based on a semantic model to build a dense vector index, and to build a full-text inverted index based on the text content of each specification clause; The multimodal parsing module is used to extract geographic location features and potential hazard entities from the user's input query request. Based on the synonym mapping relationship in the safety specification knowledge graph, the potential hazard entities are expanded into terms. The geographic location features and the expanded potential hazard entities are used together as preprocessed query features. The hybrid retrieval engine is used to input preprocessed query features into the dense vector index and the full-text inverted index for recall, normalize and fuse the scores of the two recalls to obtain the basic relevance scores of each normative clause, and filter out the candidate clause set according to the set confidence threshold. The target specification clause filtering module is used to determine the validity weight, regional weight, and timeliness weight of each specification clause in the candidate clause set based on structured metadata, calculate the graph hop distance between each specification clause and the hidden danger entity based on the safety specification knowledge graph, determine the hazard level weight of each specification clause, calculate the priority score of each specification clause based on the basic relevance score of each specification clause and the validity weight, regional weight, timeliness weight, and hazard level weight, and sort and extract the target clause set according to the priority score; The constraint generation module combines the target clause set and the user's input query request into a prompt word context, injects structured constraints that limit the output format into the large language model, and drives the large language model to answer the user's input query request based on the original text of the normative clauses in the target clause set.