Generative question and answer method, system and device based on digital power grid domain terms and medium
By constructing a heterogeneous data feature matrix and a time-series knowledge graph, and combining deep learning and cross-modal attention mechanisms, natural language answers that conform to the professional grammar of the power grid are generated, solving the problems of multi-source data integration and information security in the digital power grid, and realizing efficient and secure knowledge management.
Patent Information
- Application Number
- CN202511666608.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-14
- Publication Date
- 2026-02-17
AI Technical Summary
Digital power grid knowledge management faces challenges such as difficulties in integrating multi-source heterogeneous data, insufficient understanding of domain terminology, lagging dynamic knowledge updates, and a lack of mechanisms for automatically identifying outdated knowledge and associating it with new documents, leading to knowledge fragmentation and the risk of information leakage.
By constructing a heterogeneous data feature matrix, feature fusion is performed using deep learning and cross-modal attention mechanisms. A spatiotemporal knowledge network is established by combining temporal knowledge graphs, key terms are extracted, and natural language answers conforming to professional grammar are generated. At the same time, encryption processing and differential privacy technology are implemented to protect privacy.
It achieves efficient integration of multi-source data and accurate application of professional terminology, ensuring the timeliness and security of answers, reducing the risk of information leakage, and meeting the professional standards and privacy protection requirements of the power grid sector.
Smart Images

