Method and device for constructing smart grid knowledge base based on thought chain tracing and data flywheel self-evolution

By constructing a smart grid knowledge base based on thought chain tracing and data flywheel self-evolution, the traceability issues of multi-source heterogeneous data organization and complex problem reasoning have been solved, enabling continuous self-optimization and efficient decision support of the knowledge base, and improving the safe and stable operation capability of the power grid.

CN122240848APending Publication Date: 2026-06-19HUAIYIN INSTITUTE OF TECHNOLOGY

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HUAIYIN INSTITUTE OF TECHNOLOGY
Filing Date
2026-03-02
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing smart grid knowledge bases suffer from several problems, including insufficient ability to organize multi-source heterogeneous data, lack of traceability in the reasoning process for complex business problems, difficulty in verifying the consistency of reasoning results, and difficulty in achieving continuous evolution during long-term operation.

Method used

By employing a method based on mind chain tracing and data flywheel self-evolution, a three-dimensional indexed power grid dataset is constructed by dividing the power grid into 'scenario-subdomain-time window' units. Combined with hierarchical knowledge representation of document layer, event layer and graph layer, deep fusion and accurate location of multi-source data are achieved. An online self-correction mechanism and periodic self-evolution closed loop are adopted to improve the traceability and adaptability of the knowledge base.

Benefits of technology

It significantly improves the accuracy and reliability of smart grids in complex decision-making such as fault diagnosis and operation monitoring, realizes continuous iterative upgrades of the knowledge base, and enhances the system's intelligence level in situational awareness, fault handling, and maintenance assistance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122240848A_ABST
    Figure CN122240848A_ABST
Patent Text Reader

Abstract

This invention discloses a method and apparatus for constructing a smart grid knowledge base based on thought chain tracing and data flywheel self-evolution. Using a three-dimensional index of "scenario-subdomain-time window," multi-source heterogeneous power grid data is organized and preprocessed. A hierarchical knowledge base comprising document, event, and graph layers is constructed to achieve correlation modeling of text, time-series, and structured data. Complex power grid problems are decomposed, retrieved in parallel, reasoned multi-hop, and consistency determined, constructing a traceable multi-layered thought chain and outputting results with complete tracing information. Quality indicators are monitored in real time during reasoning, triggering online self-correction when anomalies occur, generating a correction chain, and outputting the optimal result. User feedback and actual operational effects are annotated in the thought chain samples. Through periodic clustering analysis and joint optimization, knowledge completion, graph reconstruction, and self-evolution of reasoning strategies are driven, forming a data flywheel closed loop. This invention improves the interpretability, consistency, and continuous evolution capability of reasoning for complex power grid problems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of smart grid knowledge engineering and artificial intelligence reasoning technology, specifically involving a method and device for constructing a smart grid knowledge base based on thought chain tracing and data flywheel self-evolution. Background Technology

[0002] With the rapid development of new power systems and smart grids, a large amount of diverse and heterogeneous data is generated during power grid operation, maintenance, and dispatch. This includes operation monitoring data, equipment ledger data, fault and alarm records, maintenance work orders, as well as regulations, standards, and expert experience documents. How to effectively organize and utilize this multi-source heterogeneous information to build a smart grid knowledge base for complex business scenarios has become a crucial technical issue in the application of smart grids.

[0003] In existing technologies, related research and systems typically model and query power grid knowledge using rule bases, static knowledge graphs, or vector-based retrieval knowledge bases. While these technologies have improved information retrieval and decision support capabilities to some extent, they still have shortcomings in practical applications: On the one hand, existing knowledge bases mostly employ offline construction and periodic update mechanisms, making it difficult to reflect the dynamic changes in power grid operation status and business knowledge; on the other hand, existing reasoning and question-answering processes mostly only output the final result, lacking explicit representation and traceability mechanisms for intermediate reasoning processes, making it difficult to assess and correct the reliability of the results.

[0004] Furthermore, in scenarios such as complex fault diagnosis and multi-condition joint analysis, existing technologies typically rely on single retrieval or simple multi-round reasoning, making it difficult to effectively decompose and backtrack long-sequence problems. When reasoning results are inconsistent or inaccurate, there is a lack of systematic self-correction and feedback mechanisms. As a result, knowledge bases are prone to knowledge redundancy, conflict accumulation, and performance degradation after long-term operation, limiting the continuous evolution capability of smart grid knowledge systems.

[0005] Therefore, there is an urgent need for a smart grid knowledge base construction technology that can achieve knowledge construction and traceability of reasoning processes in complex power grid scenarios, and has the ability to continuously self-optimize, in order to overcome the shortcomings of the existing technologies mentioned above. Summary of the Invention

[0006] Purpose of the invention: To address the problems in existing smart grid knowledge bases, such as insufficient data organization capabilities for multi-source heterogeneous power grids, lack of traceability in the reasoning process for complex business problems, difficulty in verifying the consistency of reasoning results, and difficulty in achieving continuous evolution during long-term operation, this invention proposes a method and apparatus for constructing a smart grid knowledge base based on thought chain tracing and data flywheel self-evolution. By realizing knowledge modeling, reasoning support, and feedback-driven evolution for complex power grid operation and maintenance scenarios, this invention improves the stability, reliability, and adaptability of the smart grid knowledge system in complex scenarios.

[0007] Technical Solution: This invention proposes a method for constructing a smart grid knowledge base based on thought chain tracing and data flywheel self-evolution, including the following steps:

[0008] Step 1: Divide the power grid into several "scene-subdomain" units and set a time window for each unit; use the "scene-subdomain-time window" combination as an index to collect and preprocess power grid data, and add scene, subdomain and time window labels to the preprocessed data to form a three-dimensional indexed power grid original dataset;

