A label control type instruction data automatic generation method for power grid service scenarios

CN122817475APending Publication Date: 2026-09-25ELECTRIC POWER RESEARCH INSTITUTE OF STATE GRID JIBEI ELECTRIC POWER CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610938748.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-26
Publication Date
2026-09-25

AI Technical Summary

Technical Problem

[0010]本发明旨在解决现有大语言模型技术在电力系统垂直领域落地应用时面临的若干关键技术瓶颈

Benefits of technology

[0031]本发明上述技术方案与现有技术相比,具有显著的有益效果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122817475A_ABST
    Figure CN122817475A_ABST
Patent Text Reader

Abstract

The application discloses a label control type instruction data automatic generation method for power grid service scenarios, and belongs to the fields of artificial intelligence and power big data. The application aims to solve the problems of knowledge illusion, uncontrollable content and low multi-modal utilization rate of general large models when applied in the power grid field. The method first constructs a power multi-modal knowledge graph and generates a hierarchical multi-dimensional control label system; secondly, a double-tower architecture is used to realize deep semantic alignment and fusion of unstructured procedure text and structured SCADA time series data; then, a generation model based on prompt learning is constructed, discrete labels are mapped into continuous control vectors through a label encoder, and an attention bias mechanism is used to generate instruction data conforming to scene constraints; finally, a natural language reasoning logic verification mechanism is introduced to filter low-quality data. The application can automatically produce high-quality and highly controllable power grid instruction data sets, and significantly reduce the landing threshold of large models.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention mainly relates to the fields of artificial intelligence technology, natural language processing technology, and power system automation technology. Specifically, it relates to a method, system, electronic device, and computer-readable storage medium for automatically generating tag-based control command data for complex business scenarios such as power grid dispatching, substation maintenance, and safety monitoring, utilizing knowledge graph enhancement, multimodal data alignment, and prompt learning technologies. Background Technology

[0002] With the advancement of the "dual carbon" target and the construction of a new power system based on new energy sources, the power grid structure is becoming increasingly complex, and the scale of equipment in all aspects of power generation, grid, load, and storage is growing exponentially. The safe and stable operation of the power system highly depends on the professional experience and decision-making capabilities of dispatchers, maintenance personnel, and safety supervisors. Faced with massive amounts of equipment alarm information, complex fault handling procedures, and increasingly stringent safety regulations, traditional manual decision-making models are gradually becoming insufficient to meet the power grid's needs for efficient and accurate operation and maintenance.

[0003] In recent years, generative large language models (LLMs) based on the Transformer architecture, trained on massive amounts of data and using reinforcement learning with human feedback (RLHF), have demonstrated remarkable capabilities in general natural language understanding and generation tasks. This provides a new technological path for the digital transformation of the power grid, namely, using large models to build "intelligent power grid assistants" to help business personnel perform procedures retrieval, fault assessment, operation ticket generation, and emergency plan preparation.

[0004] However, directly "migrating" a general-purpose model to the vertical field of the power grid is no easy task. In practical implementation, it faces significant challenges at three levels: data, model, and application. Existing technologies have clear limitations in addressing these issues. The lack of domain knowledge and the serious "illusion" problem: The training corpora of general-purpose large models (such as GPT-4, Llama, etc.) mainly come from Wikipedia, books, and web pages, lacking closed data from within the power grid (such as the "Power Safety Work Regulations," "Dispatch Management Regulations," equipment ledgers, historical accident reports, etc.). The power industry is a field where physical laws and administrative regulations are strongly coupled, requiring extremely high accuracy of knowledge. When dealing with specialized problems, existing technologies often generate seemingly logical but erroneous answers (i.e., "illusions") based on statistical probability. For example, a model might suggest opening a "disconnect switch" under "load," which is a serious misoperation absolutely prohibited in the power grid. This lack of domain-constrained generation capabilities makes general-purpose large models almost unusable in core power grid operations.

[0005] For large-scale models with extremely scarce high-quality instruction fine-tuning (SFT) data to transform from "general chatbots" into "power grid business experts," they must undergo an instruction fine-tuning (SFT) phase. The effectiveness of SFT is highly dependent on the quality, diversity, and coverage of the instruction data. Currently, constructing power grid-specific instruction datasets mainly relies on two methods: Manual annotation: Question-and-answer pairs are compiled by senior power experts. While this method produces high-quality data, it is extremely expensive, and experts have limited time and energy, making it difficult to cover the tens of thousands of equipment models and fault scenarios in the power grid, and the data scale is difficult to expand.

