Tree index dual-engine hybrid retrieval method and system for power plant safety knowledge base
By employing a tree-indexed dual-engine hybrid retrieval method, leveraging the hierarchical structure of the power safety knowledge system, and combining vector semantics and keyword retrieval, the issues of retrieval accuracy and efficiency in the power safety knowledge base are resolved, achieving efficient and low-cost index maintenance and accurate retrieval.
Patent Information
- Application Number
- CN202611338247.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-31
- Publication Date
- 2026-11-24
AI Technical Summary
Existing general-purpose retrieval-enhanced generation architectures in the power safety knowledge base suffer from insufficient retrieval accuracy, decreased retrieval efficiency as the knowledge base expands, and high index update and maintenance costs, failing to effectively utilize the multi-layered hierarchical relationships within the power safety knowledge system.
A tree-based dual-engine hybrid retrieval method is adopted. By constructing a knowledge domain classification tree and a retrieval index tree, and combining vector semantic retrieval and keyword retrieval, top-down route pruning and local index updates are achieved, reducing the retrieval scope and executing two-way retrieval in parallel, and performing weighted fusion and reordering.
It improves search accuracy, reduces search latency, lowers index maintenance resource consumption, adapts to the refined search needs of professional fields, and supports continuous expansion and efficient operation and maintenance of the knowledge base.
Smart Images