[0009] Step 2: Process the text data, time series data, equipment ledgers and structured record entity data in the original 3D indexed power grid dataset to obtain document fragments and their document vector indexes, event chains of equipment state transitions and power grid knowledge graph triples of relevant entities. Then, attach the document fragments and event chains to the knowledge graph through shared entity nodes to obtain a hierarchical power grid knowledge base.

[0010] Step 3: Map the power grid problem to the corresponding "scenario-subdomain-time window" unit, decompose the complex problem into several sub-problems step by step, perform parallel retrieval and multi-hop graph search on the document vector index, event chain index and power grid knowledge graph respectively for the sub-problems, construct a multi-layer thinking chain structure, and trigger backtracking based on consistency judgment to output the target answer with complete thinking chain traceability information;

[0011] Step 4: In the reasoning stage, monitor quality indicators in real time, generate at least one corrected thought chain based on the online self-correction mechanism, and execute it in parallel with the original thought chain in the remaining reasoning stages. Select the best one to determine the final output chain and corresponding answer, and form a thought chain sample with feedback annotation.

[0012] Step 5: Periodically cluster the thought chains within the same unit based on the thought chain samples with feedback annotations, using "scenario-subdomain-time window" as the outer index, generate evolution tasks, and automatically perform joint optimization for the evolution tasks to form a data flywheel self-evolution closed loop driven by thought chains.

[0013] Furthermore, the specific method of step 1 is as follows:

[0014] Step 1.1: Based on the business scenario and elements such as voltage level, geographical area, and equipment type, classify the power grid business objects, divide the target power grid into several "scenario-subdomain" units, and establish an index mapping table for each unit;

[0015] Step 1.2: For each "scene-subdomain" unit, pre-configure multi-scale time window parameters at the minute, hour, day, or week level to generate a corresponding time window set, which is used to constrain the scope of subsequent data collection and retrieval;

[0016] Step 1.3: Using the combination of "scenario-subdomain-time window" as a three-dimensional index, automatically collect matching data from SCADA / EMS measurement system, equipment ledger system, operation and maintenance work order system, alarm and accident record library, procedure standard library and historical Q&A log library, and complete noise reduction, deduplication, missing data completion, timestamp alignment and equipment code mapping during the collection process;

[0017] Step 1.4: Add corresponding scene identifiers, subdomain identifiers, time window identifiers, and device identifiers to the preprocessed data records, and store them as a multi-source power grid raw dataset with three-dimensional index labels.

[0018] Furthermore, in step 2, the textual data includes regulations and standards, accident reports, expert records, and historical Q&A; the time-series data includes telemetry curves, alarms, and operation records. Entities of equipment, lines, regions, fault types, and regulations are extracted from equipment ledgers and structured records, along with their hierarchical, connection, causal, and constraint relationships. The textual data is segmented and feature-extracted to generate document fragments, and a document vector index is constructed using semantic encoding. The time-series data is sorted by time and labeled with status to construct an event chain of equipment status changes. The hierarchical power grid knowledge base includes a document layer, an event layer, and a graph layer, and retains scene, subdomain, and time window identifiers.

[0019] Furthermore, the specific process in step 3 is as follows:

[0020] Step 3.1: Receive natural language questions from the user or the upper-level system. Through intent recognition model The problem intent category and related device, region, and time elements are obtained. The problem features are then matched with the "scene-subdomain-time window" index, and a matching score is calculated for each candidate unit. The matching score is obtained by weighted summation of intent matching degree, entity coverage degree, and time relevance, and the specific calculation formula is as follows:

[0021] ;

[0022] in, As an indicator function, when the problem is intended Belongs to the scene Preset set of intentions The value is 1 if the condition is met and 0 otherwise, and is used to measure the degree of matching with the business scenario. Scene identifier is recorded as The set of entities contained in the following is obtained from the knowledge graph. This indicates the number of intersections between the problem entity and the subdomain entities. This item calculates the entity coverage and measures the relevance between the problem and the subdomain. For time decay functions, such as sub ,in For time windows The central timestamp, This is the attenuation coefficient, used to measure time correlation. The weights are configurable and satisfy the following conditions: Select the unit with the highest score. As the main processing unit, it retains scores above the threshold when necessary. Several suboptimal units are used for parallel probing;

[0023] Step 3.2: Regarding the problem Computational complexity score:

[0024] ;

[0025] in, The number of entities identified, The number of implicit conditions, The length of the question. For weight parameters; when Greater than the complexity threshold At that time, Treat it as a complex problem and decompose it into functions The set of subproblems is obtained:

[0026] ;

[0027] in, For the first The issue of height. This represents the total number of subproblems in this round; subsequently, a directed dependency graph is constructed between the subproblems. edge set Indicate the precedence relationship between subproblems; the first In each iteration, the current set of target problems is denoted as . ;

[0028] Step 3.3: For the first Each subproblem in the wheel In the knowledge base constructed in step 2, the document retrieval function is called in parallel. Event chain retrieval function From document vector indexes respectively Event chain set and knowledge graph Obtain the candidate set: ;

[0029] A set of intermediate conclusions is obtained by fusing and filtering candidate knowledge. It includes the source nodes and confidence information, and constructs the corresponding thought chain nodes. Each node contains a "subproblem" The quadruple relation “-retrieval operation--candidate conclusion--knowledge reference” is used to classify all nodes into a subtask dependency graph. The topological order connection forms the first Mesoscopic thinking chain structure;

[0030] Step 3.4: For each intermediate conclusion Calculate the semantic domain score:

[0031] ;

[0032] in, For text encoding functions; in graph-structured domains, based on knowledge graphs Calculate the shortest path length from the problem-related entity to the conclusion-related entity. The overall score is defined as follows:

[0033] ;

[0034] in , To adjust the weights and calculate the semantic / graph structure consistency difference:

[0035] ;

[0036] in, The candidate with the highest overall score;

