A scene interactive reasoning engine construction method and system for power grid training
By constructing a multi-source heterogeneous knowledge graph for power training and an interactive reasoning engine for fine-tuning large models, the problems of knowledge heterogeneity and fragmented reasoning links in power grid training have been solved. This has enabled the unified structuring and adaptive closed-loop of power training knowledge, improving the accuracy of intelligent reasoning and the efficiency of the training system.
Patent Information
- Application Number
- CN202611512617.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-28
- Publication Date
- 2026-11-24
AI Technical Summary
Existing power grid training suffers from problems such as diverse and heterogeneous knowledge sources, insufficient semantic understanding, severe professional illusions due to large models, and fragmented reasoning links across multiple scenarios. These issues lead to difficulties in entity alignment, incomplete structured knowledge systems, poor reasoning accuracy, and an inability to achieve closed-loop linkage in the training process.
It adopts an overall architecture with a single inference kernel and a globally unified scheduling center. Through the construction of a multi-source heterogeneous knowledge graph for power training, fine-tuning of a large model with bidirectional constraints on the knowledge graph, unified interactive reasoning in multiple scenarios, and cross-scenario linkage of learning data, it achieves unified structured modeling of power training knowledge and precise suppression of the large model, and supports adaptive closed loops for intelligent question answering, fault inference, and adaptive assessment.
It improves the reasoning accuracy and functional reusability of the power grid intelligent training system, realizes the standardization and personalized adaptation of power training knowledge, improves the accuracy and interpretability of intelligent reasoning results, eliminates the interaction gaps and data barriers in multiple scenarios, and realizes an adaptive closed loop for the entire learning, practice and testing process.
Smart Images

