A method and device for constructing a power dispatch question and answer large model, and a power dispatch question and answer method
By constructing a large-scale question-and-answer model for power dispatching and generating a knowledge graph of multi-dimensional entities and relationships using multi-source dispatching data, the problem of poor adaptability of existing large-scale question-and-answer models in the field of power dispatching is solved, and higher information coverage and question-and-answer accuracy are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- POWER DISPATCHING CONTROL CENT OF GUANGDONG POWER GRID CO LTD
- Filing Date
- 2026-03-20
- Publication Date
- 2026-06-19
Smart Images

Figure CN122242703A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power dispatch question and answer, and in particular to a method, apparatus and method for constructing a large-scale power dispatch question and answer model. Background Technology
[0002] With the advancement of new power system construction, the scale of professional knowledge in power dispatching and operation scenarios is growing exponentially, and dispatching operations are increasingly demanding higher accuracy and intelligence in knowledge acquisition. Currently, power dispatching question answering still relies on general question-answering models.
[0003] General question-and-answer models typically use a single-dimensional identifier, such as a device ID. However, power dispatch involves complex, multi-dimensional logic. For example, various entities (equipment, procedures, cases, operating status, etc.) in power dispatch operations have intricate relationships. In power dispatch question-and-answer scenarios, different questions may require information from different dimensions to answer. A single device ID entity cannot reflect the inherent connections between these entities, making it difficult to comprehensively represent the entities and their complex relationships. It also fails to meet the precision requirements of dispatch operations, ultimately resulting in poor adaptability of general-purpose models in the power dispatch field. Summary of the Invention
[0004] This invention provides a method, apparatus, and method for constructing a large-scale power dispatch question-and-answer model, which can solve the problem that existing large-scale question-and-answer models, which use a single-dimensional identifier, cannot cover multi-dimensional information of power dispatch, and improve the adaptability of the large-scale model in the field of power dispatch.
[0005] One embodiment of the present invention provides a method for constructing a large-scale power dispatch question-and-answer model, comprising: Acquire multi-source dispatch data from the power dispatching system; the multi-source dispatch data includes: operating status parameters of lines and equipment in the power dispatching system, equipment attribute parameters, equipment operation and maintenance parameters, code data that the power dispatching system must meet during operation, and fault case data; Each equipment entity is generated using equipment attribute parameters and equipment operation and maintenance parameters as entity attributes; each procedure entity is generated using procedure data as entity attributes; each operation status entity is generated using operation status parameters as entity attributes; and each fault case entity is generated using fault case data as entity attributes. Based on the business logic satisfied by each entity, determine the relationships between equipment entities, procedure entities, fault case entities, and operating status entities; A knowledge graph is constructed using each entity as a node and the relationships between entities as edges. A large-scale question-and-answer model for power dispatching is constructed based on the knowledge graph.
[0006] Furthermore, after acquiring multi-source dispatch data from the power dispatching system, the process also includes: Perform integrity verification, logical consistency verification, and business relevance verification on each of the multi-source scheduling data to identify abnormal data; Based on the abnormal data, a scheduling knowledge anomaly list is generated so that schedulers can manually verify or supplement the abnormal data according to the scheduling knowledge anomaly list.
[0007] Furthermore, after generating the fault case entity, it also includes: For a device entity, identify the device type of the device entity and use it as the device entity keyword; For a procedure entity, identify the applicable equipment type and clause content of the procedure entity as procedure entity keywords; For running status entities, identify the data type of the running status entity and use it as the running status entity keyword; For fault case entities, identify the fault type and handling steps of the fault case entity, and use them as fault case entity keywords; The entity keywords of equipment, procedures, operating status, and fault cases are matched with the preset scene tags to determine the scene tag corresponding to each entity, and the scene tag is used as the entity attribute of the corresponding entity.
[0008] Furthermore, the relationships include: applicable procedure relationships, guidance scenario relationships, involved equipment relationships, triggering case relationships, and matching status relationships; Based on the business logic satisfied by each entity, determine the relationships between equipment entities, procedure entities, fault case entities, and operational status entities, including: If the equipment model of the equipment entity matches the equipment type to which the procedure applies in the procedure entity, it is determined that there is an applicable procedure relationship between the equipment entity and the corresponding procedure entity. If the procedure content of a procedure entity matches the scene label in the entity, it is determined that there is a guiding scene relationship between the procedure entity and the entity corresponding to the scene label. If the device ID of a device entity is the same as the fault device ID of a fault case entity, it is determined that there is a device-related relationship between the device entity and the fault case entity. If the device operating status of the operating status entity exceeds the trigger threshold of the fault case entity, a trigger case relationship is determined between the operating status entity and the fault case entity. If the device ID of the device entity is the same as the fault device ID of the fault case entity, and the occurrence time of the fault case entity is before the collection timestamp of the running status entity, a matching status relationship is determined between the fault case entity and the running status entity.
[0009] Furthermore, based on the knowledge graph, a large-scale question-and-answer model for power dispatch is constructed, including: Acquire a number of power training data; each power training data includes: a first power dispatch training question and the corresponding first power dispatch real response; The knowledge graph is embedded into a pre-defined general-purpose large model to generate a large-scale power dispatch question-and-answer model to be trained. Several power training data are input into the power dispatch question-answering model to be trained. The model retrieves a knowledge graph based on the first power dispatch training question and generates a first prompt template. The model is trained using the first power dispatch training question and the first prompt template as input and the first power dispatch predicted response as output. In each training process, the first loss is calculated based on the first power dispatch predicted response and the first power dispatch actual response. The model parameters of the power dispatch question-answering model are adjusted based on the first loss until the first loss converges, resulting in a trained power dispatch question-answering model.
[0010] Furthermore, after constructing the large-scale power dispatch question-and-answer model, it also includes: Obtain feedback on the results of the dispatcher's questions and answers; The number of unqualified questions and answers and the total number of questions and answers are counted from the feedback results. Calculate the deviation rate of the question and answer results based on the number of unqualified question and answer results and the total number of question and answer results; An early warning will be issued if the deviation rate exceeds a preset deviation threshold.
[0011] Furthermore, after issuing the warning, it also includes: Acquire some supplementary power data; the supplementary power data includes: the second power dispatch training question and the corresponding real second power dispatch response; The model parameters of the power dispatch question and answer model are frozen, and a LoRA low-rank adapter is inserted into the power dispatch question and answer model to be adjusted. Several supplementary power data are input into the power dispatch question-and-answer model to be adjusted, so that the model can retrieve the knowledge graph based on the second power dispatch training question and generate a second prompt template. The model is trained with the second power dispatch training question and the second prompt template as input and the second power dispatch predicted response as output. In each training process, the second loss is calculated based on the second power dispatch predicted response and the second power dispatch actual response. The parameters of the LoRA low-rank adapter are adjusted according to the second loss until the second loss converges, resulting in the adjusted power dispatch question-and-answer model.
[0012] Furthermore, after constructing the large-scale power dispatch question-and-answer model, it also includes: Obtain the dispatcher's identity information; Based on the dispatcher's identity information, set the corresponding operation permissions for the dispatcher in the power dispatch Q&A model.
[0013] Based on the above method embodiments, the present invention provides corresponding apparatus embodiments, including: a multi-source data acquisition module, an entity generation module, a relationship determination module, a graph construction module, and a model construction module; The multi-source data acquisition module is used to acquire multi-source dispatch data from the power dispatching system. The multi-source dispatch data includes: operating status parameters of lines and equipment in the power dispatching system, equipment attribute parameters, equipment operation and maintenance parameters, code data that the power dispatching system needs to meet during operation, and fault case data. The entity generation module is used to generate various equipment entities using equipment attribute parameters and equipment operation and maintenance parameters as entity attributes; generate various procedure entities using procedure data as entity attributes; generate various operation status entities using operation status parameters as entity attributes; and generate fault case entities using fault case data as entity attributes. The relationship determination module is used to determine the association relationships between equipment entities, procedure entities, fault case entities, and operating status entities based on the business logic satisfied by each entity. The knowledge graph construction module is used to construct a knowledge graph with each entity as a node and the relationships between entities as edges. The model building module is used to build a large-scale power dispatch question-and-answer model based on the knowledge graph.
[0014] An embodiment of the present invention provides a power dispatching question-and-answer method, including: Obtain the power dispatching issues to be consulted; The power dispatching question is input into the power dispatching question-and-answer model, so that the power dispatching question-and-answer model can retrieve the knowledge graph based on the power dispatching question and generate a prompt statement; based on the power dispatching question and the prompt statement, a corresponding power dispatching response is generated; wherein, the power dispatching question-and-answer model is obtained by the power dispatching question-and-answer model construction method provided in an embodiment of the present invention.
[0015] Compared with the prior art, the beneficial effects of this embodiment are as follows: This invention acquires multi-source dispatch data from power dispatching systems, including operating status parameters of lines and equipment, equipment attribute parameters, equipment maintenance parameters, operational procedures required for the power dispatching system, and fault case data. It generates equipment entities using equipment attribute parameters and maintenance parameters as entity attributes; procedure entities using procedure data as entity attributes; operating status entities using operating status parameters as entity attributes; and fault case entities using fault case data as entity attributes. This approach encompasses multi-dimensional information from equipment, procedures, cases, and equipment operating status within the power dispatching system, solving the problem of incomplete information from a single identifier. Based on the business logic satisfied by each entity, the relationships between equipment entities, procedure entities, fault case entities, and operating status entities are determined, thereby identifying the complex inherent connections between various entities in power dispatching operations and overcoming the deficiency of a single equipment ID entity in reflecting these inherent connections. Using each entity as a node and the relationships between entities as edges, a knowledge graph is constructed, leading to a large-scale power dispatching question-and-answer model.
[0016] In summary, this invention extracts multi-dimensional attribute fields from multi-source scheduling data and generates various entities, enabling large models to fully utilize multi-dimensional information in the power dispatching system. This solves the problem that existing question-answering large models, which use a single-dimensional identifier, cannot cover multi-dimensional information in power dispatching, thus improving the adaptability of large models in the field of power dispatching. Attached Figure Description
[0017] Figure 1 This is a flowchart illustrating a method for constructing a large-scale power dispatching question-and-answer model according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of a power dispatch question-and-answer large model construction device provided in an embodiment of the present invention; Figure 3 This is a flowchart illustrating a power dispatching question-and-answer method provided in an embodiment of the present invention. Detailed Implementation
[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] In the description of this invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated.
[0020] like Figure 1 As shown, in order to address the problem that existing large-scale question-and-answer models, which use a single-dimensional identifier, cannot cover multi-dimensional information about power dispatching, an embodiment of the present invention provides a method for constructing a large-scale question-and-answer model for power dispatching. This method includes at least the following steps: Step S101: Obtain multi-source dispatch data from the power dispatch system; wherein, the multi-source dispatch data includes: operating status parameters of lines and equipment in the power dispatch system, equipment attribute parameters, equipment operation and maintenance parameters, procedure data that the power dispatch system needs to meet during operation, and fault case data; For step S101, the current multi-source dispatch data is obtained from various data sources in the power dispatch system, including the operating status parameters of lines and equipment in the power dispatch system, equipment attribute parameters, equipment operation and maintenance parameters, the procedure data that the power dispatch system needs to meet during operation, and fault case data. The above operating status parameters include: device ID, bus voltage of the bus connected to the device, line power of the transmission line connected to the device, device operating status, data type of data collected, and data collection timestamp; The above equipment attribute parameters include: equipment ID, equipment model, the substation to which the equipment belongs, and rated parameters; The above equipment operation and maintenance parameters include: the equipment's commissioning time and the equipment's operation and maintenance records; The regulatory data required for the operation of the aforementioned power dispatching system includes: regulation number, regulation name, applicable equipment type, regulation content, clause content, effective date, and revision version number; The above fault case data includes: case ID, faulty device ID, fault type, trigger threshold, case occurrence time, handling steps, and rectification suggestions; It should be noted that the multi-source dispatch data in the power dispatch system is dynamically changing. It adopts a dual-mode synchronization of real-time incremental and timed full data to continuously maintain the timeliness, integrity and consistency of the data. The specific multi-source dispatch data is shown in Table 1.
[0021] Table 1 Classification of Multi-Source Scheduling Data Acquisition The real-time incremental synchronous acquisition method targets dynamic data and is based on change data capture technology. It monitors the add, delete, and modify operation logs of each source system database. From the generation of operation logs to the synchronization of data to the target knowledge database, the delay is ≤15 seconds, which meets the timeliness requirements of real-time power grid operation data. Apache Flink is used as the real-time computing engine, and a data flow pipeline of "source system → Flink → target database" is configured to support breakpoint resume and avoid data loss.
[0022] The scheduled full-data synchronization method targets static and quasi-static data, collecting data during the low-load period of the power grid from 3:00 to 5:00 every morning to avoid impacting business systems. It verifies the data integrity of real-time incremental synchronization and large file data not covered by the incremental synchronization mechanism. For structured data, it calculates the field hash values of the source and target tables, and a difference of ≤0.1% is considered normal synchronization. For unstructured documents, it uses dual verification of file size and modification time.
[0023] In a preferred embodiment, after acquiring multi-source dispatch data from the power dispatch system, the method further includes: Perform integrity verification, logical consistency verification, and business relevance verification on each of the multi-source scheduling data to identify abnormal data; Based on the abnormal data, a scheduling knowledge anomaly list is generated so that schedulers can manually verify or supplement the abnormal data according to the scheduling knowledge anomaly list.
[0024] In one embodiment of the present invention, in order to exclude invalid data from multi-source scheduling data and ensure that the knowledge input into the modeling process is consistent, complete, and associative, the present invention performs hierarchical verification of multi-source scheduling data, progressively verifying it according to basic integrity, logical consistency, and business relevance. Specific rules and judgment thresholds are set for each level of verification, as shown in Table 2.
[0025] Table 2. Three-level verification rules After three levels of verification, abnormal data that does not conform to the rules can be identified. For abnormal data, manual verification and supplementation are performed, specifically differentiated according to two anomaly levels. For critical anomalies containing serious issues such as missing device IDs or logical inconsistencies in fault times, data maintenance specialists handle them within one hour, triggering incremental synchronization for re-verification after handling. For alarm anomalies with unclear expert document association scenarios, the scheduling knowledge administrator supplements the annotations within 24 hours, without requiring re-synchronization after annotation. For both anomaly levels, a scheduling knowledge anomaly list is generated in a unified format, including fields such as anomaly ID, data source system, data type, anomaly level, anomaly description, discovery time, responsible person for handling, and handling status. Once all the manual verification and supplementation of the above abnormal data is completed, the cleaned multi-source scheduling data is obtained. Subsequently, a large-scale power scheduling question-and-answer model can be built based on this cleaned multi-source scheduling data.
[0026] This invention ensures data integrity, logical consistency, and business relevance through multi-source scheduling data acquisition and synchronization, employing a dual-mode synchronization mechanism of real-time incremental and timed full data collection. Combined with various verification rules and abnormal data handling procedures, it achieves a data qualification rate of ≥99.5% and a correlation matching rate of ≥99.8% after cleaning, providing a high-quality data foundation for subsequent model training and inference. Real-time incremental synchronization latency is ≤15 seconds, and data freshness is ≤20 seconds, enabling timely acquisition and processing of dynamic information such as real-time power grid operation data, meeting the stringent timeliness requirements of power dispatching operations.
[0027] Step S102: Generate each equipment entity using equipment attribute parameters and equipment operation and maintenance parameters as entity attributes; generate each procedure entity using procedure data as entity attributes; generate each operation status entity using operation status parameters as entity attributes; generate each fault case entity using fault case data as entity attributes. For step S102, the corresponding attribute fields are extracted from the multi-source scheduling data. The specific extraction method and field mapping examples are shown in Table 3.
[0028] Table 3. Entity Extraction Methods and Field Mapping Examples Specifically, the equipment attributes originate from the structured MySQL tables in the equipment file system. During extraction, the structured fields in the table are read directly, and duplicates are removed using "equipment ID" as the unique identifier. The final result is a set of equipment entity attributes that includes equipment ID, equipment model, substation, rated parameters, commissioning time, and operation and maintenance records.
[0029] The procedure-type attributes originate from the relational data table of the scheduling procedure database. When extracting, the fields in the table are read, and duplicates are removed using "procedure number" as the unique identifier. The "applicable equipment type" keyword (such as 110kV transformer) is then associated to obtain a set of procedure entity attributes that include procedure number, procedure name, applicable equipment type, procedure content, clause content, effective date, and revision version number.
[0030] The case-type attributes originate from the semi-structured JSON / XML data in the fault case library. During extraction, the semi-structured data is first parsed to extract the structured fields. Then, the device entity is associated with the "faulty device ID" to ensure data correlation. Finally, the fault case entity attributes are obtained, which include case ID, faulty device ID, fault type, trigger threshold, case occurrence time, handling steps, and rectification suggestions.
[0031] The operational status attributes are derived from real-time JSON / CSV data from the EMS energy management system. During extraction, fields are read from the real-time synchronized data, and duplicates are removed using "device ID and acquisition timestamp" as unique identifiers to avoid duplicate status records. The final result is an operational status entity attribute containing device ID, bus voltage, line power, device operational status, and acquisition timestamp.
[0032] Cypher statements are used to transform entity attributes into knowledge graph-recognizable entity nodes. By using "device ID" as the entity identifier and combining it with corresponding device attribute parameters and device operation and maintenance parameters to generate device entities, the relevant information of specific devices can be clearly identified. By using "procedure number" as the entity identifier and combining it with corresponding procedure data to generate procedure entities, it is helpful to sort out and clarify the relevant procedure content. By using "faulty device ID" as the entity identifier and combining it with corresponding fault case data to generate fault case entities, fault cases can be managed systematically. By using "device ID and collection timestamp" as the entity identifier and combining it with corresponding operating status parameters to generate operating status entities, the operating status of devices can be monitored in real time.
[0033] In a preferred embodiment, after generating the fault case entity, the method further includes: For a device entity, identify the device type of the device entity and use it as the device entity keyword; For a procedure entity, identify the applicable equipment type and clause content of the procedure entity as procedure entity keywords; For running status entities, identify the data type of the running status entity and use it as the running status entity keyword; For fault case entities, identify the fault type and handling steps of the fault case entity, and use them as fault case entity keywords; The entity keywords of equipment, procedures, operating status, and fault cases are matched with the preset scene tags to determine the scene tag corresponding to each entity, and the scene tag is used as the entity attribute of the corresponding entity.
[0034] In one embodiment of the present invention, to facilitate subsequent scene-based graph filtering, scene tags are added to entity nodes. Scene tags are automatically labeled based on the entity's core attributes and business rules, and the specific process is as follows: First, a set of preset core business scenario tags for scheduling is used as preset keywords, such as "line fault handling", "transformer maintenance", and "overload fault handling". Then, for different types of entities, keywords are extracted from their attribute fields according to specific rules and matched with scenario tags. The methods for extracting keywords and matching scene tags for various entities are as follows: For procedure entities, identify the applicable equipment type and clause content as procedure entity keywords, such as labeling "110kV transformer operation and maintenance procedure" with "transformer operation and maintenance" tag; For fault case entities, identify the fault type and handling steps as fault case entity keywords, such as labeling "overload fault case" with "overload fault handling" tag; For equipment entities, identify the equipment type as equipment entity keywords, such as labeling "110kV transformer" with "transformer related" tag; For operating status entities, identify the data type as operating status entity keywords, such as labeling "220kV line active power" with "line active power" tag.
[0035] Finally, after extracting keywords and matching scene tags for all entities, the scene tag for each entity is stored as an attribute field in the corresponding entity node of the knowledge graph.
[0036] Step S103: Determine the relationships between equipment entities, procedure entities, fault case entities, and operating status entities based on the business logic satisfied by each entity; In a preferred embodiment, the relationships include: applicable procedure relationships, guidance scenario relationships, involved device relationships, trigger case relationships, and matching status relationships; Based on the business logic satisfied by each entity, determine the relationships between equipment entities, procedure entities, fault case entities, and operational status entities, including: If the equipment model of the equipment entity matches the equipment type to which the procedure applies in the procedure entity, it is determined that there is an applicable procedure relationship between the equipment entity and the corresponding procedure entity. If the procedure content of a procedure entity matches the scene label in the entity, it is determined that there is a guiding scene relationship between the procedure entity and the entity corresponding to the scene label. If the device ID of a device entity is the same as the fault device ID of a fault case entity, it is determined that there is a device-related relationship between the device entity and the fault case entity. If the device operating status of the operating status entity exceeds the trigger threshold of the fault case entity, a trigger case relationship is determined between the operating status entity and the fault case entity. If the device ID of the device entity is the same as the fault device ID of the fault case entity, and the occurrence time of the fault case entity is before the collection timestamp of the running status entity, a matching status relationship is determined between the fault case entity and the running status entity.
[0037] For step S103, for power dispatching business, association rules are set in advance to establish association relationships with actual business logic between equipment entities, procedure entities, fault case entities and operating status entities.
[0038] In this embodiment, five core relationships are specifically included, as shown in Table 4. When the device model of a device entity belongs to the "applicable device type" of a certain procedure entity, the two will establish an applicable procedure relationship to clarify the operation and maintenance basis corresponding to the device. When the content of a procedure entity contains a scenario tag, the procedure entity and the entity corresponding to the scenario tag will establish a guidance scenario relationship to explain the business scenario that the procedure can guide. When the "fault device ID" of a fault case entity is completely consistent with the "device ID" of a certain device entity, the two will establish a device-related relationship to clarify the fault device corresponding to the case. When the device operating parameters (such as power and voltage) reflected by the running status entity exceed the preset trigger threshold, the running status entity and the fault case entity corresponding to the threshold will establish a trigger case relationship to indicate the fault type that may be triggered in the current state. When the "fault device ID" of the fault case entity is consistent with the "device ID" of the running status entity, and the case occurrence time is earlier than the collection timestamp of the running status, the two will establish a matching status relationship to trace the status changes after the device failure.
[0039] Table 4. Five types of association rules for scheduling business scenarios. By establishing the above five types of relationships, compared with a single "device ID" node that only carries static device attributes, the knowledge graph structure of multi-entity association breaks the information isolation of a single node. It can not only integrate the basic attributes of the device, but also associate operation and maintenance procedures, fault cases and real-time operating status, forming a complete business link from static device information to dynamic operation, from procedure guidance to fault handling, which greatly improves the support capability of intelligent decision-making and the efficiency of scenario-based analysis.
[0040] Step S104: Construct a knowledge graph based on equipment entities, procedure entities, fault case entities, and operating status entities and their relationships; For step S104, based on the equipment entities, procedure entities, fault case entities, and operating status entities generated in step S102, as well as the scene tags labeled for these entities, and the relationship established in step S103, various entities are used as nodes of the knowledge graph, business relationships between entities are used as edges connecting nodes, and scene tags are used as attributes of nodes. This integrates and constructs a knowledge graph in the field of power dispatching. This graph can provide a structured knowledge index that can be directly called for large models, thereby supporting intelligent decision-making and analysis in power dispatching scenarios.
[0041] Step S105: Construct a large-scale power dispatch question-and-answer model based on the knowledge graph.
[0042] In a preferred embodiment, a large-scale power dispatch question-and-answer model is constructed based on a knowledge graph, including: Acquire a number of power training data; each power training data includes: a first power dispatch training question and the corresponding first power dispatch real response; The knowledge graph is embedded into a pre-defined general-purpose large model to generate a large-scale power dispatch question-and-answer model to be trained. Several power training data are input into the power dispatch question-answering model to be trained. The model retrieves a knowledge graph based on the first power dispatch training question and generates a first prompt template. The model is trained using the first power dispatch training question and the first prompt template as input and the first power dispatch predicted response as output. In each training process, the first loss is calculated based on the first power dispatch predicted response and the first power dispatch actual response. The model parameters of the power dispatch question-answering model are adjusted based on the first loss until the first loss converges, resulting in a trained power dispatch question-answering model.
[0043] For step S105, first prepare several sets of power training data. Each set of data contains a power dispatch training question and the corresponding real answer, providing the model with learning samples for domain question answering. Next, the constructed power dispatch knowledge graph, which includes equipment, procedures, cases, operating status and relationships, is embedded into the preset general model to generate a power dispatch question-and-answer model to be trained, so that the general model has a structured knowledge index in the field of power dispatch. Subsequently, through full-parameter training, general knowledge from the scheduling domain is incorporated. Specifically, power training data is input into the model to be trained. The model retrieves relevant domain knowledge from the knowledge graph for each power scheduling training question. Using PromptTuning technology, each power scheduling training question and the retrieved knowledge are transformed into a corresponding prompt template, thereby guiding the model to call upon relevant knowledge and avoiding irrelevant answers. An illustrative example of a prompt template is shown below: User query input: "Applicable operation and maintenance procedures and historical overload fault cases for SFZ11-12500 / 110 type transformers".
[0044] Prompt Template: Please answer the user question based on the following information: "Please list the applicable operation and maintenance procedures for the SFZ11-12500 / 110 transformer, as well as historical overload failure cases of this equipment (including the time of failure and the core handling steps)."
[0045] (1) Equipment entity: Equipment ID=D12345, Model=SFZ11-12500 / 110, Rated power=12500kVA, Substation=Substation A; (2) The procedure entities already associated in the knowledge graph: Procedure ID=G110-001 (Applicable equipment type=110kV transformer, clause content: ...), Procedure ID=G110-002 (Applicable equipment type=220kV transformer, clause content: ...); (3) Fault case entities already associated in the knowledge graph: Case ID=C20231005 (Fault device ID=D12345, Fault type=overload, Occurrence time=2023-10-05, Handling steps:...), Case ID=C20240112 (Fault device ID=D67890, Fault type=short circuit, Occurrence time=2024-01-12, Handling steps:...).
[0046] Using training questions and prompt templates as input and output, the predicted response is calculated. In each training round, the predicted response is compared with the actual response to calculate the loss value. Based on the loss value, the model is fully adjusted. The process is iterated until the loss converges, and finally a large-scale power dispatch question-and-answer model is obtained.
[0047] In a preferred embodiment, after constructing the large-scale power dispatch question-and-answer model, the method further includes: Obtain feedback on the results of the dispatcher's questions and answers; The number of unqualified questions and answers and the total number of questions and answers are counted from the feedback results. Calculate the deviation rate of the question and answer results based on the number of unqualified question and answer results and the total number of question and answer results; An early warning will be issued if the deviation rate exceeds a preset deviation threshold.
[0048] In one embodiment of the present invention, in order to continuously improve the accuracy of question-and-answer and reasoning efficiency of the power dispatch question-and-answer model, a closed-loop optimization feedback and early warning mechanism is established. Specifically, firstly, feedback on the question-and-answer results from dispatchers is obtained. This step combines the dispatchers' direct evaluation of the model's question-and-answer output with business scenario adaptability analysis, synchronously collects model optimization requirements, and automatically monitors the quality performance of all question-and-answer results. Secondly, the number of unqualified question-and-answer results and the total number of question-and-answer results are counted from the feedback. Among them, "unqualified question-and-answer results" are clearly defined as question-and-answer outputs that do not meet the three core business standards of "professional accuracy, correlation completeness, and logical consistency". Next, the deviation rate of the question-and-answer results is calculated based on the number of unqualified question-and-answer results and the total number of question-and-answer results. The specific calculation formula is: Deviation rate = (Number of unqualified question-and-answer results / Total number of question-and-answer results) × 100%. Finally, if the deviation rate exceeds a preset deviation threshold, an early warning is issued. The preset deviation threshold in this mechanism is 5%. When the deviation rate is > 5%, the system will automatically trigger an early warning, prompting maintenance personnel to optimize the power dispatch question-and-answer model.
[0049] In a preferred embodiment, after issuing the warning, the method further includes: Acquire some supplementary power data; the supplementary power data includes: the second power dispatch training question and the corresponding real second power dispatch response; The model parameters of the power dispatch question and answer model are frozen, and a LoRA low-rank adapter is inserted into the power dispatch question and answer model to be adjusted. Several supplementary power data are input into the power dispatch question-and-answer model to be adjusted, so that the model can retrieve the knowledge graph based on the second power dispatch training question and generate a second prompt template. The model is trained with the second power dispatch training question and the second prompt template as input and the second power dispatch predicted response as output. In each training process, the second loss is calculated based on the second power dispatch predicted response and the second power dispatch actual response. The parameters of the LoRA low-rank adapter are adjusted according to the second loss until the second loss converges, resulting in the adjusted power dispatch question-and-answer model.
[0050] In one embodiment of the present invention, after issuing an early warning, it indicates that the current power dispatch question-and-answer model can no longer meet the accuracy requirements of power dispatch business scenarios. At this time, it is necessary to optimize and adjust the power dispatch question-and-answer model. Specifically: First, acquire some supplementary power data, which includes new power dispatch training questions and corresponding real responses, to specifically address the model output bias issues exposed by the early warning system. Next, the original parameters of the power dispatch question-and-answer model are frozen to retain the power dispatch domain knowledge already learned by the model and avoid knowledge forgetting caused by full training. At the same time, a LoRA low-rank adapter is inserted into the model to generate a power dispatch question-and-answer model to be adjusted. In this way, new data can be adapted with only a small number of trainable low-rank parameters, which can significantly reduce the computation and resource costs of training. Subsequently, the supplementary power data is input into the power dispatch question-and-answer model to be adjusted. The model retrieves the knowledge graph for each new training question to generate a corresponding prompt template. Then, it generates a predicted answer using the training question and the prompt template as input. In each round of training, the predicted answer and the real answer are compared to calculate the loss value. Only the parameters of the LoRA low-rank adapter are adjusted until the loss converges, and finally the adjusted power dispatch question-and-answer model is obtained.
[0051] The adjusted power dispatch question-answering model is fine-tuned specifically based on LoRA (Low-Rank Adaptation) technology. This optimizes model parameters for intelligent question-answering tasks, reducing computational consumption while improving domain adaptability. Preferably, for small-sample scenarios, QLoRA (Quantized LoRA) quantization fine-tuning technology can be used to achieve efficient model updates at INT4 quantization precision.
[0052] This invention adapts the model to a domestically developed open-source or general-purpose large model for specific domain applications. Through full-parameter training, the model deeply integrates with scheduling domain knowledge. Subsequent fine-tuning using a LoRA low-rank adapter focuses on enhancing the model's understanding of power scheduling issues, complex logical reasoning, and multi-turn dialogue capabilities, ensuring accurate interpretation of scheduling business requirements. In the question-and-answer phase, the model first retrieves relevant information from the knowledge graph and then generates customized prompt templates using prompt optimization technology. This guides the model to accurately invoke domain knowledge, effectively improving the accuracy of responses. Furthermore, the model is equipped with a deviation rate warning and closed-loop optimization mechanism, continuously optimizing through dispatcher feedback and data iteration, ultimately achieving a highly professional and accurate question-and-answer result.
[0053] In a preferred embodiment, after constructing the large-scale power dispatch question-and-answer model, the method further includes: Obtain the dispatcher's identity information; Based on the dispatcher's identity information, set the corresponding operation permissions for the dispatcher in the power dispatch Q&A model.
[0054] In one embodiment of the present invention, after constructing the large-scale power dispatching question-and-answer model, security control is required to ensure the model's operational security and the compliance of dispatching operations. Specifically, this involves obtaining the identity information of each dispatcher. Based on the dispatcher's identity information, corresponding operation permissions are set for each dispatcher within the large-scale power dispatching question-and-answer model. These permissions include dispatcher-level permissions, administrator-level permissions, or system-level permissions. For example, dispatcher-level permissions only allow querying knowledge within their assigned dispatching area and initiating regular question-and-answer sessions; administrator-level permissions allow reviewing batch query requests and exporting knowledge data; and system-level permissions grant full access. Furthermore, permission scope is bound to the dispatching business scenario to prohibit cross-regional or unauthorized access to core dispatching knowledge. Querying sensitive knowledge requires additional operation approval and recording.
[0055] Based on this, a three-tiered end-to-end log system was established, consisting of operation logs, model logs, and knowledge update logs. Operation logs record user ID, operation time, query content, and response results. Model logs track inference task ID, computing power usage, inference latency, and reasons for anomalies. Knowledge update logs retain update time, update content, and reviewer information. All logs are stored in the audit database in JSON structured format with a retention period of ≥365 days. The system supports multi-dimensional retrieval by user, time, query type, device number, and other dimensions. Log files can be exported for compliance auditing and fault tracing, ensuring that every operation and model run can be accurately traced.
[0056] The power dispatching question-and-answer model constructed in this invention features strict access control and comprehensive log traceability. A three-tiered access control mechanism, combined with dispatcher authentication, binds operational permissions to the scope of dispatching business, prohibiting cross-regional and unauthorized access to core dispatching knowledge. Sensitive knowledge queries are subject to operation approval and recording, effectively ensuring the security of dispatching knowledge. Three types of end-to-end logs—operation logs, model logs, and knowledge update logs—are established and stored in an audit database using JSON structured format, with a retention period of ≥365 days. Multi-dimensional queries and exports are supported, providing strong support for compliance auditing and fault tracing.
[0057] like Figure 2 As shown, based on the above method embodiments, corresponding apparatus embodiments are provided; An embodiment of the present invention provides a device for constructing a large-scale power dispatch question-and-answer model, comprising: a multi-source data acquisition module, an entity generation module, a relationship determination module, a graph construction module, and a model construction module; The multi-source data acquisition module is used to acquire multi-source dispatch data from the power dispatching system. The multi-source dispatch data includes: operating status parameters of lines and equipment in the power dispatching system, equipment attribute parameters, equipment operation and maintenance parameters, code data that the power dispatching system needs to meet during operation, and fault case data. The entity generation module is used to generate various equipment entities using equipment attribute parameters and equipment operation and maintenance parameters as entity attributes; generate various procedure entities using procedure data as entity attributes; generate various operation status entities using operation status parameters as entity attributes; and generate fault case entities using fault case data as entity attributes. The relationship determination module is used to determine the association relationships between equipment entities, procedure entities, fault case entities, and operating status entities based on the business logic satisfied by each entity. The knowledge graph construction module is used to construct a knowledge graph with each entity as a node and the relationships between entities as edges. The model building module is used to build a large-scale power dispatch question-and-answer model based on the knowledge graph.
[0058] It is understood that the above-described device embodiments correspond to the method embodiments of the present invention, and can implement the method for constructing the power dispatch question-and-answer large model provided by any of the above-described method embodiments of the present invention.
[0059] It should be noted that the device embodiments described above are merely illustrative, and some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can specifically be implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.
[0060] like Figure 3 As shown, based on the above-described method embodiments, an embodiment of the present invention provides a power dispatching question-and-answer method, which includes at least the following steps: Step S201: Obtain the power dispatching problem to be consulted; For step S201, when starting the power dispatch Q&A, the system receives power dispatch questions raised by dispatchers in power dispatch business scenarios. These questions originate from real business needs such as daily dispatch and maintenance, fault diagnosis and handling, procedure compliance verification, and equipment status analysis.
[0061] Step S202: Input the power dispatching question into the power dispatching question-and-answer model, so that the power dispatching question-and-answer model can retrieve the knowledge graph based on the power dispatching question and generate a prompt statement; and generate a corresponding power dispatching response based on the power dispatching question and the prompt statement; wherein, the power dispatching question-and-answer model is obtained by the power dispatching question-and-answer model construction method provided in an embodiment of the present invention.
[0062] In step S202, the power dispatching problem is input into the power dispatching question-and-answer model. After receiving the power dispatching problem, the model first searches the constructed power dispatching knowledge graph based on the keywords in the problem to accurately locate the equipment entities, procedure entities, fault case entities, and operating status entities associated with the problem. Then, through prompting optimization technology, the power dispatching problem and the related domain knowledge retrieved from the knowledge graph are integrated into a structured prompt statement, thereby guiding the model to anchor professional knowledge and avoid outputting content that is detached from business logic.
[0063] The large-scale power dispatch question-and-answer model takes power dispatch questions and prompts as input. Based on the model's learned professional understanding and reasoning abilities in power dispatch, it generates power dispatch responses that meet the standards of professional accuracy, complete relevance, and logical consistency. The entire process, based on a domain-adaptive large-scale model constructed according to an embodiment of the present invention, ensures that the responses not only fit the power dispatch business scenario but also efficiently utilize structured knowledge from the knowledge graph, ultimately outputting accurate and professional response results.
[0064] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A method for constructing a large-scale power dispatch question-and-answer model, characterized in that, include: Acquire multi-source dispatch data from the power dispatching system; the multi-source dispatch data includes: operating status parameters of lines and equipment in the power dispatching system, equipment attribute parameters, equipment operation and maintenance parameters, code data that the power dispatching system must meet during operation, and fault case data; Each device entity is generated using device attribute parameters and device operation and maintenance parameters as entity attributes; each procedure entity is generated using the procedure data as entity attributes; each operation status entity is generated using operation status parameters as entity attributes; and each fault case entity is generated using fault case data as entity attributes. Based on the business logic satisfied by each entity, determine the relationships between equipment entities, procedure entities, fault case entities, and operating status entities; A knowledge graph is constructed using each entity as a node and the relationships between entities as edges. A large-scale question-and-answer model for power dispatching is constructed based on the knowledge graph.
2. The method for constructing a large-scale power dispatching question-and-answer model according to claim 1, characterized in that, After acquiring multi-source dispatch data from the power dispatching system, the process also includes: Perform integrity verification, logical consistency verification, and business relevance verification on each of the multi-source scheduling data to identify abnormal data; Based on the abnormal data, a scheduling knowledge anomaly list is generated so that schedulers can manually verify or supplement the abnormal data according to the scheduling knowledge anomaly list.
3. The method for constructing a large-scale power dispatching question-and-answer model according to claim 1, characterized in that, After generating the fault case entity, it also includes: For a device entity, identify the device type of the device entity and use it as the device entity keyword; For a procedure entity, identify the applicable equipment type and clause content of the procedure entity as procedure entity keywords; For running status entities, identify the data type of the running status entity and use it as the running status entity keyword; For fault case entities, identify the fault type and handling steps of the fault case entity, and use them as fault case entity keywords; The entity keywords of equipment, procedures, operating status, and fault cases are matched with the preset scene tags to determine the scene tag corresponding to each entity, and the scene tag is used as the entity attribute of the corresponding entity.
4. The method for constructing a large-scale power dispatching question-and-answer model according to claim 3, characterized in that, The relationships include: applicable procedure relationships, guidance scenario relationships, involved equipment relationships, triggering case relationships, and matching status relationships; The process of determining the relationships between equipment entities, procedure entities, fault case entities, and operating status entities based on the business logic satisfied by each entity includes: If the equipment model of the equipment entity matches the equipment type to which the procedure applies in the procedure entity, it is determined that there is an applicable procedure relationship between the equipment entity and the corresponding procedure entity. If the procedure content of a procedure entity matches the scene label in the entity, it is determined that there is a guiding scene relationship between the procedure entity and the entity corresponding to the scene label. If the device ID of a device entity is the same as the fault device ID of a fault case entity, it is determined that there is a device-related relationship between the device entity and the fault case entity. If the device operating status of the operating status entity exceeds the trigger threshold of the fault case entity, a trigger case relationship is determined between the operating status entity and the fault case entity. If the device ID of the device entity is the same as the fault device ID of the fault case entity, and the occurrence time of the fault case entity is before the collection timestamp of the running status entity, a matching status relationship is determined between the fault case entity and the running status entity.
5. The method for constructing a large-scale power dispatching question-and-answer model according to claim 1, characterized in that, Based on the knowledge graph, a large-scale question-and-answer model for power dispatching is constructed, including: Acquire a number of power training data; each power training data includes: a first power dispatch training question and the corresponding first power dispatch real response; The knowledge graph is embedded into a preset general large model to generate a power dispatch question-and-answer large model to be trained. Several power training data are input into the power dispatch question-answering model to be trained. The model retrieves a knowledge graph based on the first power dispatch training question and generates a first prompt template. The model is trained using the first power dispatch training question and the first prompt template as input and the first power dispatch predicted response as output. In each training process, the first loss is calculated based on the first power dispatch predicted response and the first power dispatch actual response. The model parameters of the power dispatch question-answering model are adjusted based on the first loss until the first loss converges, resulting in a trained power dispatch question-answering model.
6. The method for constructing a large-scale power dispatching question-and-answer model according to claim 5, characterized in that, After constructing the large-scale power dispatch question-and-answer model, it also includes: Obtain feedback on the results of the dispatcher's questions and answers; The number of invalid questions and answers and the total number of questions and answers are counted from the feedback of the question and answer results. Calculate the deviation rate of the question and answer results based on the number of unqualified question and answer results and the total number of question and answer results; An early warning will be issued if the deviation rate exceeds a preset deviation threshold.
7. The method for constructing a large-scale power dispatching question-and-answer model according to claim 6, characterized in that, After issuing the warning, it also includes: Acquire a number of supplementary power data; the supplementary power data includes: the second power dispatch training question and the corresponding real response of the second power dispatch. The model parameters of the power dispatch question and answer model are frozen, and a LoRA low-rank adapter is inserted into the power dispatch question and answer model to be adjusted. Several supplementary power data are input into the power dispatch question-and-answer model to be adjusted, so that the model can retrieve the knowledge graph based on the second power dispatch training question and generate a second prompt template. The model is trained with the second power dispatch training question and the second prompt template as input and the second power dispatch predicted response as output. In each training process, the second loss is calculated based on the second power dispatch predicted response and the second power dispatch actual response. The parameters of the LoRA low-rank adapter are adjusted according to the second loss until the second loss converges, resulting in the adjusted power dispatch question-and-answer model.
8. The method for constructing a large-scale power dispatching question-and-answer model according to claim 5, characterized in that, After constructing the large-scale power dispatch question-and-answer model, it also includes: Obtain the dispatcher's identity information; Based on the dispatcher's identity information, set the corresponding operation permissions for the dispatcher in the power dispatch Q&A model.
9. A device for constructing a large-scale power dispatch question-and-answer model, characterized in that, include: The module includes a multi-source data acquisition module, an entity generation module, a relationship determination module, a graph construction module, and a model construction module. The multi-source data acquisition module is used to acquire multi-source dispatch data in the power dispatch system; wherein, the multi-source dispatch data includes: operating status parameters of lines and equipment in the power dispatch system, equipment attribute parameters, equipment operation and maintenance parameters, procedure data that the power dispatch system needs to meet during operation, and fault case data; The entity generation module is used to generate each device entity using device attribute parameters and device operation and maintenance parameters as entity attributes; generate each procedure entity using the procedure data as entity attributes; generate each operation status entity using operation status parameters as entity attributes; and generate fault case entities using fault case data as entity attributes. The relationship determination module is used to determine the association relationship between the device entity, procedure entity, fault case entity and operating status entity based on the business logic satisfied between the entities. The graph construction module is used to construct a knowledge graph with each entity as a node and the relationship between each entity as an edge. The model building module is used to construct a large-scale power dispatch question-and-answer model based on the knowledge graph.
10. A power dispatching question-and-answer method, characterized in that, include: Obtain the power dispatching issues to be consulted; The power dispatching problem is input into the power dispatching question-and-answer model, so that the power dispatching question-and-answer model can retrieve the knowledge graph based on the power dispatching problem and generate prompt statements; Based on the power dispatching questions and prompts, corresponding power dispatching responses are generated; wherein, the power dispatching question-and-answer model is obtained by the power dispatching question-and-answer model construction method according to any one of claims 1-8.