[0006] Traditional data augmentation involves generating data using synonym substitution, back-translation, or simple rule templates. While this approach can expand the amount of data at low cost, it often compromises the rigor of electrical terminology (e.g., replacing "reclosing" with "re-closing the switch," which, although semantically similar, is not a technical term), or the generated data has simple logic and lacks depth, making it impossible to train the model's complex reasoning capabilities.

[0007] The Semantic Gap in Multimodal Data: Power grid operations are inherently multimodal. While procedures and contingency plans are text, the core basis for reflecting the real-time status of equipment lies in time-series data from SCADA (Supervisory Control and Data Acquisition) and WAMS (Wide Area Measurement System), such as voltage drop curves, current surge waveforms, and oil temperature trends. Most existing command data generation methods focus solely on the text modality, attempting to construct training data based solely on textual descriptions. This approach severs the connection between "procedure logic" and "physical state." For example, a procedure might stipulate that "when the main transformer oil temperature rises too quickly, the cooler's operating status should be checked." If the generated data lacks a time-series feature description corresponding to "oil temperature rising too quickly" (e.g., "oil temperature rose by 5°C within 10 minutes"), the model cannot truly understand which physical condition triggers which response strategy. Current technologies lack an effective mechanism for semantically aligning and fusing unstructured text with structured time-series data.

[0008] The uncontrollability of the generation process and the scenario drift inherent in power grid operations highlight the highly scenario-specific nature of these processes. The operational procedures for a "500kV hub substation" are drastically different from those for a "10kV distribution room"; the focus of "routine inspections" is also completely different from that of "accident handling." Existing automated data generation methods (such as Self-Instruct) often employ random sampling strategies, making it difficult to fine-tune the generated content. Users cannot specify that the model "generate a batch of handling instructions for low pressure alarms in the gas chambers of 220kV GIS equipment." This uncontrollability of the generation process leads to uneven distribution of the generated dataset (more data on common faults and fewer data on rare faults), and it is prone to scenario drift (e.g., applying inspection requirements for transmission lines to transformers), severely impacting the training performance of downstream large-scale models.

[0009] In summary, breaking down the barriers of multimodal data and constructing a method for generating instruction data that can accurately control business scenarios, deeply integrate physical features and procedural logic, and has automated quality cleaning capabilities is a key technical challenge that urgently needs to be addressed in the field of power grid artificial intelligence. Summary of the Invention

[0010] This invention aims to address several key technical bottlenecks encountered by existing large language model technologies in the vertical application of power systems. First, general-purpose large models lack knowledge of the power grid's unique physical topology and operational procedures. When generating instructions for fault handling or switching operations, they often generate seemingly coherent but erroneous instructions based on statistical probability, violating power grid safety regulations. Furthermore, they cannot precisely control the boundaries of generated content according to user intent, resulting in low usability of the generated data. Second, power grid operational data exhibits high heterogeneity, containing unstructured text and structured time-series data. Existing technologies struggle to effectively align the waveform features of time-series data with text semantics, leading to generated instructions lacking awareness of the real-time physical state of equipment. Moreover, constructing power grid-specific instruction datasets typically relies on manual writing by senior experts, which is extremely costly and inefficient. Traditional data augmentation methods based on synonym replacement or back-translation compromise the rigor of power terminology and cannot meet the requirements of supervised fine-tuning of large models for data logic and diversity.

[0011] Technical solution To address the aforementioned technical problems, this invention provides a method for automatically generating tag-controlled command data for power grid business scenarios. The core of this method lies in constructing a generation pipeline that integrates knowledge graphs and multimodal data, and implementing soft constraints on the large model generation process through trainable tag control vectors.

[0012] The method described in this invention first constructs a multimodal knowledge graph and a hierarchical multidimensional control tag system in the power field.

[0013] This step employs deep learning information extraction technology to extract entities, relationships, and attributes from multi-source power grid data, constructing a power domain knowledge graph that includes primary equipment, secondary equipment, topology connections, business rules, and historical fault cases. Based on the graph structure features of this knowledge graph, graph clustering algorithms and business rule mining techniques are used to automatically generate a hierarchical multidimensional control label set. This multidimensional control label set covers at least the physical attribute dimension, business scenario dimension, state feature dimension, and risk level dimension. Specifically, the physical attribute dimension includes voltage level, equipment type, equipment model, and manufacturer information; the business scenario dimension includes normal inspections, switching operations, accident tripping handling, abnormal alarm analysis, and maintenance testing; the state feature dimension includes specific fault modes such as heavy gas activation, differential protection activation, oil temperature exceeding limits, and low SF6 pressure; and the risk level dimension is based on the power grid safety risk management system, classifying levels as general, severe, and critical.