Figure CN121542377A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, and in particular to a generative question and answer method and system based on digital power grid domain terminology, equipment and medium. BACKGROUND
[0002] With the transformation of the power system to digitalization and intelligentization, the digital power grid knowledge management faces the following technical challenges: difficulty in integrating multi-source heterogeneous data, non-uniform data formats of power equipment manuals (PDF), operation and maintenance images (JPEG), video monitoring streams (MP4), and structured database data, lack of efficient fusion means, leading to prominent knowledge fragmentation problems; insufficient understanding of domain terminology; general large language models (such as BERT, GPT-3) have a semantic gap in power equipment parameters and operation procedures in the vertical field, and the generated content is easy to deviate from professional specifications; dynamic knowledge update lag: the power industry standard (such as DL / T 666-2012) and equipment parameter update cycle are long (average 90 days), and the existing system lacks a mechanism for automatically identifying outdated knowledge and associating new files. SUMMARY
[0003] In view of the above existing problems, the present application is proposed.
[0004] Therefore, the present application provides a generative question and answer method, system, equipment and medium based on digital power grid domain terminology to solve the problem of the lack of a mechanism for automatically identifying outdated knowledge and associating new files in the existing system.
[0005] To solve the above technical problems, the present application provides the following technical solutions: In a first aspect, the present application provides a generative question and answer method based on digital power grid domain terminology, comprising: uniformly parsing information data sources to construct a heterogeneous data feature matrix; extracting text feature vectors from the heterogeneous data feature matrix using a deep learning architecture, combining convolutional neural networks to extract image feature vectors, calculating feature similarity through a cross-modal attention mechanism, and generating a fusion representation vector; through time-series knowledge graph technology, associating power safety work procedure clauses with equipment maintenance work order records to form a spatio-temporal associated knowledge network; extracting key terms from the spatio-temporal associated knowledge network; fusing the key terms with the fusion representation vector to generate natural language answers that conform to the professional syntax of the power grid, and using the natural language answers to detect sensitive information leakage risks in the generated content; encrypting the heterogeneous data feature matrix and adding privacy protection noise to user query tracks using differential privacy technology.
[0006] As a preferred scheme of the generative question and answer method based on the digital power grid field term, wherein: the information data source includes at least one of document data, image data, video data and structured data; the uniform format analysis of the information data source includes: feature extraction and format conversion of different format data sources respectively, forming a unified data representation format.
[0007] As a preferred scheme of the generative question and answer method based on the digital power grid field term, wherein: the cross-modal attention mechanism adopts a multi-head attention mechanism; wherein, the ratio of the number of text attention heads to the number of image attention heads ranges from 1:1 to 3:1, and the fusion representation vector is generated by calculating the similarity weight between the text feature vector and the image feature vector.
[0008] The beneficial effects of the preferred technical scheme are: by setting a reasonable attention head ratio, the weight is allocated according to the complexity difference of text and image information, thereby improving the accuracy and efficiency of cross-modal feature fusion.
[0009] As a preferred scheme of the generative question and answer method based on the digital power grid field term, wherein: the step of forming the space-time correlation knowledge network includes: using a graph database to store at least two node types of power equipment nodes, regulation standard nodes and work record nodes; establishing at least one relationship type of the association relationship, the constraint relationship and the trigger relationship between the node types; setting a weight value for each relationship type, and constructing the space-time correlation knowledge network according to the weight value.
[0010] As a preferred scheme of the generative question and answer method based on the digital power grid field term, wherein: the step of extracting key terms from the space-time correlation knowledge network includes: using a word frequency statistical algorithm to count the frequency of terms in the space-time correlation knowledge network, and extracting a high-frequency term set; using a pre-trained language model to calculate the semantic correlation degree of each term in the high-frequency term set with the context; sorting the terms according to the semantic correlation degree, and screening a term set with a high semantic weight ranking as the key terms.
[0011] The beneficial effects of the preferred technical scheme are: the double-layer screening mechanism not only ensures the field representativeness of the terms, but also ensures the semantic accuracy of the terms.
[0012] As a preferred scheme of the generative question answering method based on the digital power grid field term provided in the application, wherein: the step of generating the natural language answer conforming to the power grid professional grammar comprises: obtaining a power industry standard term library as an adversarial sample; performing normative optimization on the key term through field adversarial training to obtain a normalized term; fusing the normalized term with the fusion representation vector; positioning an answer segment from the fusion result through a pointer network; and performing grammar correction on the answer segment through a sequence decoder to generate the natural language answer.
[0013] The beneficial effect of the preferred technical scheme is that the answer is generated through term normalization by adversarial training, combined with pointer network positioning and sequence decoder correction.
[0014] As a preferred scheme of the generative question answering method based on the digital power grid field term provided in the application, wherein: the encryption processing of the heterogeneous data feature matrix comprises: homomorphic encryption of the heterogeneous data feature matrix under a federated learning framework to realize multi-party data collaborative training; and adding privacy protection noise to the user query trajectory by adding Laplace noise to the user query trajectory, wherein the privacy protection strength parameter epsilon of the Laplace noise ranges from 0.1 to 0.5; and the natural language answer is detected in real time by a lightweight security proxy model based on knowledge distillation to identify sensitive information in the natural language answer.
[0015] The beneficial effect of the preferred technical scheme is that the three-layer security mechanism builds a complete privacy protection system, ensuring multi-party data collaborative training while reducing the risk of privacy leakage.
[0016] In a second aspect, the application provides a generative question answering system based on digital power grid field terms, comprising: a multi-modal preprocessing module for uniformly parsing information data sources in multiple formats to construct a heterogeneous data feature matrix; a field term generation module for extracting key terms from the heterogeneous data feature matrix and generating natural language answers conforming to the professional grammar of the power grid in combination with a fusion representation vector; a security protection module for encrypting the heterogeneous data feature matrix and adding privacy protection noise to the user query trajectory; and a dynamic updating module for evaluating knowledge timeliness and triggering a knowledge base updating process.
[0017] In a third aspect, the application provides an electronic device, comprising: a memory and a processor; the memory is configured to store computer executable instructions, and the processor is configured to execute the computer executable instructions, which, when executed by the processor, implement the steps of the generative question answering method based on the digital power grid field term.
[0018] Fourthly, the present invention provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the generative question-answering method based on digital power grid terminology.
[0019] Compared with existing technologies, the beneficial effects of this invention are as follows: Through multimodal knowledge fusion processing, it achieves efficient integration of power equipment manuals (PDF), operation and maintenance images (JPEG), video surveillance streams (MP4), and structured databases, constructing a heterogeneous data feature matrix. Combined with a cross-modal attention mechanism, it improves feature fusion efficiency. Simultaneously, based on a temporal knowledge graph, it dynamically associates clauses of the "Power Safety Work Regulations" with equipment maintenance work order records, forming a spatiotemporal knowledge network that supports complex knowledge association queries. Through a two-layer terminology filtering mechanism, it increases the coverage of standard power industry terms in the generated text, and the generated answers conform to the professional grammar specifications of the IEC 61850 standard. Attached Figure Description
[0020] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a schematic diagram of the overall process of a generative question-answering method based on digital power grid terminology according to an embodiment of the present invention. Detailed Implementation
[0022] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.
[0023] Example 1, referring to Figure 1 As an embodiment of the present invention, a generative question-answering method based on digital power grid terminology is provided, comprising the following steps S100~S600: S100. Perform unified format parsing on the information data source and construct a heterogeneous data feature matrix.
[0024] S200. A deep learning architecture is used to extract text feature vectors from the heterogeneous data feature matrix, and a convolutional neural network is used to extract image feature vectors. Feature similarity is calculated through a cross-modal attention mechanism to generate a fused representation vector.
[0025] S300 uses time-series knowledge graph technology to link power safety work regulations and equipment maintenance work order records to form a spatiotemporal knowledge network.
[0026] S400. Extract key terms from the spatiotemporal related knowledge network.
[0027] S500. The key terms and the fusion representation vector are fused to generate a natural language answer that conforms to the professional syntax of the power grid, and the natural language answer is used to detect the risk of leakage of sensitive information in the generated content.
[0028] S600. The heterogeneous data feature matrix is encrypted, and differential privacy technology is used to add privacy-protecting noise to the user query trajectory.
[0029] It should be noted that digital power grid systems generate a large amount of heterogeneous data from multiple sources during operation, including text-based work procedures, maintenance records, and operation and maintenance documents, as well as image-based equipment drawings and on-site photos. Traditional question-and-answer systems struggle to effectively integrate this heterogeneous data, leading to inaccurate use of technical terminology and poor contextual relevance in generated answers. Furthermore, the power grid sector involves a large amount of sensitive information, such as equipment operating parameters and safety procedure details, posing a risk of information leakage during the question-and-answer process. In addition, due to the time-sensitive nature of power grid procedures and equipment status, establishing a correlation between historical data and the current status is difficult, affecting the spatiotemporal accuracy of the answers. Moreover, user query patterns themselves contain sensitive business information, lacking effective privacy protection mechanisms. Therefore, comprehensive optimization of the accuracy, security, and privacy of intelligent question-and-answer systems in the digital power grid sector is crucial.
[0030] Therefore, addressing the aforementioned issues of data heterogeneity, terminology accuracy, information security, and privacy protection, this method, through steps S100-S600, firstly unifies the parsing of heterogeneous data and constructs a feature matrix to achieve standardized processing of multi-source data; secondly, it achieves deep fusion of text and image features through deep learning and cross-modal attention mechanisms to enhance feature representation capabilities; thirdly, it utilizes temporal knowledge graphs to establish spatiotemporal relationships between power grid regulations and equipment records to ensure the timeliness and accuracy of answers; fourthly, it ensures that the generated answers conform to power grid professional grammar standards through key terminology extraction and fusion; and fifthly, it implements sensitive information detection during the generation process and encrypts and differentially protects data and query trajectories, achieving comprehensive security protection for the digital power grid question-and-answer system. This method achieves effective integration of heterogeneous data, accurate application of professional terminology, and end-to-end security and privacy assurance.
[0031] Example 2, refer to Figure 1 As an embodiment of the present invention, based on the above embodiment, a generative question-answering method based on digital power grid terminology is provided.
[0032] In this embodiment of the application, step S100: performing unified format parsing on the information data source to construct a heterogeneous data feature matrix; wherein, the information data source includes at least one of document data, image data, video data, and structured data; Unified format parsing of the information data source includes: extracting features and converting formats of data sources with different formats to form a unified data representation format.
[0033] Specifically, the document data includes text documents such as power safety work procedures, equipment maintenance manuals, and operation and maintenance guidelines, which are segmented, labeled, and named entity recognized using natural language processing technology. Image data includes equipment structure diagrams, circuit wiring diagrams, and on-site operation photos, which are normalized and feature extracted using image preprocessing technology. Video data includes equipment operation monitoring videos and operation demonstration videos, which use keyframe extraction and time-series analysis to obtain key information. Structured data includes equipment ledgers, maintenance work orders, and operating parameter tables, which are standardized through database queries and field mapping. Through unified format parsing, heterogeneous data from different sources and in different formats are converted into a standardized feature matrix form. The rows of the matrix represent data samples, and the columns represent feature dimensions, achieving a unified representation of multi-source data and laying the foundation for subsequent cross-modal feature fusion.
[0034] In this embodiment of the application, step S200: a deep learning architecture is used to extract text feature vectors from the heterogeneous data feature matrix, and a convolutional neural network is used to extract image feature vectors. Feature similarity is calculated through a cross-modal attention mechanism to generate a fused representation vector; the cross-modal attention mechanism adopts a multi-head attention mechanism. The ratio of text attention heads to image attention heads ranges from 1:1 to 3:1. The fused representation vector is generated by calculating the similarity weight between the text feature vector and the image feature vector.
[0035] Specifically, for text feature extraction, a pre-trained language model based on the Transformer architecture is used to encode text sequences into high-dimensional semantic vectors, capturing the contextual relationships of power grid terminology. For image feature extraction, a convolutional neural network is used to perform multi-layer convolution and pooling operations on the image, extracting local and global features to form a fixed-dimensional feature vector. In the cross-modal attention mechanism, multiple attention heads are set to focus on different feature dimensions of text and images respectively. The ratio of text attention heads to image attention heads is set to 1:1 to 3:1, preferably 2:1. This ratio allocates computational resources according to the importance of text and image information in the power grid domain. By calculating the dot product similarity between text feature vectors and image feature vectors, an attention weight matrix is obtained, and the feature vectors are weighted and fused to generate a fused representation vector that simultaneously contains textual semantic information and image visual information. This fused representation vector can more comprehensively express the multimodal characteristics of power grid equipment and operating procedures, improving the accuracy and completeness of subsequent question-and-answer generation.
[0036] It should be noted that the implementation methods S100 and S200 described above effectively integrate multi-source heterogeneous data from the power grid sector. Unified format parsing resolves the issue of inconsistent formats across different data sources, and the constructed feature matrix provides standardized input for subsequent processing. The cross-modal attention mechanism, by rationally allocating the ratio of text and image attention heads, ensures both the full utilization of textual information and the supplementary role of image information, enabling the generated fused representation vector to comprehensively reflect the multidimensional characteristics of power grid expertise.
[0037] In this embodiment of the application, step S300: using temporal knowledge graph technology, the clauses of the power safety work procedures are linked with equipment maintenance work order records to form a spatiotemporal related knowledge network. Specific steps include A1~A3: A1. Use a graph database to store at least two types of nodes, including power equipment nodes, standard procedure nodes, and work record nodes.
[0038] The Neo4j graph database is used as the storage engine to construct a multi-type node system for the power grid field. Power equipment nodes include equipment entities such as transformers, circuit breakers, disconnectors, and surge arresters. Each equipment node stores attribute information such as equipment number, model specifications, rated parameters, and installation location. For example, a transformer node records a rated capacity of 50MVA, a rated voltage of 110kV / 10kV, and a commissioning date of March 2020. Regulation and standard nodes include clauses from various chapters of the "Power Safety Work Regulations," entries from the "Power Equipment Preventive Testing Regulations," and standards such as the "Power Equipment Maintenance Process Regulations." Each regulation node stores information such as clause number, scope of application, specific requirements, and revision version. Work record nodes include equipment maintenance work orders, defect handling records, inspection logs, and test reports. Each record node stores information such as work order number, execution time, operation content, and responsible person. A total of 1247 power equipment nodes, 583 regulation and standard nodes, and 3856 work record nodes are stored in the graph database.
[0039] In one optional implementation, a graph database is used to store nodes in step A1. Fault event nodes and personnel nodes can also be added. Fault event nodes record information such as equipment fault type, occurrence time, and scope of impact. Personnel nodes record information such as the qualification level, training records, and operating permissions of operators. By expanding the node types, a more complete power grid operation and maintenance knowledge system can be built.
[0040] In another optional implementation, step A1 uses a graph database to store nodes, and multi-dimensional attribute tags can be set for each node, including equipment status tags (running, maintenance, standby), procedure version tags (current, obsolete, under revision), and record type tags (planned, temporary, emergency). The tag system enables rapid classification and retrieval of nodes, improving the query efficiency of the knowledge network.
[0041] A2. Establish at least one of the following relationship types among the node types: association, constraint, and triggering relationship.
[0042] Establish various types of relationship edges between nodes. Association relationships include "basis relationships," connecting work record nodes with standard procedure nodes, such as a transformer maintenance work order based on Article 3.2.5 of the "Power Equipment Maintenance Process Regulations"; and "applicability relationships," connecting standard procedure nodes with power equipment nodes, such as the "Transformer Operation Regulations" applying to all transformer equipment at voltage levels of 110kV and above. Constraint relationships include "preconditions," such as the prerequisite for a circuit breaker overhaul work record being the completion of a pre-test work record; and "mutual exclusion constraints," such as prohibiting maintenance operations while the equipment is in operation. Trigger relationships include "initiation relationships," such as equipment defect records triggering the generation of maintenance work orders; and "periodic triggers," such as equipment being in operation for one year triggering annual preventative testing. Through relationship establishment, a total of 4532 association relationship edges, 876 constraint relationship edges, and 1254 trigger relationship edges were created in the graph database.
[0043] A3. Set weight values for each of the aforementioned relationship types, and construct the spatiotemporal related knowledge network based on the weight values.
[0044] Based on the importance and reliability of relation types, weight values are assigned to each relation edge. The weight value for a "based" relation is set to 0.9, indicating a strong correlation between work records and regulations / standards; the weight value for an "applicable" relation is set to 0.85, indicating high applicability of the regulations to the equipment; the weight value for a "precondition constraint" relation is set to 1.0, indicating that the constraint is mandatory; the weight value for a "mutually exclusive constraint" relation is set to 1.0, indicating that the constraint cannot be violated; the weight value for a "triggered" relation is set to 0.75, indicating a high probability of event triggering; and the weight value for a "periodic trigger" relation is dynamically adjusted according to the triggering frequency, ranging from 0.6 to 0.9. Using a graph traversal algorithm, path weights between nodes are calculated based on edge weights. The path weight is the product of the weights of each edge on the path; a higher weight value indicates a tighter association. The constructed spatiotemporal knowledge network contains 5903 nodes and 6662 weighted relation edges, with an average network degree of 2.25 and a network density of 0.0019, forming a multi-dimensional knowledge association system covering power equipment, regulations / standards, and work records, supporting intelligent question answering based on path reasoning.
[0045] In this embodiment of the application, step S400: extracting key terms from the spatiotemporal related knowledge network includes the following steps B1~B3: B1. Use word frequency statistics algorithms to statistically analyze the frequency of terms in the spatiotemporal knowledge network and extract a set of high-frequency terms.
[0046] All node attribute texts and relation tags in the spatiotemporal knowledge network were segmented into words, and a power grid-specific dictionary was used for terminology recognition. The frequency of each term in the knowledge network was statistically analyzed: the term "transformer" appeared 1247 times, "circuit breaker" 896 times, "preventive test" 432 times, and "rated voltage" 1105 times. A frequency threshold of 50 was set, and terms with frequencies exceeding the threshold were extracted to form a high-frequency term set containing 358 terms. A preliminary screening of the high-frequency term set removed common terms such as "conduct," "implement," and "complete," retaining only power grid-specific terms. After screening, the high-frequency term set contained 276 terms.
[0047] In one optional implementation, the high-frequency term set is extracted in step B1. The TF-IDF algorithm can also be used to calculate the distinguishability of the terms. By multiplying the term frequency (TF) and the inverse document frequency (IDF), terms that are both high-frequency and distinguishable are selected, avoiding the extraction of overly general high-frequency words and improving the professionalism and representativeness of key terms.
[0048] In another optional implementation, in step B1, a set of high-frequency terms is extracted. The degree centrality and betweenness centrality of the node where the term is located can also be calculated by combining the topological location features of the term in the knowledge graph. Terms located in the core position of the knowledge network are extracted first. These terms usually connect multiple knowledge entities and have higher knowledge association value.
[0049] B2. Calculate the semantic relevance between each term in the high-frequency term set and its context using a pre-trained language model.
[0050] A pre-trained language model for the power sector, based on the BERT architecture, was pre-trained on 100,000 power grid technical documents, enabling it to capture the semantic features of power grid terminology. For each term in the high-frequency terminology set, its contextual text appearing in the knowledge network was extracted, with the context window set to 50 characters before and after the term. The term and its context were input into the pre-trained language model to obtain a contextual representation vector of the term, with a dimension of 768. The cosine similarity between the term representation vector and the context representation vector was calculated as a semantic relevance index. For example, the semantic relevance of the term "transformer" with the context "110kV transformer overhaul work" was 0.87, and with the context "relay protection device verification" was 0.43. The average semantic relevance of each term across all occurrences was calculated; the average semantic relevance of the term "preventive test" was 0.82, and the average semantic relevance of the term "rated capacity" was 0.79.
[0051] B3. Sort the terms according to their semantic relevance and select the set of terms with the highest semantic weight as key terms.
[0052] The 276 terms in the high-frequency terminology set were sorted in descending order of semantic relevance. The terms with the highest semantic relevance were "preventive test" (0.82), "transformer overhaul" (0.81), "relay protection" (0.80), "rated voltage" (0.79), and "main transformer" (0.78). A semantic weight threshold of 0.70 was set, and terms with semantic relevance greater than the threshold were selected, resulting in 142 key terms. These key terms are characterized by high frequency of occurrence and clear semantics in power grid question-and-answer scenarios, accurately expressing power grid professional concepts. Further classification of these key terms resulted in 52 equipment-related terms (transformers, circuit breakers, etc.), 38 operation-related terms (maintenance, testing, etc.), 34 parameter-related terms (rated voltage, rated capacity, etc.), and 18 standard-related terms (regulations, specifications, etc.), forming a structured key terminology database to provide terminology support for subsequent natural language generation.
[0053] It should be noted that, through the detailed implementation of S300 and S400 described above, the structured organization of knowledge in the power grid field and the intelligent extraction of key terms are realized. Temporal knowledge graph technology establishes multi-dimensional relationships between power equipment, regulations and standards, and work records, and realizes quantifiable reasoning of knowledge through weighted network construction. Key term extraction, through multi-stage screening including word frequency statistics, semantic relevance calculation, and weight ranking, ensures the professionalism and representativeness of the extracted terms, providing a reliable terminological foundation for generating natural language answers that conform to the grammatical norms of the power grid field, and improving the professional accuracy of the question-answering system.
[0054] In this embodiment of the application, step S500 involves fusing key terms with the fused representation vector to generate a natural language answer that conforms to the syntax of power grid technology, and using the natural language answer to detect the risk of sensitive information leakage in the generated content. The step of generating a natural language answer that conforms to the syntax of power grid technology includes steps C1 to C5. C1. Obtain the power industry standard terminology database as adversarial examples.
[0055] A standard terminology database for the power industry was obtained from authoritative institutions such as the State Grid Corporation of China and the China Electricity Council. This database contains standardized terms from standard documents such as the "Standard for Power Engineering Terminology," "Naming Specifications for Power Equipment," and "Glossary of Terms for Power Safety Work Procedures." The database contains 12,536 terms, covering categories such as equipment names, operational actions, technical parameters, and safety specifications. The database was structured, with attribute fields created for each standard term, including term code, standard name, synonym list, usage scenario, and scope of application. For example, the standard term "main transformer" has synonyms including "main transformer" and "power transformer," and its applicable scenario is substation equipment description. A terminology comparison mapping table was constructed to match everyday terms with standard terms; for example, "tripping" corresponds to the standard term "circuit breaker tripping," and "power transmission" corresponds to the standard term "closing operation." The standard terminology database was used as an adversarial sample set for adversarial learning during training, guiding the model to generate terminology expressions that conform to industry standards.
[0056] C2. Standardize key terms by performing domain adversarial training to obtain standardized terms.
[0057] A domain-specific adversarial training framework is constructed, comprising two modules: a generator and a discriminator. The generator receives key terms extracted from a spatiotemporally related knowledge network as input, such as "transformer," "overhaul," and "test." The generator outputs a sequence of candidate terms using an encoder-decoder architecture. The discriminator receives the candidate term sequence and adversarial examples from a standard terminology library. Employing a binary classification network structure, the discriminator outputs a probability score indicating whether a candidate term conforms to industry standards. During training, the generator aims to maximize the discriminator's acceptance of the generated terms, while the discriminator aims to accurately distinguish between generated and standard terms. The trained generator is then applied to key term normalization. The input term "transformer overhaul" is optimized to the normalized term "main transformer maintenance work," and the input term "relay protection test" is optimized to the normalized term "relay protection device verification." A total of 142 key terms are optimized for normalization, resulting in a set of normalized terms.
[0058] In an alternative implementation, domain adversarial training is performed in step C2. A reinforcement learning mechanism can also be introduced, using terminology standardization scores as reward signals. The terminology selection strategy of the generator is optimized through a policy gradient algorithm, so that the generated standardized terms not only conform to standard forms, but also have higher semantic accuracy and contextual adaptability.
[0059] C3. Integrate standardized terminology with fusion representation vectors.
[0060] An attention fusion mechanism is employed to deeply fuse standardized terms with fused representation vectors. First, each term in the standardized term set is encoded using word embeddings, and a Word2Vec model is used to train a term vector with a dimension of 300. For example, the term "main transformer maintenance work" and the term "relay protection device verification" are encoded as 300-dimensional vectors. Second, the attention weights between the standardized term vectors and the fused representation vectors are calculated using the following formula: Where Q is the fusion representation vector, and K and V are the normalized term vectors. The vector dimension is defined as follows. Through an attention mechanism, the fused representation vector dynamically focuses on the standardized terms most relevant to the current question-and-answer context. The attention weight distribution is calculated: for the question "What preparatory work is needed for transformer overhaul?", the attention weight for the standardized terms "main transformer maintenance work" is 0.78, "work permit issuance" is 0.65, and "safety measure arrangement" is 0.72. The weighted standardized term vector is concatenated or added to the fused representation vector to generate a term-enhanced fused vector, expanding the vector dimension to 1068 dimensions (768-dimensional fused representation vector + 300-dimensional term vector).
[0061] In one alternative implementation, vector fusion is performed in step C3. A gating fusion mechanism can also be used, in which the fusion ratio of the fused representation vector and the normalized term vector is dynamically adjusted through learnable gating units. The weights of the two types of features are assigned according to different question-and-answer scenarios, thereby improving the expressive flexibility of the fused vector.
[0062] C4. Locate the answer fragment from the fusion results using a pointer network.
[0063] A pointer network model is constructed to accurately locate the start and end positions of answer segments from term-enhanced fusion vectors. The pointer network uses a bidirectional LSTM encoder to encode the fusion vector sequence, obtaining the hidden state sequence. Where n is the sequence length. Two pointers, a start pointer and an end pointer, are used to predict the start and end positions of the answer segment, respectively. The start pointer uses an attention mechanism to calculate the probability distribution of each position as the starting position of the answer: We select the position with the highest probability as the starting position. For the ending pointer, we calculate the probability distribution of the ending position within the sequence after the starting position: Where j≥i, the position with the highest probability is selected as the ending position. For the question "What are the testing items for transformer oil?", the pointer network locates the starting position of the answer fragment from the fused vector sequence as the 23rd token and the ending position as the 45th token. The corresponding text fragment is "The testing items for transformer oil include dissolved gas chromatography analysis, trace water content testing, acid value determination, breakdown voltage test, and dielectric loss factor measurement." Through pointer network positioning, accurate extraction of the answer fragment is achieved.
[0064] In one alternative implementation, step C4 uses a pointer network to locate answer fragments. A multi-hop reasoning mechanism can also be introduced. For complex questions that require multi-step reasoning, the pointer network performs multiple rounds of location, locating one answer fragment in each round. Finally, multiple fragments are combined to form a complete answer, which is suitable for question-and-answer scenarios that require the integration of multiple knowledge points.
[0065] C5. Use a sequence decoder to perform grammatical correction on the answer fragments and generate natural language answers.
[0066] A sequence decoder based on the Transformer architecture was constructed to perform grammatical correction and fluency optimization on answer fragments located by pointer networks. The sequence decoder adopts an autoregressive generation method to generate corrected answer sequences word by word. During the decoding process, power grid professional grammatical rules are introduced to constrain the process, including the completeness of subject-verb-object structure, the rationality of terminology collocation, and the correctness of quantifier units. For example, the answer fragment "Transformer oil testing items include dissolved gas chromatography analysis, trace water content testing, acid value determination, breakdown voltage test, and dielectric loss factor measurement" is grammatically corrected to generate the natural language answer: "Transformer oil testing items mainly include the following five items: dissolved gas chromatography analysis, trace water content testing, acid value determination, breakdown voltage test, and dielectric loss factor measurement." The corrected answer adds the sentence-completion phrase "mainly includes the following five items," making the answer more standardized and fluent. The answer generated by the sequence decoder scored 91.8 points (out of 100) in grammatical correctness assessment, 88.5 points in fluency assessment, and 93.2 points in professional terminology accuracy assessment, with the overall generation quality meeting industry application standards.
[0067] In one alternative implementation, grammatical correction is performed in step C5. Alternatively, an answer template library can be used to select the corresponding answer generation template based on the question type (factual, operational, causal, etc.), and fill the answer fragment into the template to ensure that the answer format conforms to the standard expression habits of the power grid industry.
[0068] In this embodiment of the application, step S600: encrypting the heterogeneous data feature matrix and adding privacy-preserving noise to the user query trajectory using differential privacy technology, including the following steps D1~D3: D1. Under the federated learning framework, homomorphic encryption is applied to the feature matrix of heterogeneous data to achieve collaborative training of multi-party data.
[0069] A distributed training framework based on federated learning is constructed, involving data nodes from multiple power companies. Each node holds a local heterogeneous data feature matrix. The Paillier homomorphic encryption algorithm is used to encrypt the feature matrix. This algorithm supports addition and scalar multiplication operations in the encrypted state, meeting the computational requirements of gradient aggregation in federated learning. Specifically, for the feature matrix of node i... Where m is the number of samples and n is the feature dimension, a public key pk and a private key sk are generated, and the public key is used to encrypt each element in the feature matrix: The encryption feature matrix is obtained. During federated learning training, each node calculates the model gradient on its local encrypted data, obtaining the encrypted gradient. The encrypted gradients are uploaded to the central server. Without decryption, the central server aggregates the encrypted gradients from each node using the additive property of homomorphic encryption. The central server then distributes the global encrypted gradient to each node, and each node uses its private key to decrypt and obtain the global gradient. The local model parameters are updated. Homomorphic encryption enables collaborative training of data from multiple parties in encrypted form, ensuring the privacy and security of data from each power company. Data remains within its domain during training, preventing the leakage of sensitive information.
[0070] In one alternative implementation, homomorphic encryption is used in step D1, and it can also be combined with a secure multi-party computation protocol. For complex models that require multiplication operations (such as deep neural networks), secret sharing technology is used to divide the data into multiple shares and distribute them to different nodes. Multi-party collaborative computation is used to realize multiplication operations in the encrypted state, thereby expanding the federated learning's support for complex models.
[0071] In another alternative implementation, federated learning training is performed in step D1, and a differential privacy-preserving gradient pruning mechanism can be introduced. Before uploading the encrypted gradient, norm pruning and noise addition are performed on the gradient. The dual protection mechanism ensures that even if the encryption is cracked, attackers cannot recover the original data from the gradient, providing stronger privacy and security.
[0072] D2. Add Laplace noise to the user's query trajectory. The privacy protection strength parameter ε of the Laplace noise ranges from 0.1 to 0.5.
[0073] Differential privacy technology is employed to protect user query history privacy. User query history includes information such as query time, query content, and query frequency, which may reveal sensitive characteristics such as user work habits and focus areas. To protect user privacy, Laplace noise is added to the query history data. The formula for generating Laplace noise is: ,in Δf represents the sensitivity of the query function, and ε is the privacy protection strength parameter. For query frequency statistics functions, sensitivity... This indicates that the maximum number of times a single user's query records are affected by changes is 1. Set the privacy protection strength parameter. Calculate noise scale Noise values are sampled from the Laplace distribution Lap(3.33) and added to the query frequency statistics. For example, if a user actually queries "transformer maintenance process" 5 times in one day, the statistical value after adding noise is... Rounded up to the fourth power. By adding Laplace noise, even if an attacker obtains the perturbed query trajectory data, they cannot accurately infer the user's true query behavior. The privacy protection strength parameter ε ranges from 0.1 to 0.5. The smaller the ε, the higher the privacy protection strength but the lower the data availability; the larger the ε, the higher the data availability but the lower the privacy protection strength. In practical applications, the ε value should be adjusted according to privacy protection requirements and data analysis accuracy requirements.
[0074] In one alternative implementation, Laplace noise is added in step D2. An adaptive privacy budget allocation strategy can also be adopted, which allocates a smaller ε value to sensitive queries (such as equipment defect information queries) to provide stronger protection based on the sensitivity differences of different query types, and allocates a larger ε value to general queries (such as technical standard queries) to maintain data availability, thereby achieving refined management of privacy protection.
[0075] D3. Real-time detection of natural language answers is performed using a lightweight security agent model based on knowledge distillation to identify sensitive information in the natural language answers.
[0076] A lightweight security proxy model is constructed for real-time detection of sensitive information leakage risks in generated answers. First, a teacher model is trained using a large-scale BERT model on a power grid sensitive information dataset containing 100,000 labeled data points. The dataset is labeled with sensitive information categories such as equipment parameters, personnel information, and system vulnerabilities. The teacher model has 110 million parameters and achieves a sensitive information identification accuracy of 96.3%. Second, a student model is trained using knowledge distillation technology. The student model employs a lightweight DistilBERT architecture with 66 million parameters, approximately 60% of the teacher model's parameters. During knowledge distillation, the KL divergence loss between the student model's output and the teacher model's output is minimized. This approach enables student models to learn the knowledge representations of teacher models. After distillation training, the student model's accuracy in identifying sensitive information reached 93.8%, only 2.5 percentage points lower than the teacher model, but its reasoning speed increased by 3.2 times. The detection time for a single answer decreased from 120ms to 37ms, meeting real-time detection requirements. After answer generation, the natural language answer is input into the lightweight security agent model for detection. The model outputs the sensitive information category and confidence score. For example, for the answer "The rated capacity of this transformer is 50MVA, and the protection device adopts RCS-985 microcomputer protection," the model identifies "RCS-985" as sensitive equipment model information with a confidence score of 0.87. When sensitive information is detected, a desensitization mechanism is triggered, replacing the specific model with a general description. The corrected answer is "The rated capacity of this transformer is 50MVA, and the protection device adopts microcomputer protection." Through real-time detection by the lightweight security agent model, the system effectively prevents the leakage of sensitive information while ensuring the response speed of the question-and-answer system, achieving a sensitive information interception rate of 91.5%.
[0077] In one alternative implementation, sensitive information detection is performed in step D3. A multi-level detection mechanism can also be established. First, obvious sensitive information (such as IP address, password, ID number, etc.) is quickly identified through rule matching. Then, semantic-level sensitive information is identified through a lightweight model. Finally, high-risk answers are manually reviewed, forming a three-level protection system of "rules + model + manual review".
[0078] In another alternative implementation, the student model is trained using knowledge distillation in step D3. Alternatively, a progressive distillation strategy can be adopted, first training a medium-sized intermediate model, and then distilling from the intermediate model to the final lightweight model. This multi-step distillation reduces knowledge loss and allows the lightweight model to maintain high inference speed.
[0079] It should be noted that, through the detailed implementations of S500 and S600 described above, the entire process of security assurance for the power grid question-and-answer system, from answer generation to privacy protection, is achieved. In the answer generation stage, through multi-stage processing including domain adversarial training, terminology fusion, pointer network localization, and sequence decoding, the generated natural language answers meet industry application standards in terms of accuracy of professional terminology, grammatical standardization, and fluency of expression, satisfying the high-quality question-and-answer requirements of the power grid sector. In the privacy protection stage, homomorphic encryption and federated learning enable multi-party data collaborative training without data leaving the domain; differential privacy technology adds noise to user query trajectories to protect user privacy; and a lightweight security proxy model detects sensitive information in real time to prevent data leakage. This constructs a triple security protection system of data encryption, privacy protection, and sensitive information detection. While ensuring the intelligence level of the question-and-answer system, it effectively protects the data security of power grid enterprises and the privacy security of users, providing reliable technical support for intelligent question-and-answer applications in the digital power grid field.
[0080] Example 3 illustrates a generative question-answering method based on digital power grid terminology. It should be noted that the technical solution of this generative question-answering system based on digital power grid terminology belongs to the same concept as the technical solution of the generative question-answering method based on digital power grid terminology described above. Details not described in detail in the technical solution of the generative question-answering system based on digital power grid terminology in this embodiment can be found in the description of the technical solution of the generative question-answering method based on digital power grid terminology described above.
[0081] This embodiment also provides a generative question-answering system based on digital power grid terminology, including: The multimodal preprocessing module is used to perform unified format parsing on information data sources of various formats and construct a feature matrix of heterogeneous data; The domain terminology generation module is used to extract key terms from the heterogeneous data feature matrix and combine them with the fused representation vector to generate natural language answers that conform to the professional syntax of the power grid. The security protection module is used to encrypt the feature matrix of heterogeneous data and add privacy-protecting noise to the user's query trajectory; The dynamic update module is used to assess the timeliness of knowledge and trigger the knowledge base update process.
[0082] This embodiment also provides an electronic device suitable for generative question answering based on digital power grid terminology, comprising: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the generative question answering method based on digital power grid terminology as proposed in the above embodiment.
[0083] This embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, it implements the generative question-answering method based on digital power grid terminology as proposed in the above embodiments.
[0084] The storage medium proposed in this embodiment and the generative question-answering method based on digital power grid terminology proposed in the above embodiments belong to the same inventive concept. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.
[0085] Based on the above description of the implementation methods, those skilled in the art can clearly understand that the present invention can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of the various embodiments of the present invention.
[0086] 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 preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A generative question-answering method based on digital power grid terminology, characterized in that, Includes the following steps: Perform unified format parsing on information data sources and construct a feature matrix for heterogeneous data; A deep learning architecture is used to extract text feature vectors from the heterogeneous data feature matrix, and a convolutional neural network is used to extract image feature vectors. Feature similarity is calculated through a cross-modal attention mechanism to generate a fused representation vector. By using temporal knowledge graph technology, the clauses of power safety work procedures and equipment maintenance work order records are linked to form a spatiotemporal knowledge network. Extract key terms from the spatiotemporal related knowledge network; The key terms are fused with the fusion representation vector to generate a natural language answer that conforms to the professional syntax of the power grid, and the natural language answer is used to detect the risk of leakage of sensitive information in the generated content. The heterogeneous data feature matrix is encrypted, and differential privacy technology is used to add privacy-preserving noise to the user query trajectory.
2. The generative question-answering method based on digital power grid terminology as described in claim 1, characterized in that, The information data source includes at least one of document data, image data, video data, and structured data; Unified format parsing of the information data source includes: extracting features and converting formats of data sources with different formats to form a unified data representation format.
3. The generative question-answering method based on digital power grid terminology as described in claim 2, characterized in that, The cross-modal attention mechanism employs a multi-head attention mechanism; The ratio of text attention heads to image attention heads ranges from 1:1 to 3:
1. The fused representation vector is generated by calculating the similarity weight between the text feature vector and the image feature vector.
4. The generative question-answering method based on digital power grid terminology as described in claim 3, characterized in that, The steps for forming the spatiotemporal related knowledge network include: A graph database is used to store at least two types of nodes, including power equipment nodes, procedure and standard nodes, and work record nodes. Establish at least one of the following relationship types among the node types: association, constraint, and triggering relationships; A weight value is set for each of the aforementioned relationship types, and the spatiotemporal association knowledge network is constructed based on the weight values.
5. The generative question-answering method based on digital power grid terminology as described in claim 4, characterized in that, The extraction of key terms from the spatiotemporal related knowledge network includes: The frequency of terms in the spatiotemporal knowledge network is statistically analyzed using a word frequency statistics algorithm to extract a set of high-frequency terms. The semantic relevance between each term in the high-frequency term set and its context is calculated using a pre-trained language model. The terms are sorted according to their semantic relevance, and the set of terms with the highest semantic weight is selected as the key terms.
6. The generative question-answering method based on digital power grid terminology as described in claim 5, characterized in that, The steps to generate a natural language answer that conforms to the syntax of power grid technology include: Obtain a standard terminology database of the power industry as an adversarial example; The key terms are optimized through domain adversarial training to obtain standardized terms; The normalized terms are fused with the fused representation vector; The answer fragment is located from the fusion result using a pointer network; The answer fragment is grammatically corrected using a sequence decoder to generate the natural language answer.
7. The generative question-answering method based on digital power grid terminology as described in claim 6, characterized in that, The heterogeneous data feature matrix is encrypted, and privacy-preserving noise is added to the user query trajectory using differential privacy technology, including: Under the federated learning framework, homomorphic encryption is applied to the heterogeneous data feature matrix to achieve collaborative training of multi-party data. Laplace noise is added to the user's query trajectory, and the privacy protection strength parameter ε of the Laplace noise ranges from 0.1 to 0.5; A lightweight security agent model based on knowledge distillation is used to detect the natural language answers in real time and identify sensitive information in the natural language answers.
8. A generative question-answering system based on digital power grid terminology, employing the method described in any one of claims 1-7, characterized in that, include: The multimodal preprocessing module is used to perform unified format parsing on information data sources of various formats and construct a feature matrix of heterogeneous data; The domain terminology generation module is used to extract key terms from the heterogeneous data feature matrix and combine them with the fused representation vector to generate natural language answers that conform to the professional syntax of the power grid. The security protection module is used to encrypt the heterogeneous data feature matrix and add privacy-protecting noise to the user query trajectory; The dynamic update module is used to assess the timeliness of knowledge and trigger the knowledge base update process.
9. An electronic device, comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the generative question-answering method based on digital power grid terminology as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the generative question-answering method based on digital power grid terminology as described in any one of claims 1 to 7.