[0037] Step 3.5: When , To set a consensus threshold, intermediate conclusions are accepted. And write it into the current layer's mesoscopic thought chain; when > If the document layer and graph layer retrieval weights, time window filtering conditions, or device similarity thresholds are adjusted first, steps 3.3 and 3.4 are re-executed; if the preset number of retries is reached... If the consistency condition is still not met, then structural backtracking is triggered, and the current subproblem is revisited. Revert to the previous set of questions Then, re-decompose the problem and reconstruct the dependency graph; when the first The intermediate conclusions of all subproblems converge to form a new problem. The termination condition is met, or the number of iterations is reached.

[0038] Furthermore, the quality indicators in step 4 include the length of the thought chain, the number of backtracking steps, the uncertainty of intermediate conclusions, and the response latency. When any indicator exceeds the preset range, an online self-correction mechanism is triggered. The online self-correction mechanism generates at least one corrected thought chain by adjusting the retrieval weights of the document layer and the graph layer, limiting the multi-hop search depth of the graph, merging low-confidence sub-problems, or resetting the time window and scene filtering conditions. This corrected thought chain is executed in parallel with the original thought chain in the remaining reasoning stage. Based on the consistency score, security verification results, and resource consumption indicators, the final output link and corresponding answer are selected from the corrected one. At the same time, the explicit rating of the answer by the user, text correction, adoption of the recommended solution, and the actual processing effect in the subsequent running data are recorded. The above feedback is written as a label into the corresponding micro, meso, and macro thought chain nodes to form a thought chain sample with feedback annotation.

[0039] Furthermore, after the parallel thought chain has finished executing, based on the comprehensive evaluation function:

[0040] ;

[0041] in, This represents the thought chain to be evaluated. This indicates the chain of thought. Average consistency score This indicates its response latency, and rc indicates its backtracking count; , , These are the preset positive weight coefficients for the corresponding items; the link with the highest evaluation value and that meets the security policy constraints is selected from the original thinking chain and the revised thinking chain as the final output thinking chain, and the target answer is generated accordingly.

[0042] Furthermore, the specific method of step 5 is as follows:

[0043] Step 5.1: Periodically read the set of thought chain samples with feedback annotations from the thought chain sample library formed in Step 4. According to scene identifiers Subdomain identifier and time window indicators The samples are divided into buckets to obtain sample subsets. When the number of samples, the average number of backtracking attempts, or the proportion of negative feedback in any bucket exceeds a preset trigger threshold, a corresponding evolutionary task is generated. ;

[0044] Step 5.2: For each evolutionary task Extract the structural feature vector from the thought chain sample:

[0045] ;

[0046] in, For chain length, For the number of backtracking steps, For the average consistency score, To determine the multi-hop depth of the graph; perform clustering operations on the feature vector set to obtain high-frequency error clusters, high backtracking clusters, and low consistency clusters, which are used to locate the type of system performance bottlenecks;

[0047] Step 5.3: Based on the dominant characteristics of each cluster, automatically determine the evolution type as at least one of the following: knowledge missing, knowledge conflict, retrieval strategy mismatch, or redundant thought chain structure; generate corresponding evolution strategy sets for different evolution types, including: graph node completion and relationship reconstruction, procedure and version consistency alignment, document and graph joint retrieval ranking function update, and sub-problem decomposition template and backtracking control strategy adjustment;

[0048] Step 5.4: Execute the evolutionary strategy in an isolated sandbox environment, evaluate the updated knowledge base, retrieval strategy, or thought chain template by replaying historical thought chains, and calculate the consistency score before and after evolution. Number of backtracking steps Gain metrics related to response delay To make the gain index satisfy Only then will the corresponding evolution results be submitted to the version control module and enter the canary release phase, whereby... and These are preset positive threshold numbers;

[0049] Step 5.5: Continuously monitor the effect during the subsequent online inference process, and write the evolution version identifier, performance evaluation results and newly generated thought chain samples back to the thought chain sample library to trigger the next round of evolution process from Step 5.1 to Step 5.4, forming a data flywheel self-evolution closed loop driven by thought chain samples.

[0050] This invention also discloses a smart grid knowledge base construction device based on thought chain tracing and data flywheel self-evolution, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed, it causes the processor to implement the steps in the smart grid knowledge base construction method based on thought chain tracing and data flywheel self-evolution as described above.

[0051] Beneficial effects:

[0052] The present invention provides a method for constructing a smart grid knowledge base based on mind chain tracing and data flywheel self-evolution, which can effectively solve the problems of scattered multi-source knowledge of the power grid, poor interpretability of reasoning for complex problems, lagging knowledge updates, and insufficient system adaptability in the existing technology.

[0053] 1. By constructing a three-dimensional structured power grid dataset indexed by "scene-subdomain-time window", this invention achieves deep fusion and accurate location of multi-source heterogeneous data, laying a reliable foundation for subsequent knowledge modeling and efficient retrieval.

[0054] 2. This invention employs a hierarchical knowledge representation method combining document, event, and graph layers. This not only achieves unified management and association of textual, temporal, and structural data but also preserves the original data's context and spatiotemporal identifiers, significantly enhancing the hierarchy and traceability of knowledge organization. Through a thought-chain-driven multi-hop retrieval and reasoning mechanism, this method achieves automatic problem decomposition, parallel retrieval, multi-source information fusion, and consistency verification in solving complex problems. Furthermore, by leveraging a complete thought-chain traceability structure, the reasoning process becomes transparent and reliable, greatly improving the accuracy and reliability of complex decisions such as fault diagnosis and operational monitoring.