[0014] Secondly, this invention constructs a spatiotemporal semantic alignment and fusion corpus of multi-source heterogeneous data.

[0015] This step involves collecting multi-source heterogeneous data from the power grid, including unstructured power grid operation procedures, dispatch management regulations, and emergency response plans, as well as structured PMS equipment ledgers, SCADA, and WAMS real-time measurement time-series data. A dual alignment strategy based on time window sliding and semantic anchor matching is employed to construct a basic factual corpus. Specifically, a pre-trained power domain language model is used to segment and encode the text data, extracting semantic feature vectors. A one-dimensional convolutional neural network is used to capture local morphological features of the time-series data, and a Transformer encoder is used to capture long-distance time-dependent features, generating time-series feature vectors. An association index between text and time-series data is established based on timestamps and equipment IDs. A multi-head cross-attention mechanism is used to fuse the text semantic feature vectors and time-series feature vectors, generating a unified-dimensional fused feature vector, forming a multimodal corpus unit containing a strong mapping relationship between "physical state features and procedural handling logic."

[0016] Next, this invention constructs a prefix fine-tuning label control instruction generation model based on prompt learning.

[0017] This step constructs a joint architecture consisting of a label encoder and a pre-trained generative large language model. The label encoder, employing a multilayer perceptron or Transformer Encoder architecture, maps discrete target label sequences sampled from the multidimensional control label set into continuous label control embedding vectors. Subsequently, the main parameters of the generative large language model are frozen, and only the label encoder and the adapter parameters inserted at the input of each Transformer layer are trained. The label control embedding vectors serve as learnable prefix cues, and their dimension is consistent with the word embedding dimension of the large language model.

[0018] Subsequently, the present invention performs tag-guided attention-mask controlled text generation.

[0019] This step uses the fused feature vectors from the basic fact corpus as context, concatenating the generated label-controlled embedding vectors before the context, and inputting them into the generative large language model. During the decoding and generation process, an improved self-attention mechanism and label attention bias are used to force the model to allocate high-weight attention to the label-controlled embedding vectors when calculating the generation probability of each token, thereby generating instruction-response data pairs that strictly conform to the constraints of specific label combinations.

[0020] Finally, this invention implements a dual quality verification mechanism based on logical implication and domain rule constraints.

[0021] This step involves constructing an automated quality gating module to perform post-processing and filtering of the generated data. The first layer of rule-based verification utilizes regular expression matching and a power grid expert rule base to detect explicit errors in the generated content, such as non-power domain vocabulary, incorrect numerical units, and physical quantity exceeding limits. The second layer of logical verification uses a discriminant model fine-tuned on a natural language inference dataset to calculate the logical implication probability of the generated responses to the input factual corpus. Only data with an implication probability higher than a preset threshold is retained, filtering out data with factual conflicts or fabricated information, resulting in the final high-quality power grid business instruction dataset.

[0022] As a further improvement to the technical solution of this invention, regarding the generation of a multidimensional control tag set: Specifically, the Louvain community discovery algorithm is used to cluster entity nodes in the knowledge graph to identify equipment groups with similar business attributes; the PageRank algorithm is used to calculate the importance weight of each entity node in the graph and select the Top-K key entities as high-frequency label candidates; based on the power grid's "source-grid-load-storage" business logic chain, the subgraph matching algorithm is used to mine specific fault propagation paths and abstract these paths into combined scenario labels.

[0023] As a further improvement to the technical solution of this invention, the specific implementation of multimodal alignment is as follows: For time-series data, a sliding window technique is first used to segment it into fixed-length subsequences, followed by Z-score normalization. A dual-tower feature extraction network is constructed, where the left tower takes a procedural text fragment as input and outputs a textual hidden state sequence through a BERT layer; the right tower takes a time-series subsequence as input, extracts waveform features through a 1D-CNN, and then overlays positional encodings into a Transformer layer to output a time-series hidden state sequence. In the fusion layer, a query matrix, a key matrix, and a value matrix are defined, cross-attention is calculated, and residual connections are used to add the attention output to the original text features to obtain the final corpus vector that incorporates physical state information.

[0024] As a further improvement to the technical solution of this invention, regarding the training objective of the tag encoder and prefix fine-tuning: Let the input corpus be The sampled label set is The target generated instruction data is The tag encoder function is... Discrete labels Mapped to continuous vectors The parameters of the large language model are: (Frozen), prefix parameter is (Trainable). The training objective is to maximize the conditional log-likelihood probability under label control:

