A power dispatch vector knowledge base retrieval method and device and a storage medium
Patent Information
- Application Number
- CN202611071417.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-20
- Publication Date
- 2026-10-09
AI Technical Summary
[0004]本发明实施例提供一种电力调度向量知识库的检索方法、装置及存储介质,能有效解决现有技术检索结果冗余且准确率低的问题
本发明提供一种电力调度向量知识库的检索方法、装置及存储介质,其方法能够通过统一语义向量化的机制,从根本上摆脱了对字面关键词匹配的依赖。一方面,在知识库构建阶段,将所有知识片段通过语义编码转化为统一语义空间下的知识向量集合,用向量表征知识的深层语义,而非用文本字符表征字面内容;另一方面,在检索阶段,将用户的自然语言查询语句进行向量化编码生成查询向量,整个检索过程以向量间的语义相似度为核心判断依据,而非字面字符的匹配程度。即便用户的口语化表述与标准规程术语的字面存在明显差异,只要二者核心语义一致,在向量空间中就会呈现出较高的相似性,能够被准确召回;同时,在知识库构建阶段,将分散在不同来源中的异构原始知识数据,统一处理为标准化的知识片段集合,并全部编码至同一语义空间。检索时在统一知识库内完成匹配,可一次性命中不同文档、不同类型的相关知识片段,自动实现跨文档的关联知识召回,无需人工切换多个系统分别查询,从根源上避免了信息割裂导致的关联知识遗漏。采用业务约束定位、候选子空间粗筛、精确相似度筛选、业务重排序的多级检索机制,首先通过业务意图解析提取检索约束条件,结合业务分类索引树与语义簇群构成的复合索引,快速定位候选向量子空间,先从全库中过滤掉大量业务不相关、语义不相关的内容;再通过近似最近邻搜索召回初步相关的初始知识片段集合;随后通过精确相似度计算筛选得到初始知识列表;最后通过重排序进一步优化结果优先级。多层过滤逐步收敛检索范围,既保障核心相关内容不遗漏,又大幅剔除无关冗余结果,整体检索准确率显著提升。
Smart Images

