A large language model power grid regulation system semantic retrieval method based on knowledge graph fusion
By constructing a combination of dual-structure knowledge graph and language model, the modeling problem of responsibility distribution and semantic inheritance relationship in power grid regulations was solved, realizing efficient and reliable structured semantic retrieval and explanatory retrieval result generation in the power system.
Patent Information
- Application Number
- CN202511393861.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-28
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2045-09-28
AI Technical Summary
Existing power grid regulations retrieval systems struggle to comprehensively model complex responsibility distributions, semantic inheritance relationships, and semantic paths, resulting in fragmented retrieval results, lack of context, and weak explanatory power, failing to meet the practical application needs of the power industry.
We construct a dual-structure knowledge graph with clauses as nodes and responsibility collaboration and hierarchical inheritance as edges. We combine a language model to perform structured semantic retrieval, build an index table to support fast path location, introduce a structure-aware language model to parse user queries and generate structured query triples as the entry point for graph path retrieval.
It enables the generation of semantically coherent and responsibility chain closed-loop path sequences for power grid regulations and supports reproducible, highly reliable, and strongly interpretable semantic retrieval for key business operations such as power system compliance inquiry, fault review, and responsibility location.
Smart Images

Figure CN120873208B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of semantic retrieval, and particularly relates to a large language model power grid regulation system semantic retrieval method fusing a knowledge graph. BACKGROUND
[0002] With the increasing complexity of power system operation, power grid enterprises have accumulated a large number of rules and regulations documents with strong regulations in business scenarios such as equipment operation and maintenance, dispatching control, and fault disposal. These system documents have diverse sources, including national laws and regulations, industry technical standards, and operation rules and management specifications compiled by group headquarters and subordinate units. Such documents generally use natural language expression, and their content usually has structured characteristics such as article number, chapter level, responsibility subject, and applicable scenario. However, existing retrieval systems generally ignore these structure dimensions and only match based on keywords, word frequency, or shallow semantics, making it difficult to meet the needs of semantic reasoning and responsibility chain tracing. Especially in the power industry, the disposal of the same event often involves the coordination of multiple posts, and the articles in different regulations respectively stipulate the behavior obligations of dispatchers, maintenance personnel, and safety supervisors. However, existing systems cannot reconstruct the collaboration relationship between these articles, resulting in scattered retrieval results, missing context, and weak explanation ability. At the same time, due to the obvious hierarchical difference of regulations, the same operation process may be described differently in national standards and enterprise rules, and existing methods lack the ability to model these cross-level semantic inheritance relationships. In addition, although some large model-based text question and answer systems can improve language understanding ability, they cannot embed structured knowledge such as post system, event type, and responsibility chain path in existing regulations due to the lack of coding methods for regulation article structure, and thus cannot solve the problems of structure accuracy and responsibility consistency in retrieval. Therefore, existing technologies cannot achieve comprehensive modeling of complex responsibility distribution, semantic inheritance relationship, and semantic path closed loop in power grid regulation system documents, and cannot provide interpretable retrieval ability, limiting their feasibility in practical applications in the power industry. SUMMARY
[0003] The present application proposes a structured semantic retrieval method fusing a knowledge graph and a language model to address the problems of complex semantics, multi-dimensional responsibility distribution, and strong hierarchical structure of power grid regulation system.
[0004] To achieve the above purpose, in a first aspect of the present application, a large language model power grid regulation system semantic retrieval method fusing a knowledge graph is provided, comprising:
[0005] Regulatory documents are obtained through a company regulation document storage system API call, each of which has metadata fields of source number, document internal section number and regulatory level identification, then the regulatory documents are subjected to structure recognition processing, and all the regulatory documents are aggregated to obtain a regulatory document set, the regulatory document set is input into a semantic recognition model, and a provision semantic unit set is output;
[0006] Based on the provision semantic unit set, a double-structure knowledge graph suitable for the power grid regulatory system retrieval scenario is constructed, and a structure semantic index table is generated simultaneously, each provision semantic unit in the provision semantic unit set is mapped to a graph node, and an edge set of the double-structure knowledge graph includes regulatory hierarchy inheritance edges and responsibility coordination chain edges;
[0007] The user input natural language question is mapped to a structured semantic representation, and based on the constructed power grid regulatory system double-structure knowledge graph and structure semantic index table, a multi-hop retrieval of the provision set and its path structure related to the user question semantics is completed; and a jump link is extracted from the double-structure knowledge graph, the jump link includes a path between a starting provision node and another provision node, by setting a maximum jump number of 4, selecting the top k paths according to the path score, and aggregating to obtain a final matching path set;
[0008] According to the final matching path set and the hit provision set, a structured semantic modeling is performed to generate a structure aggregation representation of each path, all node encodings and edge encodings, combine the node encodings and edge encodings into a path structure representation, match all the path structure representations with the structured semantics, sort according to the cosine similarity, and select the top
[0009] As a preferred, the structure of the semantic recognition model is as follows:
[0010] The input is a text sequence with a length less than or equal to 256 words, context dependency information is extracted through a bidirectional LSTM text encoding layer, then a convolutional feature extractor is connected to identify the keyword area, finally the responsibility role, key behavior and event object three types of fields are output, the training corpus of the semantic recognition model is derived from a manually annotated power grid regulatory sentence set, the roles and objects are labeled using BIO labels, and the training loss function is a multi-label cross-entropy.
[0011] As a preferred, each provision semantic unit in the provision semantic unit set includes a responsibility role, a behavior verb, an operation object, a provision number and a regulatory level.
[0012] As preferred, the structural semantic index table takes the operation object as the primary key, each key indexes a set of clause semantic units, and records its node ID, role, regulation level, atlas adjacency edge, etc. The structure is as follows:
[0013] Primary key: object name; Field 1: hit clause set; Field 2: responsible role; Field 3: atlas edge and its type, weight, adjacent node pointer;
[0014] The structural semantic index table is stored in the key-value database in the form of key-value pairs, which is used to build an inverted index tree.
[0015] As preferred, after the user inputs the natural language question, the natural language question is converted into a semantic triple for graph path starting point retrieval, and then a structured query intent is output through a structure-aware language model.
[0016] More preferably, the structure-aware language model structure includes a pre-trained basic BERT and three independent Transformer-MLP substructures for classification prediction of the three types of fields of responsible role, key behavior, and operation object, each substructure includes 2 layers of Transformer and 1 layer of fully connected classification head, the input dimension is 256, and the output dimension is determined according to the size of the corresponding category dictionary;
[0017] The training data comes from the enterprise power grid regulation system question and answer library and the accident handling resolution text, and a total of semantic field samples are collected and labeled;
[0018] The output result is a structured query intent, which specifically includes: the responsible role field, the behavior target field, and the operation object field
[0019] More preferably, when the structure-aware language model extracts the intent field, the operation object field is used to locate the matching object entry in the structural semantic index table, and a related node set is obtained as a path starting candidate set.
[0020] In each node in the related node set, multi-hop path expansion is performed based on the regulation level inheritance edge and the responsibility coordination chain edge in the double-structure knowledge graph, and the path expansion adopts a scoring function based on edge type and semantic consistency for priority sorting.
[0021] More preferably, the scoring function is used to calculate the score of the selected path, which is calculated through the regulation level inheritance edge weight, the responsibility coordination chain edge weight, the regular adjustment factor, the regular reward item, the number of repeated roles or regulations in the path, and the penalty factor in the double-structure knowledge graph, and the maximum jump number is set to 4. The top 4 paths are selected as the final matching path set, and the nodes hit by the path endpoints are summarized into a hit clause set.
[0022] As preferred, the structured aggregation representation comprises semantic coding for each provision node in the path, transforming each provision node into a structured vector, and assigning an aggregation weight for each provision node in the path.
[0023] More preferably, the aggregation weight is calculated by a role priority set comprising dispatchers and shift operators, a regulation hierarchy priority set comprising groups and countries, and a normalization factor, wherein the aggregation weight makes the regulation-related nodes comprising dispatchers and groups in the path occupy a higher proportion in the final representation.
[0024] The beneficial technical effects of the present application are at least the following:
[0025] The present application proposes a structured semantic retrieval method for power grid regulations that integrates knowledge graph and language model to address the problems of complex semantics, multi-dimensional responsibilities, and strong hierarchical structure of regulations. The method constructs a double-structure knowledge graph with provisions as nodes and responsibility coordination and hierarchical inheritance as edges, extracts and structures elements such as roles, behaviors, objects, and regulation levels in the regulation text, and constructs an index table with object fields to support fast path positioning. On this basis, a structure-aware language model is introduced to analyze the user's natural language query and generate structured query triples as the graph path retrieval entry. The path search process adopts a multi-hop diffusion mechanism, and in the path scoring, the responsibility chain integrity, cross-role / cross-hierarchy reward items, and structure redundancy penalty factors are integrated to effectively construct a coherent semantic and closed-loop responsibility chain of provision path sequence. Further, in the path modeling process, the role priority mechanism and edge type attention mechanism are introduced to realize the weighted aggregation of provision nodes and path relationships, thereby generating a path representation with structure expression capability to support downstream structured question answering and explanation-based retrieval result generation. Through the continuous processing mechanism of structured analysis-graph modeling-path retrieval-representation aggregation, the present application constructs a structure-driven retrieval system that can reconstruct responsibility chains, normalize hierarchical regulations, and output closed-loop semantic paths, providing a reproducible, highly reliable, and strongly explained semantic retrieval solution for power system compliance queries, fault review, and responsibility positioning. BRIEF DESCRIPTION OF DRAWINGS
[0026] The present application is further illustrated by the accompanying drawings, but the embodiments in the drawings do not constitute any limitation on the present application. For those skilled in the art, other drawings can be obtained without creative labor based on the following drawings.
[0027] Figure 1 The present application is a large language model power grid regulation semantic retrieval method integrating knowledge graph. DETAILED DESCRIPTION
[0028] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0029] In one or more embodiments, such as Figure 1 As shown, a semantic retrieval method for power grid regulations using a large-scale language model that integrates knowledge graphs is disclosed. The method includes the following:
[0030] S1. Obtain the regulations documents through the API call of the company's regulations document storage system. The regulations documents all have metadata fields such as source number, document internal chapter number and regulation level identifier. Then, perform structural recognition processing on the regulations documents and summarize all regulations documents to obtain a regulations document set. Input the regulations document set into the semantic recognition model and output a set of clause semantic units.
[0031] This step focuses on the information infrastructure construction of power grid regulations and institutional documents. The goal is to extract unstructured regulatory texts into semantically structured units, serving as the basic nodes for subsequent graph modeling and structured semantic retrieval. Power grid regulations and institutional documents typically consist of standard procedures issued by the State Grid Corporation of China, implementation manuals compiled by subsidiaries, operating regulations, and emergency response plans. While highly structured, they lack uniformity in surface document format, often stored in PDF, Word, and HTML formats. Content may include long natural language sentences, nested numbering, and unannotated roles. Therefore, this step primarily addresses the following problem: how to accurately identify the boundaries, responsible roles, core actions, and event objects of each regulation, and structure them into semantic units. This is for use in subsequent map building and semantic computation.
[0032] The input for this step is a collection of regulatory documents. Each document The documents were obtained through the company's internal regulations management platform, and were stored in the following formats: original PDF (approximately 70%), Office Word (approximately 20%), and HTML webpage format (approximately 10%). All documents contained metadata fields such as source number (e.g., "State Grid Dispatch Regulations 2020 Edition"), internal chapter number (e.g., "3.2.1"), and regulation level identifier (e.g., "Group Regulations", "City-level Implementation Rules"). This data was obtained by calling the company's regulations document storage system API to retrieve the original content and metadata.
[0033] First, regarding the document Structure recognition processing is performed. Due to document format heterogeneity, differentiated parsing strategies need to be adopted according to the document type. For PDF format documents, an OCR text image-based parsing tool (such as PaddleOCR or ABBYY API) is used for page-level recognition to extract text content, paragraph position, text block coordinates, and numbered position information on each page; for Word and HTML format documents, a method combining style tag parsing and regular expression rules is used to extract title levels (such as Heading1-3), text fields, and numbered areas. All documents are finally mapped to a document paragraph stream, with each piece of text corresponding to a paragraph number, hierarchical position, and text field, forming the following field set:
[0034] : Clause number, obtained by regular matching of the numbered format (such as "3.2.4"); : Regulation level, directly marked by document meta-information; : Section number; : Paragraph text.
[0035] For example, in the group dispatching regulation document, there is a paragraph: "4.3.2 After receiving the line trip information, the dispatcher should immediately notify the operation team to start the current restoration process", which is parsed as: , , .
[0036] Next, semantic event extraction is performed on . The input is fed into the semantic recognition model , which has the following structure: the input is a text sequence (length ≤ 256 characters), which is extracted through a bidirectional LSTM text encoding layer to extract context dependency information, followed by a convolutional feature extractor to identify key word regions, and finally outputs three types of fields: responsibility role , key behavior , and event object . The model training corpus is derived from a manually annotated set of power grid regulation sentences (about 3200 sentences), with roles and objects labeled using BIO tags (such as "B-role" and "I-object"), and the training loss function is a multi-label cross-entropy.
[0037] The model output is parsed into clause structure units:
[0038]
[0039] Where: is the structured clause; is the responsibility role, extracted from the subject identification module in ; is the action verb, identified by the convolutional layer and matched in the action verb table. is the operation object, obtained by dependency syntax analysis and cross-validation with the terminology library; and is the step front field identification result.
[0040] In the above example, the system output is: , , .
[0041] To ensure the scale consistency of edge weight and similarity calculation in the subsequent graph, the above field is further normalized. Since the frequency of the same semantic field in different regulations may differ significantly, if not unified, it will affect the semantic alignment judgment, therefore the following normalization function is introduced:
[0042]
[0043] Where: represents the word frequency or semantic similarity score of a certain role, behavior or object in the corpus; is the normalized result in the range of ; is a small constant to prevent division by zero, generally .
[0044] This normalization is only used for edge weight auxiliary calculation in semantic mapping process, and does not affect the original representation of the field.
[0045] Finally, the text semantic unit set is obtained, where each contains fields, representing that in a certain regulatory provision with regulation number and regulation level , the role performs the behavior on the object .
[0046] S2, based on the text semantic unit set, construct a double-structure knowledge graph suitable for the power grid regulation system retrieval scenario, and simultaneously generate a structure semantic index table, by mapping each text semantic unit in the text semantic unit set to a graph node, the edge set of the double-structure knowledge graph includes regulation level inheritance edges and responsibility coordination chain edges;
[0047] The goal of this step is to construct a double-structure knowledge graph suitable for the power grid regulation system retrieval scenario based on the text semantic unit set obtained in step S1 , and simultaneously generate a structure semantic index table . The atlas system describes the "regulatory hierarchy inheritance relationship" and "post responsibility coordination link" between the regulatory provisions, which is used to support subsequent structured semantic retrieval and path reasoning tasks.
[0048] The power grid regulations have the following typical scene characteristics in actual implementation: first, the regulations have multiple levels of content such as national standards, group systems, and unit regulations, and the provisions may have repeated numbers but have guiding and subordinate relationships; second, the same device event or accident type (such as "trip", "fire", "voltage anomaly") is usually handled by multiple post roles in the form of "sequence + division of labor", and the regulations of each post are scattered and semantically coupled; third, there are semantic style differences between different regulatory levels for the same object (such as "should be handled immediately" and "report as soon as possible"), which must be explicitly identified and standardized by the atlas to avoid semantic retrieval confusion. Therefore, the atlas modeling scheme emphasizes structural rationality, semantic fusion, and application-oriented responsibility link.
[0049] This step first constructs a set of atlas nodes Each is mapped to a graph node , and the node attributes retain the original five-tuple fields. The node unique identifier is generated by concatenating to ensure that provisions with repeated numbers but different regulatory sources are structurally distinguished.
[0050] Then build the edge set , which contains two subsets: regulatory hierarchy inheritance edges and responsibility coordination chain edges . Among them, models the "provision semantic inheritance relationship" between regulatory systems, models the "same event different post handling relationship" between multiple roles.
[0051] The regulatory hierarchy edge construction method is as follows:
[0052] In order to identify semantic inheritance clauses in different regulatory levels (such as groups and cities), the invention first constructs a joint semantic vector for each , which is obtained by concatenating the behavior and object fields after encoding by a fine-tuned BERT model. The BERT model has been fine-tuned in the field of State Grid regulations data, with a structure of 12 layers of Transformer, input of "action + object" sequence, and output vector dimension of 128.
[0053] The semantic inheritance weight is defined as follows:
[0054]
[0055] in: For the clauses and Semantic similarity weights; and The embedding vector constructed in step one; Represents the cosine similarity of vectors; This is an indicator function for whether the regulatory levels are consistent. Penalty coefficient (recommended value) This is used to suppress the phenomenon of excessively high semantic similarity in regulations at the same level.
[0056] This innovative formula introduces a special negative term for "cross-level clause matching," ensuring that the graph prioritizes establishing inheritance relationships between cross-level clauses, rather than simply identifying similar text as synonyms. Only when... (Actual measurement) )and Only then should a hierarchical inheritance boundary be established. .
[0057] The method for constructing the chain of responsibility edges is as follows:
[0058] The chain of responsibility structure aims to depict the logical connections between the clauses involved in different roles within an event handling chain. Its implementation involves three steps:
[0059] ① By operation object Create an inverted index This is used to find all clause pairs that involve the same object;
[0060] ② Use a predefined behavior sequence list (e.g., "Discover" < "Report" < "Process" < "Record") Determine the action of the clause. and Does the timing match?
[0061] ③If satisfied and If the timing is met, then a responsibility collaboration edge is generated.
[0062] To achieve more refined edge weight differentiation, the following responsibility chain edge weight function is proposed:
[0063]
[0064] in: For word vector similarity between actions (trained on power grid regulations data using Word2Vec); For semantic similarity between objects, the Jaccard similarity metric is used. Instructions for different job positions; To indicate whether the actions meet the sequence requirements, set the value to 1 or 0; These are weighted parameters with initial values of (0.3, 0.3, 0.2, 0.2), which can be adjusted according to the task precision.
[0065] This formula innovatively integrates four dimensions: word vector similarity, object consistency judgment, job similarity and difference judgment, and action sequence structure, enabling the responsibility chain graph to truly recreate the rule chain in a cross-role event processing flow and support edge weight sorting.
[0066] The structural semantic index table is constructed as follows:
[0067] To avoid performance bottlenecks caused by graph traversal retrieval, this step simultaneously establishes a structural semantic index table. By operating on the object Primary key, each key indexes a group It records information such as node ID, role, rule level, and graph adjacency edges, with the following structure:
[0068] Primary key: object name Field 1: Set of Hit Clauses Field 2: Corresponding role Field 3: Graph Edges Its type, weight, and neighboring node pointers.
[0069] This table is stored in a key-value database as key-value pairs. An inverted index tree can be built as needed, supporting fast local path queries in the graph triggered by event objects or roles in the next step.
[0070] This step yields a structural knowledge graph. , where the set of nodes From edge set Includes hierarchical edges Collaboration with Responsibilities ;Structure semantic index table A structured index table organized with object fields as the primary key, storing graph nodes and their structural connection information.
[0071] S3. Map the natural language question input by the user into a structured semantic representation, and based on the constructed dual-structure knowledge graph of power grid regulations and the structured semantic index table, complete the multi-hop retrieval of the set of articles related to the semantics of the user question and its path structure; and extract the jump links in the dual-structure knowledge graph, the jump links include the path between the starting article node and another article node, by setting the maximum number of jumps to 4, select the top k paths with the highest path scores, and summarize to obtain the final matching path set;
[0072] This step is based on the output of the previous two steps, mapping the user input natural language question into structured semantic representation, and based on the constructed power grid regulation dual structure knowledge graph With the structure semantic index table , complete the multi-hop retrieval of the article set related to the semantic of the user question and its path structure . The main goal is to solve two core problems in the semantic query of power grid regulations: first, user expression usually has problems such as post missing, event ambiguity or behavior verb irregularity, which directly affects the accuracy of retrieval; second, the regulation articles in the graph present multi-level hierarchy, wide role distribution and path redundancy, without structure guidance, it is impossible to form accurate article matching and responsibility path closed loop. Power grid regulations in actual scenarios such as "accident handling", "violation judgment", "operation scheduling" and other queries are usually not expressed in standardized terms, for example, "who is responsible for reporting the fire" and "who needs to be notified when the cable trips" such expressions are neither standardized nor explicitly indicate the object category and post subject. The structure semantic guidance mechanism designed in this step is specifically designed for such input, through the structure perception language model + path selection regular design, to maximize the restoration of user query in the structure of the regulation graph The real article mapping path realizes the structured projection of semantic intent in the regulation graph.
[0073] Graph structure , where is an article node, each contains a five-element structure; , respectively, are regulation level inheritance edges and responsibility chain edges. Index table , with the operation object as the primary key, organizes structured inverted information containing related article ID, role set, and graph structure relationship.
[0074] In addition, the user input question is a Chinese natural language sentence, such as "who should report the line trip" and "how to handle the cable fire", which has not been structured and needs to be parsed into semantic meta-information for graph path initiation.
[0075] The first stage task of this step is to convert the natural language question into a structured semantic triple for graph path starting point retrieval. For this purpose, a structure perception language model The model structure consists of BERT (pre-trained base) plus three independent Transformer-MLP substructures, which perform classification predictions for three categories of fields: responsibility role, key behavior, and operation object. Each substructure contains two Transformer layers and one fully connected classification head layer. The input dimension is 256, and the output dimension depends on the size of the corresponding category dictionary.
[0076] The training data comes from the enterprise power grid regulations Q&A database and accident handling resolution texts, with a total of 3700 semantic field samples collected and labeled. The output is a structured query intent.
[0077]
[0078] in: The field representing the responsibility role is identified from the syntactic subject or role noun, such as "who", "duty officer", "dispatcher"; The target field for the behavior is extracted from predicate phrases, such as "report", "notify", and "isolate". This indicates the field being operated on, using semantic similarity in the index table. Obtained by matching the primary key; This represents a structured query intent triple.
[0079] After the model extracts the intent field, that is... In the index table Locate the matching object entry in the middle and obtain its related node set. , as the candidate set for the starting point of the path.
[0080] Subsequently, in response to Each node in the graph is based on the graph. Chain of Responsibility With hierarchical chains Simultaneously, multi-hop path expansion is performed. Path expansion employs a scoring function based on edge type and semantic consistency for priority ranking. Specifically addressing the fragmentation problem of responsibility links in power grid regulations, the following path scoring function is designed:
[0081]
[0082] in: For path The score; The edge weights (responsibility edges or inherited edges) obtained from step two. This is a new regularization term introduced in this step, representing the edge. Whether it crosses levels or positions, if it does, an additional reward value (such as 0.1) will be added to improve the diversity of the path; Regularization factor (recommended value) ); represents the number of repeated roles or regulations in the path, as a path redundancy penalty term; is a penalty factor, and the value is recommended to be .
[0083] The scoring function is designed for the grid regulation structure retrieval scenario, and is specifically used to solve the problem of path selection tending to "local fragment repetition" and "excessive role consistency" when the responsibility distribution is distributed in multiple posts and the regulation levels intersect. By adding a structure reward regular , the cross-role and cross-regulation regulation linkage is encouraged to be activated first, so that the path structure is more in line with the accident accountability or processing process.
[0084] The path expansion adopts a combination of breadth-first search (BFS) and heuristic scoring sorting. Within the range of the set maximum jump number , the top paths are selected as the final matching path set , and the node article set hit by the path endpoint is recorded as .
[0085] For example, in the question "Who is responsible for handling the cable fire?", the model identifies , , missing. The system starts from the object "cable fire" in the graph, and preferentially selects the path with the role of "dispatcher" and "duty officer", and jumps down to the "operation team" or "repair team" node through the responsibility chain, forming a complete chain of "dispatching discovery → operation processing" that conforms to the accident scene.
[0086] This step obtains the article set : The hit path endpoint article set is structured and represented; the path set : The structure path set, each path is , accompanied by a score and a path explanation field (such as role jump, regulation level crossing, etc. annotation information).
[0087] The path set represents the set of "article-to-article jump links" obtained by the system in the graph structure, which is related to the semantic of the user's question . Each path represents a series of responsibility relationships or hierarchical inheritance relationships starting from a starting article node , and finally jumping to an article node This path reflects the process of connecting the provisions between multiple roles or multiple levels in the regulations, that is, the responsibility chain of "who is responsible → who handles → who reports". Each edge in the path represents a structural jump or logical association. All paths together constitute the structured semantic understanding process of the system for user problems.
[0088] S4, according to the final matching path set and the hit provision set, performing structured semantic modeling to generate a structural aggregate representation of each path, all node encodings and edge encodings, combining the node encodings and edge encodings into a path structure representation, matching all the path structure representations with the structured semantics, ranking according to the cosine similarity, and taking the top paths with the highest scoring cosine similarity as the retrieval results;
[0089] The task of this step is to perform structured semantic modeling on the basis of the path set and the hit provision set obtained in step S3 to generate a structural aggregate representation of each path to support subsequent structured retrieval and explanation generation. The core purpose of path modeling is to uniformly represent the provision information of different sources, different roles, and different levels of regulations in the path, so that the subsequent system can consistently model and analyze the "responsibility chain defined by multiple regulations". In the power grid regulation scenario, the same responsibility chain is often composed of multiple provisions across roles and across regulation levels. For example, a processing path related to "cable fire" may consist of "dispatchers should notify the operation team" and "operation personnel are responsible for handling the fire", which are two provisions from the group and unit regulations respectively. If the path cannot be aggregated in structure, the subsequent semantic retrieval and responsibility chain restoration will be broken. This step is the key modeling link to solve this problem.
[0090] To construct a structured representation from the path set, the present application first needs to perform semantic encoding on each provision node in the path. Each node will be converted into a structured vector . In order to maintain semantic consistency, the present application uses a text encoder model trained in step one, which has a BiLSTM structure (2 layers, hidden layer size 128, input is the concatenated role, action, and object sequence). This model has been pre-trained on a power grid regulation text set (about 8000 provisions), so it has strong industry term expression ability.
[0091] For example, the provision "dispatchers should notify the operation team immediately after receiving the fire" has a structured information of , , , the input after concatenation is "Dispatcher informs fire". This sequence is input , and the output is a context semantic vector of length 128 .
[0092] Next, the invention assigns an aggregated weight to each node in the path . The weight takes into account two factors: first, whether the node belongs to the core role of the path; second, whether the node comes from a high-priority regulation hierarchy (e.g., group regulation). The invention constructs a role priority set , and a regulation hierarchy priority set . The weight is calculated as follows:
[0093]
[0094] where , , is a normalization factor. This design makes the "Dispatcher-group regulation" node in the path occupy a higher proportion in the final representation, more in line with the structure of the grid event responsibility leading chain.
[0095] The modeling of edges adopts the same encoding strategy as the edge weight calculation in step two. The invention inherits the weight of each edge in the path from step three . In this step, the invention calculates the aggregated weight of each edge, whose calculation logic is as follows:
[0096]
[0097] where is the existing edge weight in step two, is a tuning parameter, is a cross-hierarchy / cross-role reward item: if the edge is a responsibility edge and connects different roles, or a hierarchy edge connecting different regulation levels, a reward is given (set to 0.1 and 0.15). This makes the part of the path with frequent structural jumps and large responsibility span in the aggregated representation get a higher weight.
[0098] After obtaining all node encodings and edge encodings , the invention combines them into a path structure representation , whose calculation formula is as follows:
[0099]
[0100] After aggregation, each path is mapped to a vector , which represents its comprehensive structural semantics. These vectors will be subsequently input into the structured semantic retrieval module as the basis for sorting and screening.
[0101] To achieve the final retrieval result generation, the system will match all path representations with the structured query intent , sort according to the cosine similarity between the path aggregation vector and the query intent, and return the top path with the highest score as the retrieval result. The clause number, role chain, and path structure information attached to each retrieval result will be formatted for output, supporting the structured understanding of the scope of responsibility and the source of the clause by power business personnel.
[0102] For the path representing "dispatcher notification → operation and maintenance processing → unit report", which contains two nodes "group regulation dispatcher notification" and "unit regulation operation and maintenance processing", one responsibility edge and one hierarchical edge, the final path aggregation vector combines role priority, hierarchical rewards, and context text representation. The system finally selects this path as the high-confidence retrieval result and returns it, outputting structural fields such as the clause numbers involved (e.g. "group 3.2.1", "unit 7.1.4"), the role responsibility chain ("dispatcher → operation and maintenance personnel"), and path analysis instructions ("cross-hierarchical + cross-role double-hop path") for users to quickly understand and apply.
[0103] The above describes the preferred embodiments of the present application. It should be noted that for those skilled in the art, without departing from the principles of the present application, several improvements and refinements can be made, which are also considered within the scope of protection of the present application.
Claims
1. A method for retrieving power grid regulation system semantics based on a large language model fused with a knowledge graph, characterized in that, The method comprises the following steps: Regulatory documents are obtained through a company regulation document storage system API call, each of the regulatory documents having metadata fields of a source number, a document internal section number, and a regulation level identifier, and then the regulatory documents are subjected to structural recognition processing, and all the regulatory documents are aggregated to obtain a regulatory document set, and the regulatory document set is input into a semantic recognition model to output a provision semantic unit set; Based on the provision semantic unit set, a double-structure knowledge graph suitable for a power grid regulation system retrieval scenario is constructed, and a structural semantic index table is synchronously generated, each provision semantic unit in the provision semantic unit set is mapped to a graph node, and an edge set of the double-structure knowledge graph includes regulation hierarchy inheritance edges and responsibility coordination chain edges; A user-input natural language question is mapped to a structured semantic representation, and based on the constructed power grid regulation system double-structure knowledge graph and the structural semantic index table, multi-hop retrieval of a provision set and a path structure related to the semantic of the user question is completed; and a jump link is extracted from the double-structure knowledge graph, the jump link including a path between a starting provision node and another provision node, a maximum jump number is set to 4, a top-k path is selected according to a path score, and a final matching path set is aggregated; According to the final matching path set and a hit provision set, structured semantic modeling is performed to generate a structural aggregation representation of each path, all node encodings and edge encodings, the node encodings and the edge encodings are combined into a path structure representation, all the path structure representations are matched with the structured semantic, a cosine similarity is calculated, and a top-N path with the highest cosine similarity is taken as a retrieval result.
2. The semantic retrieval method for power grid regulations and rules based on a large-scale language model incorporating knowledge graphs as described in claim 1, characterized in that, The structure of the semantic recognition model is as follows: The input is a text sequence with a length less than or equal to 256 characters, context dependency information is extracted through a bidirectional LSTM text encoding layer, then a convolution feature extractor is connected to identify a keyword area, finally, three types of fields of a responsibility role, a key behavior, and an event object are output, training corpus of the semantic recognition model is derived from a manually annotated power grid regulation sentence set, a role and an object are labeled by using a BIO label, and a multi-label cross-entropy is used as a training loss function.
3. The method according to claim 1, wherein, Each provision semantic unit in the provision semantic unit set includes a responsibility role, a behavior verb, an operation object, a provision number, and a regulation level.
4. The method according to claim 1, wherein, The structural semantic index table takes an operation object as a primary key, each key index a group of provision semantic units, and records a node ID, a role, a regulation level, and graph adjacency edge information, and the structure is as follows: Primary key: object name; field 1: hit provision set; field 2: responsibility role; field 3: graph edge and its type, weight, and adjacent node pointer; The structural semantic index table is stored in a key-value database in a key-value pair, and is used to construct an inverted index tree.
5. The method according to claim 1, wherein, After a user-input natural language question, the natural language question is converted into a semantic triple for graph path starting point retrieval, and then a structured query intent is output through a structure perception language model.
6. The method according to claim 5, wherein, The structure-aware language model structure comprises a pre-trained base BERT and three independent Transformer-MLP substructures for classification prediction of three types of fields, namely responsibility roles, key behaviors and operation objects, each substructure comprising 2 layers of Transformers and 1 layer of fully connected classification heads, the input dimension being 256, and the output dimension being determined according to the size of the corresponding category dictionary; The training data come from an enterprise power grid regulation system question and answer library and accident handling resolution texts, and a total of semantic field samples are collected and labeled; The output result is a structured query intent, specifically including a responsibility role field, a behavior target field and an operation object field.
7. The method according to claim 5, wherein, After the structure-aware language model extracts the intent field, the operation object field is used to locate a matching object entry in a structure semantic index table, a related node set is obtained and used as a path starting candidate set; In each node in the related node set, multi-hop path expansion is simultaneously performed based on regulation hierarchical inheritance edges and responsibility coordination chain edges in the double-structure knowledge graph, and a scoring function based on edge type and semantic consistency is used for priority sorting in the path expansion.
8. The method according to claim 7, wherein, The scoring function is used for calculating the score of a selected path, and the score is calculated through regulation hierarchical inheritance edge weights, responsibility coordination chain edge weights, a regular adjustment factor, a regular reward item, the number of repeated roles or regulations in the path and a penalty factor in the double-structure knowledge graph, and the top k paths in the score range of a maximum jump number of 4 are selected as the final matching path set, and the nodes hit by the path endpoints are summarized as a hit article set.
9. The method according to claim 1, wherein the method further comprises: The structure aggregation representation comprises semantic coding of each article node in the path, conversion of each article node into a structured vector, and allocation of an aggregation weight to each article node in the path.
10. The method according to claim 9, wherein the method further comprises: The aggregation weight is calculated through a role priority set, a regulation hierarchical priority set and a normalization factor, wherein the role priority set comprises dispatchers and shift operators, and the regulation hierarchical priority set comprises groups and countries, and the aggregation weight makes the regulation-related nodes including dispatchers and groups in the path occupy a higher proportion in the final representation.
Citation Information
Patent Citations
Regulation retrieval method and device, computer equipment and storage medium
CN117743511A
Modularized knowledge graph and retrieval enhanced large model fusion interaction method and system oriented to financial branch mechanism
CN120448510A
Cited By
A hierarchical search and graph reasoning-based vertical procedure intelligent analysis method and system
CN122528897A