[0025] Only update the parameters using the gradient descent algorithm. This makes each word generated Both are affected by the prefix vector Semantic constraints.

[0026] As a further improvement to the technical solution of this invention, regarding the improved self-attention mechanism: Specifically, when calculating the attention score matrix, a label constraint matrix is ​​introduced. The formula is expressed as:

[0027] in, The embedding vector is controlled by the label. The adjustment coefficient is used to enhance the consistency between the generated token and the tag semantics: when the semantics of the current decoding position is highly related to the tag, the corresponding attention weight is increased; when semantics that are mutually exclusive with the tag appear, a penalty term is applied to suppress the generation of text that deviates from the scene.

[0028] As a further improvement to the technical solution of this invention, the construction and verification of the natural language reasoning model are as follows: Construct a binary classification model based on the RoBERTa-Large architecture. During training data construction, power grid regulations are used as a premise, manually written correct instructions are used as implication samples, and erroneous instructions with altered keywords are used as contradictory samples. In the validation phase, the basic corpus is used as the premise, and the generated responses are used as the hypothesis; the model outputs the implication probability. A threshold is set (e.g., 0.9); if the implication probability is greater than the threshold, the generated data is considered logically correct; otherwise, it is considered to be a hallucination and discarded.

[0029] In addition, the present invention also provides a tag-controlled instruction data automatic generation system for power grid business scenarios.

[0030] The system comprises a graph construction and management module, a multimodal data pipeline module, a label control generation service module, and a quality audit and closed-loop optimization module. The graph construction and management module connects to the graph database, executes entity relationship extraction algorithms, and provides visual editing and maintenance functions for the label system. The multimodal data pipeline module integrates OCR recognition, time-series data cleaning, feature engineering, and vector alignment algorithms, responsible for transforming raw heterogeneous data into model-readable vector representations. The label control generation service module deploys a large language model inference engine, has a built-in label encoder, and provides an API interface for command generation based on label parameters. The quality audit and closed-loop optimization module integrates a rule engine and an NLI discriminative model to perform real-time cleaning of the generated data and provides a human feedback interface to collect expert scores on the generated quality, thereby building a reward model to further optimize the generation strategy.

[0031] Compared with the prior art, the above-mentioned technical solution of the present invention has significant beneficial effects.

[0032] First, this invention achieves strong controllability and precise scenario adaptation of the generated content. Existing large-scale model data augmentation methods are mostly based on random sampling, making it difficult to control the specific business attributes of the generated content. This invention innovatively transforms discrete business constraints into attention biases at the model's underlying level by introducing a hierarchical multi-dimensional control label system and a continuous-space label control embedding vector. This allows the invention to precisely control the generation of instruction data for specific voltage levels, specific equipment types, and specific fault scenarios in a large-scale model, much like a "remote control," completely solving the problems of content divergence and scenario drift, and ensuring that the data strictly conforms to the boundaries of power grid business.

[0033] Secondly, this invention bridges the semantic gap in multimodal data fusion, enhancing the practical value of the data. Traditional methods often process textual procedures and SCADA numerical data separately, resulting in generated models that "understand theory but not practice." The multimodal alignment technology proposed in this invention, based on a dual-tower architecture and a cross-attention mechanism, can deeply integrate the temporal waveform features of device operation into the textual semantics. This ensures that the generated instruction data not only contains the procedural logic of "how to do it," but also the physical state triggering conditions of "under what circumstances to do it," greatly enhancing the application value of the data in complex tasks such as fault diagnosis and condition-based maintenance.

[0034] Furthermore, this invention constructs an automated "anti-illusion" defense based on logical implication, ensuring data rigor. Addressing the vulnerability of large models to factual errors, this invention abandons the inefficient traditional perplexity-based filtering method and introduces an NLI model as a logical discriminator. By calculating the logical implication probability of the generated responses to the basic corpus, it can automatically identify and eliminate "hollow" illusionary data at the semantic level. Combined with dual verification from a power grid expert rule base, it ensures that every instruction data output meets the rigor requirements of the power industry, significantly improving data usability.

[0035] Finally, this invention significantly reduces the implementation cost and barriers to entry for large-scale power grid-specific models. It can automatically and in batches produce large-scale, high-quality structured instruction datasets. Using this data, power grid companies can directly perform full parameter tuning or efficient parameter fine-tuning on open-source general-purpose models without having to pre-train expensive base models from scratch. This significantly reduces computing and time costs, shortens the development cycle of large-scale power grid-specific models, and provides a solid data foundation for the rapid and large-scale deployment of intelligent power grid applications. Attached Figure Description