[0055] 3. This invention further introduces an online self-correction mechanism, which can dynamically monitor reasoning quality and optimize the thought chain in real time. It combines user feedback and actual operational results to form labeled thought chain samples, effectively improving the system's adaptability and robustness in real-world environments. Furthermore, through a periodic self-evolutionary closed loop driven by thought chain samples and indexed by "scenario-subdomain-time window," the system can automatically identify high-frequency errors and knowledge conflicts, completing knowledge completion, graph reconstruction, and joint optimization of reasoning strategies. This achieves continuous iterative upgrades of the knowledge base and reasoning model, thus completely changing the limitations of traditional static and passive knowledge base updates.

[0056] Ultimately, this invention significantly improves the intelligence level of smart grids in terms of situational awareness, fault handling, maintenance assistance, and risk warning, providing traceable, evolvable, and highly reliable decision support for the safe, stable, and efficient operation of the power grid, and has broad industrial application prospects and promotional value. Attached Figure Description

[0057] Figure 1 A flowchart illustrating the method for constructing a smart grid knowledge base based on mind chain tracing and data flywheel self-evolution;

[0058] Figure 2 A schematic diagram illustrating the construction of a hierarchical power grid knowledge base;

[0059] Figure 3 This is a diagram illustrating reasoning and correction based on thought chains.

[0060] Figure 4 This is a schematic diagram of the data flywheel's self-evolutionary closed loop. Detailed Implementation

[0061] The present invention will be further illustrated below with reference to specific embodiments. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. After reading the present invention, any modifications of the present invention in various equivalent forms by those skilled in the art will fall within the scope defined by the appended claims.

[0062] This invention proposes a method for constructing a smart grid knowledge base based on thought chain tracing and data flywheel self-evolution. See the overall flowchart below. Figure 1 It includes the following steps:

[0063] Step 1: Obtain the original dataset of the 3D indexed power grid.

[0064] Step 1.1: Based on business scenarios such as operation monitoring, fault diagnosis, maintenance plan, and risk warning, as well as factors such as voltage level, geographical area, and equipment type, classify the power grid business objects, divide the target power grid into several "scenario-subdomain" units, and establish an index mapping table for each unit.

[0065] Step 1.2: For each "scene-subdomain" unit, pre-configure multi-scale time window parameters at the minute, hour, day, or week level to generate a corresponding time window set, which is used to constrain the scope of subsequent data collection and retrieval.

[0066] Step 1.3: Using the combination of "scene-subdomain-time window" as a three-dimensional index, automatically collect matching data from SCADA / EMS measurement system, equipment ledger system, operation and maintenance work order system, alarm and accident record library, procedure standard library and historical Q&A log library, and complete noise reduction, deduplication, missing data completion, timestamp alignment and equipment code mapping during the collection process.

[0067] Step 1.4: Add corresponding scene identifiers, subdomain identifiers, time window identifiers, and device identifiers to the preprocessed data records, and store them as a multi-source power grid raw dataset with three-dimensional index labels, providing a data foundation for knowledge modeling and reasoning in subsequent steps.

[0068] Step 2: Based on the original 3D indexed power grid dataset obtained in Step 1, segment and extract features from textual data such as regulations, standards, accident reports, expert records, and historical Q&As to generate document fragments and construct document vector indexes through semantic encoding; sort and label time-series data such as telemetry curves, alarms, and operation records to construct event chains of equipment state changes; extract entities such as equipment, lines, regions, and fault types, as well as their membership, connection, and causal relationships, from equipment ledgers and structured records to generate power grid knowledge graph triples. Link document fragments and event chains to the knowledge graph through shared entity nodes to form a hierarchical power grid knowledge base containing document, event, and graph layers, while retaining the scenario, subdomain, and time window identifiers from Step 1 for subsequent retrieval and reasoning based on thought chains. See the detailed process below. Figure 2 .

[0069] Step 2.1: Segment the textual data obtained in Step 1, including regulations, standards, accident reports, expert records, and historical Q&As, and record each original document as... It is divided into several document fragment sets. ,in Number the segments; for each document segment Extract structured features such as keywords, device identifiers, and fault types, and record their scenario identifiers. Subdomain identifier and time window indicators .

[0070] Step 2.2: For each document fragment Through semantic encoding function Calculate semantic vectors

[0071]

[0072] in, For vector dimensions; use quadruples And write the fragment identifier ID into the document vector index table This allows for subsequent filtering based on a combination of semantic distance and constraints such as scene, subdomain, and time window.

[0073] Step 2.3: Discretize and identify the monitoring data, alarms, and operation logs from SCADA / EMS, and record each event as:

[0074]

[0075] in, For device ID, For status or alarm codes, For timestamps; for the same device The events are arranged in ascending order of time to form an event chain:

[0076]