Figure CN123158375A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of power systems, and specifically relates to a method and system for constructing a scenario-based interactive reasoning engine for power grid training. Background Technology
[0002] With the continuous construction of new power systems, the industry is gradually introducing knowledge graphs and large models to conduct intelligent training in order to cope with iteratively updated fault types, operation and maintenance procedures, and safety standards. However, existing technical solutions still have the following shortcomings for power scenarios: First, the sources of knowledge for power grid training are diverse and heterogeneous, covering safety regulations, equipment principles, practical procedures, assessment points and fault cases. Existing general knowledge extraction methods are difficult to adapt to the semantics of the power industry, resulting in difficulties in entity alignment and an imperfect structured knowledge system. Second, large language models suffer from insufficient semantic understanding and factual illusion in the power sector, resulting in outputs lacking traceable evidence. Specifically, when answering questions, large language models generate seemingly reasonable and fluent content that is actually inconsistent with reality or completely fabricated. Furthermore, one-way RAG (Retrieval Augmentation) can only supplement external knowledge and is insufficient for inversely constraining and correcting the model's reasoning process. Third, functions such as intelligent question answering, fault inference and adaptive assessment are usually implemented separately, lacking a unified scheduling and context sharing mechanism, resulting in data fragmentation, duplicate inference links and low system collaboration efficiency. Summary of the Invention
[0003] To address the technical shortcomings of existing power grid training systems, such as difficulties in modeling heterogeneous knowledge, severe professional illusions in large models with unexplainable outputs, independent and fragmented reasoning links across multiple training scenarios, and the inability to achieve closed-loop linkage of learning data, this invention provides a method and system for constructing a scenario-based interactive reasoning engine for power grid training. It adopts an integrated architecture combining a single reasoning kernel with a globally unified scheduling center. Through four core modules—constructing a multi-source heterogeneous knowledge graph for power training, fine-tuning a large model with bidirectional constraints on the knowledge graph, unified interactive reasoning across multiple scenarios, and cross-scenario linkage of learning data—it achieves unified structured modeling of power training knowledge, precise suppression of large model illusions, unified support of three core training business types by a single reasoning kernel, and an adaptive closed-loop learning, practice, and assessment process. This improves the reasoning accuracy, functional reusability, and personalized adaptation capabilities of the power grid intelligent training system.
[0004] The present invention adopts the following technical solution: Based on heterogeneous data from the power system, a unified representation vector with business attributes is extracted to form a standardized power training dataset; based on the training dataset, a compliance-standardized knowledge triplet is constructed, the power grid training scenario graph structure is defined, and a knowledge graph is established. Based on the knowledge content in the knowledge graph, natural language training samples corresponding to different power grid training scenarios are derived through template filling. LoRA low-rank adaptation is used to supervise and fine-tune the large language model. Reinforcement learning training samples are constructed from the knowledge graph to distinguish the training scenarios and to reinforce the large language model after supervision and fine-tuning. In interactive reasoning, the current training scenario is identified and scenario-adaptive knowledge subgraphs are selected from the knowledge graph; the scenario-adaptive knowledge subgraphs and user interaction text are input into the large language model after reinforcement training for reasoning, and the reasoning text is output; all interaction data is retained during the interactive reasoning process. Periodically extract multi-source learning data from the interaction data to assess the user's mastery of the training knowledge points; calculate the cross-scenario linkage trigger factor by combining the multi-source learning data with the mastery level, and compare it with the preset trigger threshold of the current training scenario, so as to drive the adaptive switching of training scenarios during the training process.
[0005] The process of constructing the standardized power training dataset includes: After preprocessing the heterogeneous data of the power system, a block-based business text dataset is output and categorized and organized according to storage format. The normalized data is converted into a text semantic vector, and then concatenated with the business label vector to form a unified semantic representation vector, outputting a standardized power training dataset with business labels; each sample in the training dataset contains business text, a unified semantic representation vector, and a business classification label.
[0006] Furthermore, the construction process of the compliance standardization knowledge triple includes: From a single text in the training dataset, entities are extracted to form candidate entity relationship pairs. After mutual information filtering and maximum entropy classification, compliance standardization knowledge triples are output. The structure of the triples includes a head entity, a tail entity, and a business relationship. In the maximum entropy classification, the determination relationship is verified by introducing power industry rule constraints.
[0007] Furthermore, a knowledge quality score is generated for the compliant and standardized knowledge triplet from three dimensions: knowledge authority, knowledge timeliness, and knowledge completeness; different training scenarios filter the access triplets through the threshold of the knowledge quality score. The training scenarios include intelligent question-and-answer scenarios, fault simulation scenarios, and adaptive assessment scenarios.
[0008] Furthermore, the construction process of the knowledge graph includes: Corresponding to the structure of triples, the node categories and associated edge categories in the knowledge graph of the power training scenario are defined, and the node entities are merged by synonyms; During the synonym merging process, a baseline weight is assigned to each knowledge node to distinguish between different power training scenarios. The weight is then corrected by the knowledge quality score of the triplet to obtain the scenario adaptation weight of the node. The scenario adaptation weights are used to invoke triples in different training scenarios.
[0009] Furthermore, the derivation process of the natural language training samples includes: Traverse all node entities in the knowledge graph and retrieve the standardized description text bound to the node; Using the head entity, tail entity, business relationship, and entity-related attributes of the triple as slots, and pre-configured question-and-answer templates, fault description templates, and assessment answer templates as sentence skeletons; extracting entity names, fault phenomena, operation actions, constraints, and relevant clauses from the standard description text and filling them into the corresponding slots; then using a thesaurus to replace non-safety key terms to generate natural language text for the scenario. The entity semantic vector, the scene natural language text, and the scene identifier are used to construct a natural language training sample.
[0010] Furthermore, in the aforementioned monitoring and fine-tuning: The natural language training samples corresponding to the three training scenarios are mixed and trained in a unified manner. The alignment loss function in the training is defined as the difference between the semantic encoding vector output by the large language model and the semantic vector of the graph entity.
[0011] Furthermore, the reinforcement training includes: The large language model after supervision and fine-tuning is used as the initial model for reinforcement learning. The corresponding standard knowledge paths are extracted from the knowledge graph according to the training scenario to construct reinforcement learning training samples. The reinforcement learning training samples are composed in the form of knowledge points. Each knowledge point consists of the head entity, tail entity, related edge and node attached description text of a compliant standardized knowledge triple in the knowledge graph. The interactive text corresponding to the reinforcement learning training samples is input into the initial reinforcement learning model, and candidate response text is output. The interactive text refers to the corresponding data object of the natural language training samples in the online stage, that is, the original natural language text input by the user in the training scenario.
[0012] The output text of the large model is validated point by point based on standard knowledge points. The reinforcement learning reward function is defined as the ratio of the weighted total score of the effective knowledge points to the weighted total score of all standard knowledge points. Among them, effective knowledge points refer to the knowledge points in the candidate answer text that match the knowledge graph.
[0013] Furthermore, the process of filtering the scenario-adaptive knowledge subgraph includes: During the initial inference, the current training scenario is determined based on the user input, the scenario adaptation weights corresponding to the current training scenario are loaded, the large language model after reinforcement training is called to perform inference, and the interactive learning data is recorded; when the interactive learning data reaches the scenario switching threshold, the training scenario is switched and inference is performed again. The scenario adaptation weight is used to correct the matching results when retrieving triples in the knowledge graph based on user input and the current training scenario, and to generate a scenario-adapted knowledge subgraph.
[0014] Furthermore, the method for calculating the mastery of the aforementioned knowledge points is as follows: The multi-source learning data consists of interactive statistics of knowledge points for each type of training scenario. For each type of training scenario, the normalized score corresponding to that training scenario is calculated based on the corresponding knowledge point interaction statistics. By weighting the normalized performance scores of the three training scenarios, we can obtain the user's mastery of the knowledge points.
[0015] Furthermore, the cross-scenario linkage triggering factor is calculated based on a comprehensive analysis of the number of questions asked about a knowledge point, the level of mastery, and the number of errors. The beneficial effects of this invention are that, compared with the prior art, This invention discloses a multi-scenario interactive reasoning engine for power grid training that integrates graphs and models. Through a progressive architecture design that combines multi-source knowledge unified modeling, bidirectional constraint fine-tuning of large models based on knowledge graphs, integrated reasoning across multiple scenarios, and closed-loop linkage of learning across scenarios, it effectively solves the technical problems existing in current smart power grid training, such as non-standard knowledge modeling, poor accuracy of professional reasoning in large models, fragmented multi-scenario architecture, and inability to achieve closed-loop linkage of training processes. It has the following three core technical benefits.
[0016] This invention achieves standardized and structured unified modeling of heterogeneous training knowledge from multiple power sources, constructing a dedicated domain knowledge foundation adaptable to all training operations. For heterogeneous data such as power grid regulations, equipment documentation, practical procedures, assessment standards, and field fault cases, this invention completes data normalization, knowledge extraction, authority assessment, and entity alignment processing, forming a structurally unified, semantically standardized, and traceable power training knowledge system, and storing it in a graph database. This effectively improves upon the problems of traditional knowledge modeling, such as disorganization, inconsistent standards, and poor scenario adaptability, providing stable and unified knowledge support for large-scale model fine-tuning, multi-scenario intelligent reasoning, and learning-based collaborative analysis.
[0017] This invention employs a hierarchical fine-tuning strategy with bidirectional constraints based on knowledge graphs, effectively optimizing the domain-specific reasoning capabilities of large models and alleviating the illusion problem in specialized scenarios. Unlike traditional single-retrieval enhancement schemes, this invention constrains the model's reasoning logic from two dimensions: text knowledge vector alignment and reverse correction of output results. It leverages standardized knowledge graphs to optimize the model's domain-specific semantic understanding and output standardization, ensuring that the output content of model question answering, fault deduction, and assessment judgments aligns with power grid operation and maintenance and training standards. This improves the accuracy, compliance, and interpretability of intelligent reasoning results, adapting to the high-rigor training requirements of the power grid.
[0018] This invention establishes an integrated architecture combining a single-core unified reasoning mechanism with finite state machine global scheduling, effectively eliminating interaction gaps and data silos across multiple scenarios, and achieving an adaptive closed-loop process for the entire power grid training process (learning, practice, and assessment). This invention abandons the fragmented architecture of traditional multi-scenario independent reasoning, ensuring complete continuity of context and learning data during scenario switching through a unified scheduling mechanism. Simultaneously, relying on comprehensive learning data collection, quantitative assessment of knowledge points, and a dynamic scenario triggering mechanism, it achieves autonomous linkage and flow between intelligent question answering, fault simulation, and adaptive assessment scenarios. This effectively improves system module reusability and operational efficiency, and allows for adaptive adjustment of the training process based on trainees' learning progress, achieving a closed-loop intelligent power grid training that combines standardization and personalization. Attached Figure Description
[0019] Figure 1 It is a flowchart of knowledge graph construction; Figure 2 This is a schematic diagram of the structure of the multi-scenario interactive reasoning engine for power grid training. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of this invention. The embodiments described in this application are merely some embodiments of this invention, and not all embodiments. Based on the spirit of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of this invention.
[0021] In one embodiment, a specific implementation of the scenario-based interactive reasoning engine construction method for power grid training proposed in this application is given.
[0022] S1. In one implementation, see Figure 1 Based on heterogeneous data from the power system, a unified representation vector with business attributes is extracted to form a standardized power training dataset; based on the training dataset, a compliance-standardized knowledge triplet is constructed, the power grid training scenario graph structure is defined, and a knowledge graph is established.
[0023] 1.1 In a further implementation, the original heterogeneous data of the power system is preprocessed and a standard dataset is output through unified representation transformation.
[0024] The original heterogeneous data of the power system includes five categories of data: power safety work procedures texts, primary and secondary equipment technical manuals, standardized operation and maintenance practice procedures, job assessment and scoring specifications, and past power grid field fault cases.
[0025] Various types of data correspond to different business needs in different scenarios. The power safety work procedure text provides a compliance benchmark for answering theoretical questions. The technical manuals of primary and secondary equipment provide mechanistic support for fault simulation. The standardized operation and maintenance practice process provides a step basis for simulation interaction. The job assessment and scoring specifications provide an evaluation standard for automatic scoring. Past power grid field fault cases supplement the experience in handling non-standard working conditions.
[0026] Furthermore, the five types of raw heterogeneous data are divided into three categories according to their storage format: (1) Unstructured text: Power safety work regulations text, and past power grid field fault cases. The data consists of purely free paragraph text, without a fixed table / flowchart format, with varying paragraph lengths, and contains colloquial field records and scattered clauses; (2) Semi-structured graphic manuals: technical specifications for primary and secondary equipment, and job performance evaluation standards. The data consists of text interspersed with equipment schematics, wiring diagrams, evaluation tables, and subheadings. The text and graphics are mixed, and there are some fixed formats but no unified time sequence as a whole. (3) Structured time sequence process: Standardized operation and maintenance practice process. Its data is strictly sorted according to the order of operations, including step number, operation object, operation conditions, and security constraint fields, which are standard time sequence structured form data.
[0027] In a further embodiment, the preprocessing steps for the above three types of data include general noise reduction and cleaning, and type-specific processing.
[0028] General noise reduction cleaning includes: (1) Remove invalid content; filter watermarks, headers and footers, document numbers, blank line breaks, garbled characters from scans, advertising labels, and duplicate or redundant clauses; delete vendor advertisements, equipment procurement prices, and project bidding information that are unrelated to power grid training; (2) Format fragment integration: split long paragraphs of text without segmentation, merge procedures and fault records that are broken across pages; separate images, tables and plain text content for semi-structured manuals and store them separately in image and text blocks; remove incomplete process entries with missing key fields from structured processes. (3) Abnormal text filtering: delete invalid short sentences with too many typos, semantic breaks, or no business entities, and filter duplicate content in the entire paragraph.
[0029] Specific processing for different types includes: (1) For unstructured text; For the text of power safety work regulations, the following measures are implemented: Clause segmentation and standardization: Long regulations are divided into independent, minimum compliant clause units using compliance keywords such as "Article X," "prohibited," "shall," and "must" as separators; Unified terminology replacement: Multiple types of power terms with the same meaning are standardized, for example, "switch" and "circuit breaker" are uniformly standardized as "circuit breaker," and "knife switch" and "disconnect switch" are uniformly standardized as "disconnect switch," eliminating synonymous and inconsistent expressions; Safety level labeling: Each regulation is automatically labeled with a risk level tag (general risk / major safety risk).
[0030] For past power grid field fault cases, the following steps were taken: Case element segmentation: Free text was split into five categories: "faulty equipment, fault phenomenon, fault cause, handling steps, and accident consequences"; Spoken language to written language conversion: Spoken language in field records such as "burned out" and "tripped out" was uniformly replaced with standard power terminology such as "equipment burned out" and "protection action tripped"; Irrelevant records were removed: Idle chatter among field personnel and irrelevant inspection records were deleted, and only complete closed-loop records of fault handling were retained.
[0031] (2) For semi-structured graphics and text; For technical manuals of primary and secondary equipment, the following procedures are followed: Decoupling and unification of diagrams and text: Equipment schematics and wiring diagrams are stored separately, and text annotations in the diagrams are extracted as text descriptions and bound to the corresponding equipment mechanism paragraphs; Standardization and unification of parameters: The units for parameters such as rated voltage, current, and capacity of the equipment are standardized, two decimal places are retained, and field names are standardized (such as "rated capacity", no longer using "capacity" and "rated power" interchangeably); Structured chapter marking: Differentiate between three sub-chaps: equipment structure, operating principle, and fault characteristics, and add chapter category tags.
[0032] For the job performance evaluation and scoring standards, the following steps are implemented: Structured parsing of the tables is performed to extract the evaluation items, deduction standards, and passing thresholds from the scoring tables, converting them into standard key-value pairs; evaluation dimensions are categorized, with scattered scoring items classified into three categories: theoretical evaluation, practical evaluation, and safety regulations; and scoring rules are standardized, unifying the logical expression of full marks and deductions, eliminating vague descriptions such as "discretionary deduction" or "minor penalty," and quantifying them into fixed score ranges.
[0033] (3) Perform time sequence verification and cleaning on structured time sequence process text: remove incomplete processes with reversed steps or missing pre-safety measures; complete and unify fields: unify fixed fields for each process: operation sequence number, operation equipment, operation action, safety constraint, operation result; mark parallel / branch process: distinguish between single sequential operation, multi-device parallel operation, and fault branch handling process, and add time sequence identifiers.
[0034] After the general and specific preprocessing steps described above are completed, a normalized and segmented business text dataset is output. All five types of data are split into the smallest independent text units with unified terminology and business tags, and stored in three different formats: normalized plain text blocks, image-text bound text blocks, and structured time-series form blocks.
[0035] In a further implementation, the processed data undergoes a unified representation transformation to achieve a unified vector representation of the three types of data (unstructured, semi-structured, and structured), including the following steps: First, the three types of text are standardized: for unstructured text, the complete blocks of text are directly used as the input sequence; for semi-structured text and images, the image text descriptions, table content, and body text are concatenated into a complete and ordered text sequence, and the image-text binding relationship is embedded as an additional tag in the sequence; for structured sequential processes, the form fields are concatenated into a coherent descriptive text according to the "operation order + constraint conditions + operation object", and the sequence number is used as a prefix marker of the sequence.
[0036] Then, a pre-trained power BERT model was used to complete word segmentation based on the power grid professional vocabulary. Fixed-dimensional semantic vectors were generated for each segment of the serialized unified text. Domain word weights were added for equipment, fault, and safety terms to improve the accuracy of professional vocabulary representation.
[0037] Finally, data types (structured, semi-structured, and unstructured), risk levels (corresponding to unstructured power safety work procedures text), assessment types (corresponding to semi-structured graphic and text-based job assessment scoring specifications), and time sequence numbers (corresponding to structured time sequence process text) are converted into low-dimensional label vectors. These vectors are then concatenated and fused with the text semantic vectors to form a unified representation vector that integrates business attributes. After the unified representation transformation is completed, a standardized power training dataset with business labels is output. Each sample in the dataset contains: business text, a unified semantic representation vector, and a business classification label.
[0038] 1.2 In a further implementation, based on a standardized power training dataset, power training knowledge is automatically extracted to generate structured knowledge triples.
[0039] First, define the extraction targets: Entity types include equipment entities (power equipment objects such as transformers, circuit breakers, and disconnectors), fault entities (equipment anomalies, protection actions, fault types, etc.), operation action entities (maintenance operations such as inspection, repair, and switching on / off), safety standard entities (operational prohibitions, safety measures, procedural requirements, etc.), assessment point entities (theoretical knowledge points, practical scoring points, safety requirements, etc.), and operating condition entities (operating status, environmental conditions, fault scenarios, etc.); Relationship types include business relationships such as mechanism (between equipment and fault), operation prerequisite (between operation actions and equipment), fault causes, compliance constraints (between operation and safety standards), assessment association (between assessment content and knowledge points), and handling plan (between fault and handling measures).
[0040] Then, the BERT model, fine-tuned with a power industry corpus, is used to extract contextual semantic information from the regularized text in the standardized power training dataset. Based on the context, professional semantics such as equipment names, fault descriptions, operating behaviors, and safety regulations are distinguished to generate text feature vectors containing semantic information in the power industry.
[0041] Furthermore, the text feature vectors output by BERT are input into the BiLSTM network to capture the correlation between texts, learn the time dependency relationship in the fault evolution process, identify the operation sequence relationship in the operation and maintenance process, and extract the correlation features between equipment state changes and safety constraints. That is, the text feature vectors of the three types of data are processed separately, and the deep features of power text corresponding to the three types of data are output.
[0042] Furthermore, based on the deep features of power-related texts, the NER model in the power field is used to identify specialized entities in the text and output the six types of entities defined above.
[0043] Iterate through the entities identified within a single text entry, and combine any two entities to form candidate entity relationship pairs [head entity and tail entity]. Examples include [circuit breaker - failure to operate], [maintenance operation - safety procedure], and [protection action - tripping phenomenon].
[0044] In a further implementation, to address the issue of a large number of generic terms, colloquial descriptions, and lack of business-related information in power-related texts, mutual information features are used to filter candidate entity relationship samples: ; In the above formula, This is a set of lexical features for power-related texts. A predefined set of relational labels for power training; For the joint probability of words and relations, , These represent the marginal probabilities of the two. A fixed filtering threshold is set to remove low-relevance and invalid text features, while retaining highly specific features relevant to the power sector, ensuring that the extracted content aligns with the business needs of the three training scenarios.
[0045] In a further implementation, the candidate entity pairs filtered by mutual information and their corresponding text features are input into the maximum entropy classification algorithm to complete the classification of relationships between entities. This accurately identifies power grid-specific business relationships such as equipment-fault, fault-phenomenon, operation-specification, and test point-knowledge point, thus improving the knowledge triple association logic. In one example implementation, the specific steps for relationship determination and triple output based on maximum entropy classification are given: (1) For each candidate entity pair after mutual information filtering, construct complete input information as a sample. This includes header entities, footer entities, contextual text, and business tags; for example: Head entity x: 110kV main transformer (power equipment entity); Tail entity y: insulation aging (fault type entity); Context text: 110kV main transformer is prone to insulation aging faults when operating under load for a long time, and aging will cause winding overheating; Business tag: Data source is national standard regulations, text belongs to interactive fault simulation scenario.
[0046] (2) Define a feature template, which consists of two fixed pairs, including matching conditions and a binary feature function specific to power business; The matching criteria are the rules for judging the head entity, tail entity, text, and business tags; Binary characteristic function The value is 1 if the matching condition is met, and 0 otherwise.
[0047] In one implementation example, the calculation results of the characteristic function of this application are given in Table 1.
[0048] Table 1
[0049] (3) For the same group of candidate entity pairs, calculate the linear score for all four types of candidate business relationships.
[0050] The maximum entropy model maintains a set of feature weight parameters for each of the four predefined candidate business relationships: equipment-fault relationship, fault-phenomenon relationship, operation-standard relationship, and test point-knowledge point relationship. The pre-training samples consist of standardized knowledge triples that have undergone source credibility verification and manual review. For each confirmed triple, its head and tail entities are used as positive sample entity pairs, and its actual business relationship is used as the category label. Within the same text fragment or the same equipment, fault, or operation topic, the tail entity or relationship label is randomly replaced to construct an equal number of negative sample entity pairs. For each candidate entity pair, binary feature functions are extracted, including entity type combination, character distance between entities, trigger words between the two entities, syntactic dependency path keywords, whether safety standard entities appear simultaneously, whether test keywords appear, source type, and scenario label.
[0051] During training, the objective is to maximize the conditional probability of candidate relation labels. The maximum entropy conditional log-likelihood function with L2 regularization is used to train the feature weights. Samples are divided into training, validation, and test sets at 70%, 15%, and 15% respectively. The L-BFGS optimization algorithm is used to iteratively update the weights. Training stops when the validation set loss decreases by less than 0.001 for three consecutive rounds. After training, the feature weight combination, feature dictionary version number, and training data version number corresponding to each of the four relation classes are fixed as relation classification parameters. During online extraction, these parameters are used to calculate the conditional probabilities of the four relation classes for candidate entity pairs, and the relation with the highest probability is selected as the initial relation classification result.
[0052] The weights of each type of relation maintained by the maximum entropy model are combined with their corresponding indices. The maximum entropy model is invoked to calculate the weighted feature sum for each of the four candidate business relationships. , indicating candidate relationship In the sample The following scores: ; In the maximum entropy model, candidate relations are represented. To maintain the first The weights of each binary feature function.
[0053] (4) Then the sample Candidate entity pairs belong to the relation The probability is: ; Selection probability The power grid-specific business relationship corresponding to the maximum value The entity association relationship of the candidate entity pair will output the compliance standardization knowledge triple: <110kV main transformer, prone to failure type, insulation aging>.
[0054] In a further implementation, to address potential erroneous associations that may arise during the maximum entropy model relationship determination process, power industry rule constraints are introduced for verification. Specifically: (1) Construct a power compliance rule library, which is divided into two categories: hard prohibition rules and business matching rules. Hard prohibition rules store illegal entity associations that violate safety regulations and equipment operating mechanisms, such as illegal triple combinations such as <disconnecting switch, performing operation, closing under load> and <circuit breaker, fault, long-term unprotected opening>. Business matching rules limit the legal matching boundaries between equipment, fault, operation, and regulations.
[0055] (2) Send the initial triples output by the maximum entropy model into the rule verification module one by one, and first perform hard prohibition rule matching: if the current triple head entity, relation and tail entity combination completely matches any prohibition rule, mark it as invalid and filter it out.
[0056] (3) For triples that do not trigger the prohibition rule, perform business matching rule verification: check whether the entity type and the corresponding relationship match the preset legal combination. For example, the device entity is only allowed to be paired with the fault type relationship, and the operation entity is only allowed to be paired with the standard type relationship. If the entity type and the relationship do not match, it is judged as an incorrect association and filtered.
[0057] (4) Read the source identifier (national standard / enterprise standard / field case) bound to the triple and perform source credibility auxiliary verification: If the non-standard association generated by the low credibility field case is not supported by national standard clauses, it is marked as pending verification and will not be entered into the database before manual verification.
[0058] (5) Valid triples that pass the verification retain the original text fragment, semantic vector, and source label; illegal triples that are filtered out are archived separately for subsequent model iteration and optimization of samples, thus completing the entire triple verification and filtering process.
[0059] 1.3 In a further implementation, entity alignment and fusion are performed based on the original knowledge triples output in 1.2 to solve the problems of synonymous entity duplication, non-compliant relationships, and inconsistent entities from multiple sources, and to construct a knowledge graph.
[0060] 1.2 The original knowledge triples output are in the form of <head entity, business relationship, tail entity>; (1) Bind extended attribute information to each original knowledge triple, including knowledge source (standard procedures, enterprise procedures, on-site cases), original regularized text, unified semantic representation vector, and training scenario tags (adaptive assessment scenario, intelligent question answering scenario, interactive fault simulation scenario).
[0061] In a further implementation, to address the issue of varying reliability of knowledge from different sources, a reliability evaluation is performed on each knowledge triple to generate a knowledge quality score.
[0062] The knowledge quality score consists of three dimensions: ; in, To score for knowledge authority, Score for the timeliness of knowledge. Score for knowledge completeness. , , The weighting coefficients for the three evaluation dimensions are set according to the priority of the rigor of power grid training knowledge. Knowledge authority directly determines the compliance and on-site operational guidance of the training content, and is a core prerequisite for ensuring safe operation and maintenance; therefore, it is assigned the highest weight. Knowledge timeliness reflects the degree of matching between procedures, cases, and current operation and maintenance standards, and is a secondary evaluation dimension. Knowledge completeness is a supplementary indicator used to measure the fullness of knowledge granularity, and has the lowest weight. The overall allocation meets the business requirements of high compliance and strong rigor in power grid training. For example, these can be set to 0.5, 0.3, and 0.2.
[0063] In a further implementation, a knowledge authority score is given. Knowledge timeliness score Knowledge completeness score The method of deriving / mapping / calculation.
[0064] For knowledge authority score The base score is assigned based on the data source bound to the triplet: 95 points for the source being the current national standard power safety regulations and mandatory industry standards; 75 points for the source being the power grid company's internal formal operation and maintenance specifications and the official equipment manufacturer's manual; and 55 points for the source being front-line on-site fault handling records and informal practical cases.
[0065] The deduction rules are determined using the following criteria: A textual conflict refers to a discrepancy between the fact expressed by the entity, relation, or tail entity in a triple and the corresponding clause, table, diagram, or explicit conclusion in its source text. Specifically, this is determined by semantic similarity matching between the serialized triple text and the original source text paragraphs, and by comparing paragraphs with a similarity score greater than or equal to 0.85 using negative words, numerical values, units, action directions, and conditional restrictions. If there are contradictory conclusions such as "allow / prohibit," "close / open," or "raise / lower," or inconsistencies in rated values, time limits, operating sequences, or applicable conditions, it is considered a textual conflict.
[0066] Terminology misuse refers to the use of abbreviations, aliases, old names, symbolic forms, or colloquial terms not included in the entity thesaurus for the same entity in a triplet, without being mapped to a unique standard entity identifier. The entity to be evaluated is queried in the entity dictionary; if a unique standard identifier is found, the terminology is considered unified; if no identifier is found or the query results correspond to more than two standard identifiers, it is determined to be terminology misuse.
[0067] A logical violation occurs when the head entity type, relation type, and tail entity type of a triple do not conform to a preset relational pattern, or violate safety prohibition rules, operation precondition rules, or causal direction rules in the rule base. For example, directly connecting a device entity to an "execute operation" relation, using "closing under load" as a permitted operation for a disconnector, or using a fault phenomenon as a precondition for a handling step are all considered logical violations. For each triple, calculate the conflict indicator C, terminology indicator T, and logic indicator L respectively; set to 1 if the corresponding issue exists, otherwise set to 0. The knowledge authority score is calculated as follows: ; in, The base score is determined by the source. A is the knowledge authority score, which ranges from 0 to 100.
[0068] The knowledge timeliness score is calculated based on the publication date or last revision date of the source document. Let... The current standard base year in the system, L represents the year the knowledge material was generated, published, or last revised. max To determine the maximum effective period, we take 5 years; let the time difference... equal: ; When the source document has been explicitly marked as obsolete, superseded, or no longer applicable by an authoritative issuing agency, the timeliness score T is directly set to 0; in other cases, T is calculated according to the following formula:
[0069] If the equipment model, operating procedures, or safety requirements recorded in the material have been explicitly abolished by subsequent official documents, then 30 points will be deducted from the above calculation results, and the final T will be a value between 0 and 100 points.
[0070] For the score of knowledge timeliness Prerequisite parameters: Preset current standard benchmark year Year of knowledge material generation / publication Maximum effective years threshold ; Time difference calculation: ; Piecewise linear mapping rule: (The materials are from the new standards and cases of that year.) ; like : ; like Exceeding the validity period, .
[0071] Additional deduction: The equipment model and operating procedures described in the material have been officially abolished; an additional 30 points will be deducted, which will affect the final score. .
[0072] For knowledge completeness score The system pre-selects four essential core business elements: equipment parameters, causes of failure, standard handling procedures, and compliance provisions. The actual number of covered elements in the description text accompanying the ternary set. (Values: 0, 1, 2, 3, 4); Basic score conversion: ; The operating condition description refers to structured information used to define the applicable boundaries of faults or operations, and includes at least two of the following: equipment operating status, load or voltage and current conditions, environmental or time conditions, and protection or safety measures. This information can be obtained from the applicable conditions section of the original procedure, the operating conditions section of the equipment manual, the event record field of field cases, or manually entered operating condition forms. Supplementary remarks refer to supplementary explanations from the original source text that are bound to the triplet but not included in the four mandatory core business elements. At least one of the following should be recorded: source identifier, applicable conditions, or reason for absence. Supplementary remarks can only be entered by data import personnel based on the original source text and cannot be automatically generated by the model.
[0073] A brief, single-sentence description refers to a description text containing only a natural language sentence ending with a period, with a sentence length of less than 30 Chinese characters or fewer than two valid business entities, and excluding any of the following: numerical parameters, conditional restrictions, processing actions, or legal clause numbers. If the description text is accompanied by a work condition description that meets the above definition, 8 points are added to the base score conversion result; if any of the four required core business elements are missing and there are no supplementary remarks, no points are added; if the condition of a brief, single-sentence description is met, 10 points are deducted after the initial addition and subtraction. The knowledge completeness score is calculated as follows: ; Where N is the number of core business elements actually covered, and the value is 0, 1, 2, 3 or 4; G is the indicator quantity of working condition description, which is 1 when there is a qualified working condition description, and 0 otherwise; S is the indicator quantity of simplified description, which is 1 when the simplified description condition is met, and 0 otherwise; I is the knowledge completeness score.
[0074] After normalizing the scores of all three sections to a range of 0 to 100, the knowledge quality score is calculated. :
[0075] in, The score represents the quality of knowledge, with A being the score for knowledge authority, T for knowledge timeliness, and I for knowledge completeness. The score ranges from 0 to 100, and the output is rounded to two decimal places. The same score will be used for knowledge access, reinforcement learning reward weighting, and knowledge level classification in subsequent training scenarios.
[0076] final The maximum score is 100, and the minimum is 0. After normalizing all three individual scores to 0-100, the scores are weighted and added into the following formula to obtain the final knowledge quality score. ; The output results are rounded to two decimal places, with a score range of 0 to 100. The score is directly used to determine the knowledge entry threshold for the three training scenarios.
[0077] In a further implementation, different access strategies are set for knowledge access based on the different requirements for knowledge reliability in different training scenarios.
[0078] For adaptive scene admission thresholds, set the score to 80 and retain only... National standard knowledge units; intelligent question answering scenario admission threshold of 70 points; interactive fault deduction scenario admission threshold of 50 points, triples below the corresponding score are directly filtered during retrieval.
[0079] (2) In the original knowledge triples extracted in 1.2, there are entity inconsistencies due to different sources, such as synonyms with different names, different abbreviations, and different symbolic expressions. This embodiment uses the cosine similarity algorithm to align multi-source heterogeneous knowledge entities.
[0080] In this specific implementation, the unified semantic representation vector generated during the unified representation stage is invoked: ; in, , Let be the unified semantic representation vector of the two entities to be aligned. For semantic similarity, a threshold of 0.85 is set. Heterogeneous entities with similarity higher than this threshold are classified as synonymous entities and merged. Entities with similarity lower than this threshold remain independent entities.
[0081] Furthermore, based on the head and tail entities and corresponding knowledge graphs, this embodiment defines five types of nodes: power equipment, fault types, operation and maintenance, safety regulations, and assessment points. Based on business relationships, this embodiment defines four types of associated edges: equipment-fault, fault-phenomenon, operation-regulation, and assessment point-knowledge point. Typical knowledge triples include: <110kV main transformer, common fault types, insulation aging>, <switching operation, execution basis, power safety work procedures>. Finally, unified standardized knowledge triples are generated and synchronously stored in the Neo4j graph database, completing the construction of the underlying knowledge foundation.
[0082] In a further specific implementation, when merging synonymous entities, a scenario adaptation weight is added to the knowledge node. (Including the weight of intelligent question answering scenarios) Fault simulation scenario weights Adaptive assessment scenario weights This is used to represent the applicability of knowledge to different training tasks. The weighting of Q&A nodes leans towards theoretical and normative content, the weighting of deduction nodes leans towards fault handling procedures, and the weighting of assessment nodes leans towards test points.
[0083] The weight uniform value range is set as follows The closer the value is to 1, the higher the adaptability of the node to the corresponding scenario. There are three sets of fixed benchmark weights preset, and it also supports node knowledge quality scoring. Fine-tuning and corrections: Baseline Fixed Weights: Baseline Weights for Intelligent Question Answering Scenarios Adaptation procedures, equipment principles, and theoretical knowledge points; benchmark weights for fault simulation scenarios. Adapt to fault causes and step-by-step handling procedures; adaptive benchmark weights for assessment scenarios. It is adapted to clearly defined test points and deduction standards.
[0084] Fine-tuning and correction rules: based on knowledge quality scores As a correction factor, the correction coefficient The final formula for calculating the adaptation weights of a single node for the three scenarios is as follows: ; ; ; For example, a national standard safety specification ternary set, ; .
[0085] A case study of a field failure using a triplet. ; .
[0086] Explanation of the impact of differentiated multi-weight values on subsequent retrieval calculation: Weights only act as similarity correction coefficients and do not disrupt the relative sorting logic of original semantic similarity. The subsequent retrieval correction formula is , which is the original cosine similarity of the entity, representing the inherent semantic matching degree. For the same batch of candidate entities, it remains fixed and is only scaled by the corresponding scene weight. The relative order of similarity levels between entities remains unchanged, so there will be no incorrect sorting where highly matched entities are suppressed and lowly matched entities surpass them, ensuring stable retrieval result logic.
[0087] The interval design avoids extreme value distortion issues: all weights fall within the interval and only undergo reduction scaling, so there will be no calculation errors such as similarity being amplified to exceed 1 or numerical overflow. Simultaneously, a global similarity screening threshold of 0.85 is used for secondary filtering, and low-weight knowledge nodes after correction are extremely likely to fall below the threshold, automatically filtering out irrelevant knowledge that does not match the current scenario, with no calculation distortion occurring.
[0088] Differentiated weights are a business hierarchical control method that does not undermine the effectiveness of mathematical calculations. The differentiated setting of three types of benchmark weights is intended to distinguish the business attributes of knowledge, belonging to a business-level hierarchical screening strategy. It only changes the admission threshold for candidate knowledge, while the underlying mathematical logic of model vector calculation and similarity solving remains unchanged. It does not reduce the calculation accuracy of vector matching and subgraph retrieval, and only achieves scenario-differentiated knowledge recall effects without generating calculation errors.
[0089] Fallback constraints ensure calculation stability in extreme cases: the system sets a minimum effective weight of 0.3, and if after correction it falls below this threshold, the node is directly determined to be incompatible with the current scenario and automatically discarded during retrieval, eliminating calculation accuracy fluctuations caused by extremely small weights.
[0090] When triples are stored in the Neo4j graph database, three independent subgraph indexes are divided according to intelligent Q&A, interactive fault deduction, and adaptive assessment. The subgraphs respectively store highly adapted knowledge units for corresponding scenarios, and subsequent reasoning links can directly call the scenario-specific subgraphs, achieving scenario-differentiated processing during the knowledge modeling phase.
[0091] S2. In one implementation, based on the knowledge content in the knowledge graph, natural language training samples corresponding to different power grid training scenarios are derived through template filling, and supervised fine-tuning is performed on the large language model using the LoRA low-rank adaptation method. Reinforcement learning training sample pairs are constructed from the knowledge graph by distinguishing training scenarios, and reinforcement training is performed on the supervised fine-tuned large language model. By using knowledge graphs as "standard answer constraints" and employing reinforcement learning to reverse-correct the output of large models, the model outputs are gradually aligned with the normative knowledge in the power sector, thereby suppressing illusions and enhancing compliant reasoning capabilities.
[0092] 2.1 In a further implementation, based on the constraints in the knowledge graph, the large model is subjected to supervised fine-tuning, and the entity vectors in the knowledge graph are aligned with the text semantic vectors generated by the large model.
[0093] The core optimization target of this stage of supervised fine-tuning is only the model's text encoder, and it does not participate in the optimization of question-answering generation capabilities. Its core objective is to unify the semantic measurement standards of the two vector spaces: the knowledge graph and the large model. Entity nodes in the knowledge graph have fixed structured representations, while the text vectors output by the native encoder of the Qwen2-72B base adopt independent semantic measurement rules, and the two vector spaces are not interconnected. This fine-tuning uses a loss function constraint to minimize the Euclidean distance between the graph entity vectors and the natural language text encoding vectors corresponding to the same power business semantics. Throughout the training process, only the encoder's semantic mapping rules are adjusted, without changing the model's generation logic. After training, user input text in any scenario can be accurately matched with graph entities through cosine similarity. The generation-side optimization for question-answering output and inference compliance will be implemented separately in the subsequent reinforcement learning stage 2.2. The optimization objectives of the two fine-tuning stages are independent of each other and each performs its own function.
[0094] To complete vector alignment training, this embodiment constructs dedicated training samples based on all entity nodes and associated standard text of the power grid training knowledge graph. The sample construction process consists of three steps: The first step is to traverse all entity nodes in the graph and retrieve the standardized description texts such as national standard clauses, equipment manuals, fault explanations, and standard operating procedures bound to the nodes. The second step involves using a slot-filling template rewriting technique to derive natural language input sentences adapted to three training scenarios. This technique uses the head entity, relation, tail entity, and entity attributes of a knowledge graph triple as slots, and pre-configured question-and-answer templates, fault description templates, and assessment response templates as sentence structures. Entity names, fault phenomena, operational actions, restrictions, and supporting clauses from standard description text are extracted and filled into the corresponding slots. A thesaurus is then used to perform limited replacements of non-safety-critical terms. Safety-critical terms, equipment models, numerical values, units, and polar words such as "prohibited" or "permitted" are not included in the replacement. The derived text must simultaneously meet the following conditions: contain the target entity name or unique entity identifier, have a semantic similarity of at least 0.85 with the original triple, and not change the safety constraints in the original text; text that does not meet any of these conditions is discarded.
[0095] For example, for the ternary set <disconnecting switch, compliance constraints, prohibition of opening and closing under load> and its standard description "disconnecting switches are strictly prohibited from opening and closing under load", the question-and-answer template "{equipment} is allowed {operation}?" generates "Is the disconnecting switch allowed to open and close under load?"; the fault simulation template "What risks might arise from performing {operation} under {operating condition}?" generates "What risks might arise from performing disconnecting and closing under the condition of equipment operating under load?"; and the assessment template "Explain the {basis} for {equipment} {operation}." generates "Explain the safety basis for prohibiting disconnecting and closing under load.". All three types of text are bound to the fixed graph vector of the "disconnecting switch" entity and the corresponding scenario identifier, forming training samples.
[0096] The structure of a single training sample is ,in, For fixed and unchanging graph entity semantic vectors, Natural language text for the scene. For scene identification. Further, the scene natural language text is divided into three categories: ① intelligent question-and-answer question sentences, such as "Is it permissible to operate the disconnect switch under load?"; ② fault inference description sentences, such as "The transformer's operating temperature measurement value continues to exceed the standard"; ③ adaptive assessment answer sentences, such as "Briefly describe the safety basis for prohibiting the disconnect switch from operating under load".
[0097] This training phase does not require "question-answer" pairs. The training loss only calculates the L2 distance between the graph entity vector and the corresponding scene text encoding vector, without involving text generation supervision. The graph entity vector is an offline standardized and condensed representation. Simplified, colloquial user questions are prone to semantic shifts after being encoded by the base. This representational bias provides ample training space for model optimization, and there is no problem with training convergence. Taking the disconnector entity as an example, its standard description is "Disconnectors are strictly prohibited from being opened or closed under load and belong to high-voltage isolation equipment." Three types of training texts can be derived: question-answer text "Is it permissible to operate disconnectors under load?", assessment text "Please explain the prohibitions on disconnector operation", and fault deduction text "What risks will occur if disconnectors are operated under load on site?". These three sets of texts are paired with the entity vector to participate in training, continuously reducing the vector distance of similar semantics.
[0098] During training, all three types of derived samples—intelligent question answering, fault inference, and adaptive assessment—are shuffled and mixed for unified training, eliminating the need for separate fine-tuning for each scenario. Since the three training scenarios share the same set of power entities and knowledge graphs, the underlying power semantic rules are completely universal. Hybrid training allows the encoder to adapt to input sentence structures across all scenarios simultaneously. After training, only one set of LoRA lightweight parameters needs to be maintained, eliminating the need for multiple scenario-specific models, resulting in a more lightweight overall inference architecture.
[0099] Furthermore, this embodiment uses the Qwen2-72B open-source large language model as its inference foundation. The large model takes three types of training samples as input and outputs semantic encoding vectors corresponding to the three training scenarios.
[0100] In further training, the alignment loss function is defined as follows: ; in, The semantic encoding vector output by the large model. For standard knowledge vectors in the graph; The number of training samples. This is the index for the training samples.
[0101] In a further implementation, based on The Qwen2-72B pedestal model is fine-tuned using LoRA low-rank adaptation, updating only the LoRA lightweight parameters without altering the weights of the pedestal main model. For example, the initial learning rate during the vector alignment training phase is set to... The training rounds were set to 3 rounds, and the learning rate was dynamically adjusted using a cosine annealing strategy during the training process to balance the model's convergence speed and generalization performance.
[0102] After vector alignment training is completed, the supervised fine-tuning of the power domain adaptation model's encoding logic adapts to interactive text with different sentence structures and input formats in three scenarios. Regardless of whether the user inputs standard clauses, fault descriptions, or answer text, the encoded text vectors can be matched with the corresponding equipment, fault, and test point entity vectors in the graph. This enables accurate identification of the power business semantics carried by the input in different scenarios, achieving precise docking of multi-format input content in three major scenarios.
[0103] In this embodiment, the two fine-tuning stages share the same set of LoRA lightweight parameters. The training sequence is fixed: first, vector alignment supervised fine-tuning is performed. After the encoder vector mapping loss converges, the LoRA weights obtained in this round of training are loaded as the initial parameters for PPO reinforcement learning. During the reinforcement learning stage, the text generation logic is optimized only on the basis of the aligned vector representation. The training process will not reset or destroy the semantic mapping relationship that has been converged in the vector alignment stage. The two training parameters iterate in a unidirectional manner, and there is no problem of weight overlap or vector space offset.
[0104] 2.2 In a further implementation, based on completing the vector alignment supervised fine-tuning and loading the converged LoRA weights, PPO reinforcement learning is used to further constrain the output of the large model.
[0105] Using the large language model after supervised fine-tuning as the initial model for reinforcement learning, corresponding standard knowledge paths are extracted from the power grid training knowledge graph according to the training scenario to construct reinforcement learning training samples. Specifically: For intelligent question-answering scenarios, extract the corresponding standards and the total number of test knowledge points; For fault simulation scenarios, extract the total number of knowledge points related to equipment, faults, and handling procedures; For adaptive assessment scenarios, extract the total number of knowledge points that correspond to the test questions.
[0106] The knowledge points referred to in this application are the smallest knowledge units in a knowledge graph that carry complete business semantics. A complete triple is composed of entity nodes, associated edges, and node-attached descriptive text. There are no independent knowledge points in the graph system that are detached from entities and their relationships. Any compliant knowledge triple can be used as a knowledge point on its own. The total number of knowledge points is equivalent to the total number of valid triples that meet the scenario admission criteria.
[0107] Based on the business logic of power grid training, the graph triplet can be divided into four categories of business knowledge points: (1) For normative knowledge points, the safety normative entity is the head entity, the compliance constraint is the associated edge, and the operation or equipment entity is the tail entity. A typical example of a triplet is <disconnecting switch, compliance constraint, prohibition of closing under load>. (2) For test point-type knowledge points, the test point entity is the head entity, the test association is the association edge, and the theoretical or equipment entity is the tail entity. For example, <Operating Specifications for Disconnecting Switches, Test Association, It is Strictly Prohibited to Switch On or Off Under Load>. (3) Knowledge points related to equipment failure: the head entity is the power equipment entity, the associated edge is the fault cause or the relationship that is prone to failure, and the tail entity is the fault entity. Example: <110kV main transformer, prone to failure, insulation aging>. (4) Fault handling knowledge points: the fault entity is the head entity, the handling plan is the associated edge, and the operation and maintenance entity is the tail entity. A typical triplet is <winding overheating fault, handling plan, shutdown and temperature measurement maintenance>.
[0108] In a further implementation, the interactive text corresponding to the training samples, the scene-specific knowledge subgraph, and the global historical context are input into the supervised fine-tuning large language model, which outputs candidate response text. The three parts of the model input are defined as follows: (1) The interactive text corresponding to the training samples scene : Refers to the corresponding data object of the scene natural language text in the training samples of 2.1 vector alignment during the online operation phase, that is, the original natural language text input by the user in the intelligent question answering, fault inference or adaptive assessment scenario, including consultation questions, fault descriptions, operation handling answers or assessment answer text; in the online phase, it is not required to meet the training template sentence pattern, but is encoded into text vectors after entity recognition and standardization processing in 1.2; (2) Scene-specific knowledge subgraph: A set of standardized triples filtered based on the current scene identifier and scene adaptation weight, which carries all the standard knowledge points corresponding to this interaction task; (3) Global historical interaction context: Multi-turn dialogue records and cross-scenario historical interaction learning data are persistently cached by the scheduling unit to support continuous, cross-scenario fusion reasoning.
[0109] The model-generated results are matched point-by-point with standard knowledge in the knowledge graph. Standard knowledge points are extracted from the scene-corresponding knowledge subgraph. The complete extraction process is as follows: (1) Identify the training scenario identifier corresponding to the current interaction, and the scheduling unit retrieves the subgraph index (including intelligent question answering subgraph / interactive fault deduction subgraph / adaptive assessment subgraph) pre-established for the scenario to lock the retrieval scope; (2) Traverse all stored standardized knowledge triples <head entity, business relationship, tail entity> within the corresponding subgraph. A compliant triple is defined as a standard knowledge point. (3) Filter triples according to the preset knowledge quality threshold for this scenario: The knowledge quality score is the final knowledge quality score defined in stage 1.3. base The entry threshold for intelligent question answering scenarios is 70 points, for fault deduction scenarios it is 50 points, and for adaptive assessment scenarios it is 80 points; triples below the current scenario's entry threshold are directly eliminated.
[0110] (4) Perform deduplication on all triples retained after screening and merge duplicate knowledge entries corresponding to synonymous entities; (5) The final set of all unique and compliant triples is the set of all standard knowledge points of the current interactive task. Each triple independently participates in the subsequent point-by-point matching and verification.
[0111] In a further implementation, based on standard knowledge points, the output text of the large model is validated point by point, and a reinforcement learning reward function is defined: ; In the formula, and These are the weighted total score for valid knowledge points and the weighted total score for all standard knowledge points, respectively. Valid knowledge points refer to those whose business semantics and core logic match the content recorded in the nodes and related edges of the knowledge graph. The matching criteria are determined using vector similarity metrics. Specifically: The training scenarios are divided into three smallest units for matching knowledge points: intelligent question answering scenarios use entity nodes or single business triples as the matching unit; interactive fault simulation scenarios use fault knowledge paths composed of multiple related triples as the matching unit; and adaptive assessment scenarios use single assessment related triples as the matching unit.
[0112] Matching criteria do not require the text to be exactly the same. The verification is based on the cosine similarity of the unified representation vector. The similarity threshold is set at 0.85. If the vector similarity is greater than or equal to 0.85, the business semantics and knowledge logic are considered to be successfully matched and counted as valid knowledge points. It is compatible with differences in interactive text such as synonyms, word order rewriting, and colloquial descriptions.
[0113] When counting the number of knowledge points, a weighted calculation rule is used: based on knowledge quality score. Divide knowledge points into levels. The national standards and mandatory specifications are the key knowledge points, with a weighting coefficient of 1.0; The enterprise supplements and on-site case triples are considered secondary knowledge points, with a weighting coefficient of 0.4. The weighted matching total score is calculated separately. Weighted total score for all knowledge points The weighted calculation method of this reward function means that the lack of key knowledge points will reduce the reward value, and the training process prioritizes the core standard knowledge of the model output graph.
[0114] A proximal strategy optimization algorithm is employed, using the reward value signal to drive parameter updates in the large model, ensuring that the model output aligns with the standard answer in the graph. The reinforcement iteration rounds are set to two rounds, continuously correcting the model's reasoning logic through output-side reverse constraints, further suppressing the professional illusion problem in different scenarios and guaranteeing the rigor and compliance of the reasoning results across all scenarios.
[0115] It should be noted that the parameters optimized and updated during the reinforcement learning phase are only the LoRA parameters trained in phase 2.1, while the parameters of the Qwen2-72B pedestal model are frozen.
[0116] S3. In one implementation, during interactive reasoning, the current training scenario is identified and scenario-adaptive knowledge subgraphs are selected from the knowledge graph; the scenario-adaptive knowledge subgraphs and user interaction text are input into the large language model after reinforcement training for reasoning, and the reasoning text is output.
[0117] By integrating user input, knowledge subgraphs, and historical context through a unified scheduling mechanism, cross-scenario adaptive retrieval and continuous reasoning are achieved within the same large model reasoning chain. At the same time, the output results are traced back to their source and learning progress is recorded, realizing a closed-loop interactive training system of "retrieval-reasoning-feedback".
[0118] 3.1 In a further implementation, a globally unified scenario scheduling unit is constructed, and a finite state machine is used to describe the running state of different training tasks.
[0119] Define four types of states: The intelligent question-and-answer system corresponds to procedure consultation, equipment knowledge query, and theoretical knowledge explanation. Fault simulation status, corresponding to fault phenomenon analysis, cause reasoning, and handling procedure drills; Adaptive assessment mode, including answering questions, automatic scoring, and analysis of weaknesses; The scene switching transition state is used for parameter adjustment and context transfer between different training tasks.
[0120] Furthermore, the current training scenario is determined based on the user's input data. Specifically: The system first determines the initial scenario based on the semantics of the user's input text: if the text is a question about procedures or equipment principles, the finite state machine enters the intelligent question-and-answer state; if it contains descriptions of equipment malfunctions or handling procedures, it switches to the fault deduction state; if it is the student's answer, it enters the adaptive assessment state.
[0121] After scene recognition is completed, the scheduling unit loads the knowledge subgraph weights and inference parameters for the corresponding scene and executes the unified interactive inference for this round. After a single round of interaction, S3 collects the original learning data from this round of interaction and writes it into the global learning data database. The background S4 periodically reads all the learning data in the database to complete the quantification calculation. When the switching threshold is reached, it sends a switching command to S3. After receiving the command, S3 jumps to the switching transition state, loads the target scene parameters and completely retains all historical interaction data. After the parameters are adapted, it switches to the target business steady state and waits for the next user input.
[0122] The finite state machine defines four states, including three business steady states and one transition state. The three business steady states are the intelligent question-and-answer steady state, the interactive fault deduction steady state, and the adaptive assessment steady state, which correspond to the normal interactive states of three types of training scenarios, respectively. The one transition state is the scenario adaptation switching transition state, which is used for parameter adaptation during the scenario transition process.
[0123] In further explanation, the scheduling unit undertakes all core tasks related to system-wide interaction signal distribution, context cache management, scenario state transitions, and learning data relay. This unit can automatically identify three differentiated business scenarios accessed from the front end in real time: intelligent question answering, fault interactive deduction, and adaptive assessment. It uniformly receives interaction signals from all scenarios and persistently stores multi-turn dialogue contexts, real-time inference progress, and learner's full-cycle historical interaction behavior and learning status data. Under normal business processes, during the entire switching process between any two training scenarios, the scheduling unit will not clear, reset, or isolate historical interaction data and inference context. This enables seamless continuation of cross-scenario interaction logic and complete continuity of inference state, effectively eliminating interaction gaps caused by scenario fragmentation at the scheduling level and providing a globally consistent operating environment for the unified inference chain at the backend.
[0124] 3.2 In a further implementation, the large model optimized by reinforcement learning receives user input text and performs self-inference; User input text includes theoretical consultation text for intelligent question-and-answer scenarios, fault response text for interactive fault simulation scenarios, and answer text for adaptive assessment scenarios, corresponding to the three major training scenarios.
[0125] After preprocessing the input text, a lightweight BERT-NER model is used to extract entities. This lightweight online BERT-NER model directly reuses the NER weights trained in the S1 knowledge extraction stage for the power domain, without retraining the entity recognition network. Only lightweight pruning of inference is performed (removing the BiLSTM layer, reducing the maximum length of the input sequence, and simplifying post-processing). The entity recognition label set is consistent with that of offline extraction, also including six types of entities: equipment entities, fault entities, operation and maintenance entities, safety specification entities, assessment point entities, and operating condition entities. There is no redundancy problem of repeated training of model weights.
[0126] The online entity recognition outputs complete results for 6 types of entities. During the retrieval phase, four core entities—equipment, faults, operation and maintenance, and assessment points—are prioritized as the main retrieval entry points. At the same time, the identified safety specifications and operating condition entities are retained as constraint tags and attached to the retrieval conditions. This is used to filter irrelevant knowledge subgraphs that do not match compliance requirements and operating conditions, avoiding omissions of procedures and operating condition-related knowledge points. Finally, a structured entity set is output.
[0127] This reasoning chain is the only universal reasoning chain across the entire domain, without independent branch chains for different scenarios. It relies on a unified data flow to complete closed-loop reasoning throughout, with each stage having clearly defined input and output boundaries, fully adapting to all interactive needs of three training scenarios. The system uniformly receives interactive input data from trainees across the entire domain, covering theoretical consultation texts for intelligent question-and-answer scenarios, fault response texts for interactive fault deduction scenarios, and answer texts for adaptive assessment scenarios. All heterogeneous input texts are uniformly merged into the same semantic parsing unit. Based on a finely tuned BERT-NER model for the power industry, it completes online real-time entity recognition, accurately extracting four core business entities: equipment, faults, operation and maintenance, and assessment points. After filtering out invalid colloquial content, it outputs standardized structured entity information. This entity recognition stage is designed for real-time reasoning scenarios, differing from offline knowledge extraction in the knowledge graph construction stage. Its core function is to provide a precise retrieval entry point for subsequent knowledge subgraph retrieval, ensuring the accuracy and response efficiency of the reasoning chain retrieval.
[0128] 3.3 Standardized structured entities are uniformly integrated into the global knowledge subgraph retrieval process. The scheduling unit identifies the current running scenario and matches it with a specific scenario weight, correcting the vector retrieval similarity. This enables the same retrieval logic to adapt to different knowledge retrieval needs across three scenarios. The retrieval correction formula is as follows: ; In the formula For the original cosine similarity of entities, Dynamic weights specific to the corresponding scenario. Scenario-adaptive weights are used to correct matching results when retrieving triples from the knowledge graph based on user input.
[0129] During retrieval, the system simultaneously carries the identified safety specification entity tags and operating condition entity tags. The safety specification entity tag is a set of identifiers, including the procedure name, clause number, safety measures, or prohibitions, identified by BERT-NER and standardized through an entity dictionary. Examples include "Electric Power Safety Work Procedures," "Prohibition of Switching On or Off Under Load," or "Work Permit." The operating condition entity tag is a set of identifiers, including the equipment's operating status, load level, voltage level, environmental conditions, fault stage, or protection status, identified and standardized by BERT-NER. Examples include "110kV," "Operating Under Load," "After Protection Action," or "Maintenance Status."
[0130] For each candidate triple within the subgraph, first determine if its bound safety specification label is the same as the input safety specification entity label, is a higher-level concept, or does not conflict; then determine if its bound operating condition label is the same as the input operating condition entity label, is a compatible operating condition, or is empty. If any judgment results in a conflict, the triple is removed; if both judgments pass, it is retained. For inputs where no safety specification entity label or operating condition entity label is identified, only the corresponding label filtering step is skipped; missing labels are not considered as conflict conditions.
[0131] The input to the retrieval process consists of standardized structured entity and scene recognition signals, and the output is a dedicated knowledge subgraph tailored to the current business needs. The Q&A scenario focuses on the retrieval of theoretical knowledge point subgraphs, the deduction scenario focuses on the retrieval of fault logic link subgraphs, and the assessment scenario focuses on the retrieval of test point association subgraphs.
[0132] 3.4 The Qwen2-72B integrated reasoning kernel is finely tuned by bidirectional constraints of the knowledge graph, with the scene-adapted knowledge subgraph and the original user interaction text serving as input.
[0133] The large model retrieves a globally unified context cache and performs fusion reasoning by combining historical cross-scenario interaction records. The core structure remains unchanged, only the output bias is adaptively adjusted to suit different scenarios: intelligent question-answering scenarios emphasize outputting complete and standardized theoretical knowledge point answers; interactive fault deduction scenarios emphasize outputting step-by-step logical guidance and error correction prompts; and adaptive assessment scenarios emphasize outputting correctness judgments of answers and analysis of weak test points. The input to this stage includes the original interactive text, scenario-adaptive knowledge subgraph, and global historical context data, and the output is the original reasoning content that conforms to the power grid training specifications.
[0134] 3.5. Result tracing semantic offset monitoring and data archiving; Define the original inference content output in 3.4 as the inference text (Text). reason3.3 During the retrieval phase, when outputting the scenario-adapted knowledge subgraph, each selected standard knowledge triplet is simultaneously retained with its unique triplet ID, source document ID, source original text paragraph ID, and knowledge quality score. base Inference Text reason It is a text result generated by a large model based on the current user interaction text, but without the addition of traceability identifiers and interface display format.
[0135] The scheduling unit semantically matches sentences or steps in the reasoning text with standard knowledge triples in the scene-adaptive knowledge subgraph retrieved and input into the large model in this round. When the semantic similarity between a sentence or step and a certain triple is greater than or equal to 0.85, the source identifier pre-bound to that triple is extracted as a source tracing identifier. The source tracing identifier includes at least a unique triple number, a source document number, a source original text paragraph number, and a knowledge quality score. base Since the source identifier is extracted only from the triples obtained in this round of actual retrieval and is not re-retrieved across the entire graph, it ensures that the reasoning basis is consistent with the retrieval basis.
[0136] The source identification is bound to the corresponding reasoning text sentence or step in the output, forming a standardized output text with source identification. output After a user or administrator clicks the source tracing icon, the system uses the source document number and the original text paragraph number to reverse locate the original text paragraph in the power safety regulations, equipment manuals, or fault cases. Sentences that do not match any qualified triples are marked as "No Graph Basis" and are not output as safety operation suggestions.
[0137] To avoid irrelevant knowledge recall or knowledge subgraph retrieval routing errors due to contextual semantic drift during continuous interactions, semantic offset is calculated for the user interaction text in adjacent rounds. Let v t Text for the current round of user interaction scene The corresponding normalized semantic vector, v {t-1} The normalized semantic vector corresponding to the user interaction text in the previous round, with semantic offset d. t for:
[0138] in, The value ranges from 0 to 1, with larger values indicating greater semantic shifts between adjacent rounds of interactive text. Let the base recall for the current scenario be K0, and the minimum recall be K. min The maximum number of items to be recalled is K. max Then the number of recalls in this round, K t for:
[0139] When the semantic offset is high, K t Increase K to broaden the scope of knowledge recall; when the semantic offset is low, K t To reduce interference from irrelevant knowledge and improve retrieval efficiency.
[0140] After each round of interaction, the Text will be displayed. output Unique triple number, source identifier, semantic offset d t Scene identifiers, knowledge point identifiers, student identifiers, and timestamps are written into the full-domain learning database for S4 to perform learning statistics, ability profile construction, and scene switching calculations.
[0141] S4. In one implementation, multi-source learning data is periodically extracted from the interaction data to assess the user's mastery of the training knowledge points; the multi-source learning data is combined with the mastery to calculate a cross-scenario linkage trigger factor, and compared with a preset trigger threshold of the current training scenario, so as to drive the adaptive switching of training scenarios during the training process based on the comparison result.
[0142] Based on a comprehensive learning database, a unified learner competency profile is constructed. Through comprehensive scoring and triggering factors, the system is driven to automatically switch between three scenarios: intelligent question answering, fault simulation, and adaptive assessment, forming a closed-loop adaptive training mechanism of "learning-training-assessment".
[0143] 4.1 Periodically read the raw historical interaction data of specified students in the current scenario from the global learning database, and extract the corresponding knowledge point interaction statistics for the scenario; specifically: The scheduling unit generates a learning event record for each interaction, containing a student identifier, scenario identifier, knowledge point identifier, session identifier, and timestamp, and writes it to the full-domain learning database. The intelligent question-and-answer scenario collects the number of knowledge point questions asked (Q), the number of times students confirmed the correct answer after follow-up questions (CQ), and the number of times students explicitly denied or re-asked the question (WQ). Specifically, Q is accumulated from user questioning events for the same knowledge point identifier; CQ is accumulated from events where students selected "understood" after the system provided an explanation or answered correctly in subsequent questions on the same knowledge point; and WQ is accumulated from events where students selected "not understood," asked the same knowledge point again, or gave negative feedback.
[0144] Interactive fault simulation scenario acquisition task start time t start The time t for submitting the correct cause of the fault for the first time correct The required number of operation steps is N. step The number of steps correctly executed, N correctAnd the number of erroneous operations E; whereby the system compares each step selected, filled in, or confirmed by the trainee with the standard steps in the current fault knowledge path one by one. Incorrect sequence, omission of essential steps, selection of steps conflicting with the working conditions, or violation of safety regulations are all counted as one erroneous operation. Fault location time D equals t. correct Subtract t start If the task is not correctly located within the specified time limit, the maximum preset time limit D will be used. max .
[0145] The adaptive assessment scenario collects the knowledge point identifier, question score, score, question type, and submission time for each question; for any knowledge point k, the accuracy rate R for each question type is... exam k equals the sum of the actual scores of all submitted questions related to that knowledge point, divided by the sum of the full marks for the corresponding questions. The distribution of points lost is recorded using the knowledge point identifier as the key, recording the cumulative value of the difference between the full marks and the actual scores for questions under that knowledge point. This value is not directly used as a continuous numerical value in the calculation, but is used to determine the priority of questions in the next round of assessment.
[0146] 4.2. Based on multi-source learning data collected across the entire domain, a unified knowledge point mastery assessment model is constructed, which weights and integrates learning performance across three scenarios. For any knowledge point k, the normalized performance score for each of the three scenarios is first calculated:
[0147]
[0148]
[0149] in, For intelligent question answering, normalized performance score, For fault deduction normalization performance, To assess and normalize performance scores; , and These represent the number of times knowledge point k was confirmed correctly, the number of times it was asked, and the number of times it was rejected or asked repeatedly. , , , and These are the correct number of steps, required number of steps, fault location time, preset maximum location time, and number of erroneous operations for the fault task corresponding to knowledge point k. and These represent the sum of the actual scores and the sum of the full marks for the questions involving knowledge point k.
[0150] The overall mastery of the knowledge points is as follows:
[0151] The value range is 0 to 100; when a scenario has not yet generated a valid record for a knowledge point, it is temporarily excluded from the scenario weight, and the weights of the remaining scenarios with generated records are normalized proportionally. The distribution of test point deductions is used to... Sort by low to high, and prioritize knowledge points with low mastery and high cumulative point deductions for subsequent training or assessment.
[0152] 4.3 Set a unified cross-scenario linkage trigger factor across the entire learning domain, automatically determining the timing of scenario switching based on students' overall learning behavior. The cross-scenario linkage trigger factor is calculated based on a comprehensive analysis of the number of questions asked about a knowledge point, the level of mastery, and the number of errors. Specifically:
[0153] In the formula, the linkage trigger factor F is used to quantify the demand for training scenario transitions; the higher the F, the stronger the demand for switching to the next training scenario; Q represents the cumulative number of questions asked by the trainee in the current knowledge point or task. The maximum number of questions to be asked is preset for this scenario; M represents the current overall mastery of the knowledge points; E represents the cumulative number of incorrect operations performed by the trainee in the current fault simulation task. This represents the standard total number of steps for the task. Incorrect operations are only recorded in interactive fault simulation scenarios. These refer to actions by trainees that deviate from the standard steps of the current fault knowledge path when selecting, sorting, confirming, or filling in candidate handling steps presented by the system. These include incorrect order, omitting essential safety steps, selecting steps that conflict with the current operating conditions, selecting steps that conflict with safety regulations, and exceeding the allowed number of repeated attempts. Natural language questions in intelligent question-and-answer scenarios and text-based answers in adaptive assessment scenarios are not counted as incorrect operations.
[0154] In a further implementation, the linkage triggering factor will be... The threshold is compared with the preset threshold for the current scenario. For example, the threshold is set to 0.6 for the intelligent question-answering scenario, 0.55 for the fault deduction scenario, and 0.65 for the adaptive assessment scenario.
[0155] In the current scenario, if If the value is less than the threshold corresponding to the scenario, the finite state machine maintains the current steady state of business and continues to operate (refer to S3). like If the threshold value is greater than or equal to the threshold value corresponding to the scenario, the state switching process will be initiated. (1) The finite state machine transitions from the current steady state of business to the transitional state of scenario adaptation switching; the scheduling unit of S3 reads the scenario weight and knowledge retrieval preference rules corresponding to the target scenario, and completes the adaptation update of retrieval parameters and model output preference parameters. The knowledge retrieval preference rules are a set of parameters stored with the target scenario as the key, including priority relation type and minimum score. baseThresholds, TopK return values for vector retrieval, similarity threshold, maximum allowed hops in knowledge paths, safety regulations, and operational condition tag filtering switches. The priority relationship types for intelligent question answering scenarios are operation-regulation and exam point-knowledge point, with Score... base The threshold is 70, TopK is 8, similarity threshold is 0.85, and maximum hop count is 2; the priority relationship types for fault simulation scenarios are device-fault, fault-phenomenon, and fault handling path, with a score of 70. base The threshold is 50, TopK is 12, similarity threshold is 0.80, and maximum number of hops is 3; the priority relationship type for the adaptive assessment scenario is test point—knowledge point and operation—standard, Score. base The threshold is 80, the TopK is 10, the similarity threshold is 0.85, and the maximum number of hops is 2.
[0156] The model's output bias parameters include system prompt word templates, output structure, maximum generation length, and temperature coefficient. The intelligent question-answering scenario uses an output structure of "Conclusion—Basis—Precautions," with a maximum generation length of 800 Chinese characters and a temperature coefficient of 0.2. The fault deduction scenario uses an output structure of "Phenomenon Confirmation—Cause Reasoning—Step-by-Step Handling—Safety Verification," with a maximum generation length of 1200 Chinese characters and a temperature coefficient of 0.15. The adaptive assessment scenario uses an output structure of "Scoring Result—Correct Basis—Points Deducted—Next Question Suggestion," with a maximum generation length of 600 Chinese characters and a temperature coefficient of 0.1.
[0157] The adaptation update is implemented using a parameter table replacement method: After the finite state machine enters the scenario adaptation switching transition state, the scheduling unit reads the corresponding parameter table according to the target scenario identifier, replaces the current session's retrieval threshold, TopK, maximum hop count, relation type filter, and tag filter switch with the target scenario parameters, and writes the target scenario prompt word template, output structure, maximum generation length, and temperature coefficient into the current round of model call configuration; historical context, student identifier, and identified entity identifier are not cleared. After the parameters are written and at least one qualified triplet is returned in a single trial retrieval, the finite state machine transitions to the target business steady state; if no qualified triplet is returned, the safety specification filter switch is maintained and the TopK is increased to twice the target value before retrying once. If there is still no result, the message "No basis satisfying the conditions was found in the current knowledge base" is output.
[0158] (2) After parameter adaptation is completed, the finite state machine switches to the target business steady state. The historical dialogue context and learning data are fully preserved throughout the process. After the switch is completed, the machine accepts a new round of interactive input from the learners to carry out reasoning.
[0159] The target scenario is defined as follows: If the current scenario is an intelligent question-and-answer scenario and the target scenario is an interactive fault simulation scenario, when a student exposes a theoretical deficiency in the intelligent question-and-answer scenario, the system will automatically continue the historical context and jump to the interactive fault simulation scenario to strengthen the application ability of knowledge points through practical training.
[0160] If the current scenario is a fault simulation scenario and the target scenario is an intelligent question and answer scenario, when the student frequently makes logical errors in the fault simulation scenario, the system will automatically revert to the intelligent question and answer scenario to provide targeted theoretical tutoring. A training session consists of an intelligent question-and-answer sub-phase and a fault simulation sub-phase. In the intelligent question-and-answer sub-phase, trainees ask questions related to the target knowledge points of the session. The system outputs standardized explanations with traceability tags and accumulates the number of questions asked, the number of correct answers confirmed, and the number of repeated questions. A trainee is considered successful when their intelligent question-and-answer performance score for that knowledge point reaches 60 points or higher, or when the cumulative number of questions reaches Q... max The intelligent question-and-answer sub-stage ends when the time is right. In the fault deduction sub-stage, the system generates a fault task from the equipment-fault-handling knowledge path associated with the knowledge point. The trainee sequentially completes the steps of phenomenon confirmation, fault cause location, handling step selection, and safety verification. The system accumulates the location time, the number of correct steps, and the number of incorrect operations. The system ends when the trainee completes the task, actively submits the end, or reaches the maximum allowed task time D. max When the fault deduction sub-stage ends, the training is considered complete. Both the intelligent question-and-answer sub-stage and the fault deduction sub-stage are considered complete when one round of training is finished.
[0161] The system can perform a maximum of two rounds of training. The first round focuses on the initial target knowledge points; after the first round, the system will perform training based on the M of the first round. k The system selects the relevant knowledge point with the lowest mastery level based on the number of incorrect operations and the distribution of points lost, and uses this as the target knowledge point for the second round. The intelligent question-and-answer sub-stage and the fault simulation sub-stage are repeated. In any sub-stage, if the linkage trigger factor F is greater than or equal to the preset threshold corresponding to the current scenario, the system only allows one transition between the intelligent question-and-answer state and the fault simulation state; each transition retains the current round identifier, completed steps, and accumulated learning data. The system terminates the second round of the fault simulation sub-stage after it ends, or when all relevant knowledge points have been completed within both rounds and the mastery level of all target knowledge points is reached. k When all scores are greater than or equal to 80, the transition between the intelligent question-and-answer state and the fault deduction state is terminated, and the finite state machine enters the scenario adaptation switching transition state and switches to the adaptive assessment state.
[0162] After entering the adaptive assessment state, the system starts from M. k Select test points from those who scored below 80 or had a high cumulative loss of points, and generate personalized test questions; update M after the assessment. k And the distribution of test points where points were lost. If M still exists. kFor knowledge points scored below 60, the next training cycle will begin after the assessment results are confirmed; otherwise, the current training cycle will end. If the current scenario is an adaptive assessment scenario, and there are knowledge points with a comprehensive mastery level Mk below 60, the target scenario will be the intelligent question-and-answer scenario, and this knowledge point will be used as the initial target knowledge point for the next training cycle; if there is no Mk, the target knowledge point will be used. k For any knowledge point scored below 60, the training cycle ends, and the finite state machine will no longer trigger scenario switching.
[0163] Example 2 As an embodiment of this application, a scenario-based interactive reasoning engine construction system for power grid training is disclosed, employing the specific implementation method described in Embodiment 1 above. (See also...) Figure 2 The system includes: A module for constructing a multi-source heterogeneous knowledge graph for power grid training is included. This module extracts unified representation vectors with business attributes from heterogeneous power system data to form a standardized power training dataset. Based on this training dataset, a compliance-standardized knowledge triplet is constructed, the power grid training scenario graph structure is defined, and a knowledge graph is established. A knowledge graph bidirectional constraint large model fine-tuning module; based on the knowledge content in the knowledge graph, natural language training samples corresponding to different power grid training scenarios are derived through template filling, and LoRA low-rank adaptation is used to supervise and fine-tune the large language model; reinforcement learning training samples are constructed from the knowledge graph to distinguish training scenarios and to reinforce the large language model after supervised fine-tuning. A unified interactive reasoning module for multiple scenarios; in interactive reasoning, the current training scenario is identified and scenario-adaptive knowledge subgraphs are selected from the knowledge graph; the scenario-adaptive knowledge subgraphs and user interaction text are input into the large language model after reinforcement training for reasoning, and the reasoning text is output; all interaction data is retained during the interactive reasoning process; The module includes a cross-scenario learning profile and closed-loop linkage module. It periodically extracts multi-source learning data from the interaction data to assess the user's mastery of the training knowledge points. It calculates the cross-scenario linkage trigger factor by combining the multi-source learning data with the mastery level and compares it with the preset trigger threshold of the current training scenario. The comparison result drives the adaptive switching of the training scenario during the training process.
[0164] As an embodiment of this application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is loaded onto the processor, it employs the specific implementation method described in Embodiment 1 above.
[0165] As an embodiment of this application, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, employs the specific implementation method described in Embodiment 1 above.
[0166] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the protection scope of the claims of the present invention.
Claims
1. A method for constructing a scenario-based interactive reasoning engine for power grid training, characterized in that, include: Based on heterogeneous data from the power system, a unified representation vector with business attributes is extracted to form a standardized power training dataset; Based on the training dataset, construct compliance standardization knowledge triples, define the power grid training scenario graph structure, and establish a knowledge graph. Based on the knowledge content in the knowledge graph, natural language training samples corresponding to different power grid training scenarios are derived through template filling. LoRA low-rank adaptation is used to supervise and fine-tune the large language model. Reinforcement learning training samples are constructed from the knowledge graph to distinguish the training scenarios and to reinforce the large language model after supervision and fine-tuning. In interactive reasoning, the current training scenario is identified and scenario-adaptive knowledge subgraphs are selected from the knowledge graph; the scenario-adaptive knowledge subgraphs and user interaction text are input into the large language model after reinforcement training for reasoning, and the reasoning text is output. The interactive reasoning process retains all interaction data; Periodically extract multi-source learning data from the interaction data to assess the user's mastery of the training knowledge points; calculate the cross-scenario linkage trigger factor by combining the multi-source learning data with the mastery level, and compare it with the preset trigger threshold of the current training scenario, so as to drive the adaptive switching of training scenarios during the training process.
2. The method for constructing a scenario-based interactive reasoning engine for power grid training according to claim 1, characterized in that, The process of constructing the standardized power training dataset includes: After preprocessing the heterogeneous data of the power system, a block-based business text dataset is output and categorized and organized according to storage format. The normalized data is converted into a text semantic vector, and then concatenated with the business label vector to form a unified semantic representation vector, outputting a standardized power training dataset with business labels; each sample in the training dataset contains business text, a unified semantic representation vector, and a business classification label.
3. The method for constructing a scenario-based interactive reasoning engine for power grid training according to claim 1, characterized in that, The process of constructing the compliance standardization knowledge triplet includes: From a single text in the training dataset, entities are extracted to form candidate entity relationship pairs. After mutual information filtering and maximum entropy classification, compliance standardization knowledge triples are output. The structure of the triples includes a head entity, a tail entity, and a business relationship. In the maximum entropy classification, the determination relationship is verified by introducing power industry rule constraints.
4. The method for constructing a scenario-based interactive reasoning engine for power grid training according to claim 1, characterized in that, Knowledge quality scores are generated for the compliant and standardized knowledge triples based on three dimensions: knowledge authority, knowledge timeliness, and knowledge completeness. Different training scenarios filter the access triples through thresholds set by the knowledge quality scores. The training scenarios include intelligent question-and-answer scenarios, fault simulation scenarios, and adaptive assessment scenarios.
5. The method for constructing a scenario-based interactive reasoning engine for power grid training according to claim 1, characterized in that, The process of constructing the knowledge graph includes: Corresponding to the structure of triples, the node categories and associated edge categories in the knowledge graph of the power training scenario are defined, and the node entities are merged by synonyms; During the synonym merging process, a baseline weight is assigned to each knowledge node to distinguish between different power training scenarios. The weight is then corrected by the knowledge quality score of the triplet to obtain the scenario adaptation weight of the node. The scenario adaptation weights are used to invoke triples in different training scenarios.
6. The method for constructing a scenario-based interactive reasoning engine for power grid training according to claim 1, characterized in that, The derivation process of the natural language training samples includes: Traverse all node entities in the knowledge graph and retrieve the standardized description text bound to the node; Using the head entity, tail entity, business relationship, and entity-related attributes of the triple as slots, and pre-configured question-and-answer templates, fault description templates, and assessment answer templates as sentence skeletons; extracting entity names, fault phenomena, operation actions, constraints, and relevant clauses from the standard description text and filling them into the corresponding slots; then using a thesaurus to replace non-safety key terms to generate natural language text for the scenario. The entity semantic vector, the scene natural language text, and the scene identifier are used to construct a natural language training sample.
7. The method for constructing a scenario-based interactive reasoning engine for power grid training according to claim 1, characterized in that, In the aforementioned monitoring and fine-tuning: The natural language training samples corresponding to the three training scenarios are mixed and trained in a unified manner. The alignment loss function in the training is defined as the difference between the semantic encoding vector output by the large language model and the semantic vector of the graph entity.
8. The method for constructing a scenario-based interactive reasoning engine for power grid training according to claim 1, characterized in that, The intensive training includes: The large language model after supervision and fine-tuning is used as the initial model for reinforcement learning. The corresponding standard knowledge paths are extracted from the knowledge graph according to the training scenario to construct reinforcement learning training samples. The reinforcement learning training samples are composed in the form of knowledge points. Each knowledge point consists of the head entity, tail entity, related edge and node attached description text of a compliant standardized knowledge triple in the knowledge graph. The interactive text corresponding to the reinforcement learning training samples is input into the initial reinforcement learning model, and candidate response text is output. The interactive text refers to the corresponding data object of the natural language training samples in the online stage, that is, the original natural language text input by the user in the training scenario.
9. A method for constructing a scenario-based interactive reasoning engine for power grid training according to claim 8, characterized in that, The intensive training also includes: The output text of the large model is validated point by point based on standard knowledge points. The reinforcement learning reward function is defined as the ratio of the weighted total score of the effective knowledge points to the weighted total score of all standard knowledge points. Among them, effective knowledge points refer to the knowledge points in the candidate answer text that match the knowledge graph.
10. The method for constructing a scenario-based interactive reasoning engine for power grid training according to claim 1, characterized in that, The process of filtering the scene-adaptive knowledge subgraph includes: During the initial inference, the current training scenario is determined based on the user input, the scenario adaptation weights corresponding to the current training scenario are loaded, the large language model after reinforcement training is called to perform inference, and the interactive learning data is recorded; when the interactive learning data reaches the scenario switching threshold, the training scenario is switched and inference is performed again. The scenario adaptation weight is used to correct the matching results when retrieving triples in the knowledge graph based on user input and the current training scenario, and to generate a scenario-adapted knowledge subgraph.
11. The method for constructing a scenario-based interactive reasoning engine for power grid training according to claim 1, characterized in that, The method for calculating the mastery of the knowledge points is as follows: The multi-source learning data consists of interactive statistics of knowledge points for each type of training scenario. For each type of training scenario, the normalized score corresponding to that training scenario is calculated based on the corresponding knowledge point interaction statistics. By weighting the normalized performance scores of the three training scenarios, we can obtain the user's mastery of the knowledge points.
12. The method for constructing a scenario-based interactive reasoning engine for power grid training according to claim 1, characterized in that, The cross-scenario linkage trigger factor is calculated based on the number of questions asked about the knowledge point, the level of mastery, and the number of errors.
13. A scenario-interactive inference engine construction system for power grid training, executing the engine construction method as described in any one of claims 1-12, characterized in that, The system includes: A module for constructing a multi-source heterogeneous knowledge graph for power grid training is included. This module extracts unified representation vectors with business attributes from heterogeneous power system data to form a standardized power training dataset. Based on this training dataset, a compliance-standardized knowledge triplet is constructed, the power grid training scenario graph structure is defined, and a knowledge graph is established. A knowledge graph bidirectional constraint large model fine-tuning module; based on the knowledge content in the knowledge graph, natural language training samples corresponding to different power grid training scenarios are derived through template filling, and LoRA low-rank adaptation is used to supervise and fine-tune the large language model; reinforcement learning training samples are constructed from the knowledge graph to distinguish training scenarios and to reinforce the large language model after supervised fine-tuning. A unified interactive reasoning module for multiple scenarios; in interactive reasoning, the current training scenario is identified and scenario-adaptive knowledge subgraphs are selected from the knowledge graph; the scenario-adaptive knowledge subgraphs and user interaction text are input into the large language model after reinforcement training for reasoning, and the reasoning text is output; all interaction data is retained during the interactive reasoning process; The module includes a cross-scenario learning profile and closed-loop linkage module. It periodically extracts multi-source learning data from the interaction data to assess the user's mastery of the training knowledge points. It calculates the cross-scenario linkage trigger factor by combining the multi-source learning data with the mastery level and compares it with the preset trigger threshold of the current training scenario. The comparison result drives the adaptive switching of the training scenario during the training process.
14. An electronic device 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 loaded into the processor, it implements the engine construction method according to any one of claims 1-12.
15. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the engine construction method according to any one of claims 1-12.