[0036] Figure 1 This is the overall flowchart of the present invention; Figure 2 This is a flowchart of the multimodal data alignment and fusion process of the present invention; Figure 3 This is a flowchart of the quality verification and closed-loop optimization process of the present invention. Detailed Implementation

[0037] To enable those skilled in the art to better understand the technical solutions of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. The scope of protection of the present invention should be determined by the claims and their equivalents.

[0038] The present invention discloses an automatic generation method for tag-based control command data for power grid business scenarios, which relies on a high-performance deep learning computing cluster for operation. In the specific physical implementation environment, the system is deployed in the private cloud data center of the power grid company to ensure data security and compliance.

[0039] In this embodiment, constructing a multimodal knowledge graph in the power sector is fundamental to implementing tag-based control. This process does not rely on simple keyword matching, but instead employs a deep learning-driven information extraction pipeline.

[0040] First, the power domain ontology is modeled. The ontology layer defines the logical framework of power grid operations, including five core classes and their subclasses: "Equipment," "Attributes," "Status," "Events," and "Procedures." For example, the "Equipment" class is further subdivided into subclasses such as "Transformer," "Circuit Breaker," "Disconnect Switch," and "Instrument Transformer"; the "Status" class includes "Operating," "Maintenance," "Standby," and "Fault." In terms of attribute definitions, attribute patterns such as "Rated Voltage," "Oil Temperature Threshold," and "Load Rate" are defined for "Transformer." Regarding relationship definitions, directional semantic relationships are constructed, such as "Transformer - Includes -> Tap Changer," "Heavy Gas Protection - Action -> Trip Circuit Breaker," and "Dispatcher - Order -> Switching Operation."

[0041] Secondly, entity extraction based on BERT-BiLSTM-CRF is performed. After inputting unstructured "Substation Maintenance Management Regulations" or historical fault report text, the BERT layer outputs word-level contextual semantic vectors; the BiLSTM layer (Bidirectional Long Short-Term Memory Network) captures long-distance dependency features of the sequence; the CRF layer (Conditional Random Field) learns the state transition matrix and performs globally optimal decoding on the output label sequence, thereby accurately identifying entities such as equipment names, voltage levels, and fault phenomena in the text.

[0042] Next, relation extraction is performed based on PCNN (Piecewise Convolutional Neural Network). For the extracted entity pairs, the system takes the sentence containing these two entities as input and uses Piecewise Max Pooling to extract features before, between, and after the entities, respectively. After fusing the position vectors, the data is input into a Softmax classifier to determine whether a predefined semantic relationship exists between the entities. For example, from the sentence "High transformer oil temperature leads to non-electrical protection action," the causal triple <high ​​transformer oil temperature, leading to, non-electrical protection action> is extracted.

[0043] Finally, based on the constructed knowledge graph, multi-dimensional control labels are mined and generated. The system uses the Louvain community discovery algorithm to perform cluster analysis on the graph, dividing closely connected equipment nodes into "interval" or "site" communities. Simultaneously, the PageRank algorithm is used to calculate the centrality weight of each node in the graph, selecting the top 10% of key entities (such as 500kV substations and main transformers) as primary core labels. The system further traverses the multi-hop neighbor nodes of the core entities, extracting their attribute values ​​(such as "500kV" and "oil-immersed") as secondary attribute labels, and extracting their associated fault events (such as "gas protection action") as tertiary scenario labels. Through this graph traversal mechanism, the system automatically generates a hierarchical label tree covering "equipment type - voltage level - business scenario - risk level," forming the semantic foundation for subsequent control vector generation.

[0044] In order to ensure that the generated instruction data has both the legal basis of the procedure and the physical characteristics of the device operation, this embodiment designs a dual-tower multimodal alignment network to process text modal and temporal modal data respectively.

[0045] In the Text Tower processing pathway, the system first cleans the collected "Power Safety Work Regulations," "Dispatch Management Regulations," and various emergency plans. Regular expressions are used to remove headers, footers, revision records, and irrelevant formatting symbols. The text is then segmented based on semantic paragraphs (e.g., "Article X," "Section X"), and long texts are truncated into 512-token segments using a sliding window technique. These segments are then fed into the BERT encoder. The hidden states of the last four Transformer layers of BERT are extracted and averaged to obtain the deep semantic representation vector of the text. This vector not only contains lexical information but also captures the conditional constraints in the regulations (e.g., "Under... circumstances, it is strictly prohibited to...") through a self-attention mechanism.