Figure CN123157671A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of power plant safety knowledge base, specifically involving a tree-indexed dual-engine hybrid retrieval method and system for power plant safety knowledge base. Background Technology
[0002] The documents and materials stored in power safety production scenarios are numerous and voluminous, covering a wide range of content including national and industry safety regulations, enterprise safety management rules, equipment operation guidelines, technical specifications, accident review reports, and safety training materials. Taking a conventional coal-fired power plant as an example, safety management regulations alone can be categorized into multiple levels based on the issuing entity, such as national regulations, industry standards, group management documents, plant management systems, and plant-level operating rules. Adding to this are equipment maintenance manuals, accident warning notices, and hazard identification and rectification logs, resulting in thousands of documents per plant, which are continuously and dynamically replenished as production and operations progress. Frontline workers, when processing work permits, identifying operational risks, and verifying safety protection measures, must sift through this massive amount of data to find the relevant provisions for their current work scenario, demanding high accuracy and response speed in their searches.
[0003] Current power industry safety knowledge bases mostly employ a retrieval-enhanced generation architecture. This architecture breaks down original documents into text fragments and builds a vector retrieval index based on these fragments. Upon receiving a user query, it performs a full-domain semantic similarity comparison across the entire database, recalling text paragraphs with high matching scores, which are then integrated by a large language model to generate a response. While this flat, non-hierarchical retrieval model is suitable for open-ended question-and-answer scenarios in general applications, it suffers from several shortcomings when applied to specialized, niche scenarios like power safety.
[0004] First, the accuracy of retrieval and matching is insufficient. Power industry texts have strong domain attributes, and the same professional term can have different meanings in different business contexts. Flat retrieval lacks a hierarchical discrimination mechanism based on professional domain and operational scenario. Relying solely on vector similarity to recall content easily returns document fragments from different professional sectors simultaneously, leading to professional mismatches and logical confusion in the final generated content, which fails to meet the compliance requirements of on-site safety management.
[0005] Second, retrieval efficiency continuously decreases as the knowledge base expands. The computational cost of the retrieval-enhanced generation architecture is approximately linearly positively correlated with the number of document slices. The power plant safety knowledge base is constantly expanding; revisions to standards, additions of cases, and supplementation of equipment operation and maintenance data all increase the document size. Without hierarchical and structured cropping, each query requires traversing all document slices in the database to perform similarity calculations, and the retrieval response time will continuously increase as the knowledge base expands.
[0006] Third, the knowledge base index update and maintenance costs are high. In traditional retrieval enhancement generation architectures, after a document is added or modified, the entire vector index needs to be rebuilt or updated in batches before the new content can be retrieved. The update frequency of different types of documents in the power plant safety knowledge base varies significantly. Regulatory and procedural documents are revised infrequently, while business templates such as standard work orders are adjusted frequently. Frequent triggering of full index rebuilding consumes a large amount of resources, affecting the continuity of retrieval services.
[0007] The core reason for the above defects is that the existing general retrieval enhancement generation architecture manages the knowledge base as a collection of scattered documents without hierarchy. It does not take advantage of the multi-layered subordinate relationships that naturally exist in the power safety knowledge system. The constraints and relationships between knowledge categories, professional fields, production areas, and equipment types do not play a role in limiting the scope of the retrieval process, resulting in an inability to balance retrieval accuracy, efficiency, and maintenance costs. Summary of the Invention
[0008] The purpose of this invention is to overcome the problem that existing general retrieval enhancement generation architectures cannot simultaneously achieve retrieval accuracy, efficiency, and maintenance costs. It proposes a tree-indexed dual-engine hybrid retrieval method and system for power plant safety knowledge bases.
[0009] To achieve the above objectives, the present invention adopts the following technical solution: In a first aspect, the present invention provides a tree-indexed dual-engine hybrid retrieval method for a power plant safety knowledge base, comprising the following steps: Construct a knowledge domain classification tree, and attach all documents in the knowledge base to the leaf nodes of the knowledge domain classification tree according to their hierarchical classification. Each document is associated with hierarchical path coordinates. A retrieval index tree is constructed, which is built based on the hierarchical structure of a knowledge domain classification tree. Local retrieval indexes are set independently in each leaf node of the retrieval index tree, and the aggregated index summary of the subtrees under its jurisdiction is stored in each intermediate node of the retrieval index tree. Receive user query requests, parse the query intent, obtain the parsing results, and perform route pruning from top to bottom along the knowledge domain classification tree based on the parsing results to determine the target leaf node; Within the document scope covered by the target leaf node, two-way retrieval is performed in parallel to obtain two candidate results and two relevance scores; Normalize the two relevance scores separately, perform weighted fusion on the normalized relevance scores to obtain a fusion result set, perform re-ranking on the fusion result set, and output the final search result.
[0010] Furthermore, the knowledge domain classification tree takes the knowledge base's main entry point as the root node, and is divided into first-level nodes by knowledge type, second-level nodes by professional field, third-level nodes by production area, and leaf nodes by third-level nodes; a single document is attached to at least one leaf node.
[0011] Furthermore, the local retrieval index includes a local vector index and a local inverted index; the local vector index is constructed from the semantic vectors of all document slices under the leaf nodes of the retrieval index tree, and the local inverted index is constructed from the word segmentation mapping relationship of all document slices under the leaf nodes of the retrieval index tree.
[0012] Furthermore, the two retrieval methods are vector semantic retrieval and keyword retrieval, respectively. Vector semantic retrieval is performed based on local vector indexes, while keyword retrieval is performed based on local inverted indexes.
[0013] Furthermore, the analysis results include confidence information; When performing route pruning, the number of target leaf nodes in the knowledge domain classification tree is determined based on the confidence information.
[0014] Furthermore, when documents within the knowledge base are added, deleted, or modified, the local retrieval indexes of leaf nodes along the same path in the retrieval index tree are updated based on the document's mounting path in the knowledge domain classification tree, as well as the aggregated index summaries of each intermediate node on the path from the leaf node upwards to the root node of the retrieval index tree.
[0015] Furthermore, the leaf nodes of the retrieval index tree are associated with external real-time data sources; While performing two-way retrieval, real-time data is obtained from external real-time data sources and incorporated into candidate results for weighted fusion and re-ranking processing.
[0016] Secondly, this invention provides a tree-indexed dual-engine hybrid retrieval system for a power plant safety knowledge base, comprising: The knowledge domain classification tree module is used to construct a knowledge domain classification tree, which categorizes all documents in the knowledge base and attaches them to the leaf nodes of the knowledge domain classification tree according to their hierarchical levels, with each document associated with hierarchical path coordinates; The module for building the retrieval index tree is used to construct the retrieval index tree, which is built based on the hierarchical structure of the knowledge domain classification tree. Local retrieval indexes are set independently in each leaf node of the retrieval index tree, and the aggregated index summary of the subtrees under its jurisdiction is stored in each intermediate node of the retrieval index tree. The target leaf node determination module is used to receive user query requests, parse the query intent, obtain the parsing results, and perform route pruning from top to bottom along the knowledge domain classification tree based on the parsing results to determine the target leaf node; The two-way retrieval module is used to perform two-way retrievals in parallel within the document range covered by the target leaf node, and obtain two candidate results and two relevance scores. The module that outputs the final search results is used to perform normalization on the two relevance scores respectively, perform weighted fusion on the normalized two relevance scores to obtain a fusion result set, perform reordering on the fusion result set, and output the final search results.
[0017] Thirdly, the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements a tree-indexed dual-engine hybrid retrieval method for a power plant safety knowledge base.
[0018] Fourthly, the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements a tree-indexed dual-engine hybrid retrieval method for a power plant safety knowledge base.
[0019] Compared with the prior art, the present invention has the following beneficial technical effects: This invention proposes a tree-based dual-engine hybrid retrieval method for power plant safety knowledge bases. It employs a two-layer tree architecture combining a knowledge domain classification tree and a retrieval index tree. The hierarchical paths of the knowledge domain classification tree complete the structured classification of documents. Through a top-down routing pruning mechanism, the retrieval scope can be reduced from the entire database to a local area covered by the target leaf node, significantly reducing the computational scale of a single retrieval. This decouples retrieval response speed from the overall size of the knowledge base, effectively mitigating the increased retrieval latency caused by continuous knowledge base expansion. Leaf nodes utilize independent local retrieval indexes; document addition, deletion, and modification operations only require updating the corresponding path's node index, eliminating the need for full database index reconstruction. This reduces resource consumption in daily knowledge base maintenance and minimizes the impact of index maintenance on retrieval service continuity. Simultaneously, two retrieval paths are executed in parallel within a limited retrieval scope. Combined with score normalization, weighted fusion, and re-ranking, the matching advantages of different retrieval dimensions can be integrated, reducing irrelevant content recall, improving the accuracy and ranking rationality of retrieval results, and adapting to the refined retrieval needs of professional domain knowledge bases. Attached Figure Description
[0020] The accompanying drawings described herein are for illustrative purposes only and are not intended to limit the scope of the invention in any way. Furthermore, the shapes and proportions of the components in the drawings are merely schematic to aid in understanding the invention and do not specifically limit the shapes and proportions of the components. In the drawings: Figure 1 This is a flowchart of the tree-indexed dual-engine hybrid retrieval method for the power plant safety knowledge base of this invention.
[0021] Figure 2 This is a simplified structural diagram of the tree-indexed dual-engine hybrid retrieval system for the power plant safety knowledge base of this invention.
[0022] Figure 3 This is an electronic device diagram of the tree-indexed dual-engine hybrid retrieval method for the power plant safety knowledge base of this invention.
[0023] Figure 4 This is a schematic diagram of the overall dual tree index architecture in an embodiment of the present invention.
[0024] Figure 5 This is a schematic diagram of the hierarchical structure of the knowledge domain classification tree in an embodiment of the present invention.
[0025] Figure 6 This is a schematic diagram of the retrieval index tree structure in an embodiment of the present invention.
[0026] Figure 7 This is a flowchart illustrating the dual-track knowledge base update strategy in an embodiment of the present invention. Detailed Implementation
[0027] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0028] Example 1 See Figure 1 The tree-indexed dual-engine hybrid retrieval method for the power plant safety knowledge base includes the following steps: Construct a knowledge domain classification tree, and attach all documents in the knowledge base to the leaf nodes of the knowledge domain classification tree according to their hierarchical classification. Each document is associated with hierarchical path coordinates. A retrieval index tree is constructed, which is built based on the hierarchical structure of a knowledge domain classification tree. Local retrieval indexes are set independently in each leaf node of the retrieval index tree, and the aggregated index summary of the subtrees under its jurisdiction is stored in each intermediate node of the retrieval index tree. Receive user query requests, parse the query intent, obtain the parsing results, and perform route pruning from top to bottom along the knowledge domain classification tree based on the parsing results to determine the target leaf node; Within the document scope covered by the target leaf node, two-way retrieval is performed in parallel to obtain two candidate results and two relevance scores; Normalize the two relevance scores separately, perform weighted fusion on the normalized relevance scores to obtain a fusion result set, perform re-ranking on the fusion result set, and output the final search result.
[0029] This invention's dual-tree index architecture upgrades the knowledge base from a "flat document collection" to a "hierarchical semantic space." The knowledge domain classification tree provides semantic coordinates, while the retrieval index tree provides a fast channel; together, they achieve "drill-down layer by layer, precise targeting." The tree index brings non-linear compression of the search space, with the retrieval scope pruned along the tree from the full database level to the leaf node level, decoupling query latency from database size. Independent indexes at the tree node level support incremental local updates, avoiding the overhead of rebuilding the entire database index. Within the small space constrained by the tree, a three-stage sorting pipeline of parallel dual-path retrieval, weighted fusion, and re-sorting ensures accurate sorting of the final results. The dual-track knowledge update strategy addresses the differentiated timeliness requirements of low-frequency full documents and high-frequency structured data.
[0030] Specifically, the core idea of this invention is: locate first, then retrieve. Instead of aimlessly searching through all documents in the knowledge base for each query, it first uses a tree-like index structure to quickly pinpoint the professional field and document scope involved in the query, compressing the search space from the entire database level to the leaf node level. Then, within this constrained small scope, vector semantic retrieval and BM25 keyword retrieval are performed simultaneously. The results from the two paths are weighted and fused, and then finely ranked and output using a re-ranking model.
[0031] To achieve this goal, this invention constructs two complementary tree-structured indexes, one for classification and the other for fast retrieval. The design of the two tree-structured indexes and how they work together to complete the retrieval process are explained below.
[0032] First, there's the knowledge domain classification tree, which assigns coordinates to each document in the knowledge base, ensuring that any regulation, accident case, or maintenance manual can be located on a clear hierarchical path. The construction logic of this tree fully follows the business dimensions of power safety management, rather than simply technical classification.
[0033] The root node is the main entry point for the entire safety knowledge base. First-level branches are divided according to the type of safety knowledge, with typical categories including safety regulations and procedures, technical standards and procedures, accident case analyses, equipment operation and maintenance manuals, and safety training materials. The criterion for this layer is the nature of the knowledge: whether it is a normative document or a reference document, and whether it is preventative or reactive knowledge.
[0034] The second-level branches further subdivide the primary classifications by professional field, with typical categories including electrical engineering, thermal engines, thermal control, boiler engineering, steam turbine engineering, chemistry, and fuel engineering. The operating procedures for different specialties are distributed across different branches in the tree structure, eliminating the possibility of cross-disciplinary retrieval interference at the data structure level.
[0035] The third-level branches are further subdivided according to production area or equipment type. For example, the electrical specialty branch is further divided into switch stations, transformer areas, power distribution rooms, cable trays, etc.; the boiler specialty branch is further divided into boiler body, pulverizing system, flue gas system, desulfurization system, etc. This level of granularity is aligned with the actual organization of on-site operations, and the work area of the work order can usually be accurately corresponded at the third-level branch level.
[0036] The document loading process is as follows: The system uses a pre-trained security domain text classification model to perform semantic analysis on the document content, automatically determining its corresponding knowledge type branch, professional domain branch, and production area / equipment branch, and attaching it to the corresponding leaf node of the classification tree. For cross-domain documents, such as a protection procedure involving both electrical and thermal control, the system supports attaching the document to multiple branch nodes simultaneously, ensuring that queries from different professional perspectives can find the document. In actual engineering, electronic documents are directly uploaded and parsed, while paper documents undergo the same process after OCR scanning. The system's AI automatic classification function can provide default classification suggestions for each uploaded document, reducing the burden of manual classification, while allowing managers to adjust and confirm the classification results.
[0037] Taking the actual organization of a power company's safety knowledge base as an example: a document titled "Electrical First Type Work Permit Implementation Specifications" is automatically categorized into the path "Safety Regulations → Electrical → Switching Station → First Type Work Permit"; a document titled "Boiler Furnace Maintenance Safety Measures" is categorized into "Technical Standards → Boiler → Furnace Body → Maintenance Safety Measures". Each document obtains such a clear hierarchical path when it is added to the database, which serves as the document's "coordinates" within the entire knowledge base.
[0038] See Figure 6 Secondly, there is the retrieval index tree, which is built on the basis of the classification tree. Both share the same tree node topology, but the content stored on each node has a different focus.
[0039] Specifically, at the leaf node level, each leaf node independently maintains two indexes: one is a vector index, which extracts semantic vectors from the text slices of all documents under that node using a text embedding model to build a local vector index library; the other is an inverted index, which establishes an inverted mapping from keywords to document slices after word segmentation of all document slices under that node, for use by the BM25 algorithm. A key design feature here is that both the vector index and the inverted index of each leaf node are local, covering only the document slices within that leaf node's scope and not including the content of other leaf nodes. They only manage the index of their own small subset of documents, resulting in a small index size, low maintenance cost, and fast retrieval speed.
[0040] At the intermediate node level (non-leaf nodes, i.e., first- and second-level branch nodes), each intermediate node does not store the complete document slice index. Instead, it maintains an aggregated index summary of the documents covered by its subtrees. This summary is essentially a directory of the indexes of all leaf nodes under that node, recording how many documents each child node covers, the main keywords and semantic cluster centers involved. The size of the aggregated summary is much smaller than the complete index (typically in the range of a few KB to a few hundred KB), but it is sufficient to support the system in making correct branch selection decisions during the retrieval routing phase, such as determining whether a query should proceed to the "electrical" branch or the "thermal control" branch.
[0041] This hierarchical index structure design has an important engineering consideration: the leaf nodes are where the actual retrieval is performed, containing relatively large amounts of data but covering only a small range of documents (typically slices of dozens to hundreds of documents); the intermediate node indexes are very lightweight, used for fast routing and not involved in the actual retrieval calculations. From the root node to the leaf node, the amount of data decreases layer by layer while the precision increases layer by layer. The root node only knows the global classification directions, while the leaf nodes are precise down to the vector and keyword positions of each document slice.
[0042] When a search request enters the system, the dual tree index works collaboratively in a three-stage process: "top-down layer-by-layer routing → parallel retrieval of leaf nodes by dual engines → weighted fusion and fine ranking of results". The working mechanism of each stage is explained in detail below.
[0043] First section: Tree routing pruning.
[0044] The system first performs intent parsing on the user's query. Taking the query "What are the specific requirements for voltage testing after a power outage for the first type of work ticket at the switch station?" as an example, the system uses a large language model for intent recognition and entity extraction. The parsing result is: Knowledge Type = Safety Regulations, Professional Field = Electrical, Production Area = Switch Station, Query Focus = Voltage Testing Operation Specifications. After obtaining this parsing result, the system starts from the root node of the classification tree, sequentially traversing the first-level branch of "Safety Regulations", the second-level branch of "Electrical", and the third-level branch of "Switch Station", finally reaching the corresponding leaf node. After traversing the entire path, the original search scope has been compressed from "thousands of documents in the entire database" to "dozens of documents under this leaf node". This compression is not a fuzzy approximation, but a deterministic pruning based on the inherent hierarchical structure of the knowledge system. Branches that are clearly unrelated to the query's professional field (such as boilers, steam turbines, etc.) are deterministically excluded during the routing stage and will not participate in any subsequent retrieval calculations.
[0045] Here, it's crucial to explain a design aspect vital to practical effectiveness: the tree-structured routing isn't a rigid, one-size-fits-all approach. If the confidence level of the domain-specific judgment during intent resolution isn't high enough (for example, a user vaguely asks about "safety requirements related to switching stations," without specifying regulations or technical standards), the system will simultaneously route to multiple neighboring leaf nodes. Subsequent searches are performed on the union of these leaf nodes, avoiding missed detections due to minor biases in classification. The route width is dynamically determined by the confidence level of intent resolution. Higher confidence results in more precise routing and fewer covered leaf nodes; lower confidence results in wider routes and more covered leaf nodes. This is an "adaptive adjustment of retrieval scope" mechanism, striking a balance between precision and recall.
[0046] Second section: Parallel retrieval of dual engines within the leaf node range.
[0047] Within the target leaf node (or the union of several leaf nodes), the system performs two-way searches in parallel without blocking each other.
[0048] One approach is vector semantic retrieval. The user's query is converted into a semantic vector using a text embedding model. An approximate nearest neighbor search is then performed in the local vector database of the leaf nodes. Based on cosine similarity, the most semantically relevant document slices are recalled, and a relevance score is generated for each recalled slice. The advantage of vector semantic retrieval lies in its ability to capture semantic associations between synonyms, near-synonyms, and concepts. For example, a user inputting "voltage verification" can be associated with related expressions such as "voltage confirmation" and "live testing" in documents, avoiding omissions due to different wording.
[0049] The other approach is BM25 keyword retrieval. After segmenting the query, the BM25 score for each document slice relative to the query is calculated using the local inverted index of the leaf nodes. BM25 is a classic retrieval algorithm based on term frequency and inverse document frequency, performing exceptionally well in scenarios involving precise matching of technical terms, numbers, and clause names. For example, when precisely matching the standard term "first type of work order," BM25's accuracy is typically superior to vector semantic retrieval. This precisely compensates for the shortcomings of vector semantic retrieval in short queries and precise term matching scenarios. Both retrieval approaches independently produce Top-K results and corresponding relevance scores.
[0050] Third section: Weighted fusion and fine sorting.
[0051] The result sets generated by the two retrieval methods enter the fusion and ranking stage. The system first normalizes the scores of the two methods separately, because the cosine similarity score generated by vector semantic retrieval and the word frequency score generated by BM25 have significant differences in dimensions and distribution, and direct weighted summation is meaningless. Normalization maps both scores to the [0,1] interval, making them comparable on the same scale.
[0052] After normalization, the scores from the two paths are weighted and summed according to the fusion weight coefficient α. The fusion weight α is not a fixed constant, but rather dynamically calculated based on the user's role and the current work scenario. For example, when an electrical shift worker is performing a work order issuance task, their query aims to find precise regulations to verify safety measures. In this case, the BM25 weight is slightly higher (α value leans towards the keyword path), ensuring that precise clauses are ranked first. Conversely, when a shift leader is conducting a plant-wide safety situation analysis, their query aims to gain a more comprehensive understanding of relevant information. In this case, the semantic weight is slightly higher (α value leans towards the semantic path), focusing more on the coverage of information and cross-disciplinary knowledge. The specific value of the fusion weight α is preset based on the job type during actual deployment, and then fine-tuned according to the work scenario.
[0053] The fused result set is then fed into the re-ranking model for final fine-tuning. The re-ranking model employs a Cross-Encoder architecture, concatenating the query statement and each candidate document slice separately, and then performing deep cross-attention calculations to produce accurate relevance scores for each pair. The ranking quality of the Cross-Encoder is significantly better than simple linear fusion of vector similarity and BM25 scores, but its computational cost is high. Therefore, it is only executed on the candidate set produced in the fusion stage (usually a few dozen documents), rather than across the entire database. Finally, the system returns the fine-tuned results, along with the cited regulatory clause numbers and relevant case references, in a structured format to the user.
[0054] The scope of application of job scenario awareness needs to be clearly defined: the above weight adjustment only applies to the retrieval ranking level, that is, adjusting the order in which the recalled documents are presented.
[0055] Finally, there is the knowledge base update and index maintenance mechanism. The document update frequency of the power plant safety knowledge base varies greatly: safety regulations and technical standards are usually revised annually or event-driven, which are low-frequency changes; standard work permits, historical work permit records, etc., are continuously optimized and adjusted based on field experience, which are high-frequency changes. Therefore, this invention adopts a "dual-track update" strategy to address these issues separately.
[0056] The first track involves low-frequency full document updates. Low-frequency revised documents such as safety regulations, technical standards, and equipment maintenance manuals are fully imported through the knowledge base management backend after a new version is released. The process involves uploading the new version file, the system determining its mounting position in the classification tree using a text classification model, then slicing and vectorizing the document, appending the slices and their vectors to the local vector index and inverted index of the corresponding leaf node. If it's a version replacement, the slices and index entries corresponding to the old version are deleted after appending. The key advantage in this project is that this operation only affects the tree node indexes along the document's mounting path. The local index of the leaf node needs to be updated, and the aggregated index summaries of each intermediate node on the path back up from the leaf node to the root node also need to be updated, but the node indexes of other branches in the tree structure remain completely unaffected. For a knowledge base with thousands of documents, a document update only requires index maintenance within a local subtree. The scope of the operation is naturally isolated by the tree structure, decoupling maintenance overhead from the total size of the knowledge base.
[0057] The second track involves real-time acquisition of high-frequency structured data. Structured data such as standard work tickets and historical execution records change frequently. If a full import and index rebuild process were performed each time, it would be costly and inefficient. This type of data is not included in the static document management of the RAG knowledge base. Instead, it is achieved by setting external real-time data source tags on the corresponding leaf nodes of the classification tree. When the retrieval route reaches this leaf node, in addition to retrieving the local RAG document slice, it simultaneously calls the standard work ticket retrieval interface of the AnSheng platform to obtain the latest structured data, incorporating the real-time acquired content into the subsequent fusion and sorting process. From the perspective of retrieval logic, local slices and external real-time data are processed uniformly during the fusion and sorting stage, and the differences in data sources are transparent to the upper layers. This design ensures the timeliness of high-frequency changing data without increasing the maintenance burden of the knowledge base index.
[0058] The dual-track update strategy also supports the detection of policy conflicts. When RAG retrieves policy provisions from different levels that conflict—for example, when national standards differ from factory-level standards—it's usually because the lower-level standard failed to keep up with the higher-level standard's updates. During the fusion and sorting phase, the system can identify differences between provisions from different policy levels that address the same topic and alert users to policy conflicts through the front-end interface. The determination of policy conflicts follows the priority logic of "national standards over industry standards, and industry standards over factory standards." Conflict warnings do not interrupt the search process; they are only presented as a notification.
[0059] See Figure 4 This invention, with its dual tree-structured index architecture, fundamentally changes the organization and retrieval paradigm of knowledge bases. Traditional RAG schemes treat the knowledge base as a "flat collection of documents," lacking utilization of the business logic relationships between documents. See also... Figure 5 This invention uses a knowledge domain classification tree to assign business semantic coordinates to each document. In this way, a regulation is no longer an isolated text fragment, but a clearly located node on a hierarchical path. The retrieval index tree then builds an index independently for each tree node. The two trees work together to transform the problem of "blindly searching the entire database" into "drilling down the tree layer by layer for precise matching within a precise range." This paradigm shift brings intuitive benefits: retrieval accuracy no longer continuously decreases with the expansion of the knowledge base, because a large number of irrelevant documents are deterministically pruned and excluded during the tree routing stage, thus avoiding participation in subsequent similarity calculations.
[0060] The tree-structured index architecture achieves non-linear compression of the search space, decoupling retrieval latency from the total size of the database. In existing flattened retrieval schemes, the computational cost of retrieval is positively correlated with the total number of documents in the knowledge base; the larger the database, the more slices need to be calculated for similarity, resulting in slower retrieval. This invention, through tree-structured routing, narrows the retrieval scope from the entire database level to the leaf node level. The computational cost of a single retrieval depends only on the number of documents within the target leaf node's subtree (typically tens to hundreds), rather than the total number of documents in the entire database (potentially thousands).
[0061] The tree-node-level independent index structure also supports incremental local updates, completely avoiding the overhead of rebuilding the entire database index. In traditional RAG schemes, adding or modifying a document requires updating the entire database vector index for the new document to be retrieved. In this invention, adding, deleting, or modifying a document only affects the tree nodes on its mounting path. The local index of that leaf node needs to have its corresponding slice and vector appended or deleted, and the aggregated index summary of intermediate nodes on the path from that leaf node to the root node needs to be updated synchronously. However, the indexes of all nodes in other unrelated branches of the tree structure remain unchanged. This characteristic of localized impact is particularly critical for the operation and maintenance of the power plant safety knowledge base. High-frequency changing data such as standard work tickets can be updated at any time without affecting the overall retrieval service availability of the knowledge base, and annual updates of low-frequency revised documents such as regulations and systems will not trigger large-scale index rebuilding.
[0062] By performing vector semantic retrieval and BM25 keyword retrieval in parallel within a small range of tree constraints, the advantages of the two retrieval strategies are fully integrated. At the same time, the recall and precision of the retrieval are taken into account, which is more advantageous than a single retrieval strategy.
[0063] See Figure 7 The dual-track knowledge base update strategy considers the timeliness differences of different types of data. Regulations and rules with low-frequency revisions are imported in full and synchronized periodically to ensure consistency with the latest offline versions. Structured data such as standard work orders with high-frequency changes are obtained through real-time interfaces, without static storage or local index maintenance, ensuring the content is always up-to-date. Both strategies are managed uniformly on the knowledge domain classification tree. Leaf nodes can either mount local document indexes or be marked to point to external real-time data sources, remaining completely transparent to the upper-level retrieval logic. Furthermore, the dual-track architecture also implements functions such as detecting policy conflicts: when discrepancies exist between retrieved policy provisions at different levels, the system can identify conflicts during the fusion and sorting phase and provide a reverse notification to the user, preventing users from referencing outdated or conflicting policy provisions due to lower-level standards failing to keep pace with higher-level standards.
[0064] Example 2 See Figure 2 The power plant safety knowledge base uses a tree-structured index dual-engine hybrid retrieval system, including: The knowledge domain classification tree module is used to construct a knowledge domain classification tree, which categorizes all documents in the knowledge base and attaches them to the leaf nodes of the knowledge domain classification tree according to their hierarchical levels, with each document associated with hierarchical path coordinates; The module for building the retrieval index tree is used to construct the retrieval index tree, which is built based on the hierarchical structure of the knowledge domain classification tree. Local retrieval indexes are set independently in each leaf node of the retrieval index tree, and the aggregated index summary of the subtrees under its jurisdiction is stored in each intermediate node of the retrieval index tree. The target leaf node determination module is used to receive user query requests, parse the query intent, obtain the parsing results, and perform route pruning from top to bottom along the knowledge domain classification tree based on the parsing results to determine the target leaf node; The two-way retrieval module is used to perform two-way retrievals in parallel within the document range covered by the target leaf node, and obtain two candidate results and two relevance scores. The module that outputs the final search results is used to perform normalization processing on the two relevance scores respectively, perform weighted fusion on the normalized two relevance scores to obtain a fusion result set, perform reordering processing on the fusion result set, and output the final search results.
[0065] Example 3 See Figure 3 An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements a tree-indexed dual-engine hybrid retrieval method for a power plant safety knowledge base.
[0066] Example 4 A computer-readable storage medium storing a computer program, which, when executed by a processor, implements a tree-indexed dual-engine hybrid retrieval method for a power plant safety knowledge base.
[0067] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, read-only optical discs, optical storage, etc.) containing computer-usable program code.
[0068] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0069] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0070] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0071] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the protection scope of the present invention.
Claims
1. A tree index dual-engine hybrid retrieval method for power plant safety knowledge base, characterized in that, Includes the following steps: Construct a knowledge domain classification tree, and attach all documents in the knowledge base to the leaf nodes of the knowledge domain classification tree according to their hierarchical classification, with each document associated with hierarchical path coordinates; A retrieval index tree is constructed, which is built based on the hierarchical structure of the knowledge domain classification tree; a local retrieval index is independently set at each leaf node of the retrieval index tree, and the aggregated index summary of the subtree under its jurisdiction is stored at each intermediate node of the retrieval index tree. Receive user query requests, parse the query intent, obtain the parsing results, and perform route pruning from top to bottom along the knowledge domain classification tree based on the parsing results to determine the target leaf node; Within the document range covered by the target leaf node, two-way retrieval is performed in parallel to obtain two candidate results and two relevance scores; Normalize the two relevance scores respectively, perform weighted fusion on the normalized two relevance scores to obtain a fusion result set, perform reordering on the fusion result set, and output the final search result.
2. The tree-indexed dual-engine hybrid retrieval method for power plant safety knowledge base according to claim 1, characterized in that, The knowledge domain classification tree takes the knowledge base's main entry point as the root node, and is divided into first-level nodes by knowledge type, second-level nodes by professional field, third-level nodes by production area, and leaf nodes by tertiary nodes. A single document is mounted to at least one leaf node.
3. The tree-indexed dual-engine hybrid retrieval method for power plant safety knowledge base according to claim 1, characterized in that, The local retrieval index includes a local vector index and a local inverted index; the local vector index is constructed from the semantic vectors of all document slices under the leaf nodes of the retrieval index tree, and the local inverted index is constructed from the word segmentation mapping relationship of all document slices under the leaf nodes of the retrieval index tree.
4. The tree-indexed dual-engine hybrid retrieval method for power plant safety knowledge base according to claim 3, characterized in that, The two retrieval methods are vector semantic retrieval and keyword retrieval, respectively. The vector semantic retrieval is performed based on the local vector index, and the keyword retrieval is performed based on the local inverted index.
5. The tree-indexed dual-engine hybrid retrieval method for power plant safety knowledge base according to claim 1, characterized in that, The analysis results include confidence information; When performing route pruning, the number of target leaf nodes in the knowledge domain classification tree is determined based on the confidence information.
6. The tree-indexed dual-engine hybrid retrieval method for power plant safety knowledge base according to claim 1, characterized in that, When a document in the knowledge base is added, deleted, or modified, the local search index of the leaf node on the same path in the search index tree is updated according to the mounting path of the document in the knowledge domain classification tree, as well as the aggregated index summary of each intermediate node on the path from the leaf node to the root node of the search index tree.
7. The tree-indexed dual-engine hybrid retrieval method for power plant safety knowledge base according to claim 1, characterized in that, The leaf nodes of the retrieval index tree are associated with external real-time data sources; While performing two-way retrieval, real-time data is obtained from the external real-time data source, and the real-time data is incorporated into the candidate results to participate in weighted fusion and re-sorting processing.
8. A tree-indexed dual-engine hybrid retrieval system for a power plant safety knowledge base, characterized in that: include: A knowledge domain classification tree construction module is used to construct a knowledge domain classification tree, which classifies all documents in the knowledge base into hierarchical categories and attaches them to the leaf nodes of the knowledge domain classification tree, with each document associated with hierarchical path coordinates; A retrieval index tree construction module is used to construct a retrieval index tree, which is built based on the hierarchical structure of the knowledge domain classification tree; local retrieval indexes are independently set at each leaf node of the retrieval index tree, and aggregated index summaries of the subtrees under its jurisdiction are stored at each intermediate node of the retrieval index tree. The target leaf node determination module is used to receive user query requests, parse query intent, obtain parsing results, and perform routing pruning from top to bottom along the knowledge domain classification tree based on the parsing results to determine the target leaf node. The two-way retrieval module is used to perform two-way retrieval in parallel within the document range covered by the target leaf node, and obtain two candidate results and two relevance scores. The module for outputting the final search results is used to perform normalization processing on the two relevance scores respectively, perform weighted fusion on the normalized two relevance scores to obtain a fusion result set, perform reordering processing on the fusion result set, and output the final search results.
9. An electronic device, characterized in that, The system includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the tree-indexed dual-engine hybrid retrieval method for the power plant safety knowledge base as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the tree-indexed dual-engine hybrid retrieval method for the power plant safety knowledge base as described in any one of claims 1-7.