Figure CN122885266A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of knowledge base retrieval technology, and in particular to a retrieval method, apparatus and storage medium for a power dispatch vector knowledge base. Background Technology
[0002] Currently, in the retrieval and application of professional knowledge in power dispatching, traditional retrieval engines based on keyword matching or structured query systems based on relational databases are commonly used. For example, for query requests with specific names or single attribute values, such as the overload contingency plan of a substation's main transformer or the highest load value of the entire network yesterday, traditional retrieval systems can quickly return the corresponding procedure documents or numerical records by matching document titles or data fields.
[0003] However, in actual power dispatching operations, dispatchers and automation maintenance personnel often face complex knowledge requirements characterized by colloquial expressions and semantically similar but textually different elements. For example, the query "What to do next if line tripping and reclosing fails" is implicitly contained within multiple emergency response plans, dispatching procedures, and operational ticket details. Therefore, existing keyword-matching-based retrieval technologies struggle to understand deep semantic relationships through literal differences, resulting in redundant and inaccurate search results. Summary of the Invention
[0004] This invention provides a retrieval method, apparatus, and storage medium for a power dispatch vector knowledge base, which can effectively solve the problems of redundant and low-accuracy retrieval results in existing technologies.
[0005] An embodiment of the present invention provides a retrieval method for a power dispatch vector knowledge base, comprising: Obtain the natural language query statement input by the user; The natural language query statement is vectorized to generate a query vector, and the business intent of the natural language query statement is parsed to obtain the retrieval constraints. Based on the retrieval constraints, candidate vector subspaces are located in the preset power dispatch vector knowledge base. Based on the candidate vector subspaces and the query vector, an approximate nearest neighbor search is performed to obtain an initial set of knowledge fragments. Similarity is calculated based on the initial set of knowledge fragments and the query vector to obtain an initial knowledge list; The initial knowledge list is reordered according to the retrieval constraints to obtain the final sorted knowledge list; The construction of the power dispatch vector knowledge base includes: Obtain heterogeneous raw knowledge data in the power dispatching process, and label the heterogeneous raw knowledge data with business metadata tags to obtain the first set of knowledge fragments; Semantic encoding is performed on the first set of knowledge fragments to generate a set of knowledge vectors; A business classification index tree is constructed based on the knowledge vector set and business metadata tags. The knowledge vector set is spatially clustered to generate several semantic clusters. A composite index structure is generated by mapping the business classification index tree and the semantic clusters. A power dispatch vector knowledge base is then constructed based on the composite index structure.
[0006] Furthermore, the heterogeneous raw knowledge data includes: unstructured text data, semi-structured table data, and structured state field data; The heterogeneous raw knowledge data is tagged with business metadata to obtain the first set of knowledge fragments, including: Unstructured text data is segmented according to semantic boundaries to generate text knowledge fragments; Based on a pre-set power dispatch terminology template library, semi-structured tabular data is transformed into parameter entries to obtain tabular knowledge fragments; Business attribute information is extracted from text knowledge fragments, tabular knowledge fragments, and structured status field data. Based on the extracted business attribute information, corresponding business metadata tags are applied to the text knowledge fragments, tabular knowledge fragments, and structured status field data to obtain the first set of knowledge fragments.
[0007] Furthermore, semantic encoding is performed on the first set of knowledge fragments to generate a set of knowledge vectors, including: Semantic encoding is performed on each knowledge fragment in the knowledge fragment set to generate an initial dense vector; Normalize all initial dense vectors using the second norm to obtain knowledge vectors mapped to the unit hypersphere, and generate a knowledge vector set based on all knowledge vectors.
[0008] Furthermore, a business classification index tree is constructed based on the knowledge vector set and business metadata tags. Spatial clustering is performed on the knowledge vector set to generate several semantic clusters. A composite index structure is then generated by mapping the business classification index tree and the semantic clusters, including: Based on the business metadata tags corresponding to each knowledge vector in the knowledge vector set, a business classification index tree is constructed according to the hierarchical dimensions of scheduling jurisdiction, professional category, and equipment interval; wherein, the knowledge vector identifier corresponding to each knowledge vector is the leaf node of the business classification index tree; Spatial clustering is performed on the knowledge vector set to generate several semantic clusters, and the center vector of each semantic cluster is determined. A composite index structure is generated by mapping the bidirectional mapping relationship between each leaf node of the business classification index tree and the center vector of each semantic cluster.
[0009] Furthermore, the natural language query statement is parsed to obtain the retrieval constraints, including: Predict the labels for each word in a natural language query to obtain the corresponding label sequence; Based on the corresponding tag sequence, extract the device object constraints and professional category constraints from the natural language query statement, and use the device object constraints and professional category constraints as search constraints. In cases where no equipment object constraints or professional category constraints are extracted, supplementary equipment information prompts are generated.
[0010] Furthermore, based on the retrieval constraints, candidate vector subspaces are located in the pre-defined power dispatch vector knowledge base. An approximate nearest neighbor search is then performed based on the candidate vector subspaces and the query vector to obtain an initial set of knowledge fragments, including: Based on the retrieval constraints, the business classification index tree is matched in the pre-set composite index structure of the power dispatch vector knowledge base to determine the corresponding leaf nodes; The associated semantic clusters are determined based on the corresponding leaf nodes, and the knowledge vector regions covered by the associated semantic clusters are used as candidate vector subspaces. Within the candidate vector subspace, the vector distance between the query vector and the center vector of the associated semantic cluster is calculated based on the approximate nearest neighbor search method. Based on the order of vector distances, a preset number of knowledge fragments corresponding to knowledge vectors are selected as the initial set of knowledge fragments.
[0011] Furthermore, similarity calculations are performed based on the initial set of knowledge fragments and the query vector to obtain an initial knowledge list, including: The cosine similarity is calculated based on the knowledge vector and query vector corresponding to each knowledge fragment in the initial knowledge fragment set to obtain the similarity value corresponding to each knowledge fragment; The knowledge fragments in the initial knowledge fragment set are sorted according to their similarity values to obtain the initial knowledge list.
[0012] Furthermore, the initial knowledge list is reordered according to the retrieval constraints to obtain the final ranked knowledge list, which includes: The re-ranking weights are matched based on the business scenario corresponding to the search constraints; among them, the re-ranking weights include document authority weight, effective timeliness weight, and contextual coherence weight. For each knowledge fragment in the initial knowledge list, scores are obtained based on the corresponding business metadata tags to assess document authority, timeliness of effectiveness, and contextual coherence. Based on the re-ranking weights and corresponding dimensional scores, the similarity values of knowledge fragments are weighted and corrected to obtain a comprehensive ranking score. The initial knowledge list is reordered according to the overall ranking score to obtain the final ranked knowledge list.
[0013] As an improvement to the above solution, another embodiment of the present invention provides a retrieval device for a power dispatch vector knowledge base, comprising: The query statement acquisition module is used to acquire the natural language query statement input by the user; The query parsing module is used to vectorize natural language query statements, generate query vectors, and parse the business intent of natural language query statements to obtain retrieval constraints. The initial knowledge fragment search module is used to locate candidate vector subspaces in the preset power dispatch vector knowledge base according to the retrieval constraints, and to perform an approximate nearest neighbor search based on the candidate vector subspaces and the query vector to obtain the initial knowledge fragment set. The initial knowledge list generation module is used to calculate similarity based on the initial set of knowledge fragments and query vectors, and then filter to obtain the initial knowledge list. The final knowledge list generation module is used to reorder the initial knowledge list according to the retrieval constraints to obtain the final sorted knowledge list; The construction of the power dispatch vector knowledge base includes: Obtain heterogeneous raw knowledge data in the power dispatching process, and label the heterogeneous raw knowledge data with business metadata tags to obtain the first set of knowledge fragments; Semantic encoding is performed on the first set of knowledge fragments to generate a set of knowledge vectors; A business classification index tree is constructed based on the knowledge vector set and business metadata tags. The knowledge vector set is spatially clustered to generate several semantic clusters. A composite index structure is generated by mapping the business classification index tree and the semantic clusters. A power dispatch vector knowledge base is then constructed based on the composite index structure.
[0014] Another embodiment of the present invention provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements a retrieval method for a power dispatch vector knowledge base as described in the above embodiments.
[0015] Another embodiment of the present invention provides a computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to execute the power dispatch vector knowledge base retrieval method described in the above embodiment.
[0016] By implementing this invention, at least the following beneficial effects are achieved: This invention provides a retrieval method, apparatus, and storage medium for a power dispatch vector knowledge base. The method fundamentally eliminates the reliance on literal keyword matching through a unified semantic vectorization mechanism. On one hand, during the knowledge base construction phase, all knowledge fragments are semantically encoded into a set of knowledge vectors within a unified semantic space. Vectors represent the deep semantics of knowledge, rather than literal text characters. On the other hand, during the retrieval phase, users' natural language queries are vectorized to generate query vectors. The entire retrieval process uses the semantic similarity between vectors as the core criterion, rather than the degree of literal character matching. Even if there are significant differences between a user's colloquial expression and the literal terminology of standard procedures, as long as their core semantics are consistent, they will exhibit high similarity in the vector space and can be accurately recalled. Simultaneously, during the knowledge base construction phase, heterogeneous original knowledge data scattered from different sources are uniformly processed into a standardized set of knowledge fragments and encoded into the same semantic space. The retrieval process is completed within a unified knowledge base, enabling simultaneous matching of relevant knowledge fragments across different documents and document types. It automatically retrieves related knowledge across documents, eliminating the need for manual switching between multiple systems for separate queries and fundamentally preventing the omission of related knowledge due to information fragmentation. A multi-level retrieval mechanism is employed, including business constraint localization, candidate subspace coarse screening, precise similarity filtering, and business re-ranking. First, business intent analysis extracts retrieval constraints. Combined with a composite index composed of a business classification index tree and semantic clusters, candidate vector subspaces are quickly located, filtering out a large amount of business-irrelevant and semantically irrelevant content from the entire database. Next, near-nearest neighbor search retrieves a preliminary set of related knowledge fragments. Then, precise similarity calculation is used to filter and obtain an initial knowledge list. Finally, re-ranking further optimizes the priority of results. This multi-layered filtering progressively narrows the retrieval scope, ensuring no core relevant content is missed while significantly eliminating irrelevant and redundant results, resulting in a significant improvement in overall retrieval accuracy. Attached Figure Description
[0017] Figure 1 This is a flowchart illustrating a retrieval method for a power dispatch vector knowledge base according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of a retrieval device for a power dispatch vector knowledge base provided in an embodiment of the present invention. Detailed Implementation
[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. 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 are within the scope of protection of the present invention.
[0019] See Figure 1 To address the problems of redundant and low-accuracy retrieval results in existing technologies, an embodiment of the present invention provides a flowchart illustrating a retrieval method for a power dispatch vector knowledge base, comprising: S1. Obtain the natural language query statement input by the user; As an illustration, users input their queries through the dispatch system's intelligent question-and-answer interface. The interface supports text input as well as text input after speech-to-text conversion. Query content covers routine dispatch business scenarios such as fault handling, procedure lookup, and parameter verification. The dispatch system first performs basic text cleaning, removing extra spaces and special symbols, correcting common input errors, and preventing invalid characters from affecting subsequent semantic parsing.
[0020] S2. Vectorize the natural language query statement to generate a query vector, and perform business intent parsing on the natural language query statement to obtain the retrieval constraints. To illustrate, the vectorization encoding uses the same encoder as the knowledge base construction phase, ensuring that the query vector and knowledge vector are in the same semantic space and guaranteeing the effectiveness of similarity calculation. Business intent parsing extracts business dimension constraints such as device type and professional category from the query statement for pre-screening of the subsequent search scope. Before vectorization encoding, the query statement is segmented and filtered for stop words to remove filler words like "please ask" and "how," which have no actual semantic meaning, thus improving the accuracy of vector representation.
[0021] Preferably, the natural language query statement is parsed for business intent to obtain retrieval constraints, including: Predict the labels for each word in a natural language query to obtain the corresponding label sequence; Based on the corresponding tag sequence, extract the device object constraints and professional category constraints from the natural language query statement, and use the device object constraints and professional category constraints as search constraints. In cases where no equipment object constraints or professional category constraints are extracted, supplementary equipment information prompts are generated.
[0022] Specifically, the tag sequence is a sequence formed by labeling each word in a natural language query, used to extract content of a specified type. Equipment object constraints represent conditions extracted from the natural language that limit the scope of the retrieved equipment, such as main transformers, lines, and busbars. Professional category constraints represent conditions extracted from the natural language query that limit the scope of the retrieved professional fields, such as relay protection and substation operation.
[0023] To illustrate, a lightweight intent recognition model trained on sequence labeling is employed. The model takes a natural language query as input and outputs a label for each word, categorized into three types: device type, action state, and query request. Trained on labeled scheduling domain query data, the model accurately identifies specialized entities within the query. Its lightweight network structure ensures fast inference speed without increasing overall retrieval time, making it suitable for real-time retrieval scenarios.
[0024] Then, based on the tag sequence, words labeled as equipment types are extracted as equipment object constraints, and words corresponding to professional categories are extracted as professional category constraints. For example, regarding how to handle the main transformer heavy gas operation, the equipment object constraint is extracted as "main transformer," and the professional category constraint is "substation operation." The extracted constraints are standardized and mapped; for example, "main transformer" and "transformer" are uniformly mapped to "main transformer" to ensure consistency with the category tags in the business index and avoid matching failures due to differences in description.
[0025] As an example, if the query is too broad and doesn't mention specific equipment or specialty, the system will display a prompt guiding the user to add information such as equipment type and voltage level, helping to narrow the search scope and improve the accuracy of the results. An alternative mode is also provided, automatically activating a global search if the user doesn't provide additional information, ensuring an uninterrupted process while balancing accuracy and user experience.
[0026] This embodiment only requires natural language queries; the system automatically identifies the equipment and specialty, and automatically limits the search scope, making operation more convenient and reducing the time spent on manual selection. It is suitable for scenarios where dispatchers need to quickly search when busy. The model trained on dispatching terminology can accurately identify various equipment names and technical terms, without misidentifying common words as equipment or missing professional expressions. The extracted constraints are accurate, effectively narrowing the search scope and improving search efficiency and accuracy. When encountering broad queries, it proactively guides users to supplement information, avoiding returning a large number of irrelevant results; it also supports global search fallback, ensuring that a search is not impossible due to the lack of extracted constraints, adapting to different query scenarios.
[0027] S3. Based on the retrieval constraints, locate the candidate vector subspace in the preset power dispatch vector knowledge base, and perform an approximate nearest neighbor search based on the candidate vector subspace and the query vector to obtain the initial knowledge fragment set. Specifically, the power dispatch vector knowledge base represents the transformation of various professional knowledge in the power dispatch field into high-dimensional dense vectors, which are then stored in an index structure to form a knowledge base. The core function is to represent semantics through vectors, achieving semantic-level retrieval and matching. The initial set of knowledge fragments is a collection of knowledge fragments that are initially matched to the query semantics and are retrieved in the first stage of coarse screening; this serves as the basis for subsequent refined ranking.
[0028] To illustrate, the process begins by matching the business category index with search constraints to pinpoint the corresponding business partition. Then, by combining the mapping relationship of semantic clusters, the search scope is compressed from the entire database to a small vector space—the candidate vector subspace—that is relevant to both the query business and semantics. Within this candidate vector subspace, an approximate nearest neighbor algorithm is used to quickly recall a batch of initially relevant knowledge fragments, completing the coarse screening. The size of the candidate vector subspace is dynamically adjusted based on the explicitness of the search constraints; the more explicit the constraints, the smaller the subspace and the faster the search speed.
[0029] Preferably, candidate vector subspaces are located in a preset power dispatch vector knowledge base according to retrieval constraints. An approximate nearest neighbor search is then performed based on the candidate vector subspaces and the query vector to obtain an initial set of knowledge fragments, including: Based on the retrieval constraints, the business classification index tree is matched in the pre-set composite index structure of the power dispatch vector knowledge base to determine the corresponding leaf nodes; The associated semantic clusters are determined based on the corresponding leaf nodes, and the knowledge vector regions covered by the associated semantic clusters are used as candidate vector subspaces. Within the candidate vector subspace, the vector distance between the query vector and the center vector of the associated semantic cluster is calculated based on the approximate nearest neighbor search method. Based on the order of vector distances, a preset number of knowledge fragments corresponding to knowledge vectors are selected as the initial set of knowledge fragments.
[0030] Specifically, the candidate vector subspace represents the range of vectors to be retrieved after business screening and preliminary semantic screening, and is the region where the actual vector search is performed.
[0031] To illustrate, the extracted device object constraints, professional category constraints, and business classification index tree nodes are matched, locating layer by layer from the root node until the corresponding leaf node is found. If multiple leaf nodes match, all are included in the scope. Fuzzy matching is supported; for example, a user-described line will match the leaf nodes for all voltage levels, adapting to queries with varying levels of precision.
[0032] Next, using a bidirectional mapping table, all semantic clusters associated with each matching leaf node are found. The vectors contained in these clusters are merged to form the candidate vector subspace. This candidate vector subspace conforms to business constraints and is semantically relevant to the query, with a scope much smaller than the entire database. If the number of associated clusters is too small, adjacent semantic clusters will be automatically expanded to ensure that the candidate set has sufficient samples and avoid missed detections.
[0033] First, the cosine distance between the query vector and the center vector of each associated cluster is calculated. The smaller the distance, the more semantically relevant the cluster is to the query. The most relevant clusters are quickly selected using the center vectors, further narrowing the search scope and quickly eliminating most semantically irrelevant clusters. Several semantic clusters with the closest distances are then selected. Within the vector range of these semantic clusters, a more refined vector search is performed using an approximate nearest neighbor search algorithm to recall a predetermined number of knowledge fragments, forming an initial knowledge fragment set. The approximate nearest neighbor search uses the HNSW algorithm, constructing a multi-layer graph index. During retrieval, a greedy search starts from the top layer and descends layer by layer to the bottom layer to quickly find the nearest neighbor vector.
[0034] Existing coarse screening solutions either perform an approximate nearest neighbor search across the entire database, which is slow when dealing with large amounts of data; or they only use business classification filtering, which is too coarse-grained, leaving many remaining vectors and limiting the improvement in retrieval efficiency.
[0035] This embodiment first filters using the business index, then filters using the cluster center, and finally performs a single-vector approximate search. Each step eliminates a large amount of irrelevant data, resulting in a very small number of vectors actually searched and extremely fast retrieval speed. Even with hundreds of thousands of vectors, it maintains millisecond-level coarse screening time, fully meeting real-time requirements. The approximate nearest neighbor algorithm ensures a balance between recall and speed in the coarse screening, guaranteeing that core content is not missed while quickly completing the screening.
[0036] S4. Calculate similarity based on the initial knowledge fragment set and query vector, and filter to obtain the initial knowledge list; To illustrate, for each knowledge fragment returned by the coarse screening, the precise similarity between its corresponding vector and the query vector is calculated. The fragments are then sorted from highest to lowest similarity to obtain an initial knowledge list. This step is the foundation of the fine-grained ranking, and its core function is to ensure the semantic relevance of the results. Cosine similarity is used for similarity calculation, measuring the directional consistency between two vectors, which is more suitable for judging semantic similarity. The calculated result ranges from -1 to 1, with higher values indicating greater semantic similarity.
[0037] Preferably, a similarity calculation is performed based on the initial set of knowledge fragments and the query vector to obtain an initial knowledge list, including: The cosine similarity is calculated based on the knowledge vector and query vector corresponding to each knowledge fragment in the initial knowledge fragment set to obtain the similarity value corresponding to each knowledge fragment; The knowledge fragments in the initial knowledge fragment set are sorted according to their similarity values to obtain the initial knowledge list.
[0038] Specifically, the higher the cosine similarity value between the knowledge vector corresponding to each knowledge fragment and the query vector, the more consistent the semantic direction of the two vectors, and the higher the similarity. The initial knowledge list is a list obtained by sorting the knowledge fragments after coarse screening according to their precise similarity.
[0039] To illustrate, knowledge fragments are sorted from highest to lowest similarity value, with higher similarity fragments appearing first, forming an initial knowledge list. This initial knowledge list primarily reflects semantic matching and does not yet incorporate business rules. Fragments with similarity below a preset threshold are directly filtered out to prevent semantically irrelevant content from being included in the initial knowledge list, thus reducing the computational load for subsequent re-sorting.
[0040] Many existing solutions output results directly after a rough screening without performing precise similarity calculations, resulting in poor sorting accuracy and relegating semantically more relevant content to the back of the list.
[0041] This embodiment uses precise calculations to reorder the content, placing the most semantically matching elements at the beginning, thus improving the semantic ranking accuracy and ensuring the accuracy of the initial order before reordering. Segments with very low similarity are directly removed, avoiding the reordering process, reducing computation and preventing low-relevance content from interfering with the final ranking result.
[0042] S5. Reorder the initial knowledge list according to the retrieval constraints to obtain the final sorted knowledge list; To illustrate, based on the power dispatching business rules, the initial similarity ranking is adjusted by incorporating business dimensions such as document authority, timeliness, and contextual coherence, so that more authoritative, up-to-date, and complete content is ranked first, in line with the rigorous requirements of dispatching business.
[0043] Preferably, the initial knowledge list is reordered according to retrieval constraints to obtain a final ranked knowledge list, including: The re-ranking weights are matched based on the business scenario corresponding to the search constraints; among them, the re-ranking weights include document authority weight, effective timeliness weight, and contextual coherence weight. For each knowledge fragment in the initial knowledge list, scores are obtained based on the corresponding business metadata tags to assess document authority, timeliness of effectiveness, and contextual coherence. Based on the re-ranking weights and corresponding dimensional scores, the similarity values of knowledge fragments are weighted and corrected to obtain a comprehensive ranking score. The initial knowledge list is reordered according to the overall ranking score to obtain the final ranked knowledge list.
[0044] Specifically, the re-ranking weight is the proportion coefficient of different business dimensions in the comprehensive ranking; the higher the weight, the greater the impact of that dimension on the final ranking. Document authority is an indicator that measures the reliability of knowledge sources, and is related to the issuing organization and standard level of the document. National-level regulations have the highest authority, while team records have the lowest. Effectiveness is an indicator that measures whether knowledge is currently valid; the closer the effective date and the newer the version, the higher the timeliness score. Contextual coherence measures the logical consistency between a knowledge fragment and its surrounding document context, judging whether the fragment is complete and free of contradictions. The comprehensive ranking score is the final ranking score obtained by combining similarity and scores from each business dimension, with higher scores resulting in a higher ranking.
[0045] To illustrate, different query scenarios have different requirements for each dimension. For example, fault handling queries have high timeliness requirements, so the timeliness weight is increased; procedure verification queries have high authority requirements, so the authority weight is increased. The system automatically matches the corresponding weight configuration according to the business scenario of the query, making the sorting more in line with the scenario requirements. The weight configuration can be adjusted according to actual business needs to adapt to the management requirements of different dispatching agencies.
[0046] To illustrate, the document authority score is based on the source system, document type, and issuing organization level in the metadata, and is scored according to pre-defined authority level rules. National-level industry standards receive the highest score, while team / group records receive the lowest. The score also checks if the document is obsolete; obsolete documents have their scores reduced by a decay coefficient. The authority score is also adjusted based on historical citation counts; documents frequently cited by dispatchers and receiving positive feedback receive dynamic weighting to further improve their ranking. The timeliness score is calculated based on the interval between the effective date and the current date; the closer the interval, the higher the score, with the latest version of the procedure receiving the highest score and expired versions receiving lower scores. The contextual coherence score is calculated by retrieving adjacent segments in the original document and analyzing their semantic coherence and logical inconsistencies. Consistent coherence earns a high score, while inconsistencies result in a deduction.
[0047] The similarity score and the scores from the three dimensions are weighted and fused to obtain the final comprehensive ranking score for each segment. Semantic weight has the highest weight, ensuring that semantic relevance is the foundation of the ranking. The business dimension serves as a supplementary adjustment, preventing semantically irrelevant segments from being ranked higher despite having high business scores. The knowledge segments are then rearranged from highest to lowest according to their comprehensive scores, resulting in the final ranked list output to the user. The ranking result guarantees semantic matching while also meeting the professional requirements of scheduling operations.
[0048] In a preferred embodiment of the present invention, one or more knowledge fragments ranked high in the final knowledge sorting list are assembled. For highly deterministic questions, the system directly highlights key sentences in the knowledge fragments as answers and returns them to the user. For explanatory questions, the system returns a list containing summaries of relevant fragments and their source links, allowing the scheduler to quickly consult the original procedures.
[0049] In a preferred embodiment of the present invention, calculating a document authority score based on each knowledge fragment in the initial knowledge list and the source document specifically includes: A rule base for assessing the authority of documents in the power dispatching field is pre-built. This rule base assigns a basic authority score to each type of power dispatching document based on four dimensions: the document's source system type, document standard level, document version status, and the level of the document issuing organization. For example, documents originating from national or industry-level standards such as dispatching management regulations and power safety work regulations are assigned the highest basic authority score; documents originating from enterprise-level internal specifications such as operating procedures and dispatching operation details issued by provincial or regional dispatching centers are assigned a medium score; and documents originating from informal documents such as team work records, temporary technical notices, and personal operation notes are assigned the lowest score. For each knowledge fragment and its associated original document, the source system identifier (e.g., production management system, scheduling automation system, office automation system), document type code (e.g., procedure, plan, notice, record), effective date, and version number are obtained through the labeled business metadata tags. Based on the evaluation rule base, the above metadata is mapped to the corresponding basic authority score. Then check the relationship between the document's effective date and the current date, and whether there are subsequent versions or obsolescence markers. If the document has been explicitly obsolete or replaced by a subsequent version, multiply its base authority score by a decay factor less than 1; if the document is the latest currently valid version, keep the base authority score unchanged; if the document version information is missing or cannot be confirmed, process it according to the lowest valid level. For each knowledge fragment in the initial knowledge list, the system performs an internal consistency check to adjust the authority score. It analyzes the semantic coherence of the fragment with its preceding and following fragments in the original document. If there is a significant contradiction or logical break between the fragment and the context, such as a paragraph in the same document describing the prohibition of forced power transmission while the following paragraph allows forced power transmission without specifying the exception conditions, a penalty deduction is applied to the authority score of the candidate fragment. If the candidate fragment can form a complete and consistent descriptive chain with the context, its original authority score is retained. Next, the number of times the source document was consulted, cited, or used as a basis for decision-making by dispatchers, maintenance personnel, or intelligent question-and-answer systems in historical scheduling operations was counted. For documents that were frequently cited in the past year and received positive user feedback, a dynamic gain weight was added to their base authority score; for documents that were not consulted for a long time or had incorrect annotations in user feedback, their dynamic weight was reduced. Finally, the adjustment factors obtained from the above steps are comprehensively calculated to generate the final document authority score for the source document corresponding to each knowledge fragment. This score is output in numerical form and serves as an input feature of the re-ranking model. It participates in the ranking decision of the re-ranking model along with other features such as the original cosine similarity value, the number of days between document effective dates, the text length of the knowledge fragment, and the precise keyword matching identifier. Specifically, when two candidate fragments have similarities to the query vector, the re-ranking model assigns higher weight based on the authority score, prioritizing the recommendation of knowledge fragments with more authoritative sources, more recent versions, internal consistency, and practical business validation.
[0050] Most existing search systems only sort by similarity, without considering differences in business dimensions. They often prioritize outdated or informal documents, making them prone to misuse by schedulers. Even the few systems with sorting optimizations only consider a single dimension, such as publication time, without combining multiple dimensions like authority and contextual completeness. This results in insufficient sorting rationality and an inability to adapt to different business scenarios.
[0051] This embodiment employs a multi-dimensional weighted sorting system to ensure results better align with the operational requirements of power dispatching. Instead of solely considering semantic similarity, it comprehensively evaluates results based on multiple business dimensions, including authority, timeliness, and coherence. The most authoritative, up-to-date, and complete procedures are prioritized, allowing dispatchers to use them directly without needing to manually filter versions or assess reliability. This significantly improves decision-making efficiency and reduces the safety risks of misusing outdated procedures. For fault handling, the latest procedures are prioritized; for procedure learning, the most authoritative standards are prioritized. Different sorting logics are used for different scenarios, better meeting actual work needs and providing a better user experience. Many knowledge fragments are segmented from long documents, which may be ambiguous when viewed in isolation. By verifying contextual coherence, fragments taken out of context can be eliminated, ensuring the returned content is logically complete and consistent, improving the quality of search results and preventing user misunderstanding.
[0052] The construction of the power dispatch vector knowledge base includes: S601. Obtain heterogeneous raw knowledge data in the power dispatching process, mark the heterogeneous raw knowledge data with business metadata tags, and obtain the first set of knowledge fragments. Specifically, heterogeneous raw knowledge data refers to knowledge data from different sources and in different formats in the power dispatching scenario, covering three types of forms: unstructured text, semi-structured tables, and structured database fields. Business metadata tags are structured identifiers that describe the business attributes of knowledge fragments, such as the relevant specialty, applicable equipment, and effective time, and are used to quickly filter the search scope.
[0053] This example illustrates the process of acquiring heterogeneous raw knowledge data during power dispatching, tagging this data with business metadata labels, and obtaining a first set of knowledge fragments. Raw data is then accessed from multiple data sources, including dispatch automation systems, production management systems, and office systems. Data of different formats is standardized and transformed into knowledge fragments in a unified format. Each fragment is tagged with business metadata labels to support subsequent index construction and retrieval filtering.
[0054] Preferably, the heterogeneous raw knowledge data includes: unstructured text data, semi-structured table data, and structured status field data; The heterogeneous raw knowledge data is tagged with business metadata to obtain the first set of knowledge fragments, including: Unstructured text data is segmented according to semantic boundaries to generate text knowledge fragments; Based on a pre-set power dispatch terminology template library, semi-structured tabular data is transformed into parameter entries to obtain tabular knowledge fragments; Business attribute information is extracted from text knowledge fragments, tabular knowledge fragments, and structured status field data. Based on the extracted business attribute information, corresponding business metadata tags are applied to the text knowledge fragments, tabular knowledge fragments, and structured status field data to obtain the first set of knowledge fragments.
[0055] Specifically, unstructured text data refers to text-based knowledge without a fixed structure, such as various regulations, contingency plans, and instruction manuals, and is the main carrier of dispatching knowledge. Semi-structured tabular data refers to tabular data with row and column structures but inconsistent content formats, such as protection setting sheets and equipment ledgers, which contain both structured parameters and textual descriptions. Structured status field data refers to data stored in relational databases with fixed field definitions, such as equipment status definitions and alarm signal classifications. The power dispatching terminology template library is a pre-organized collection of templates containing the correspondence between power dispatching professional parameter names and natural language expressions, used to convert tabular parameters into fluent natural language. Business attribute information refers to the original attribute content carried by the knowledge fragment itself, reflecting its business affiliation and scope of application, and is the source of content for generating business metadata tags.
[0056] To illustrate, a two-level segmentation strategy is employed. The first priority segmentation follows the document's hierarchical structure, such as chapter titles, clause numbers, and indentation formats, ensuring each segment corresponds to a complete procedure clause. If the length of a segment exceeds the encoder's maximum input limit, a second priority segmentation is performed using strong terminators like periods and semicolons, while maintaining semantic integrity. After segmentation, irrelevant noise content such as headers, footers, print timestamps, and revision records is filtered out. The segment length threshold is dynamically set based on the encoder's maximum sequence length, generally controlled within 512 characters to ensure semantic integrity while adapting to the encoder's input requirements.
[0057] The power dispatch terminology template library pre-compiles the names and corresponding natural language descriptions of common power dispatch parameters, such as the template for the positive sequence impedance of a line, which specifies the per-unit value of the positive sequence impedance of that line as {numerical value}. When processing tables, the parameter name, value, and unit of each row are extracted and matched against the template library. If a match is found, the template is directly populated to generate a natural language description; otherwise, a general sentence structure is used to concatenate the parameter name, value, and unit, using the general sentence structure "Parameter name: [parameter name], Value: [value], Unit: [unit]", to generate translated text. This ensures that all table parameters can be converted into vectorizable text fragments. The power dispatch terminology template library is updated regularly to cover new equipment types and parameter names, improving the accuracy and fluency of table translation.
[0058] Structured status field data is converted into standardized text fragments according to preset description specifications. For example, alarm code: 001, type: line trip, is converted into an alarm signal coded as 001, corresponding to the line trip fault type, forming a structured knowledge fragment, ensuring that all three types of data are converted into a unified text fragment format.
[0059] Finally, business attributes are extracted from the source information, document titles, and content descriptions of the original data. These attributes include scheduling level, professional category, applicable equipment, voltage level, effective date, and issuing authority. These attributes are then organized according to a unified field specification to generate business metadata tags for each knowledge fragment. Attribute extraction employs a combination of rule matching and lightweight model recognition. Rule matching processes documents with standardized formats, while the lightweight model recognizes content with inconsistent formats, ensuring high extraction accuracy.
[0060] This embodiment standardizes the processing of three types of heterogeneous data, covering most knowledge forms in scheduling scenarios. Whether it's long documents, parameter tables, or database fields, they can all be converted into uniformly formatted text knowledge fragments, ensuring the comprehensiveness of the knowledge base and avoiding the omission of important parameter information. Especially for core business data such as protection value sheets, accurate retrieval is possible after template translation, solving the pain point of traditional retrieval methods being unable to search table content. A two-level segmentation strategy ensures the semantic integrity of knowledge fragments while adapting to encoder input requirements. It avoids losing semantic details due to excessively long fragments and prevents logical coherence from being disrupted by overly fragmented segments, improving the quality of subsequent vectorized representations and indirectly improving retrieval accuracy. Rich metadata tag dimensions not only support filtering by profession and device but can also be used for subsequent authority and timeliness scoring, forming the data foundation for the entire composite index and re-ranking mechanism.
[0061] S602. Semantically encode the first set of knowledge fragments to generate a set of knowledge vectors; Schematic, semantic encoding is performed on the first set of knowledge fragments to generate a set of knowledge vectors. A vectorized encoder is used to transform the text content of each knowledge fragment into a dense vector of fixed dimensions. All vectors together constitute the set of knowledge vectors, achieving a unified semantic representation of knowledge from different sources and in different formats.
[0062] Preferably, semantic encoding is performed on the first set of knowledge fragments to generate a set of knowledge vectors, including: Semantic encoding is performed on each knowledge fragment in the knowledge fragment set to generate an initial dense vector; Normalize all initial dense vectors using the second norm to obtain knowledge vectors mapped to the unit hypersphere, and generate a knowledge vector set based on all knowledge vectors.
[0063] Specifically, the initial dense vector is a high-dimensional vector composed of a set of continuous values, used to represent the deep semantics of the text. Text vectors with similar semantics are closer in space. L2 normalization, also known as second-norm normalization, scales the vector length to 1, mapping it to a unit hypersphere, simplifying subsequent similarity calculations. The unit hypersphere is a surface in high-dimensional space composed of all points 1 distance from the origin; the normalized vectors all lie on this surface.
[0064] Schematic, a vectorized encoder fine-tuned using corpus from the power dispatching domain is employed. The text of each knowledge fragment is input into the encoder, which extracts deep semantic features through a multi-layer attention mechanism, outputting an initial dense vector of fixed dimensions. The encoder's base model can utilize a general text representation model, fine-tuned through comparative learning using corpora from dispatching domain procedures, accident reports, and operational instructions, enabling the model to grasp the accurate semantics of specialized terminology. Fine-tuning employs a contrastive learning strategy, treating adjacent fragments from the same procedure as positive sample pairs and fragments from different specialties or equipment as negative sample pairs. The training objective is to narrow the distance between positive samples and widen the distance between negative samples, allowing the encoder to distinguish fine-grained differences in specialized terminology, such as the semantic difference between a reclosing failure and a reclosing action.
[0065] To illustrate, fine-tuning employs a contrastive learning strategy for optimization, and the specific steps include: Constructing positive and negative sample pairs: Two adjacent knowledge fragments in the same procedure are regarded as positive sample pairs, indicating that they have semantic coherence. Two knowledge fragments randomly selected from procedures of different professional categories or different equipment objects are regarded as negative sample pairs. The encoder parameters are updated using a contrastive loss function. The optimization objective of the contrastive loss function is to minimize the distance between positive sample pairs in the vector space while maximizing the distance between negative sample pairs in the vector space. This enables the encoder to learn fine-grained semantic differences between scheduling terms that are similar but have vastly different business consequences. This design aims to enable the encoder to learn fine-grained semantic discrimination capabilities in the power dispatching domain. Specifically: Positive sample pairs are usually taken from semantically coherent adjacent segments in the same procedure, such as main transformer overload and load reduction measures. Their vector distance is minimized to strengthen the compact representation of similar business knowledge. Negative sample pairs come from random fragments of different professional categories or equipment objects, such as line tripping and protection setting sheets, and their vector distance is maximized to widen the distribution differences of irrelevant semantics; Through this comparative learning strategy, the encoder can accurately distinguish between similar terms such as "reclosing not engaged" and "reclosing action taken" but with drastically different business consequences, avoiding incorrect aggregation in the vector space and thus improving the robustness of subsequent retrieval to scheduling semantic ambiguities.
[0066] Indically, the L2 norm of each initial dense vector is calculated, and then each dimension of the vector is divided by the L2 norm value to obtain a normalized vector. After normalization, the cosine similarity between any two vectors is equal to their inner product, eliminating the need to calculate the vector magnitude and significantly reducing the overhead of subsequent similarity calculations. Normalization is a common optimization technique in vector retrieval; it does not change the semantic direction of the vectors, only scales the vector length, and does not affect the semantic similarity judgment result.
[0067] The encoder fine-tuned in this embodiment is more suitable for power dispatching scenarios, resulting in higher semantic representation accuracy. Through comparative learning training, the model can accurately grasp the meaning and subtle differences of dispatching terminology, avoiding confusion between terms that are literally similar but have completely different business meanings. This significantly improves the quality of vector representation and fundamentally enhances the semantic matching accuracy of retrieval. Transforming similarity calculation into vector inner product reduces computational steps, resulting in considerable computational time savings in scenarios with massive vectors, further ensuring low-latency retrieval. Simultaneously, normalization eliminates the impact of vector length differences on similarity, making similarity only related to semantic direction, leading to more accurate judgments.
[0068] S603. Construct a business classification index tree based on the knowledge vector set and business metadata tags, perform spatial clustering on the knowledge vector set to generate several semantic clusters, and map the business classification index tree and semantic clusters to generate a composite index structure. Construct a power dispatch vector knowledge base based on the composite index structure.
[0069] Specifically, the business classification index tree represents a tree-shaped index structure built according to the hierarchical management logic of scheduling business, used to quickly narrow the search scope from a business perspective. Semantic clusters are vector sets formed by spatially clustering knowledge vectors; knowledge within the same cluster has similar semantics, used to accelerate retrieval from a semantic perspective. The composite index structure represents an index system formed by combining the business classification index tree and semantic clusters, possessing both business filtering and semantic clustering acceleration capabilities.
[0070] In a schematic manner, a business classification index tree is constructed based on a set of knowledge vectors and business metadata tags. Spatial clustering is then performed on the knowledge vector set to generate several semantic clusters. A composite index structure is generated by mapping the business classification index tree and the semantic clusters, ultimately completing the construction of the power dispatch vector knowledge base. On one hand, a classification index tree is built according to business hierarchy, dividing knowledge from a business perspective; on the other hand, all vectors are clustered, dividing knowledge from a semantic perspective; and then a mapping relationship is established between the two to form a composite index.
[0071] Preferably, a business classification index tree is constructed based on the knowledge vector set and business metadata tags. The knowledge vector set is then spatially clustered to generate several semantic clusters. A composite index structure is generated by mapping the business classification index tree and the semantic clusters, including: Based on the business metadata tags corresponding to each knowledge vector in the knowledge vector set, a business classification index tree is constructed according to the hierarchical dimensions of scheduling jurisdiction, professional category, and equipment interval; wherein, the knowledge vector identifier corresponding to each knowledge vector is the leaf node of the business classification index tree; Spatial clustering is performed on the knowledge vector set to generate several semantic clusters, and the center vector of each semantic cluster is determined. A composite index structure is generated by mapping the bidirectional mapping relationship between each leaf node of the business classification index tree and the center vector of each semantic cluster.
[0072] Specifically, the dispatch jurisdiction refers to the hierarchical management scope of power dispatch, typically divided into network-wide, provincial, municipal, and county levels, corresponding to the jurisdictional authority of different dispatching agencies. Professional categories refer to the business specialties of power dispatch, mainly including substation operation, relay protection, system mode, automation, and communication. Equipment bays are specific equipment units in the power system, such as main transformer bays, line bays, and bus bays, which are the basic units of dispatching operations. Leaf nodes correspond to the finest-grained business classifications, directly attaching the identifier of the knowledge vector. The center vector is the average of all vectors in a semantic cluster, representing the semantic center of that semantic cluster, used to quickly determine the semantic relevance between the semantic cluster and the query. The bidirectional mapping relationship is the correspondence between the business index leaf nodes and the semantic clusters, allowing users to find associated semantic clusters through business nodes and, conversely, find covered business nodes through semantic clusters.
[0073] Schematic representation: The business classification index tree is divided into three levels. The root node corresponds to the dispatching jurisdiction, such as provincial dispatching; the second-level nodes correspond to professional categories, such as relay protection and substation operation; and the third-level nodes, or leaf nodes, correspond to specific equipment bays, such as 220kV XX line bays. Each knowledge fragment is assigned to its corresponding leaf node based on its own metadata tag. The node stores a unique identifier for the knowledge vector, not the vector itself, reducing the storage space occupied by the index. The hierarchical division can be adjusted according to the actual dispatching agency settings. For example, a substation level can be added for city-level dispatching to adapt to local management models.
[0074] The K-Means clustering algorithm is used to cluster all knowledge vectors. A preset number of clusters is used, grouping semantically similar vectors into the same cluster. For each semantic cluster, the arithmetic mean of all vectors is calculated to obtain the central vector, representing the core semantic topic of that cluster. The number of clusters can be adjusted according to the size of the knowledge base to balance clustering granularity and retrieval efficiency. Clustering is updated periodically after completion to ensure that new knowledge is promptly integrated into the cluster structure.
[0075] Then, it identifies which semantic clusters each leaf node's knowledge vector belongs to, establishing a mapping between leaf nodes and cluster ID lists. Simultaneously, it identifies which leaf nodes each semantic cluster covers, establishing a reverse mapping between cluster IDs and leaf node lists. These mappings are persistently stored along with the business index and cluster information, allowing for direct retrieval without real-time computation.
[0076] In a preferred embodiment of the present invention, to clarify the retrieval path, this embodiment establishes a mapping relationship between leaf nodes and semantic clusters, rather than directly replacing leaf nodes with clustering results. In actual retrieval, based on the user's query business constraints, such as main transformer, the corresponding leaf node is first located, for example, network-wide-substation operation-main transformer. Then, one or more clusters associated with this leaf node are found through the mapping table, rather than all clusters. Approximate nearest neighbor search is performed only within these candidate clusters, thereby combining business filtering and semantic clustering for dual filtering, greatly compressing the search space.
[0077] In this embodiment, the final form of the power dispatch vector knowledge base is a composite index structure, which is jointly stored in two parts. The first is a multi-level classification index tree built based on business metadata tags, with the root node representing the dispatch jurisdiction, the second-level nodes representing professional categories, the third-level nodes representing specific equipment intervals, and knowledge fragment vectors mounted on the leaf nodes. The second is the cluster division and center vector set obtained by performing spatial clustering analysis on the full set of vectors. The two are combined to form a hybrid index that accelerates business-level filtering and vector space clustering, rather than a single classification index tree.
[0078] This embodiment utilizes a composite index combining business and semantic elements to compress the retrieval space from two dimensions simultaneously, resulting in significantly higher efficiency than a single index. The business index first eliminates irrelevant content related to specific professions and equipment from a management perspective, and then semantic clustering filters relevant topics from a content perspective. This double filtering reduces the actual number of vectors required to be calculated to only a fraction of the total database size, drastically reducing computational load and latency. The three-layer business classification index perfectly aligns with the actual management architecture of power dispatching, making the matching of retrieval constraints highly intuitive and consistent with the business habits of dispatchers. Dispatcher queries inherently carry clear professional and equipment specifics; the business index allows for rapid location of these details, improving speed while ensuring that retrieval results do not exceed the specified business scope, avoiding irrelevant cross-professional results. The bidirectional mapping relationship allows for either filtering by business first and then performing semantic retrieval, or using semantic clustering first and then performing business verification, adapting to different query scenarios. For example, if a user does not specify the equipment, semantic clustering can be used to narrow down the scope before supplementing the filtering with business classification, offering high flexibility.
[0079] In a preferred embodiment of the present invention, the provincial power dispatch control center A establishes an intelligent dispatch knowledge base and accesses data such as dispatch procedures, emergency plans, protection setting sheets, and equipment parameters for voltage levels of 220kV and above throughout the province.
[0080] First, unstructured dispatching procedures and line accident handling plans are accessed, along with semi-structured protection setting sheets for each substation and structured EMS system equipment status definition tables. All data is standardized to generate several knowledge fragments with business metadata tags. Vectorized encoders with domain fine-tuning generate vectors for all fragments, constructing a knowledge vector set. A business classification index tree is built according to the levels of provincial, relay protection, and line bay. At the same time, K-Means clustering is performed on all vectors to generate several semantic clusters. A mapping between business index nodes and semantic clusters is established to complete the construction of a composite index, ultimately forming a power dispatching vector knowledge base.
[0081] During the retrieval phase, the dispatcher inputs the query "How to handle unsuccessful reclosing of a 220kV line trip" into the system. The system vectorizes the query to generate a query vector and simultaneously parses the retrieval constraints, specifying the equipment object as a 220kV line and the professional category as relay protection or accident handling. Based on the constraints, the system locates the corresponding leaf node in the business classification index tree and maps it to eight associated semantic clusters as candidate vector subspaces. Within the candidate vector subspace, the HNSW algorithm is used to perform an approximate nearest neighbor search, recalling the top 50 knowledge fragments as the initial knowledge fragment set. The cosine similarity between each fragment and the query vector is calculated, and the fragments are sorted by similarity to obtain the initial knowledge list. The system then re-sorts the fragments based on document authority and timeliness, placing the corresponding fragments from the latest version of the power grid accident handling procedures at the top. Finally, the sorted knowledge list is output. The entire retrieval process is extremely fast and fully meets the real-time requirements of dispatching.
[0082] Current retrieval technologies rely on literal keyword matching, resulting in weak semantic understanding capabilities. They suffer from low recall accuracy when faced with colloquial or ambiguous queries, frequently leading to irrelevant answers or missed core content. Multi-source heterogeneous data lacks a unified representation; data from different systems is fragmented, requiring manual integration for cross-document and cross-system queries, which is extremely inefficient and prone to missing crucial related information. A trade-off between retrieval accuracy and efficiency is struck: either fast but inaccurate, or accurate but too slow, failing to simultaneously meet the real-time and accuracy requirements of scheduling operations. Furthermore, search results are not sorted according to scheduling business rules, often prioritizing informal and outdated content, which does not meet the authoritative requirements of scheduling work.
[0083] This embodiment achieves precise semantic-level retrieval, solving the literal dependence problem of traditional keyword matching. Through vectorized representation, the system can identify the same semantics under different expressions. For example, although the literal meaning of "reclosing failed" and the procedure's "reclosing action failed" are different, their semantic vector distance is very close, allowing for accurate recall. This significantly improves the recall accuracy of colloquial queries and reduces situations where dispatchers cannot find procedures due to differences in expression. Combined with real-world scenario testing, the recall accuracy is further improved for colloquial fault handling queries.
[0084] This system achieves unified integration of multi-source heterogeneous knowledge, breaking down data silos. Whether it's unstructured text like procedural documents, semi-structured tables like protection setting sheets, or structured data like equipment parameters, all can be transformed into vectors within the same semantic space, enabling retrieval within a single knowledge base. Dispatchers no longer need to switch between multiple systems for separate queries; a single search retrieves cross-document and cross-system related knowledge, improving query efficiency and avoiding information omissions caused by system fragmentation. Its application value is particularly prominent in complex fault scenarios requiring the integration of multiple procedural judgments.
[0085] By employing a composite index and a two-stage retrieval design, both retrieval accuracy and speed are balanced. The business category index first filters out a large amount of irrelevant content from a business perspective, while semantic clustering further narrows the scope from a semantic perspective. The first stage uses near-nearest neighbor analysis for rapid coarse screening, while the second stage performs precise calculations and reordering. This avoids the high time consumption of brute-force calculations across the entire database while ensuring the accuracy of the final results. Even with a knowledge base of hundreds of thousands of knowledge fragments, it can still achieve sub-second response times, fully meeting the real-time requirements of scheduling operations. Compared to direct full-database precise retrieval, this significantly improves retrieval speed.
[0086] A business-dimensional re-ranking mechanism is introduced to ensure the professionalism and authority of search results. Scheduling work demands extremely high accuracy and timeliness of knowledge; outdated procedures and informal records, if misused as decision-making basis, could pose security risks. This embodiment prioritizes the display of the latest versions and highest-authority procedures through re-ranking, effectively reducing the risk of schedulers misusing outdated procedures and enhancing the practical value of search results.
[0087] By implementing this embodiment, the reliance on literal keyword matching is fundamentally eliminated through a unified semantic vectorization mechanism. On the one hand, during the knowledge base construction phase, all knowledge fragments are semantically encoded into a set of knowledge vectors in a unified semantic space. Vectors represent the deep semantics of knowledge, rather than text characters representing literal content. On the other hand, during the retrieval phase, users' natural language queries are vectorized to generate query vectors. The entire retrieval process uses the semantic similarity between vectors as the core criterion, rather than the degree of matching of literal characters. Even if there are significant differences between users' colloquial expressions and the literal terms of standard procedures, as long as their core semantics are consistent, they will show high similarity in the vector space and can be accurately recalled. Simultaneously, during the knowledge base construction phase, heterogeneous original knowledge data scattered from different sources are uniformly processed into a standardized set of knowledge fragments and encoded into the same semantic space. During retrieval, matching is completed within the unified knowledge base, which can hit relevant knowledge fragments of different documents and types at once, automatically realizing cross-document related knowledge retrieval without the need for manual switching between multiple systems for separate queries, fundamentally avoiding the omission of related knowledge caused by information fragmentation. A multi-level retrieval mechanism is employed, encompassing business constraint localization, preliminary screening of candidate subspaces, precise similarity filtering, and business re-ranking. First, business intent analysis extracts retrieval constraints. This, combined with a composite index comprised of a business classification index tree and semantic clusters, quickly locates the candidate vector subspace, filtering out a large amount of business-irrelevant and semantically irrelevant content from the entire database. Next, near-nearest neighbor search recalls a preliminary set of relevant knowledge fragments. Subsequently, precise similarity calculations refine the initial knowledge list. Finally, re-ranking further optimizes the result priority. This multi-layered filtering progressively narrows the retrieval scope, ensuring no core, relevant content is missed while significantly eliminating irrelevant and redundant results, resulting in a substantial improvement in overall retrieval accuracy.
[0088] See Figure 2 This is a schematic diagram of the structure of a retrieval device for a power dispatch vector knowledge base according to an embodiment of the present invention, comprising: The query statement acquisition module is used to acquire the natural language query statement input by the user; The query parsing module is used to vectorize natural language query statements, generate query vectors, and parse the business intent of natural language query statements to obtain retrieval constraints. The initial knowledge fragment search module is used to locate candidate vector subspaces in the preset power dispatch vector knowledge base according to the retrieval constraints, and to perform an approximate nearest neighbor search based on the candidate vector subspaces and the query vector to obtain the initial knowledge fragment set. The initial knowledge list generation module is used to calculate similarity based on the initial set of knowledge fragments and query vectors, and then filter to obtain the initial knowledge list. The final knowledge list generation module is used to reorder the initial knowledge list according to the retrieval constraints to obtain the final sorted knowledge list; The construction of the power dispatch vector knowledge base includes: Obtain heterogeneous raw knowledge data in the power dispatching process, and label the heterogeneous raw knowledge data with business metadata tags to obtain the first set of knowledge fragments; Semantic encoding is performed on the first set of knowledge fragments to generate a set of knowledge vectors; A business classification index tree is constructed based on the knowledge vector set and business metadata tags. The knowledge vector set is spatially clustered to generate several semantic clusters. A composite index structure is generated by mapping the business classification index tree and the semantic clusters. A power dispatch vector knowledge base is then constructed based on the composite index structure.
[0089] This invention provides a retrieval device for a power dispatch vector knowledge base, fundamentally eliminating the reliance on literal keyword matching based on a unified semantic vectorization mechanism. On one hand, during the knowledge base construction phase, all knowledge fragments are semantically encoded into a set of knowledge vectors within a unified semantic space, using vectors to represent the deep semantics of knowledge rather than text characters to represent literal content. On the other hand, during the retrieval phase, the user's natural language query is vectorized to generate query vectors. The entire retrieval process uses the semantic similarity between vectors as the core criterion, rather than the degree of matching of literal characters. Even if there are significant differences between the user's colloquial expression and the literal terminology of standard procedures, as long as their core semantics are consistent, they will exhibit high similarity in the vector space and can be accurately recalled. Simultaneously, during the knowledge base construction phase, heterogeneous original knowledge data scattered from different sources is uniformly processed into a standardized set of knowledge fragments and encoded entirely into the same semantic space. The retrieval process is completed within a unified knowledge base, enabling simultaneous matching of relevant knowledge fragments across different documents and document types. It automatically retrieves related knowledge across documents, eliminating the need for manual switching between multiple systems for separate queries and fundamentally preventing the omission of related knowledge due to information fragmentation. A multi-level retrieval mechanism is employed, including business constraint localization, candidate subspace coarse screening, precise similarity filtering, and business re-ranking. First, business intent analysis extracts retrieval constraints. Combined with a composite index composed of a business classification index tree and semantic clusters, candidate vector subspaces are quickly located, filtering out a large amount of business-irrelevant and semantically irrelevant content from the entire database. Next, near-nearest neighbor search retrieves a preliminary set of related knowledge fragments. Then, precise similarity calculation is used to filter and obtain an initial knowledge list. Finally, re-ranking further optimizes the priority of results. This multi-layered filtering progressively narrows the retrieval scope, ensuring no core relevant content is missed while significantly eliminating irrelevant and redundant results, resulting in a significant improvement in overall retrieval accuracy.
[0090] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.
[0091] Those skilled in the art will understand that, for convenience and brevity, the specific working process of the device described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0092] Another embodiment of the present invention provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements a retrieval method for a power dispatch vector knowledge base as described in the above embodiments. The terminal device may be a desktop computer, laptop, handheld computer, cloud server, or other computing device. The terminal device may include, but is not limited to, a processor and a memory.
[0093] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the terminal device, connecting all parts of the terminal device via various interfaces and lines.
[0094] The memory can be used to store the computer program. The processor implements various functions of the terminal device by running or executing the computer program stored in the memory and calling data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function, etc.; the data storage area may store data created based on the use of the mobile phone, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, RAM, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device or other volatile solid-state storage device.
[0095] Another embodiment of the present invention provides a computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to execute the power dispatch vector knowledge base retrieval method described in the above embodiment.
[0096] The storage medium is a computer-readable storage medium, and the computer program is stored in the computer-readable storage medium. When the computer program is executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.
[0097] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A retrieval method for a power dispatch vector knowledge base, characterized in that, include: Obtain the natural language query statement input by the user; The natural language query statement is vectorized to generate a query vector, and the business intent of the natural language query statement is parsed to obtain the retrieval constraints. Based on the retrieval constraints, candidate vector subspaces are located in the preset power dispatch vector knowledge base. Based on the candidate vector subspaces and the query vector, an approximate nearest neighbor search is performed to obtain an initial set of knowledge fragments. Similarity is calculated based on the initial set of knowledge fragments and the query vector to obtain an initial knowledge list; The initial knowledge list is reordered according to the retrieval constraints to obtain the final sorted knowledge list; The construction of the power dispatch vector knowledge base includes: Obtain heterogeneous raw knowledge data in the power dispatching process, and label the heterogeneous raw knowledge data with business metadata tags to obtain the first set of knowledge fragments; Semantic encoding is performed on the first set of knowledge fragments to generate a set of knowledge vectors; A business classification index tree is constructed based on the knowledge vector set and business metadata tags. The knowledge vector set is spatially clustered to generate several semantic clusters. A composite index structure is generated by mapping the business classification index tree and the semantic clusters. A power dispatch vector knowledge base is then constructed based on the composite index structure.
2. The retrieval method for a power dispatch vector knowledge base as described in claim 1, characterized in that, The heterogeneous raw knowledge data includes: unstructured text data, semi-structured table data, and structured state field data; The heterogeneous raw knowledge data is tagged with business metadata to obtain the first set of knowledge fragments, including: Unstructured text data is segmented according to semantic boundaries to generate text knowledge fragments; Based on a pre-set power dispatch terminology template library, semi-structured tabular data is transformed into parameter entries to obtain tabular knowledge fragments; Business attribute information is extracted from text knowledge fragments, tabular knowledge fragments, and structured status field data. Based on the extracted business attribute information, corresponding business metadata tags are applied to the text knowledge fragments, tabular knowledge fragments, and structured status field data to obtain the first set of knowledge fragments.
3. The retrieval method for a power dispatch vector knowledge base as described in claim 2, characterized in that, Based on the first set of knowledge fragments, semantic encoding is performed to generate a set of knowledge vectors, including: Semantic encoding is performed on each knowledge fragment in the knowledge fragment set to generate an initial dense vector; Normalize all initial dense vectors using the second norm to obtain knowledge vectors mapped to the unit hypersphere, and generate a knowledge vector set based on all knowledge vectors.
4. The retrieval method for a power dispatch vector knowledge base as described in claim 3, characterized in that, A business classification index tree is constructed based on the knowledge vector set and business metadata tags. Spatial clustering is performed on the knowledge vector set to generate several semantic clusters. A composite index structure is generated by mapping the business classification index tree and the semantic clusters, including: Based on the business metadata tags corresponding to each knowledge vector in the knowledge vector set, a business classification index tree is constructed according to the hierarchical dimensions of scheduling jurisdiction, professional category, and equipment interval; wherein, the knowledge vector identifier corresponding to each knowledge vector is the leaf node of the business classification index tree; Spatial clustering is performed on the knowledge vector set to generate several semantic clusters, and the center vector of each semantic cluster is determined. A composite index structure is generated by mapping the bidirectional mapping relationship between each leaf node of the business classification index tree and the center vector of each semantic cluster.
5. The retrieval method for a power dispatch vector knowledge base as described in claim 1, characterized in that, The business intent of the natural language query is parsed to obtain the search constraints, including: Predict the labels for each word in a natural language query to obtain the corresponding label sequence; Based on the corresponding tag sequence, extract the device object constraints and professional category constraints from the natural language query statement, and use the device object constraints and professional category constraints as search constraints. In cases where no equipment object constraints or professional category constraints are extracted, supplementary equipment information prompts are generated.
6. The retrieval method for a power dispatch vector knowledge base as described in claim 5, characterized in that, Based on the retrieval constraints, candidate vector subspaces are located in the pre-defined power dispatch vector knowledge base. An approximate nearest neighbor search is then performed based on the candidate vector subspaces and the query vector to obtain an initial set of knowledge fragments, including: Based on the retrieval constraints, the business classification index tree is matched in the pre-set composite index structure of the power dispatch vector knowledge base to determine the corresponding leaf nodes; The associated semantic clusters are determined based on the corresponding leaf nodes, and the knowledge vector regions covered by the associated semantic clusters are used as candidate vector subspaces. Within the candidate vector subspace, the vector distance between the query vector and the center vector of the associated semantic cluster is calculated based on the approximate nearest neighbor search method. Based on the order of vector distances, a preset number of knowledge fragments corresponding to knowledge vectors are selected as the initial set of knowledge fragments.
7. The retrieval method for a power dispatch vector knowledge base as described in claim 6, characterized in that, Similarity is calculated based on the initial set of knowledge fragments and the query vector to obtain an initial knowledge list, including: The cosine similarity is calculated based on the knowledge vector and query vector corresponding to each knowledge fragment in the initial knowledge fragment set to obtain the similarity value corresponding to each knowledge fragment; The knowledge fragments in the initial knowledge fragment set are sorted according to their similarity values to obtain the initial knowledge list.
8. The retrieval method for a power dispatch vector knowledge base as described in claim 7, characterized in that, The initial knowledge list is reordered based on retrieval constraints to obtain the final ranked knowledge list, which includes: The re-ranking weights are matched based on the business scenario corresponding to the search constraints; among them, the re-ranking weights include document authority weight, effective timeliness weight, and contextual coherence weight. For each knowledge fragment in the initial knowledge list, scores are obtained based on the corresponding business metadata tags to assess document authority, timeliness of effectiveness, and contextual coherence. Based on the re-ranking weights and corresponding dimensional scores, the similarity values of knowledge fragments are weighted and corrected to obtain a comprehensive ranking score. The initial knowledge list is reordered according to the overall ranking score to obtain the final ranked knowledge list.
9. A retrieval device for a power dispatch vector knowledge base, characterized in that, include: The query statement acquisition module is used to acquire the natural language query statement input by the user; The query parsing module is used to vectorize natural language query statements, generate query vectors, and parse the business intent of natural language query statements to obtain retrieval constraints. The initial knowledge fragment search module is used to locate candidate vector subspaces in the preset power dispatch vector knowledge base according to the retrieval constraints, and to perform an approximate nearest neighbor search based on the candidate vector subspaces and the query vector to obtain the initial knowledge fragment set. The initial knowledge list generation module is used to calculate similarity based on the initial set of knowledge fragments and query vectors, and then filter to obtain the initial knowledge list. The final knowledge list generation module is used to reorder the initial knowledge list according to the retrieval constraints to obtain the final sorted knowledge list; The construction of the power dispatch vector knowledge base includes: Obtain heterogeneous raw knowledge data in the power dispatching process, and label the heterogeneous raw knowledge data with business metadata tags to obtain the first set of knowledge fragments; Semantic encoding is performed on the first set of knowledge fragments to generate a set of knowledge vectors; A business classification index tree is constructed based on the knowledge vector set and business metadata tags. The knowledge vector set is spatially clustered to generate several semantic clusters. A composite index structure is generated by mapping the business classification index tree and the semantic clusters. A power dispatch vector knowledge base is then constructed based on the composite index structure.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform a retrieval method for a power dispatch vector knowledge base as described in any one of claims 1 to 8.