[0046] In the time-series modal processing pathway (Signal Tower), the system interfaces with the SCADA historical database and the WAMS wide-area measurement system. For each business scenario described in the procedure text segment (e.g., "main transformer overload"), the system retrieves the corresponding real waveform data segment from historical operations using a timestamp index. In a preferred embodiment of the invention, the construction of the basic corpus space for multimodal alignment also includes data cleaning and standardization steps. Addressing common signal loss and high-frequency noise issues in raw SCADA data, the system first uses Lagrange interpolation to fill in missing points in the time series, ensuring the temporal continuity of the input vector; subsequently, it uses wavelet threshold denoising to filter out random noise during sensor acquisition. Furthermore, to eliminate the significant differences in the order of magnitude between measured values ​​from different devices (e.g., voltage kV and current A), Z-Score normalization is used to normalize all time-series data, as shown in the formula: ,in The mean, The standard deviation is denoted as . The data processed in the above way not only improves the model's convergence speed but also ensures the robustness of feature extraction.

[0047] For the retrieved multi-dimensional time-series data, including voltage, current, active power, reactive power, and oil temperature, Z-score normalization is first performed to eliminate dimensional differences. The data is then input into a one-dimensional convolutional neural network (1D-CNN). This CNN network uses convolutional kernels of different sizes (3, 5, and 7) to simultaneously capture instantaneous abrupt changes (such as short-circuit current surges) and local trends (such as slow oil temperature increases) in the time-series data. The output feature map of the CNN is flattened and further input into a two-layer Transformer Encoder. Positional encoding is used to inject time-series information, capturing long-distance temporal dependencies, and finally outputting a time-series feature vector.

[0048] In the multimodal fusion stage, this invention innovatively introduces a cross-attention mechanism to achieve alignment. Specifically, the text semantic vector is used as the query matrix, and the temporal feature vector is used as the key and value matrices. By calculating the dot product similarity between the query and the key, the system can automatically "attention" to the corresponding waveform features in the time-series data (such as the steep rise of the current curve) for key terms in the text (such as "current surge"). The attention weights after Softmax normalization are weighted and summed with the value matrix to generate a fusion vector. This fusion vector is added to the original text vector through a residual connection and then subjected to layer normalization to form the final basic factual corpus vector. This vector not only preserves the semantic logic of the procedural text but also implicitly contains the physical state fingerprint of the device operation, solving the problem of traditional text generation models lacking physical perception capabilities.

[0049] The instruction generation model in this embodiment is based on the "pre-training-fine-tuning" paradigm, but adopts a parameter-efficient Prefix-Tuning strategy to reduce training costs and retain the versatility of the base model.

[0050] The model primarily consists of a Label Encoder and a Frozen LLM (Base Large Language Model) with frozen parameters. The Label Encoder is a small, trainable neural network whose input is a sequence of discrete label IDs sampled from a labeling system. These IDs are first transformed into dense label vectors through an embedding layer, and then processed by a Multilayer Perceptron (MLP) to learn the combined semantics between different labels (e.g., learning that "500kV" and "distribution transformer" are semantically mutually exclusive). The output of the Label Encoder is a vector of shape... A continuous tensor, in which This is the number of virtual prompt tokens (e.g., set to 20). This is the hidden layer dimension of the base large language model (e.g., 4096). This continuous tensor is called the "Label Control Vector".

[0051] During the forward propagation of the generation process, the label control vector is concatenated to the front of the basic fact corpus vector, together forming the input sequence of the model. This invention makes targeted improvements to the self-attention mechanism of the base model by introducing a label attention bias. Specifically, when calculating the attention score matrix, the system adds a bias term matrix determined by the label semantics. The value of this bias matrix is ​​determined by the cosine similarity between the label vector and the embedding vector of the currently generated token: if the currently generated word is highly semantically related to the label (e.g., the label is "transformer" and the generated word is "winding"), the bias term is positive, enhancing the model's attention to that word; if there is a semantic conflict, the bias term is negative.

[0052] The label constraint matrix It is not merely a mathematical parameter, but a semantic mapping of the physical operation rules of the power grid. Specifically, the system transforms the power grid's "five defenses" rules (such as "preventing disconnection under load") into logically mutually exclusive pairs. When the instruction currently generated by the model involves "opening the disconnector switch," if the SCADA data in the context indicates that the line load is not zero, the label constraint matrix applies a very large negative bias (such as -1e9) to the corresponding "confirm execution" token position, mathematically forcibly blocking the generation probability of the illegal instruction, thereby achieving rigid constraints on the physical safety of the power grid at the algorithm level.