[0077] And calculate the time interval between adjacent events. ,when ( (For a preset time interval threshold), establish directed edges. This forms a directed event chain structure that represents the evolution of equipment state and the progression of faults.

[0078] Step 2.4: Extract the entity set from the equipment ledger and structured records:

[0079] Set of relation types:

[0080] ,

[0081] Represent each relation instance as a triple. and for each entity Assign a unique entity identifier ID ( ) and node type Constructing a set of triples for a power grid knowledge graph Further, for each document fragment Select its primary associated entity node Establish cross-layer link relationships and for each event Select the corresponding device or area entity Establish link relationships This allows the document layer, event layer, and graph layer to be linked together through shared entity nodes.

[0082] Step 2.5: Index the document vectors formed in Step 2.2 The event chain set formed in step 2.3 and the set of knowledge graph triples formed in step 2.4 They are uniformly stored in a hierarchical power grid knowledge base, while also retaining the scene identifiers of each object. Subdomain identifier , and time window marker This is to support subsequent joint retrieval and thought chain reasoning under specified "scene-subdomain-time window" constraints.

[0083] Step 3: Based on the hierarchical power grid knowledge base constructed in Steps 1 and 2, receive questions related to power grid operation monitoring, fault diagnosis, or maintenance decision-making. Identify the intent and determine the complexity of each question, mapping it to the corresponding "scenario-subdomain-time window" unit. In complex problem scenarios, decompose the original question into several dependent sub-questions. Perform parallel retrieval and multi-hop graph search on each sub-question using the document vector index, event chain index, and power grid knowledge graph to obtain candidate intermediate conclusions and their source nodes. Construct a multi-layered thought chain structure containing retrieval operations, sub-task dependencies, and scenario context. Further, perform consistency checks on the intermediate conclusions between the semantic vector domain and the graph structure domain. If consistency is insufficient, trigger backtracking, adjust retrieval weights, or reconstruct the sub-question partitioning and re-retrieve until the preset convergence condition is met or the iteration limit is reached. Output the target answer with complete thought chain tracing information. See details for the process. Figure 3 .

[0084] Step 3.1: Receive natural language questions from the user or the upper-level system. Through intent recognition model Once the problem intent category and related elements such as device, region, and time are obtained, the problem characteristics are matched with the "scene-subdomain-time window" index established in step one, and the matching score of each candidate unit is calculated. Select the unit with the highest score. As the main processing unit, several suboptimal units are reserved for parallel exploration when necessary.

[0085]

[0086] in, As an indicator function, when the problem is intended Belongs to the scene Preset set of intentions The value is 1 if the condition is met and 0 otherwise, and is used to measure the degree of matching with the business scenario. Scene identifier is recorded as The set of entities contained in the following is obtained from the knowledge graph. This indicates the number of intersections between the problem entity and the subdomain entities. This item calculates the entity coverage and measures the relevance between the problem and the subdomain. For time decay functions, such as sub ,in For time windows The central timestamp, This is the attenuation coefficient, used to measure time correlation. The weights are configurable and satisfy the following conditions: .

[0087] Step 3.2: Regarding the problem Computational complexity score

[0088]

[0089] in The number of entities identified, The number of implicit conditions, The length of the question. For weight parameters; when ( When the complexity threshold is reached, Treat it as a complex problem and decompose it into functions Obtain the set of subproblems

[0090]

[0091] Construct a directed dependency graph between subproblems , where edge set Indicate the precedence relationship between subproblems; the first In each iteration, the current set of target problems is denoted as . .

[0092] Step 3.3: For the first Each subproblem in the wheel In the knowledge base constructed in step two, the document retrieval function is called in parallel. Event chain retrieval function From document vector indexes respectively Event chain set and knowledge graph Obtain the candidate set: .

[0093] A set of intermediate conclusions is obtained by fusing and filtering candidate knowledge. Information such as its source nodes and confidence levels is collected, and corresponding thought chain nodes are constructed. Each node contains a "subproblem" The quadruple relation “-retrieval operation--candidate conclusion--knowledge reference” is used to classify all nodes into a subtask dependency graph. The topological order connection forms the first Layered thinking chain structure.

[0094] Step 3.4: For each intermediate conclusion Calculate the semantic domain score:

[0095]

[0096] in For text encoding functions; in graph-structured domains, based on knowledge graphs Calculate the shortest path length from the problem-related entity to the conclusion-related entity. The overall score is defined as follows:

[0097]

[0098] in , To adjust the weights, and to calculate the semantic / graph structure consistency difference.

[0099]

[0100] in It is the candidate with the highest overall score.

[0101] Step 3.5: When < ( When a preset consistency threshold is set, intermediate conclusions are accepted. And write it into the current layer's mesoscopic thought chain; when > If the document layer and graph layer retrieval weights, time window filtering conditions, or device similarity thresholds are adjusted first, steps 3.3 and 3.4 are re-executed; if the preset number of retries is reached... If the consistency condition is still not met, then structural backtracking is triggered, and the current subproblem is revisited. Revert to the previous set of questions Re-decompose the problem and reconstruct the dependency graph; when the first The intermediate conclusions of all subproblems converge to form a new problem. The termination condition is met, or the number of iterations is reached.

[0102] Step 4: Based on the multi-layered thought chain and target answer obtained in Step 3, monitor quality indicators such as the length of the current thought chain, the number of backtracking steps, the uncertainty of intermediate conclusions, and the response latency in real time during the reasoning process. When any indicator exceeds the preset range, trigger the online self-correction mechanism. Generate at least one corrected thought chain by adjusting the retrieval weights of the document layer and graph layer, limiting the graph search depth, merging low-yield sub-problems, or simplifying the sub-task dependency structure. This corrected thought chain is executed in parallel with the original thought chain in the remaining reasoning stage. Based on consistency scores and safety policies, the final output link and corresponding answer are selected from the corrected thought chain. At the same time, record the user's explicit rating of the answer, text correction, adoption of recommended solutions, and the actual processing effect in subsequent running data. Write the above feedback as tags into the corresponding micro, meso, and macro thought chain nodes to form thought chain samples with feedback annotations for subsequent offline evolution and model optimization.

[0103] Step 4.1: During the multi-layered thought chain reasoning process in Step 3, for each generated thought chain... Real-time calculation of its set of quality indicators and comparison of the indicators with a preset set of thresholds

[0104] ,

[0105] in, Indicates the length of the thought chain. Indicates the number of backtracking iterations. Indicates the uncertainty of intermediate conclusions.

[0106] Indicates response latency; and sets the metric with a preset threshold set. Compare them.

[0107] Step 4.2: When any quality index satisfies:

[0108]

[0109] When the time limit is exceeded, an online self-correction mechanism is triggered. The system selects at least one correction strategy based on the type of the exceeded indicator, including: adjusting the retrieval weight parameters of the document layer and the graph layer, reducing the multi-hop search depth of the graph, merging low-confidence sub-problems, or resetting the time window and scene filtering conditions.

[0110] Step 4.3: While maintaining the original thought chain, generate at least one modified thought chain based on the selected modification strategy. and the original thought chain With correcting the chain of thought The remaining inference phases are run in parallel; the consistency score of each parallel link is recorded. Security verification results and resource consumption indicators.

[0111] Step 4.4: After the parallel thought chain has finished executing, based on the comprehensive evaluation function:

[0112]

[0113] The link with the highest evaluation value and that meets the security policy constraints is selected from the original thinking chain and the revised thinking chain as the final output thinking chain, and the target answer is generated accordingly.

[0114] Step 4.5: Collect explicit feedback information from users on the output results, actual handling results after system operation, and subsequent power grid status change data, and map the feedback to micro-level thinking chain nodes, meso-level sub-problem links, and macro-level complete thinking chains, respectively, to generate thinking chain samples with feedback tags; write the samples, along with the corresponding scenario, subdomain, and time window identifiers, into the thinking chain sample library for subsequent offline evolution and data flywheel updates.

[0115] Step 5: Periodically, based on the thought chain samples with feedback annotations from Step 4, using "scenario-subdomain-time window" as the outer index, cluster the thought chains within the same unit according to problem type, link structure characteristics, and effect labels. Identify high-frequency error clusters, high-backtracking clusters, and knowledge conflict clusters, generating evolutionary tasks containing typical problem patterns, relevant knowledge nodes, and procedure version information. For the evolutionary tasks, automatically perform knowledge completion and version alignment, local graph structure reconstruction, and joint optimization of retrieval ranking strategies and thought chain templates. If necessary, incrementally train the question understanding model, retrieval model, or consistency discrimination model. Complete replay evaluation and version control in sandbox and gray-scale environments, and replace the existing versions with knowledge bases and strategies that outperform them online. Write the evaluation results and new links back to the thought chain sample library, thus forming a data flywheel self-evolution closed loop driven by thought chains. See details. Figure 4 .

[0116] Step 5.1: Periodically read the set of thought chain samples with feedback annotations from the thought chain sample library formed in Step 4. According to scene identifiers Subdomain identifier and time window indicators The samples are divided into buckets to obtain sample subsets. When the number of samples, the average number of backtracking attempts, or the proportion of negative feedback in any bucket exceeds a preset trigger threshold, a corresponding evolutionary task is generated. .

[0117] Step 5.2: For each evolutionary task Extracting structural feature vectors from the thought chain samples.

[0118] ,

[0119] in For chain length, For the number of backtracking steps, For the average consistency score, The feature vector set is used to perform clustering operations to obtain high-frequency error clusters, high backtracking clusters, and low consistency clusters, which are used to locate the type of system performance bottleneck.

[0120] Step 5.3: Based on the dominant characteristics of each cluster, automatically determine the evolution type as at least one of the following: knowledge missing, knowledge conflict, retrieval strategy mismatch, or redundant thought chain structure; generate corresponding evolution strategy sets for different evolution types, including: graph node completion and relationship reconstruction, procedure and version consistency alignment, document and graph joint retrieval ranking function update, and sub-problem decomposition template and backtracking control strategy adjustment.

[0121] Step 5.4: Execute the evolution strategy in an isolated sandbox environment, evaluate the updated knowledge base, retrieval strategy, or thought chain template by replaying historical thought chains, and calculate the gain metrics in consistency score, backtracking count, and response latency before and after evolution; only when the gain metrics meet the requirements...

[0122]

[0123] Only then will the corresponding evolution results be submitted to the version control module and enter the canary release phase.

[0124] Step 5.5: Replace the knowledge structure, strategy parameters, or model version that has passed the gray-scale verification with the online system, and continuously monitor its effect during the subsequent online inference process; at the same time, write the evolution version identifier, performance evaluation results, and newly generated mind chain samples back to the mind chain sample library to trigger the next round of evolution process from Step 5.1 to Step 5.4, thereby forming a data flywheel self-evolution closed loop driven by mind chain samples.

[0125] Based on the above-described method for constructing a smart grid knowledge base, this invention also discloses a device for constructing a smart grid knowledge base based on thought chain tracing and data flywheel self-evolution, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed, it causes the processor to implement the steps in the above-described method for constructing a smart grid knowledge base based on thought chain tracing and data flywheel self-evolution.

[0126] To verify the effectiveness of the smart grid knowledge base construction method based on mind chain tracing and data flywheel self-evolution proposed in this invention, a rigorous comparative experiment was designed.

[0127] Test question bank:

[0128] Publicly available industry case studies: Typical accident descriptions are extracted from publicly published industry materials such as the "Compilation of Typical Fault Cases of Accident Prevention Measures in China Southern Power Grid" and transformed into questions of the "Cause Analysis" and "Handling Decision" categories.

[0129] Publicly available standard datasets: Utilize publicly available datasets on the IEEE DataPort platform (such as electromagnetic transient simulation datasets) to design specific diagnostic and identification problems based on their event labels (such as high-resistance faults and voltage sags).

[0130] Q&A on Regulations and Clauses: Extracting relevant clauses that require interpretation and application from publicly available operating regulations and safety provisions issued by State Grid Corporation of China, China Southern Power Grid, and other organizations.

[0131] The final test set consists of 200 independent questions, which are evenly distributed across four business scenarios: operation monitoring, fault diagnosis, maintenance decision-making, and procedure query. At least 50% of these questions are complex and require multi-step reasoning.

[0132] Comparison method:

[0133] Baseline System A: A traditional retrieval system based on keyword matching, simulating the technologies commonly used in many current enterprise knowledge bases.

[0134] Baseline System B: Employs a general-purpose language model that has not been fine-tuned for a specific power grid sector. It uses designed prompts to answer questions, representing an emerging but non-specialized technical approach.

[0135] The system of this invention: a prototype system that fully implements the method of this patent.

[0136] Experimental Results and Analysis:

[0137] Evaluation System Overall accuracy Simple question accuracy Accuracy of complex problems System A 68.9% 80.6% 57.2% System B 82.6% 92.3% 72.9% This invention system 90.5% 96.2% 84.8%

[0138] The experimental results strongly confirm that this patented system not only performs robustly in routine queries, but its true breakthrough value lies in solving the automation and accuracy problems of complex analytical decision-making tasks in the power grid field. The high accuracy rate of 84.8% for complex problems signifies a new level of capability in understanding, decomposition, and reasoning, a qualitative leap brought about by the "thinking chain tracing" and "hierarchical knowledge base" design. Simultaneously, all system outputs are accompanied by complete tracing information, ensuring both high accuracy and the interpretability and auditability of the decision-making process, fully meeting the application requirements of high-reliability power systems.

[0139] The above embodiments are only for illustrating the technical concept and features of the present invention, and are intended to enable those skilled in the art to understand the content of the present invention and implement it accordingly. They should not be construed as limiting the scope of protection of the present invention. All equivalent transformations or modifications made in accordance with the spirit and essence of the present invention should be covered within the scope of protection of the present invention.

Claims

1. A method for constructing an intelligent power grid knowledge base based on thought chain tracing and data flywheel self-evolution, characterized in that, Includes the following steps: Step 1: Divide the power grid into several "scene-subdomain" units and set time windows for each unit; collect and preprocess power grid data using the "scene-subdomain-time window" combination as an index, and add scene, subdomain and time window labels to the preprocessed data to form a three-dimensional indexed power grid original dataset; Step 2: Process the text data, time series data, equipment ledgers and structured record entity data in the original 3D indexed power grid dataset to obtain document fragments and their document vector indexes, event chains of equipment state transitions and power grid knowledge graph triples of relevant entities. Then, attach the document fragments and event chains to the knowledge graph through shared entity nodes to obtain a hierarchical power grid knowledge base. Step 3: Map the power grid problem to the corresponding "scenario-subdomain-time window" unit, decompose the complex problem into several sub-problems step by step, perform parallel retrieval and multi-hop graph search on the document vector index, event chain index and power grid knowledge graph respectively for the sub-problems, construct a multi-layer thinking chain structure, and trigger backtracking based on consistency judgment to output the target answer with complete thinking chain traceability information; Step 4: In the reasoning stage, monitor quality indicators in real time, generate at least one corrected thought chain based on the online self-correction mechanism, and execute it in parallel with the original thought chain in the remaining reasoning stages. Select the best one to determine the final output chain and corresponding answer, and form a thought chain sample with feedback annotation. Step 5: Periodically cluster the thought chains within the same unit based on the thought chain samples with feedback annotations, using "scenario-subdomain-time window" as the outer index, generate evolution tasks, and automatically perform joint optimization for the evolution tasks to form a data flywheel self-evolution closed loop driven by thought chains.

2. The method for smart grid knowledge base construction based on thought chain tracing and data flywheel self-evolution according to claim 1, characterized in that, The specific method for step 1 is as follows: Step 1.1: Based on business scenarios and elements such as voltage level, geographical region, and equipment type, classify the power grid business objects, divide the target power grid into several "scenario-subdomain" units, and establish an index mapping table for each unit; Step 1.2: For each "scene-subdomain" unit, pre-configure multi-scale time window parameters at the minute, hour, day, or week level to generate a corresponding time window set, which is used to constrain the scope of subsequent data collection and retrieval; Step 1.3: Using the combination of "scene-subdomain-time window" as a three-dimensional index, automatically collect matching data from SCADA / EMS measurement system, equipment ledger system, operation and maintenance work order system, alarm and accident record library, procedure standard library and historical Q&A log library, and complete noise reduction, deduplication, missing data completion, timestamp alignment and equipment code mapping during the collection process; Step 1.4: Add corresponding scene identifiers, subdomain identifiers, time window identifiers, and device identifiers to the preprocessed data records, and store them as a multi-source power grid raw dataset with three-dimensional index labels.

3. The method of claim 1, wherein, In step 2, the text data includes regulations and standards, accident reports, expert records, and historical Q&A; the time-series data includes telemetry curves, alarms, and operation records. Entities of equipment, lines, regions, fault types, and regulations are extracted from equipment ledgers and structured records, along with their hierarchical, connection, causal, and constraint relationships. The text data is segmented and feature-extracted to generate document fragments, and a document vector index is constructed using semantic encoding. The time-series data is sorted by time and labeled with status to construct an event chain of equipment status changes. The hierarchical power grid knowledge base includes a document layer, an event layer, and a graph layer, and retains scene, subdomain, and time window identifiers.

4. The method of claim 1, wherein, The specific process in step 3 is as follows: Step 3.1: receiving a natural language question input by a user or transmitted by an upper system , obtaining a question intent category and involved devices, areas, and time elements by an intent recognition model , matching question features with a "scene-subdomain-time window" index, and calculating a matching score of each candidate unit , the matching score is obtained by weighted summation of intent matching degree, entity coverage, and time relevance, and the specific calculation formula is as follows: ; in, As an indicator function, when the problem is intended Belongs to the scene Preset set of intentions The value is 1 if the condition is met and 0 otherwise, and is used to measure the degree of matching with the business scenario. Scene identifier is recorded as The set of entities contained in the following is obtained from the knowledge graph. This indicates the number of intersections between the problem entity and the subdomain entities. This item calculates the entity coverage and measures the relevance between the problem and the subdomain. Let be the time decay function. The weights are configurable and satisfy the following conditions: Select the unit with the highest score. As the main processing unit, it retains scores above the threshold when necessary. Several suboptimal units are used for parallel probing; Step 3.2: Regarding the problem Computational complexity score: ; in, The number of entities identified, The number of implicit conditions, The length of the question. For weight parameters; when Greater than the complexity threshold At that time, Treat it as a complex problem and decompose it into functions The set of subproblems is obtained: ; in, For the first The issue of height. This represents the total number of subproblems in this round; subsequently, a directed dependency graph is constructed between the subproblems. edge set Indicate the precedence relationship between subproblems; the first In each iteration, the current set of target problems is denoted as . ; Step 3.3: For the first Each subproblem in the wheel In the knowledge base constructed in step 2, the document retrieval function is called in parallel. Event chain retrieval function From document vector indexes respectively Event chain set and knowledge graph Obtain the candidate set: ; A set of intermediate conclusions is obtained by fusing and filtering candidate knowledge. It includes the source nodes and confidence information, and constructs the corresponding thought chain nodes. Each node contains a subproblem. The quadruple relation “-retrieval operation--candidate conclusion--knowledge reference” is used to classify all nodes into a subtask dependency graph. The topological order connection forms the first Mesoscopic thinking chain structure; Step 3.4: For each intermediate conclusion Calculate the semantic domain score: ; in, For text encoding functions; in graph-structured domains, based on knowledge graphs Calculate the shortest path length from the problem-related entity to the conclusion-related entity. The overall score is defined as follows: ; in , To adjust the weights and calculate the semantic / graph structure consistency difference: ; in, The candidate with the highest overall score; Step 3.5: When , To set a consensus threshold, intermediate conclusions are accepted. And write it into the current layer's mesoscopic thought chain; when > If the document layer and graph layer retrieval weights, time window filtering conditions, or device similarity thresholds are adjusted first, steps 3.3 and 3.4 are re-executed; if the preset number of retries is reached... If the consistency condition is still not met, then structural backtracking is triggered, and the current subproblem is revisited. Revert to the previous set of questions Then, re-decompose the problem and reconstruct the dependency graph; when the first The intermediate conclusions of all subproblems converge to form a new problem. The termination condition or the number of iterations is met.

5. The method for constructing a smart grid knowledge base based on thought chain tracing and data flywheel self-evolution as described in claim 1, characterized in that, In step 4, the quality indicators include the length of the thought chain, the number of backtracking steps, the uncertainty of intermediate conclusions, and the response latency. When any indicator exceeds the preset range, an online self-correction mechanism is triggered. The online self-correction mechanism generates at least one corrected thought chain by adjusting the retrieval weights of the document layer and the graph layer, limiting the multi-hop search depth of the graph, merging low-confidence sub-problems, or resetting the time window and scene filtering conditions. This corrected thought chain is executed in parallel with the original thought chain in the remaining reasoning stage. Based on the consistency score, security verification results, and resource consumption indicators, the final output link and corresponding answer are selected from the corrected one. At the same time, the explicit rating of the answer by the user, text correction, adoption of the recommended solution, and the actual handling effect in the subsequent running data are recorded. The above feedback is written as a label into the corresponding micro, meso, and macro thought chain nodes to form a thought chain sample with feedback annotation.

6. The method for constructing a smart grid knowledge base based on thought chain tracing and data flywheel self-evolution as described in claim 5, characterized in that, After the parallel thought chain execution is completed, based on the comprehensive evaluation function: ; in, This represents the thought chain to be evaluated. This indicates the chain of thought. Average consistency score This indicates its response latency, and rc indicates its backtracking count; , , These are the preset positive weight coefficients for the corresponding items; the link with the highest evaluation value and that meets the security policy constraints is selected from the original thinking chain and the revised thinking chain as the final output thinking chain, and the target answer is generated accordingly.

7. The method for constructing a smart grid knowledge base based on thought chain tracing and data flywheel self-evolution as described in claim 1, characterized in that, The specific method for step 5 is as follows: Step 5.1: Periodically read the set of thought chain samples with feedback annotations from the thought chain sample library formed in Step 4. According to scene identifiers Subdomain identifier and time window indicators The samples are divided into buckets to obtain sample subsets. When the number of samples, the average number of backtracking attempts, or the proportion of negative feedback in any bucket exceeds a preset trigger threshold, a corresponding evolutionary task is generated. ; Step 5.2: For each evolutionary task Extract the structural feature vector from the thought chain sample: ; in, For chain length, For the number of backtracking steps, For the average consistency score, To determine the multi-hop depth of the graph; perform clustering operations on the feature vector set to obtain high-frequency error clusters, high backtracking clusters, and low consistency clusters, which are used to locate the type of system performance bottlenecks; Step 5.3: Based on the dominant characteristics of each cluster, automatically determine the evolution type as at least one of the following: knowledge missing, knowledge conflict, retrieval strategy mismatch, or redundant thought chain structure; generate corresponding evolution strategy sets for different evolution types, including: graph node completion and relationship reconstruction, procedure and version consistency alignment, document and graph joint retrieval ranking function update, and sub-problem decomposition template and backtracking control strategy adjustment; Step 5.4: Execute the evolutionary strategy in an isolated sandbox environment, evaluate the updated knowledge base, retrieval strategy, or thought chain template by replaying historical thought chains, and calculate the consistency score before and after evolution. Number of backtracking steps Gain metrics related to response delay To make the gain index satisfy Only then will the corresponding evolution results be submitted to the version control module and enter the canary release phase, whereby... and These are preset positive threshold numbers; Step 5.5: Continuously monitor the effect during the subsequent online inference process, and write the evolution version identifier, performance evaluation results and newly generated thought chain samples back to the thought chain sample library to trigger the next round of evolution process from Step 5.1 to Step 5.4, forming a data flywheel self-evolution closed loop driven by thought chain samples.

8. A smart grid knowledge base construction device based on thought chain tracing and data flywheel self-evolution, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the computer program is executed, it causes the processor to implement the steps in the method for constructing a smart grid knowledge base based on mind chain tracing and data flywheel self-evolution as described in any one of claims 1 to 7.