Large model-based power grid fault plan knowledge extraction method and system
Through a large-model-based method, key knowledge is extracted from the power grid scheduling procedures and transformed into structured objects, solving the problem of transforming power grid fault plans into knowledge graphs, achieving efficient and accurate knowledge extraction, and having strong generalization capabilities.
Patent Information
- Application Number
- CN202411581741.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-02-25
AI Technical Summary
The existing technology is difficult to effectively transform power grid fault plans into knowledge graphs, and its generalization ability is poor, making it difficult to adapt to emerging plans.
Using a large model-based method, key knowledge is extracted from the grid scheduling procedures, converted it into a structured object, and the accident name is converted into a vector through a pre-trained model and stored in a vector database. Use the big model to extract triple knowledge in the plan, define the ontology structure, and combine the prompt template to extract instances and relationships, and store them in the graph database.
Automatic fault plan knowledge extraction is realized, ensuring the consistency of the format and content of the knowledge, greatly improving the efficiency and accuracy of knowledge extraction, having strong generalization capabilities, and being able to adapt to power grid fault plans at different levels, including emerging plans.
Smart Images

Figure CN119514660A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power grid fault handling, and in particular to a power grid fault plan knowledge extraction method and system based on a large model. Background Art
[0002] A power grid fault plan refers to a set of countermeasures and plans that are formulated in advance for possible faults that may occur during the operation of the power grid. These measures and plans include fault judgment, equipment inspection, safety protection measures, personnel organization, and emergency plans, etc., which are designed to quickly and effectively handle power grid faults and ensure the stability and safety of power supply. A power grid fault plan is the main object of assistance for dispatchers when they encounter emergency faults in a production environment. Fault plans are generally written by dispatch experts who are very proficient in the power system and the underlying structure of the power grid, and their knowledge value is extremely high. In addition, as the power grid structure and electricity consumption in various regions will inevitably change with the development of the economy, in order to maximize the value of the plans written by dispatch experts, software companies in the industry generally convert fault handling plans into knowledge graphs and objectify them, thereby increasing the knowledge value of fault plans. However, there is no unified standard in the industry for the process of converting fault plans into knowledge graphs, and the related development work is difficult. On the one hand, the existing means often require the use of deep learning-related algorithms, and have high requirements for corpus. It is recognized by the industry that corpus collection is difficult. On the other hand, fault plans change every year. The existing knowledge extraction methods combined with deep learning have poor generalization ability and can often solve the problem of extracting historical plans. However, when encountering new plans, the knowledge extraction ability is not satisfactory. Summary of the invention
[0003] Purpose of the invention: The present invention provides a method and system for extracting knowledge from power grid fault plans based on a large model, which solves the problem that existing solutions are difficult to convert fault plans into knowledge graphs and the results are not ideal.
[0004] Technical solution: In the first aspect, a method for extracting knowledge of power grid fault plans based on a large model comprises the following steps:
[0005] Extract key knowledge from power grid dispatching procedures and transform them into structured objects;
[0006] Classify the structured objects of the regulation into different fault scenarios according to the accident type, design a prompt template for each fault scenario, and use the pre-trained model to convert the accident name into a vector and store it in the vector database;
[0007] Conduct content analysis on the fault emergency plans to determine the information that needs to be extracted and identify the preparation instructions and units, and classify the plans into national, provincial, and county and city fault emergency plans based on this information;
[0008] Parse the fault plan document to extract key attributes and read the plan content by segment. For tables, associate the table information with the document context. Objectify the plan content based on the document parsing results, identify the start and end of the text, define the plan object, and mine the fault description.
[0009] The big model is used to extract triple knowledge in the plan, define the ontology structure, and extract instances and relationships in combination with prompt templates. After rule verification by business experts, the knowledge is stored in the graph database, completing the entire fault plan knowledge extraction and storage process.
[0010] Furthermore, key knowledge is extracted from the power grid dispatching procedures and converted into structured objects, including:
[0011] Collect relevant dispatching regulations documents from the State Grid Dispatching Center, provincial grid dispatching centers, municipal and county grid dispatching centers, and classify the dispatching regulations documents into national dispatching regulations, provincial dispatching regulations, and county and city dispatching regulations according to the dispatching level, and select the chapters and clauses directly related to the fault emergency plan;
[0012] Based on the screened regulation knowledge, the knowledge graph construction tool is used to transform this knowledge into a structured form and construct the corresponding regulation graph.
[0013] Furthermore, the triple relationship of the adjustment gauge map is as follows:
[0014] (Accident)-[Satisfied]->(Condition)
[0015] (Condition)-[Trigger]->(Solution)
[0016] (Handling Principles)-[Adoption Conditions]->(Conditions)
[0017] (Scheme)-[Supplementary Content]->(Handling Principles)
[0018] (Handling Principles)-[Execution]->(Action)
[0019] (Plan)-[Execution]->(Action)
[0020] (Action)-[Satisfy]->(Condition)
[0021] Among them, accidents, conditions, handling principles, plans, and actions are entities extracted from the regulation documents, and satisfaction, triggering, adoption of conditions, supplementary content, and execution are the relationships between entities.
[0022] Furthermore, the types of power grid faults include frequency and voltage anomalies, voltage anomalies, power flow anomalies, switch and knife switch anomalies, voltage transformer anomalies, line accidents, busbar accidents, generator accidents, transformer accidents, system disconnection accidents, system shock accidents, communication and automation system anomalies, and power grid black start;
[0023] Classify the structured objects of the regulation into different fault scenarios according to the accident type, and design prompt templates for each fault scenario, including:
[0024] According to the fault type, prompt templates are created for accidents, conditions, processing principles, actions and actions respectively, or prompt templates are designed according to content combinations.
[0025] Furthermore, the fault plan document is parsed to extract key attributes, and the plan content is read by segment. For tables, the table information is associated with the document context, including:
[0026] Parse the fault plan document and extract key attributes of the document according to the document content and preset rules. The key attributes include one or more of the preparation unit, plan preparation time and plan directory information;
[0027] The document segmentation principle is adopted to read the fault plan document in segments. For the table, the table content is associated with the document context as a paragraph; the final reading result is kept as a list set, waiting to be used.
[0028] Furthermore, the plan content is objectified based on the document parsing results, the start and end of the text are identified, the plan object is defined, and the fault description is mined, including:
[0029] Traversing the list set, determining one by one whether the current paragraph is the first paragraph of a plan, if it is the first paragraph, it means that the main text of the plan officially begins;
[0030] The attributes of the plan object obtained include one or more of the number, validity period, power grid operation mode description, expected fault, expected fault design idea, post-fault key equipment flow calculation results, and post-fault mode description;
[0031] Determine whether the current paragraph contains the specified plan object attribute. If so, extract the fault description, and obtain the previously stored vector prompt engineering template for the adjustment plan according to the fault description, and store it in the cache;
[0032] Determine whether the plan body has ended and complete the object attributes. The object completion is implemented using a large model. Enter the complete plan content and let the large model return a json object based on the plan attributes.
[0033] Furthermore, the large model is used to extract triple knowledge in the plan, define the ontology structure, and combine the prompt template to extract instances and relations, including:
[0034] Define a plan ontology, which describes the concepts in the fault plan and their relationships with each other, and uses "handling principles" as the key node connecting the adjustment plan and the plan;
[0035] Prompt the project based on the plan object attributes and plan ontology definition;
[0036] Deploy the big model and implement the fastapi interface. According to the built prompt project, request the big model interface service one by one according to the relationship direction defined in the graph, and use the big model to extract the instances in the plan and the relationships between them.
[0037] The device class instance data is combined with the device object data already stored in the relational database to perform knowledge completion and device name replacement.
[0038] In the second aspect, a large model-based power grid fault plan knowledge extraction system includes:
[0039] The regulation knowledge extraction module is used to extract key knowledge from the power grid dispatching regulations and convert it into structured objects;
[0040] The prompt engineering building module is used to classify the structured objects of the regulation into different fault scenarios according to the accident type, design a prompt template for each fault scenario, and use the pre-trained model to convert the accident name into a vector and store it in the vector database;
[0041] The plan content analysis module is used to perform content analysis on the fault plan to determine the information that needs to be extracted and identify the preparation instructions and units, and classify the plans into national, provincial, and county and city fault plans based on this information;
[0042] The plan document parsing module is used to parse the fault plan document to extract key attributes, read the plan content by segment, and associate the table information with the document context for the table;
[0043] The plan objectification module is used to objectify the plan content according to the document parsing results, identify the start and end of the text, define the plan object, and mine the fault description;
[0044] The triple knowledge extraction module is used to extract triple knowledge in the plan using the large model, define the ontology structure, and extract instances and relations in combination with the prompt template;
[0045] The rule verification module is used by business experts to verify the rules of the extracted triple knowledge;
[0046] The knowledge storage module is used to store knowledge in the graph database and complete the entire fault plan knowledge extraction and storage process.
[0047] In a third aspect, a computer device is provided, comprising one or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and when the programs are executed by the processors, the steps of the method for extracting knowledge from a power grid fault plan based on a large model as described in the first aspect of the present invention are implemented.
[0048] In a fourth aspect, a computer storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method for extracting knowledge of power grid fault plans based on a large model as described in the first aspect of the present invention are implemented.
[0049] Beneficial effects: Compared with the prior art, the present invention has the following beneficial effects:
[0050] (1) The present invention uses a large model to extract knowledge from power grid fault plans, which can automatically extract key knowledge from a large number of fault plan documents, convert unstructured plan texts into structured knowledge graphs, and ensure the consistency of the extracted knowledge in format and content, greatly improving the efficiency and accuracy of knowledge extraction. Combined with the rule verification of business experts, the accuracy and reliability of knowledge are further guaranteed. This method does not need to rely on a specific corpus and can directly extract knowledge from power grid fault plans.
[0051] (2) The large model of the present invention does not need to rely on a specific corpus, which reduces the workload of data preparation and improves the practicality and convenience of the system. At the same time, it also has strong generalization ability and can adapt to power grid fault plans at different levels (national, provincial, county and city). Even in the face of new plans, it can effectively extract knowledge, solving the problem of poor generalization ability in the prior art.
[0052] (3) The present invention can guide the large model to extract relevant knowledge more accurately by designing specific prompt templates for each fault scenario. At the same time, these templates can be adjusted and optimized according to actual conditions, which improves the flexibility and practicality of the system. At the same time, the use of graph databases makes the storage and query of knowledge more efficient, which facilitates future expansion and optimization. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 This is a flow chart of the knowledge extraction method for power grid fault plan based on large model;
[0054] Figure 2 This is an example of a regulation map after adjusting the regulation content object in the embodiment;
[0055] Figure 3 This is an example of the atlas pattern layer obtained in the embodiment. DETAILED DESCRIPTION
[0056] The technical solutions in the embodiments of the present invention will be described clearly and completely below with reference to the accompanying drawings.
[0057] The knowledge extraction of power grid fault plans involves two parts: regulation extraction and plan extraction. The power grid regulation, namely the "Power Grid Dispatching Management Regulations", is formulated to strengthen power grid dispatching management, ensure power grid safety, protect user interests, and meet the needs of economic construction and people's lives. Power grid dispatching refers to the organization, command, guidance and coordination of power grid operation by power grid dispatching agencies to ensure safe, high-quality and economical operation of the power grid. Power grid dispatching should comply with the objective laws of power grid operation. Since the power grid is a multi-level, cross-regional and widely covered complex system. From the national level to the provincial level, municipal level and county level, the power grid structure presents a hierarchical structure. Power grids at different levels differ in operating characteristics, management methods, technical requirements and other aspects, so it is necessary to formulate different levels of regulation. Therefore, according to the actual survey situation, the regulation extraction mainly includes the extraction of national regulation, provincial regulation and county and city regulation. Dispatching agencies at different levels will compile fault handling plans based on their own regulations.
[0058] Reference Figure 1 , using a large model to extract knowledge of power grid fault plans, is divided into two links, the first link is the preparation link, including the following steps S11 to S15. The details are as follows:
[0059] Step S11: Extraction of adjustment procedures.
[0060] Knowledge extraction begins based on the dispatch level (national dispatch, provincial dispatch, and county and city dispatch).
[0061] As an implementation method, relevant dispatching procedure documents are collected from the State Grid Dispatching Center, provincial power grid dispatching centers, municipal and county power grid dispatching centers. According to the dispatching level, the dispatching regulations are divided into national dispatching regulations, provincial dispatching regulations, and county and municipal dispatching regulations, and the relevant information of the fault plan is preliminarily screened out. For example, domain experts can conduct a preliminary reading of the document, screen out the chapters and clauses directly related to the fault plan, and mark the key information. Dispatching procedure documents generally follow a fixed format. Optionally, preliminary screening is completed by automatic matching of some basic keywords or format conventions. The screened content is marked, including fault type, processing flow, operating guide, safety measures, etc. A unified marking standard should be used to ensure the accuracy and consistency of the information.
[0062] Step S12: Objectification of the regulation content.
[0063] After extracting the debugging procedures, it is necessary to transform this knowledge into a structured form, that is, objectification. This step is to facilitate the representation and management of this knowledge in the knowledge graph. The objectified content provides preparation for subsequent text classification and fault scenario construction.
[0064] Compared with the fault plan, the content of the adjustment plan is less. Generally, there is only one corresponding adjustment plan for a type of important fault. Therefore, the embodiment of the present invention adopts a knowledge graph construction tool to construct the corresponding graph in the form of dragging and dropping.
[0065] The knowledge graph is a structured semantic knowledge base that describes entities, concepts, and their relationships in the form of a graph. Logically, the knowledge graph can be divided into a schema layer and a data layer. The schema layer is the core of the knowledge graph, defining the types and constraints of entities, relationships, and attributes; the data layer stores specific entities, relationships, and attribute values. In the present invention, the content of the regulation is objectified, specifically by extracting the content of the regulation regarding system accident handling to form a graph. For power grid system accidents, the regulation content mainly includes "system stability requirements", "operation mode after failure", and "key points for failure handling". The graph schema layer is designed in combination with the regulation content, and the following entities are identified, as shown in Table 1:
[0066] Table 1 Entity categories and examples
[0067]
[0068] Based on the identified entities, the relationships between these entities are analyzed to determine the triple relationships:
[0069] (Accident)-[Satisfied]->(Condition)
[0070] (Condition)-[Trigger]->(Solution)
[0071] (Handling Principles)-[Adoption Conditions]->(Conditions)
[0072] (Scheme)-[Supplementary Content]->(Handling Principles)
[0073] (Handling Principles)-[Execution]->(Action)
[0074] (Plan)-[Execution]->(Action)
[0075] (Action)-[Satisfy]->(Condition)
[0076] Among them, (accident)-[satisfy]->(condition): means that when a specific power grid accident occurs, it will meet certain conditions. For example, if a "line short circuit" accident occurs, the condition of "immediately cut off the power supply" may be met.
[0077] (Condition)-[Trigger]->(Scheme): When a condition is met, it will trigger a specific plan. For example, if the condition "grid load exceeds the threshold" is met, the plan "adding backup generators" will be triggered.
[0078] (Handling Principle)-[Adopted Conditions]->(Conditions): Indicates that certain conditions will be considered and adopted when formulating handling principles. For example, the handling principle "Prioritize the protection of electricity supply to residents" may adopt the condition "Insufficient electricity supply in residential areas".
[0079] (Scheme)-[Supplementary Content]->(Handling Principles): Indicates that the emergency plan may contain some additional handling principles. For example, a emergency plan may add the handling principle of "safety assessment must be conducted before performing operations".
[0080] (Processing principle)-[Execution]->(Action): Indicates that the processing principle needs to be executed through specific actions. For example, the processing principle "Ensure personnel safety" needs to be executed through the action of "Evacuate personnel on site".
[0081] (Plan)-[Execution]->(Action): Indicates that a series of actions contained in the plan need to be executed. For example, the plan "Restore power to the grid" may include actions such as "Check the lines" and "Replace damaged equipment".
[0082] (Action)-[Satisfy]->(Condition): Indicates that by performing a certain action, a specific condition can be satisfied. For example, performing the action of "Replace the faulty device" can satisfy the condition of "Restore the normal operation of the device".
[0083] Figure 2 The regulation map shown is an object-oriented map obtained by processing and regulating the busbar accident at a certain location.
[0084] Step S13: Perform text classification on the objectified adjustment content to determine the specific fault scenario.
[0085] According to the accident type, the fault scenarios are classified and then saved.
[0086] The objectified knowledge needs to be classified according to different fault scenarios. This step is to ensure that the application of knowledge is targeted and the relevant processing principles and action guidelines can be quickly located according to the specific fault type.
[0087] In the present invention, for power grid faults, the fault types include but are not limited to "frequency and voltage abnormalities, voltage abnormalities, power flow abnormalities, switch and knife switch abnormalities, voltage transformer abnormalities, line accidents, bus accidents, generator accidents, transformer accidents, system decoupling accidents, system shock accidents, communication and automation system abnormalities, and power grid black start", and then enter step S14.
[0088] Step S14: Create prompt templates according to different scenarios.
[0089] According to different fault scenarios, corresponding prompt templates are created for the subsequent knowledge extraction process. That is, these templates will be used to guide the query of the knowledge graph and the extraction of information. The design of the prompt template depends on the classification results in step S13, ensuring the accuracy and practicality of the template. Prompt templates can be created for accidents, conditions, processing principles, plans and actions respectively, or they can be designed according to the content combination, or they can be constructed separately.
[0090] As an example, actions and conditions are directly "dependent" relationships, i.e. (action)-[dependency]->(condition). Actions contain attributes including "executor, executed person, action, target, equipment object". Among them, "equipment object" is generally a substation, power plant, bus or AC / DC line and its supporting hardware equipment, such as switches, circuit breakers, etc.
[0091] #Example: According to the following content "1.49.8~49.0Hz: the provincial dispatching duty dispatcher shall immediately limit power and pull the line according to the dispatching instructions of the East China Grid Dispatching Duty Dispatcher or the ACE deviation, and make the ACE deviation greater than zero as soon as possible (no more than 30 minutes) until the frequency recovers to above 49.8Hz. If the Jiangsu Power Grid and the East China Power Grid are decoupled, the provincial dispatching duty dispatcher shall take measures to restore the frequency on his own and restore the frequency to above 49.8Hz within 30 minutes", the following content can be extracted: {
[0092] "action":[{
[0093] "Serial Number": 1,
[0094] "Action content": "The provincial dispatch duty dispatcher should immediately limit power and pull the line according to the dispatch instruction of the East China Network Dispatching Duty Dispatcher or the ACE deviation, and make the ACE deviation greater than zero as soon as possible (no more than 30 minutes) until the frequency recovers to above 49.8Hz",
[0095] "Executor": "Provincial dispatch duty dispatcher",
[0096] "Person subject to execution":"",
[0097] "Action": ["Power cut", "Road pull"],
[0098] "Goal": "Make the ACE deviation greater than zero as soon as possible (no more than 30 minutes) until the frequency recovers to above 49.8Hz",
[0099] "Device Object":"ACE"
[0100] },
[0101] {
[0102] "Serial Number": 2,
[0103] "Action content": "The provincial dispatcher on duty will take measures to restore the frequency on his own and restore the frequency to above 49.8Hz within 30 minutes",
[0104] "Executor": "Provincial dispatch duty dispatcher",
[0105] "Person subject to execution":"",
[0106] "Action": ["Take measures to restore the frequency"],
[0107] "Goal": "Restore the frequency to above 49.8Hz within 30 minutes",
[0108] "Device Object":""
[0109] }
[0110] ],
[0111] "condition":[{
[0112] "Serial Number": 1,
[0113] "Condition content": "Jiangsu power grid and East China power grid are separated from each other."
[0114] } ]
[0116] }
[0117] After the extraction is completed, the result is returned in JSON format.
[0118] Step S15: construct a vector index library.
[0119] Construct vector index libraries at three levels: national, provincial, and county / city, to facilitate subsequent retrieval and matching operations.
[0120] According to the name of the accident, a pre-trained model is used for embedding, converted into a vector, and stored in the Milvus vector database. Common pre-trained models include BERT (Bidirectional Encoder Representations from Transformers), Word2Vec, GloVe, etc. These models have been trained on large-scale corpora and can capture deep semantic information in the text. Use the API or framework of the pre-trained model to obtain the embedding vector of the text, and ensure that the dimension of the obtained vector meets the requirements of Milvus. Then use the Milvus API to insert the vector into the pre-created Collection, and set a unique identifier (ID) for each vector, usually an ID associated with the accident name.
[0121] In the Milvus vector database, the content of the regulation is stored according to the national regulation, provincial regulation and county and city regulation. So far, the vector prompt project template has been created. Then the preparation phase is completed and enters the waiting state.
[0122] Step 2, extracting knowledge from historical fault plans, includes the following steps S21 to S26, which are as follows:
[0123] Step S21: Analyze the content of the fault plan.
[0124] The formats of scheduling fault plan files are diverse and not unified. In order to carry out subsequent rule classification tasks, it is necessary to decide which contents to extract from the plan according to the rules to carry out the fault classification task, such as whether there is a directory and whether there is a fault preparation description. If so, extract the relevant fault preparation description and the preparation unit, and proceed to step S22. If not, it is necessary to remind manual labeling.
[0125] Step S22: Fault contingency plan classification.
[0126] According to the output content of step S21, the fault emergency plans are divided into three categories: "national fault emergency plan", "provincial fault emergency plan" and "county and city fault emergency plan".
[0127] Step S23: parse the document to extract document attributes.
[0128] There are large differences in contingency plan documents. Even for dispatching agencies at the same level, the differences in contingency plan documents are very obvious. Standard contingency plan documents generally have a complete directory structure, and generally include preparation instructions, grid status descriptions, etc. before starting the main text of the plan. This type of contingency plan document generally contains multiple plans, and there are many types of plans, which are written by multiple people. There are also some contingency plan documents, the entire document is just one plan or a few plans (generally no more than 3), and this type of contingency plan document generally starts with the main text of the plan.
[0129] Document parsing extracts document attributes, that is, based on the document content, extracts the document preparation unit, plan preparation time, plan directory information and other content. This part is extracted according to the rules and the relevant attributes can be empty.
[0130] "Rule-based extraction" means that in the process of knowledge extraction, a series of pre-defined rules are used to guide large models or algorithms to extract specific information from text. These rules can help the system identify and extract key content more accurately and reduce false positives and false negatives. Rules can be based on text patterns, keywords, grammatical structures, etc.
[0131] Keyword matching rules: define a set of keywords or phrases to identify specific fault types, handling principles, actions, etc. For example, keywords such as "voltage abnormality" and "frequency abnormality" can be used to identify specific fault types.
[0132] Syntactic structure rules: define specific sentence structures to identify and extract key information. For example, in the sentence "When XXX fault occurs, YYY measures should be taken immediately", "XXX" and "YYY" can identify the fault type and handling measures respectively.
[0133] Context association rules: define the associated information in the context to assist in extracting key information. For example, when a paragraph mentions "anticipated failures", the content in the subsequent paragraphs may contain specific failure descriptions and treatment measures.
[0134] Logical relationship rules: define the logical relationship between entities and are used to construct triples. For example, "accident A meets condition B, triggering plan C" can be converted into triples (accident A, meets, condition B) and (condition B, triggers, plan C).
[0135] The key information extracted includes but is not limited to:
[0136] Fault type: for example, "voltage abnormality", "frequency abnormality", "line accident", etc.
[0137] Condition: A condition that triggers a specific action, such as "when the voltage drops below XX volts".
[0138] Handling principles: The basic principles and guiding ideas for handling faults, such as "restoring power supply to important loads first."
[0139] Plan: Specific treatment plan or measures, such as "disconnect the faulty line", "start the backup power supply", etc.
[0140] Action: A specific action step, such as "turn off the switch", "check the status of the device", etc.
[0141] Impact event: The impact that may occur after a fault occurs, such as "Dongshanqiao #1 main transformer loses power, Shanqian 4Y20 line loses power."
[0142] Event nature: The status of the event, such as "sent", "expected to occur", "occurred and resolved", etc.
[0143] Preparation unit: The preparation unit of the plan, such as "State Grid Dispatching Center", "Provincial Grid Dispatching Center", etc.
[0144] Plan preparation time: the date the plan was prepared.
[0145] Plan directory information: The directory structure of the plan, including titles at all levels and content summaries.
[0146] As an example, in a plan, there is a content "When voltage abnormality occurs, the following measures should be taken immediately: 1. Check whether the voltage monitoring equipment is working properly. 2. If the voltage continues to be lower than 220V, disconnect the faulty line and start the backup power supply. 3. Notify maintenance personnel to conduct on-site inspection." The extraction process according to the rules is as follows:
[0147] Keyword matching: Identify "voltage abnormality" as the fault type.
[0148] Syntactic structure: Identify "When voltage abnormality occurs, the following measures should be taken immediately" as the association between the condition and the processing principle.
[0149] Contextual association: Identify the subsequent "1. Check whether the voltage monitoring equipment is working properly" as a specific action step.
[0150] Logical relationship: Construct the triplet (voltage abnormality, satisfied, voltage continuously lower than 220V) and (voltage continuously lower than 220V, triggered, disconnect the fault line).
[0151] The key information extracted from it includes:
[0152] Fault type: voltage abnormality
[0153] Condition: Voltage is continuously lower than 220V
[0154] Handling principle: Prioritize power supply restoration
[0155] Solution: Disconnect the faulty line and start the backup power supply
[0156] action:
[0157] Check whether the voltage monitoring equipment is working properly
[0158] Disconnect the fault line
[0159] Start the backup power supply
[0160] Notify maintenance personnel to conduct on-site inspection
[0161] Impact event: No clear impact event
[0162] Nature of event: expected to occur
[0163] Prepared by: State Grid Dispatching Center
[0164] Plan preparation time: October 1, 2024
[0165] Plan catalog information: 1. Fault type 2. Handling principles 3. Specific actions
[0166] Through the definition of the above rules and key information, the required knowledge can be extracted from the plan text more accurately, a structured knowledge graph can be constructed, and the efficiency and accuracy of knowledge extraction can be improved.
[0167] Step S24: Read by segment.
[0168] Continuing with the document parsing operation in step S23, when doing content analysis, the document segmentation principle is adopted. The fault plan is generally a word document, and it is relatively easy to implement segmentation. It should be noted that when a table is found, the table content should be associated with the document context and bound to the previous paragraph as a whole paragraph. The specific details are not the focus of the present invention and will not be explained in detail here.
[0169] The document content is read paragraph by paragraph according to the preset paragraph division method until all the content is read. The final result is kept as a list collection, waiting to be used.
[0170] Step S25: Objectification of the plan content.
[0171] The objectification of plan contents includes the following series of subtasks.
[0172] 1. Determine whether the main text of the plan has started
[0173] Traverse the set of step S24 and judge one by one whether the current paragraph is the first paragraph of a plan. The judgment method adopts the textcnn algorithm to implement a text classification 2 classification algorithm, and the types are "yes" and "no". The relevant algorithm is not the focus of the present invention, but only a step of the present invention, and will not be explained in detail here.
[0174] 2. Define and instantiate the plan object
[0175] The attributes of the plan object include "number, validity period, description of power grid operation mode, anticipated faults, design ideas for anticipated faults, calculation results of the power flow of key equipment after the fault, and description of the post-fault method".
[0176] Examples of plan objects are as follows:
[0177]
[0178] 3. Mining fault descriptions and obtaining prompts for current plans
[0179] Determine whether the current paragraph contains "anticipated faults" or related information, extract the fault description, and obtain the vector prompt engineering template stored in step 1 according to the fault description. Store it in the cache for use in subsequent steps.
[0180] 4. Determine whether the plan text has ended and complete the plan object attribute completion
[0181] Determine whether the plan body ends, the method is the same as "Determine whether the plan body begins", and complete the object attributes. Use the big model to implement it, enter the complete plan content, and let the big model return the json object according to the plan attributes.
[0182] Step S26: Extracting plan triples from the large model
[0183] Using a large model to extract triples is divided into three sub-steps:
[0184] Step 1: Define the plan ontology
[0185] Failures essentially belong to the category of events. In the ontology design, eight types of logical relationships between events that are generally defined are considered, including: cause and effect, conditional, superior and subordinate, parallel, mutually exclusive, sequential, transitional, and compositional.
[0186] Since risk events do not involve mutually exclusive, sequential, or transitional events, only the remaining five types of events are retained. Several event relationship names such as "lead to", "guide", "take", "responsible for", "next step", and "execute" are used to specify the relationship between events.
[0187] Atlas mode layer Figure 3 As shown, the “processing principle” entity can be found from the figure. The processing principle here comes from the adjustment regulation, and the adjustment regulation and the plan can be linked together through the processing principle.
[0188] Step 2: Prompt the project based on the plan object attributes and plan body definition
[0189] Traverse the ontology, define the attribute relationship between each ontology and the plan object, and write the prompt project. The prompt project is divided into five parts. The first part is "background knowledge"; the second part is "rule constraints"; the third part is "samples", the fourth part is "known information", and the fifth part is "questions". The example is as follows:
[0190] #Background knowledge:
[0191] This is a knowledge extraction task in the power grid field. The extraction object is the fault plan object. From the content, it is a JSON string. It is required to extract various event knowledge based on certain attribute information of the JSON object.
[0192] #Rule constraints
[0193] 1. If the event nature is extracted, the event nature can be set to "sent", "expected to occur" or "occurred and resolved" based on the context language.
[0194] #Example:
[0195] Sample question:
[0196] From the plan object, extract the impact events after the failure, and the event attributes include "event content" and "event nature".
[0197] Sample known information:
[0198] Fault plan object {object json string}
[0199] Sample answer:
[0200] {
[0201] "Event content": "Dongshanqiao substation #1 main transformer lost power, Shanqian 4Y20 line lost power",
[0202] "Nature of event": "Expected to occur"
[0203] }
[0204] #Known information
[0205] Fault plan object {object json string}
[0206] question:
[0207] From the plan object, extract the impact events after the failure, and the event attributes include "event content" and "event nature".
[0208] Step 3: Instance and relation extraction.
[0209] The design graph is a unidirectional graph. The extraction of instances and relationships follows the direction of the graph relationship and can be extracted one by one. The specific extraction steps are:
[0210] 1. Deploy large models and implement the fastapi interface.
[0211] 2. According to the prompt project constructed in the second step, combined with the graph ontology structure, request the large model interface services one by one.
[0212] 3. Data organization and knowledge alignment.
[0213] The main method is to complete the knowledge and replace the device name by combining the device class instance data with the device object data already stored in the relational database. The specific means can be vector familiarity, text edit distance or keyword search, which is not the focus here and will not be described in detail.
[0214] 4. Rule verification
[0215] The extracted triplet knowledge is displayed on the system page and can only be stored after confirmation by business experts.
[0216] 5. Knowledge storage
[0217] Neo4j is used as the graph database to realize graph data storage.
[0218] An example of a triple object is
[0219]
[0220] The present invention also provides a large-model-based power grid fault plan knowledge extraction system, comprising:
[0221] The regulation knowledge extraction module is used to extract key knowledge from the power grid dispatching regulations and convert it into structured objects;
[0222] The prompt engineering building module is used to classify the structured objects of the regulation into different fault scenarios according to the accident type, design a prompt template for each fault scenario, and use the pre-trained model to convert the accident name into a vector and store it in the vector database;
[0223] The plan content analysis module is used to perform content analysis on the fault plan to determine the information that needs to be extracted and identify the preparation instructions and units, and classify the plans into national, provincial, and county and city fault plans based on this information;
[0224] The plan document parsing module is used to parse the fault plan document to extract key attributes, read the plan content by segment, and associate the table information with the document context;
[0225] The plan objectification module is used to objectify the plan content according to the document parsing results, identify the start and end of the text, define the plan object, and mine the fault description;
[0226] The triple knowledge extraction module is used to extract triple knowledge in the plan using the large model, define the ontology structure, and extract instances and relations in combination with the prompt template;
[0227] The rule verification module is used by business experts to verify the rules of the extracted triple knowledge;
[0228] The knowledge storage module is used to store knowledge in the graph database and complete the entire fault plan knowledge extraction and storage process.
[0229] Furthermore, key knowledge is extracted from the power grid dispatching procedures and converted into structured objects, including:
[0230] Collect relevant dispatching regulations documents from the State Grid Dispatching Center, provincial grid dispatching centers, municipal and county grid dispatching centers, and classify the dispatching regulations documents into national dispatching regulations, provincial dispatching regulations, and county and city dispatching regulations according to the dispatching level, and select the chapters and clauses directly related to the fault emergency plan;
[0231] Based on the screened regulation knowledge, the knowledge graph construction tool is used to transform this knowledge into a structured form and construct the corresponding regulation graph.
[0232] Furthermore, the triple relationship of the adjustment gauge map is as follows:
[0233] (Accident)-[Satisfied]->(Condition)
[0234] (Condition)-[Trigger]->(Solution)
[0235] (Handling Principles)-[Adoption Conditions]->(Conditions)
[0236] (Scheme)-[Supplementary Content]->(Handling Principles)
[0237] (Handling Principles)-[Execution]->(Action)
[0238] (Plan)-[Execution]->(Action)
[0239] (Action)-[Satisfy]->(Condition)
[0240] Among them, accidents, conditions, handling principles, plans, and actions are entities extracted from the regulation documents, and satisfaction, triggering, adoption of conditions, supplementary content, and execution are the relationships between entities.
[0241] Furthermore, the types of power grid faults include frequency and voltage anomalies, voltage anomalies, power flow anomalies, switch and knife switch anomalies, voltage transformer anomalies, line accidents, busbar accidents, generator accidents, transformer accidents, system disconnection accidents, system shock accidents, communication and automation system anomalies, and power grid black start;
[0242] Classify the structured objects of the regulation into different fault scenarios according to the accident type, and design prompt templates for each fault scenario, including:
[0243] According to the fault type, prompt templates are created for accidents, conditions, processing principles, actions and actions respectively, or prompt templates are designed according to content combinations.
[0244] Furthermore, the fault plan document is parsed to extract key attributes, and the plan content is read by segment. For tables, the table information is associated with the document context, including:
[0245] Parse the fault plan document and extract key attributes of the document according to the document content and preset rules. The key attributes include one or more of the preparation unit, plan preparation time and plan directory information;
[0246] The document segmentation principle is adopted to read the fault plan document in segments. For the table, the table content is associated with the document context as a paragraph; the final reading result is kept as a list set, waiting to be used.
[0247] Furthermore, the plan content is objectified based on the document parsing results, the start and end of the text are identified, the plan object is defined, and the fault description is mined, including:
[0248] Traversing the list set, determining one by one whether the current paragraph is the first paragraph of a plan, if it is the first paragraph, it means that the main text of the plan officially begins;
[0249] The attributes of the plan object obtained include one or more of the number, validity period, power grid operation mode description, expected fault, expected fault design idea, post-fault key equipment flow calculation results, and post-fault mode description;
[0250] Determine whether the current paragraph contains the specified plan object attribute. If so, extract the fault description, and obtain the previously stored vector prompt engineering template for the adjustment plan according to the fault description, and store it in the cache;
[0251] Determine whether the plan body has ended and complete the object attributes. The object completion is implemented using a large model. Enter the complete plan content and let the large model return a json object based on the plan attributes.
[0252] Furthermore, the large model is used to extract triple knowledge in the plan, define the ontology structure, and combine the prompt template to extract instances and relations, including:
[0253] Define a plan ontology, which describes the concepts in the fault plan and their relationships with each other, and uses "handling principles" as the key node connecting the adjustment plan and the plan;
[0254] Prompt the project based on the plan object attributes and plan ontology definition;
[0255] Deploy the big model and implement the fastapi interface. According to the built prompt project, request the big model interface service one by one according to the relationship direction defined in the graph, and use the big model to extract the instances in the plan and the relationships between them.
[0256] The device class instance data is combined with the device object data already stored in the relational database to perform knowledge completion and device name replacement.
[0257] It should be understood that the large model-based power grid fault plan knowledge extraction system in the embodiment of the present invention can implement all the technical solutions in the above-mentioned method embodiment, and the functions of its various functional modules can be specifically implemented according to the methods in the above-mentioned method embodiments. The specific implementation process can refer to the relevant description in the above-mentioned embodiments, which will not be repeated here.
[0258] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, devices (systems), computer equipment or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0259] The present invention is described with reference to a flowchart of a method according to an embodiment of the present invention. It should be understood that each process in the flowchart and a combination of processes in the flowchart can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. Figure 1 A device that specifies functions in a process or multiple processes.
[0260] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A function specified in a process or multiple processes.
[0261] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 The steps of a specified function in a process or multiple processes.
Claims
1. A method for extracting knowledge from power grid fault plans based on a large model, characterized in that: The method comprises the following steps: Extract key knowledge from power grid dispatching procedures and transform them into structured objects; Classify the structured objects of the regulation into different fault scenarios according to the accident type, design a prompt template for each fault scenario, and use the pre-trained model to convert the accident name into a vector and store it in the vector database; Conduct content analysis on the fault emergency plans to determine the information that needs to be extracted and identify the preparation instructions and units, and classify the plans into national, provincial, and county and city fault emergency plans based on this information; Parse the fault plan document to extract key attributes and read the plan content by segment. For tables, associate the table information with the document context. Objectify the plan content based on the document parsing results, identify the start and end of the text, define the plan object, and mine the fault description. The big model is used to extract triple knowledge in the plan, define the ontology structure, and extract instances and relationships in combination with prompt templates. After rule verification by business experts, the knowledge is stored in the graph database, completing the entire fault plan knowledge extraction and storage process.
2. The method according to claim 1, characterized in that: Extract key knowledge from power grid dispatching procedures and transform them into structured objects, including: Collect relevant dispatching regulations documents from the State Grid Dispatching Center, provincial grid dispatching centers, municipal and county grid dispatching centers, and classify the dispatching regulations documents into national dispatching regulations, provincial dispatching regulations, and county and city dispatching regulations according to the dispatching level, and select the chapters and clauses directly related to the fault emergency plan; Based on the screened regulation knowledge, the knowledge graph construction tool is used to transform this knowledge into a structured form and construct the corresponding regulation graph.
3. The method according to claim 2, characterized in that The triple relationship of the adjustment gauge map is as follows: (Accident)-[Satisfied]->(Condition) (Condition)-[Trigger]->(Solution) (Handling Principles)-[Adoption Conditions]->(Conditions) (Scheme)-[Supplementary Content]->(Handling Principles) (Handling Principles)-[Execution]->(Action) (Plan)-[Execution]->(Action) (Action)-[Satisfy]->(Condition) Among them, accidents, conditions, handling principles, plans, and actions are entities extracted from the regulation documents, and satisfaction, triggering, adoption of conditions, supplementary content, and execution are the relationships between entities.
4. The method according to claim 3, characterized in that Grid fault types include frequency and voltage anomalies, voltage anomalies, power flow anomalies, switch and knife switch anomalies, voltage transformer anomalies, line accidents, busbar accidents, generator accidents, transformer accidents, system disconnection accidents, system shock accidents, communication and automation system anomalies, and grid black start; Classify the structured objects of the regulation into different fault scenarios according to the accident type, and design prompt templates for each fault scenario, including: According to the fault type, prompt templates are created for accidents, conditions, processing principles, actions and actions respectively, or prompt templates are designed according to content combinations.
5. The method according to claim 1, characterized in that Parse the fault plan document to extract key attributes and read the plan content by segment. For tables, associate the table information with the document context, including: Parse the fault plan document and extract key attributes of the document according to the document content and preset rules. The key attributes include one or more of the preparation unit, plan preparation time and plan directory information; The document segmentation principle is adopted to read the fault plan document in segments. For the table, the table content is associated with the document context as a paragraph; the final reading result is kept as a list set, waiting to be used.
6. The method according to claim 5, characterized in that Objectify the plan content based on the document parsing results, identify the start and end of the text, define the plan object, and mine the fault description, including: Traversing the list set, determining one by one whether the current paragraph is the first paragraph of a plan, if it is the first paragraph, it means that the main text of the plan officially begins; The attributes of the plan object obtained include one or more of the number, validity period, power grid operation mode description, expected fault, expected fault design idea, post-fault key equipment flow calculation results, and post-fault mode description; Determine whether the current paragraph contains the specified plan object attribute. If so, extract the fault description, and obtain the previously stored vector prompt engineering template for the adjustment plan according to the fault description, and store it in the cache; Determine whether the plan body has ended and complete the object attributes. The object completion is implemented using a large model. Enter the complete plan content and let the large model return a json object based on the plan attributes.
7. The method according to claim 6, characterized in that Use the big model to extract triple knowledge in the plan, define the ontology structure, and combine the prompt template to extract instances and relationships, including: Define the plan ontology, which describes the concepts in the fault plan and their relationships, and uses "handling principles" as the key node connecting the adjustment plan and the plan; Prompt the project based on the plan object attributes and plan ontology definition; Deploy the big model and implement the fastapi interface. According to the built prompt project, request the big model interface service one by one according to the relationship direction defined in the graph, and use the big model to extract the instances in the plan and the relationships between them. The device class instance data is combined with the device object data already stored in the relational database to perform knowledge completion and device name replacement.
8. A large-model-based power grid fault plan knowledge extraction system, characterized in that: include: The regulation knowledge extraction module is used to extract key knowledge from the power grid dispatching regulations and convert it into structured objects; The prompt engineering building module is used to classify the structured objects of the regulation into different fault scenarios according to the accident type, design a prompt template for each fault scenario, and use the pre-trained model to convert the accident name into a vector and store it in the vector database; The plan content analysis module is used to perform content analysis on the fault plan to determine the information that needs to be extracted and identify the preparation instructions and units, and classify the plans into national, provincial, and county and city fault plans based on this information; The plan document parsing module is used to parse the fault plan document to extract key attributes, read the plan content by segment, and associate the table information with the document context for the table; The plan objectification module is used to objectify the plan content according to the document parsing results, identify the start and end of the text, define the plan object, and mine the fault description; The triple knowledge extraction module is used to extract triple knowledge in the plan using the large model, define the ontology structure, and extract instances and relations in combination with the prompt template; The rule verification module is used by business experts to verify the rules of the extracted triple knowledge; The knowledge storage module is used to store knowledge in the graph database and complete the entire fault plan knowledge extraction and storage process.
9. A computer device, characterized in that: The device includes one or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and when the programs are executed by the processors, the steps of the large model-based power grid fault plan knowledge extraction method as described in any one of claims 1 to 7 are implemented.
10. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for extracting knowledge of power grid fault plans based on a large model as described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Power grid fault plan information extraction method and system based on deep learning
CN111428981A
Knowledge graph-based fault handling plan digital model establishment method
CN115357726A
Power grid fault plan generation method and system based on knowledge graph, and storage medium
CN116680417A
Low-voltage governance aid decision-making method fusing large language model and knowledge graph
CN118863057A