[0053] Mathematically, this mechanism forces the model's hidden state distribution to be strongly constrained by the label control vector at each decoding time step. This means that even if the basic corpus contains information about multiple devices, once the input label specifies "circuit breaker," the model's attention will be highly focused on the contextual information related to "circuit breaker" when generating a response, while suppressing information flow about "disconnect switch" or "transformer." This achieves precise alignment between the generated content and the business scenario, effectively avoiding generation errors such as "misattribution."

[0054] To ensure that the generated instruction data can be directly used to train industrial-grade large-scale power grid models, this embodiment deploys a stringent automated quality gating system, which includes two lines of defense: rule verification and logic verification.

[0055] The first line of defense is a rule validator based on deterministic logic. The system incorporates a "power grid sensitive word library" and a "physical logic rule library" compiled by senior power experts. The rule library contains thousands of regular expressions and logical discriminants. For example, the rule for voltage levels is set as follows: if the label is "220kV," the voltage value involved in the generated text must be within the reasonable operating range of 198kV to 242kV. If values ​​such as "voltage display 380V" or "500kV" appear, the system will immediately determine that the data is a "physical violation" and remove it. The rule for operational logic is set as follows: if the generated text involves "opening the isolating switch," the preceding action must include "disconnecting the circuit breaker," otherwise it is determined to violate the "five-prevention" rules. In addition, the rule validator also detects the repetition rate of the generated text, the proportion of special characters, and the frequency of occurrence of non-power-related common terms (such as "restarting the router" and "refreshing the webpage") to filter out low-quality noise data.

[0056] The second line of defense is a deep learning-based Natural Language Inference (NLI) verifier. Rule-based verification struggles to uncover deep semantic contradictions; therefore, this invention introduces an NLI discriminative model based on the RoBERTa-Large architecture. This model was fine-tuned on a dataset containing positive and negative sample pairs from the power industry. Positive sample pairs consist of manually refined "original procedure text - correct operating instructions," labeled "Entailment"; negative sample pairs are generated by replacing key entities in correct instructions (e.g., changing "lock" to "unlock") or logically altering them, labeled "Contradiction."

[0057] During the validation phase, the system uses the "basic factual corpus" input into the generative model as a premise and the "response" generated by the model as a hypothesis, inputting both into the NLI model for reasoning. The NLI model outputs the probability distribution of the logical relationship between the response and the premise. The system sets strict thresholds (e.g., the implication probability must be greater than 0.95). Only when the model believes with extremely high confidence that the generated response logically strictly follows the description of the basic corpus and does not contain unreliable information outside the corpus, is the data marked as "qualified". Through this mechanism, this invention effectively blocks the generation of "illusionary" data at the source, ensuring the rigor and reliability of the final dataset.

[0058] The method of this invention is not a one-time, unidirectional process, but a closed-loop system with evolutionary capabilities. In the early stages of system operation, or when there are significant changes to the power grid business rules (such as the release of a new version of the "Safety Regulations"), the system will activate a human-in-the-Loop feedback loop.

[0059] The system provides a visual sampling and annotation platform that periodically selects a small sample (e.g., 1%) from the data that has passed double verification and pushes it to power experts for review. Experts do not need to rewrite the data; they only need to score the data quality across multiple dimensions (e.g., professionalism, fluency, logic, and security) or annotate any minor errors. This expert feedback data is collected and used to train a reward model.

[0060] The reward model is a Qwen-based generative model that takes an instruction as input and outputs a scalar score, aiming to fit expert scoring preferences. Once trained, the reward model is integrated into the instruction generation model, where reinforcement learning (such as the PPO algorithm) fine-tunes the generation strategy. Specifically, for each response generated by the generation model, the reward model provides immediate feedback, adjusting its parameters to gradually shift the probability distribution towards the high-score region favored by experts. This mechanism enables the system to continuously learn, improving the professionalism and human-likeness of the generated data over time.

[0061] This invention constructs a knowledge graph containing both physical and business attributes, innovatively utilizing a dual-tower architecture to achieve deep semantic alignment between text and time-series data. Combined with prefix fine-tuning technology and an attention bias mechanism, it achieves refined label control over the generation process of large language models. Coupled with rigorous dual quality checks and closed-loop optimization mechanisms, this invention can automatically and scalably produce high-quality, highly controllable, and low-illusion power grid professional instruction data, significantly reducing the training cost of large-scale power grid-specific models. This provides a solid data foundation and technical guarantee for their application in core business scenarios such as dispatching auxiliary decision-making, equipment fault diagnosis, and intelligent safety regulation question answering.

[0062] All training data involved in this application, including procedural texts and SCADA operation data, are sourced from the power grid company's authorized historical anonymized database. The data collection, storage, and use processes strictly comply with the "Data Security Law of the People's Republic of China" and related cybersecurity review requirements, and do not involve any personal privacy information or undisclosed state secrets.

[0063] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0064] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for automatically generating tag-based control command data for power grid business scenarios, characterized in that, This method, executed by an electronic device, includes the following steps: Constructing a semantic-physical coupled knowledge graph: A knowledge graph containing power grid equipment, business rules, and fault cases is constructed using entity extraction and relation extraction models. Based on graph clustering algorithms and centrality calculations, hierarchical business attributes are mined to generate a multi-dimensional control label set containing physical attribute dimensions, business scenario dimensions, and risk level dimensions. Constructing a multimodal aligned basic corpus space: Unstructured procedure text and structured SCADA time-series data reflecting the physical operating status of equipment are collected. A dual-tower feature extraction network containing a text encoder and a time-series encoder is constructed. A cross-attention mechanism is used to calculate the association weights between the text semantic vector and the time-series waveform feature vector, generating a multimodal fusion feature vector that integrates physical state perception. A prefix-fine-tuned generative model architecture is constructed: a generative network consisting of a label encoder and a pre-trained large language model with frozen parameters is built; the label encoder is used to map discrete labels sampled from the multi-dimensional control label set into continuous label control embedding vectors; attention-biased guided controlled generation is performed: the multimodal fusion feature vector is used as context, the label control embedding vector is injected into the model as a prefix cue, and a label constraint matrix is ​​introduced into the self-attention calculation. The token generation probability mutually exclusive with the label semantics is suppressed by dynamically adjusting the attention score, and instruction-response data pairs are output; logical implication verification is performed: the logical implication probability of the generated response pairs to the basic corpus is calculated using a natural language inference model, and only data with an implication probability higher than a preset threshold is retained.

2. The method for automatically generating tag-based control command data for power grid business scenarios as described in claim 1, characterized in that, The specific processing procedure of the dual-tower feature extraction network is as follows: the text tower uses a pre-trained language model to extract the semantic features of the procedural text. The temporal tower utilizes a one-dimensional convolutional neural network to extract local morphological features from temporal data, and cascades a Transformer encoder to extract long-range dependency features. The fusion layer calculates... The two are combined, with the query matrix included. Origin Key matrix Sum matrix Origin .

3. The method for automatically generating tag-based control command data for power grid business scenarios as described in claim 1, characterized in that, The label encoder adopts a trainable multilayer perceptron structure. Its input is the one-hot encoding or semantic embedding of the label, and its output is a control tensor with the same dimension as the word embedding dimension of the large language model. The label control embedding vector participates in gradient backpropagation during the model training phase.

4. The method for automatically generating tag-based control command data for power grid business scenarios as described in claim 1, characterized in that, The introduction of a label constraint matrix in self-attention calculation specifically refers to: in calculating attention scores... Overlay bias term ,in For the label constraint matrix; when the semantics of the current decoding position are related to the semantics of the target label, in A positive reward is assigned to the corresponding position; a negative penalty is assigned when there is a semantic conflict.

5. The method for automatically generating tag-based control command data for power grid business scenarios as described in claim 1, characterized in that, The construction of a dual quality verification mechanism based on logical implication and rule constraints also includes a rule verification step: based on regular expressions and a power grid expert rule base, it detects whether there are non-power domain terms, numerical limits exceeding limits, and descriptions that violate physical logic in the generated content.

6. The method for automatically generating tag-based control command data for power grid business scenarios as described in claim 1, characterized in that, It also includes a closed-loop optimization step: collecting expert quality scores for the generated data, constructing a reward model, and using a reinforcement learning algorithm to iteratively update the parameters of the label encoder.

7. A tag-based control command data automatic generation system for power grid business scenarios, characterized in that, include: The graph and tag parsing unit is used to analyze data in the power sector and generate a multi-dimensional control tag set; The feature fusion unit is used to extract and fuse features from the procedure text data and the device runtime sequence data to generate multimodal semantic features; A generation unit is used to generate instruction data based on the multimodal semantic features and the multidimensional control tags; The verification unit is used to perform consistency verification and filtering on the generated instruction data. Each unit is configured to collaboratively perform the method described in any one of claims 1 to 6.