Power grid emergency command decision generation method and system based on knowledge engineering
By using knowledge engineering-based methods to align power grid fault data in terms of time and entities, and combining this with the Transformer model to generate emergency command decisions, the problems of time-consuming identification and non-standard decision-making in traditional power grid emergency command are solved, enabling rapid and standardized emergency response.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-01
- Publication Date
- 2026-04-07
AI Technical Summary
Traditional power grid emergency command relies on human experience and dispatch procedures. Fault scenario identification is time-consuming, and it cannot comprehensively analyze image monitoring, on-site display screen information, and personnel operation behavior. Emergency decision generation lacks automatic learning capabilities, resulting in delays in response or non-standard instructions, which affects power grid safety.
Based on knowledge engineering methods, this study uses historical fault data for time alignment and noise suppression, combines power grid equipment ontology and fault type ontology for entity alignment and semantic disambiguation, and utilizes Transformer models for supervised learning to generate real-time emergency command decisions.
It enables the rapid and standardized generation of emergency command suggestions for complex fault scenarios, improves the intelligence and practicality of power grid emergency decision-making, and reduces the risks of delays in handling and non-standard instructions.
Smart Images

Figure CN121809813A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power grid emergency decision-making technology, and more particularly to a power grid emergency command and decision generation method and system based on knowledge engineering. Background Technology
[0002] The power grid operating environment is characterized by high real-time requirements, high coupling, and high risk. When emergencies such as line faults, equipment malfunctions, or false triggering of protection devices occur, dispatchers must complete equipment status identification, fault range assessment, deduction of response procedures, and issuance of instructions within a very short time. However, traditional emergency command relies on human experience and dispatch procedures, which suffers from problems such as time-consuming fault scenario identification, reliance on manual judgment in the formulation of response procedures, and insufficient response to complex topology changes. This can easily lead to delays in response or non-standard instructions, affecting power grid security.
[0003] In existing technologies, auxiliary decision-making methods for power grid anomalies typically rely solely on PMU measurement data, SCADA status variables, or rule bases for reasoning. They fail to comprehensively analyze image monitoring, on-site display information, and personnel operational behaviors, resulting in insufficient utilization of on-site fault information. Furthermore, existing methods often depend on preset process templates or fixed rule matching when generating emergency response suggestions, lacking the ability to automatically learn response logic from massive amounts of historical fault handling data. This makes it difficult to handle diverse and combined actual response steps, leading to low reference value and practicality of intelligently generated emergency decisions. Summary of the Invention
[0004] To address the aforementioned problems, this invention provides a method and system for generating power grid emergency command decisions based on knowledge engineering.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows: A knowledge engineering-based method for generating power grid emergency command decisions includes the following steps: S1. Based on historical fault alarm timestamps, time alignment and noise suppression processing are performed on historical power grid fault types, image stream data, PMU measurement data and topology data to obtain multimodal data sequences. S2. Based on the multimodal data sequence, target detection is performed on the power grid equipment image frames and screen display information to obtain a perception event sequence containing equipment entity labels, indication status, reading changes, and personnel operations; based on the power grid equipment entity and fault type entity, entity alignment and semantic disambiguation processing are performed on the perception event sequence to obtain state action segments. S3. Based on the emergency response rule engine and security constraints, perform consistency verification and conflict resolution on the state action segments to obtain state action data for training. S4. Based on the state action data and corresponding processing result labels used for training as input, and the target disposal step sequence as output, supervised learning training is performed through the Transformer model to obtain the Transformer model that has completed training convergence. S5. Input the real-time state and action segments into the Transformer model that has completed training and convergence, generate a real-time target handling step sequence, and generate emergency command decisions based on the real-time target handling step sequence.
[0006] Further, S1 includes the following steps: Based on historical fault alarm timestamps, inter-frame motion estimation is performed on historical image stream data using optical flow method, and PMU measurement data and topology data are time-aligned using global timestamp registration algorithm to obtain synchronous modal data. Based on synchronous modal data, the image frames are subjected to noise suppression and edge enhancement using the Laplacian Gaussian operator, and the PMU measurement data are subjected to outlier removal and trend smoothing using Kalman filtering to obtain the corrected multimodal sequence.
[0007] Furthermore, the target detection based on the multimodal data sequence of the power grid equipment image frame and screen display information includes the following steps: Based on the multimodal data sequence, a convolutional neural network is used to perform equipment region detection and equipment entity label recognition on the power grid equipment image frames to obtain the initial equipment detection results; Based on the initial detection results of the device, the screen display information is processed by optical character recognition algorithm and indicator light color segmentation algorithm to extract text readings and extract indication status, resulting in data segments containing reading changes and indication status. Based on the device entity label and the data segment, image frames within the same time window are temporally correlated to obtain a sequence of perception events including device entity label, indication status, reading changes, and personnel operations.
[0008] Furthermore, the entity alignment and semantic disambiguation processing of the perceived event sequence based on the power grid equipment ontology and the fault type ontology includes: Based on the power grid equipment ontology, a set of ontology nodes containing equipment categories, hierarchical relationships, and functional attributes is constructed, and a set of entities to be matched is generated based on the equipment entity tags extracted from the perception event sequence; Based on the set of entities to be matched, the ontology node set is mapped, including calculating the attribute similarity, structural proximity and functional matching degree of the device tag, and performing ontology node search and matching processing on each entity to be matched to obtain the aligned device entity; Based on the fault type ontology and the aligned device entity, semantic conflict detection is performed on the semantic tags of indication state and reading changes in the perceived event sequence to obtain the state action fragment after semantic disambiguation.
[0009] Furthermore, the attribute similarity, structural proximity, and functional matching degree of the device tags are obtained by cosine similarity calculation.
[0010] Further, S3 includes the following steps: Based on the emergency response rule engine, the state action segments are processed by rule condition matching. By matching the preset equipment interlocking rules, limit violation rules and operating mode constraints, a consistency detection result marking its legality is obtained. Based on the consistency detection results, graph structure verification processing is performed on the conflicting state action segments, including performing connectivity checks and power flow direction checks on the device nodes involved in the actions based on topological connection relationships, to obtain a set of conflict segments marked with conflict types. The action sequence is arranged according to the set of conflicting segments, and illegal actions are replaced by preset constraint replacement rules to obtain state action data for training.
[0011] Further, S4 includes the following steps: Each state action segment in the state action data is sequence encoded, and the fault type, equipment state change and action label are constructed into a model in chronological order and input into the sequence. The model input sequence is fed into a Transformer encoder that includes a multi-head attention mechanism. Feature extraction processing is performed on the temporal dependencies between segments to obtain the encoded temporal feature representation. Based on the temporal feature representation, the target processing step sequence is input into the Transformer decoder, and a prediction segment sequence is generated through self-attention and cross-attention to obtain the prediction processing step sequence; Based on the predicted treatment step sequence and the corresponding target treatment step sequence, the error is calculated using the loss function and gradient descent is performed to update the model until the training converges.
[0012] Furthermore, the loss function is the cross-entropy loss function.
[0013] Furthermore, the step of generating emergency command decisions based on the real-time target handling sequence includes: Based on the real-time target handling step sequence, semantic template matching is performed on the device action tags corresponding to each step to convert the action tags into structured operation statements. Based on the structured operation statements, an emergency command text containing equipment names, action instructions, and execution conditions is constructed in chronological order to obtain an emergency command decision.
[0014] A power grid emergency command and decision generation system based on knowledge engineering, applied to any of the aforementioned power grid emergency command and decision generation methods based on knowledge engineering, includes: The data acquisition module is used to perform time alignment and noise suppression processing on historical power grid fault types, image stream data, PMU measurement data and topology data based on historical fault alarm timestamps to obtain multimodal data sequences. A state-action extraction model is used to perform target detection on the image frames and screen display information of power grid equipment based on the multimodal data sequence, and obtain a perception event sequence containing equipment entity labels, indication status, reading changes, and personnel operations; based on the power grid equipment ontology and fault type ontology, entity alignment and semantic disambiguation processing are performed on the perception event sequence to obtain state-action fragments; The training data generation module is used to perform consistency verification and conflict resolution on the state action segments according to the emergency response rule engine and security constraints to obtain state action data for training. The model training module is used to perform supervised learning training on the Transformer model, based on the state action data and corresponding processing result labels used for training as input and the target disposal step sequence as output, to obtain the Transformer model that has completed training convergence. The decision output module is used to input real-time state and action segments into the completed and converged Transformer model to generate a real-time target handling step sequence, and generate emergency command decisions based on the real-time target handling step sequence.
[0015] The beneficial effects of this invention are as follows: First, based on historical fault alarm timestamps, this invention performs time alignment and noise suppression on power grid fault types, image streams, PMU measurements, and topology data to form a multimodal data sequence that can be processed uniformly. Subsequently, target detection is performed on image frames and screen display information, and entity alignment and semantic disambiguation are completed by combining the power grid equipment entity and fault type entity, thereby extracting state action fragments directly related to the handling behavior. For non-standard actions in historical handling processes, consistency verification and conflict resolution of state action fragments are performed through an emergency handling rule engine and safety constraints, retaining only training data that conforms to topology and interlocking constraints. Based on the above-verified state action data and corresponding processing result labels, supervised learning training is implemented through a Transformer model, enabling the model to learn the temporal relationships and action dependency logic between complex handling step sequences. Finally, real-time state action fragments are input into the training convergence model, automatically generating real-time target handling step sequences that conform to the fault scenario, and expressing them in a structured way as executable emergency command decision suggestions, realizing rapid and standardized generation of emergency command suggestions for complex fault scenarios. Attached Figure Description
[0016] Figure 1 This is a flowchart of the steps in a power grid emergency command decision generation method based on knowledge engineering in this invention.
[0017] Figure 2 This is a flowchart of step S4 in this invention. Detailed Implementation
[0018] Please see Figures 1-2 As shown, this invention relates to a power grid emergency command decision generation method based on knowledge engineering, comprising the following steps: S1. Based on historical fault alarm timestamps, time alignment and noise suppression processing are performed on historical power grid fault types, image stream data, PMU measurement data and topology data to obtain multimodal data sequences. S2. Based on the multimodal data sequence, target detection is performed on the power grid equipment image frames and screen display information to obtain a perception event sequence containing equipment entity labels, indication status, reading changes, and personnel operations; based on the power grid equipment entity and fault type entity, entity alignment and semantic disambiguation processing are performed on the perception event sequence to obtain state action segments. S3. Based on the emergency response rule engine and security constraints, perform consistency verification and conflict resolution on the state action segments to obtain state action data for training. S4. Based on the state action data and corresponding processing result labels used for training as input, and the target disposal step sequence as output, supervised learning training is performed through the Transformer model to obtain the Transformer model that has completed training convergence. S5. Input the real-time state and action segments into the Transformer model that has completed training and convergence, generate a real-time target handling step sequence, and generate emergency command decisions based on the real-time target handling step sequence.
[0019] In some embodiments, firstly, in step S1, historical fault alarm records containing typical fault scenarios such as line faults, transformer overloads, bus undervoltage, and protection maloperation are retrieved from the historical scheduling data platform. The corresponding fault alarm timestamps are obtained, and concurrently, the main station image monitoring stream, PMU measurement data, and network topology data from the operation mode management system are retrieved. Based on the fault alarm timestamps, various data sources are aligned using these timestamps as the alignment benchmark. A global time registration algorithm is introduced to interpolate and align PMU measurement and alarm records from different sampling periods. For the image stream, optical flow is used for inter-frame motion estimation to interpolate missing frames. Simultaneously, the Laplacian Gaussian operator is used to suppress noise and enhance edges in the image frames. For the PMU measurement data, Kalman filtering is used to remove outliers and smooth trends. After the above processing, the image sequence, measurement sequence, and topology state are aligned on a unified time axis, resulting in a multimodal data sequence that fully reflects the fault evolution process and scheduling operation process. In step S2, for the multimodal data sequence obtained in step S1, the monitoring image frames and the screen display in the dispatch hall within the time window corresponding to each fault sample are jointly analyzed. Specifically, a target detection model constructed using a convolutional neural network is used to detect and classify equipment areas such as transformers, circuit breakers, disconnect switches, and busbar sections in the image frames, outputting equipment target boxes with equipment entity labels. At the same time, the operation diagram and parameter list displayed on the large screen are captured as screen display images, and optical character recognition algorithms are used to extract text readings such as current, voltage, active power, and reactive power, and color segmentation algorithms are used to identify the status of indicator lights such as red, yellow, and green. By performing temporal correlation on consecutive frames within the same time window, equipment entity labels, changes in indicator status, changes in measurement readings, and personnel operations identified by behavior recognition algorithms (such as hand gestures or HMI click operations corresponding to switch closing and opening) are uniformly organized into a time-ordered sequence of perception events. Subsequently, based on the pre-built power grid equipment ontology and fault type ontology, entity alignment and semantic disambiguation are performed on the equipment tags, alarm semantics, and operation semantics in the perceived event sequence. Equipment entities with aliases, abbreviations, or element IDs in the monitoring screen are uniformly mapped to standardized equipment nodes in the ontology, and alarm texts and indication statuses are uniformly categorized into standard fault types and status identifiers. On this basis, "equipment status at a certain moment + corresponding scheduling / maintenance action" is abstracted into state action fragments, forming {state, action, result tendency} information units arranged in chronological order. In step S3, based on the scheduling procedures and relay protection configuration, a rule base containing equipment interlocking rules, over-limit rules, and operating mode constraints is constructed. Condition matching is performed on each state action fragment to determine whether the current action violates the interlocking logic under a given equipment status and whether it may lead to power flow over-limit or topology islanding.For segments with potential conflicts, further verification is performed using the topology model execution graph structure, including connectivity checks, power flow direction and power balance checks on the device nodes involved in the action, and marking the specific conflict type. If the conflict can be corrected by adjusting the action sequence or by using preset constraint replacement rules, the unreasonable action in the segment is replaced with a safe equivalent action; for segments that cannot be corrected and have no reference value, they are removed from the training samples. After the above rule-driven screening and conflict resolution, the remaining state action data can be regarded as a high-quality training set that conforms to current safety procedures and can truly reflect effective handling logic. S4 treats each historical fault handling as a training sample, where the "fault scenario segment" consisting of fault type, initial state of key equipment, alarm combination, and early perception event is encoded as the input sequence of the model, and the complete handling steps after rule verification are combined to form the "target handling step sequence" as the output sequence of the model. The model input maps fault type, equipment state category, and action identifier to a vector space through an embedding layer, and preserves the sequential relationship between steps through positional encoding. This input is then fed into a Transformer encoder containing a multi-head self-attention mechanism to learn the temporal dependencies and global associations between states and local actions. At the decoding end, an offset version of the target disposal step sequence is fed as a teacher signal into the Transformer decoder. The decoder predicts the next disposal action segment at each decoding step through self-attention and encoder-decoder cross-attention structures. During training, the cross-entropy loss between the predicted sequence and the target disposal sequence is used as the optimization objective, and gradient descent is used to continuously update the model parameters until convergence on the validation set. Because the training data undergoes knowledge ontology mapping and rule filtering, the model actually learns a strategy pattern of "what action should be performed in what combination of steps under a specific power grid fault scenario," rather than a simple state-to-label classification. This differs from existing schemes that train fault classification models solely based on measurement data. In S5, the Transformer model that has completed training and convergence is deployed to an online scheduling auxiliary decision-making system. When a line fault or equipment malfunction occurs during real-time power grid operation, the system follows the same processing flow as steps S1 and S2. It performs time alignment and preprocessing on the real-time image stream, PMU measurement data, and topology data within the current time window. It then generates a real-time perception event sequence using target detection, OCR, and behavior recognition. Real-time state action segments are constructed through ontology mapping and semantic disambiguation. Subsequently, this real-time state action segment is encoded into a fault scenario sequence conforming to the model input format and input into the converged Transformer model. The model then generates a real-time target handling step sequence matching the current scenario.The system further integrates the semantic template library already built in this embodiment to transform the action tags output by the model into structured operation statements, generating emergency command text arranged in chronological order and containing device names, action types, and execution conditions, which is then presented to dispatchers as decision-making suggestions. If necessary, after further online security verification through the rule engine, some instructions can be transformed into automatically controllable commands, achieving a closed loop from multimodal state perception and knowledge semantic modeling to policy sequence generation.
[0020] Further, S1 includes the following steps: Based on historical fault alarm timestamps, inter-frame motion estimation is performed on historical image stream data using optical flow method, and PMU measurement data and topology data are time-aligned using global timestamp registration algorithm to obtain synchronous modal data. Based on synchronous modal data, the image frames are subjected to noise suppression and edge enhancement using the Laplacian Gaussian operator, and the PMU measurement data are subjected to outlier removal and trend smoothing using Kalman filtering to obtain the corrected multimodal sequence.
[0021] In some embodiments, the system first performs coarse-grained time slicing on the original image stream based on historical fault alarm timestamps, extracting the monitoring images within a few seconds before and after the fault into a continuous frame sequence. For this frame sequence, an inter-frame motion estimation operator is performed on adjacent frames using optical flow methods. For example, a dense optical flow model is used to solve for the displacement vector of each pixel at time t+1, thereby obtaining the inter-frame motion field distribution. Combining the optical flow vector changes of typical structures in the power grid equipment image (such as switchboards, indicator light areas, and display windows), slight camera jitter, frame loss, or timestamp jitter can be corrected: when the overall motion vector of adjacent frames is detected to be close to rigid body translation and inconsistent with the actual physical motion of the equipment, it is determined to be camera jitter, and the stable position of the equipment in the image coordinate system is restored through reverse translation compensation; when the optical flow field of some frames exhibits abnormal abrupt changes and does not match the alarm time axis, the system uses the optical flow information of the preceding and following frames to interpolate to generate missing frames or adjust the frame timestamps, achieving dual alignment of the image sequence in pixel space and time space, thereby forming an image stream time axis with higher synchronization accuracy. After completing inter-frame motion estimation of the image stream, the system performs time alignment processing on the PMU measurement data and topology data based on a global timestamp registration algorithm. Specifically, the fault alarm timestamp is used as a global reference time axis, and the synchronization phasor data of each PMU measurement point is resampled and interpolated to match the original sampling time. Mapping to a unified time grid Furthermore, the time registration results are optimized by minimizing the residuals at different measurement points under the constraints of the power flow equation, thereby avoiding the accumulation of small time discrepancies caused by relying solely on the device's local clock. For topology data, switch state change records and operating mode switching records are mapped sequentially onto the same global time axis to form synchronized modal data containing unified alignment of "image frame timestamp - PMU data timestamp - topology state timestamp," providing an accurate time reference for subsequent cross-modal feature combinations. After obtaining the synchronized modal data, targeted filtering algorithms are applied to correct the image frames and PMU measurement data. For image frames, the system uses the Gaussian Laplacian operator to perform spatial domain filtering on each frame, combining Gaussian smoothing with the Laplacian operator. On the one hand, the Gaussian kernel is used to blur and smooth the image to suppress random noise; on the other hand, the second derivative of the Laplacian is calculated on the smoothed image to enhance high-frequency structural information such as device edges and indicator light contours. This type of LoG (Laplacian of Gaussian) filter can eliminate noise and compress background texture interference in the monitoring screen while preserving key structural details. This allows subsequent convolutional neural networks to obtain clearer and more stable input feature maps when detecting device areas, recognizing entity labels, and resolving screen display status, avoiding edge blurring and detail loss caused by traditional simple mean filtering. For PMU measurement data, the system models the voltage amplitude, phase angle, current, and other quantitative measurements of each measurement point as a discrete-time state-space sequence, and uses Kalman filtering to remove outliers and smooth trends. Specifically, by constructing linear or weakly nonlinear state equations that include "real electrical quantity state" and "measurement noise," the original PMU sampled values are treated as observations. During the filtering process, a prediction-update iteration mechanism is used to recursively estimate the state vector and covariance matrix for each time step k. When the residual between the observed value and the predicted value exceeds a preset threshold, the sampling point is identified as an outlier, and its impact is weakened by adaptive adjustment of the Kalman gain, thereby effectively suppressing data anomalies caused by transient spikes, measurement jitter, and communication errors. After Kalman filtering, the PMU measurement data exhibits a continuous, smooth, and physically reasonable trend, which can significantly improve the accuracy of subsequent topology consistency verification, power flow direction checking, and state action segment construction.
[0022] Furthermore, the target detection based on the multimodal data sequence of the power grid equipment image frame and screen display information includes the following steps: Based on the multimodal data sequence, a convolutional neural network is used to perform equipment region detection and equipment entity label recognition on the power grid equipment image frames to obtain the initial equipment detection results; Based on the initial detection results of the device, the screen display information is processed by optical character recognition algorithm and indicator light color segmentation algorithm to extract text readings and extract indication status, resulting in data segments containing reading changes and indication status. Based on the device entity label and the data segment, image frames within the same time window are temporally correlated to obtain a sequence of perception events including device entity label, indication status, reading changes, and personnel operations.
[0023] Specifically, a device detection model based on a convolutional neural network is first constructed to achieve accurate localization of device areas and recognition of device entity labels. In practical applications, due to the complex structure of equipment in substations, variations in camera installation angles, and significant fluctuations in lighting conditions, traditional detection methods based on manual features are unreliable. This embodiment introduces a deep convolutional network structure and enhances the extraction capability of key equipment forms such as circuit breakers, disconnectors, busbars, and current transformers through multi-scale feature fusion and spatial attention mechanisms, ensuring stable robustness of device area detection even under complex conditions such as occlusion and tilted shooting. After completing device area detection, the system further combines a pre-trained device classification sub-network to map each detection area to the corresponding device entity label, achieving semantic recognition of device categories. This process effectively reduces classification ambiguity caused by differences in device appearance by constructing an "equipment type embedding vector" in the feature space. After obtaining the initial device detection results, it is necessary to simultaneously extract text readings and status indication information from the display area. In real-world scenarios, the display area may contain various heterogeneous display modes such as LCD screens, power meter screens, digital tubes, and indicator lights. Therefore, this embodiment employs two types of parsing algorithms executed in parallel: For text-based display content, an Optical Character Recognition (OCR) model is used to perform character segmentation, text candidate box regression, and multilingual character recognition in local areas. Simultaneously, an error correction mechanism based on string confidence ranking is established to improve recognition accuracy in scenarios with light reflection or partial occlusion. For indicator light-type display content, since their status is typically represented by color, on / off mode, or flashing frequency, the system uses an indicator state detection algorithm based on color space segmentation, combined with HSV color gamut and local binarization methods to distinguish action states such as red, green, and yellow lights, ultimately forming semantic data segments containing reading changes and indicator states. Subsequently, to improve the consistency of multimodal results, this embodiment sequentially associates device entity tags with the aforementioned data segments according to a unified time window. Because device actions often have strong temporal characteristics, such as "circuit breaker closing—current rising—indicator light changing from red to green," spatial detection alone cannot accurately describe the event logic. This embodiment constructs an event matching map within a time window, correlates the detection results of the same device entity in consecutive frames, and uses the Dynamic Time Warping (DTW) method to measure the time alignment between the reading change curve and the device action label, thereby generating a coherent multimodal event sequence. In this process, a personnel behavior recognition module is also integrated to identify key actions of on-site operators (such as lever pulling, button pressing, and patrolling) and uniformly map them to the perceived event sequence, enabling it to fully cover the event chain of device status changes, screen display changes, and personnel actions.
[0024] Furthermore, the entity alignment and semantic disambiguation processing of the perceived event sequence based on the power grid equipment ontology and the fault type ontology includes: Based on the power grid equipment ontology, a set of ontology nodes containing equipment categories, hierarchical relationships, and functional attributes is constructed, and a set of entities to be matched is generated based on the equipment entity tags extracted from the perception event sequence; Based on the set of entities to be matched, the ontology node set is mapped, including calculating the attribute similarity, structural proximity and functional matching degree of the device tag, and performing ontology node search and matching processing on each entity to be matched to obtain the aligned device entity; Based on the fault type ontology and the aligned device entity, semantic conflict detection is performed on the semantic tags of indication state and reading changes in the perceived event sequence to obtain the state action fragment after semantic disambiguation.
[0025] In some embodiments, a power grid equipment ontology is first constructed. Its node set includes not only basic attributes such as equipment name, category, and rated parameters, but also equipment hierarchical relationships, topological connection relationships, functional role attributes (such as bus nodes, circuit breaker nodes, and main transformer nodes), equipment type constraints, and semantic tags for operating modes. Compared to traditional mapping methods based solely on equipment name or topology number, the ontology carries richer structural and semantic information, thus providing high-dimensional feature support for entity matching at the algorithm level. After obtaining the perceived event sequence, the system generates a set of entities to be matched based on the equipment entity tags appearing in the event sequence (such as "220kV#1 circuit breaker" identified by image recognition, "main transformer high-voltage side current" detected by the screen display, and "switch closing" target equipment corresponding to personnel operation actions). Each entity in the set of entities to be matched contains at least multi-domain attributes such as image tag features, OCR text features, and indication status source features, enabling subsequent ontology mapping to perform accurate matching from a cross-modal perspective. Subsequently, a multi-factor ontology mapping algorithm integrating attribute similarity, structural proximity, and functional matching is used to match the target of the ontology node set. By performing weighted fusion on three types of indicators, this embodiment can maintain a high recognition accuracy in complex scenarios where equipment names are similar but their location relationships are inconsistent, or where equipment locations are close but their functions are different, thus significantly outperforming traditional technologies that rely on single feature matching. After the aligned equipment entities are determined, semantic conflict detection is further performed on the indication status and reading changes in the perceived events based on the fault type ontology. Specifically, by constructing mapping rules between fault mode attributes (such as "overcurrent triggers protection action", "low voltage triggers linkage trip", "main transformer gas abnormality triggers differential protection", etc.) contained in the fault type ontology and equipment status semantics, the system detects whether there are logical contradictions at the semantic level in the event sequence. For example, when a circuit breaker is identified as "indicator light is closed", but the image stream shows that the bus-side protection action has been triggered and the power flow direction is inconsistent with the closed state, the system automatically determines that the semantic label is conflicting. This embodiment constructs a semantic conflict detection operator, jointly constrains ontology knowledge and detection data, and realizes the identification and elimination of conflicting states.
[0026] Furthermore, the attribute similarity, structural proximity, and functional matching degree of the device tags are obtained by cosine similarity calculation.
[0027] Specifically, firstly, attribute vectors containing characteristics such as voltage level, equipment category, installation location, and operating function type are obtained based on equipment tag parsing. Then, a structural feature vector is constructed using the local adjacency structure of the power grid topology to reflect the local topological characteristics of the equipment in the electrical connection network. Simultaneously, functional feature vectors are extracted from the equipment's protection configuration, operating functions, and association with the fault type ontology to characterize its business semantic role in fault handling logic. For the above three types of features, this scheme uniformly uses cosine similarity for similarity measurement. By calculating the angle similarity between the feature vector of the entity to be matched and the feature vector of the ontology node, the degree of similarity between the two in terms of attributes, structure, and function is determined.
[0028] Further, S3 includes the following steps: Based on the emergency response rule engine, the state action segments are processed by rule condition matching. By matching the preset equipment interlocking rules, limit violation rules and operating mode constraints, a consistency detection result marking its legality is obtained. Based on the consistency detection results, graph structure verification processing is performed on the conflicting state action segments, including performing connectivity checks and power flow direction checks on the device nodes involved in the actions based on topological connection relationships, to obtain a set of conflict segments marked with conflict types. The action sequence is arranged according to the set of conflicting segments, and illegal actions are replaced by preset constraint replacement rules to obtain state action data for training.
[0029] In some embodiments, the legality of the action segment is first determined by a rule-condition matching module. This module has multiple pre-set rule sets, including device interlocking rules (used to constrain the interlocking relationship between devices before and after operation), limit-crossing rules (used to identify out-of-bounds situations of measurements such as current, voltage, and load), and operating mode constraint rules (used to constrain permitted operations under specific wiring methods). Based on the pattern matching algorithm and logical predicate parsing model, the device labels, action types, and changes in device states before and after the event in the state-action segment are compared item by item with the rule conditions to obtain preliminary consistency detection results marking its legality. However, the judgment based solely on rule matching cannot fully cover the impact of the power grid topology in actual operation. Therefore, the system further performs graph structure verification on state-action segments with potential conflicts. In this embodiment, the power grid topology graph is used as the basic structure to perform connectivity checks and power flow direction checks on the device nodes involved in the action. Connectivity checks compare the connectivity status of device nodes before and after an operation using depth-first search (DFS) or breadth-first search (BFS) to identify whether a critical power path has been cut off due to a certain action. Power flow direction checks use approximate power flow calculations based on node admittance matrices to determine whether the power flow direction may reverse, short-circuit loops may form, or bus partitioning may be abnormal after the operation. Through the above graph structure operations, a set of conflict segments is obtained, each segment is marked with its specific conflict type, such as topology chain breakage, power flow reversal, or limit violation risk. For the set of conflict segments, this embodiment performs action adjustments through preset constraint replacement rules. The constraint replacement rules are formed from historical handling experience and control procedures, and select the corresponding replacement expression according to the conflict type, such as replacing "directly close the standby transformer" with "first disconnect the low-voltage side of the main transformer and then close the standby transformer" to meet safety constraints; if the consistency condition still cannot be met after rule replacement, the system adopts a segment elimination strategy according to the severity of the conflict to remove the state action segment from the training data to ensure that the data entering the training phase fully complies with safety logic and operational constraints.
[0030] Further, S4 includes the following steps: Each state action segment in the state action data is sequence encoded, and the fault type, equipment state change and action label are constructed into a model in chronological order and input into the sequence. The model input sequence is fed into a Transformer encoder that includes a multi-head attention mechanism. Feature extraction processing is performed on the temporal dependencies between segments to obtain the encoded temporal feature representation. Based on the temporal feature representation, the target processing step sequence is input into the Transformer decoder, and a prediction segment sequence is generated through self-attention and cross-attention to obtain the prediction processing step sequence; Based on the predicted treatment step sequence and the corresponding target treatment step sequence, the error is calculated using the loss function and gradient descent is performed to update the model until the training converges.
[0031] In some embodiments, each state-action segment is first serialized and encoded. The fault type, equipment entity label, indication state change, measurement value offset magnitude, and corresponding action label contained in the segment are organized into a discretized model input sequence according to the order of event occurrence. During the encoding process, both equipment labels and fault categories are mapped to fixed-dimensional vector representations through a pre-constructed word vector embedding matrix. Simultaneously, a positional encoding mechanism is used to represent the temporal order of events within the segment, enabling the model to distinguish the sequential positions of different actions or state changes in the event chain. Subsequently, the constructed input sequence is fed into a Transformer encoder that incorporates a multi-head attention mechanism. The encoder establishes dependencies between state changes and action labels within the segment through self-attention computation, thereby extracting key interactive features that influence the fault handling logic. For example, when a state-action chain of "main transformer current continuously rising → differential protection action → tripping operation" appears in a training data segment, multi-head attention can capture the long-distance dependency between "current trend change" and "tripping operation," thus learning the causal relationship reflected in the safety handling process without manually defining features or setting handling rules. After encoding, the temporal feature representation output by the encoder is input into the Transformer decoder. The decoder learns the temporal relationships within the target handling steps through a self-attention mechanism and couples the state change features at the encoder end with the action prediction process at the decoder end through a cross-attention mechanism. This allows the model to generate corresponding action steps based on the current state sequence. For example, when the decoder predicts the action of "disconnecting the high-voltage side disconnector," the model can query the equipment state features at the encoder end through cross-attention to verify whether the action conforms to the current decrease trend, voltage fluctuation range, and safety constraint mode, thereby generating a logically consistent sequence of action segments. During the prediction process, the model outputs a sequence of predicted handling steps. Subsequently, based on the predicted sequence and the corresponding target handling step sequence, the prediction error is calculated using the cross-entropy loss function, and gradient updates are performed using the Adam optimizer. The parameter matrix of the Transformer is continuously adjusted until the loss converges. This training process enables the model to learn not only the sequential relationships between actions but also the semantic associations of different equipment state changes in complex power grid topologies. Thus, even when faced with undefined pre-defined combined faults or continuous action chains, it can still generate a logically consistent sequence of handling steps that meets safety constraints.
[0032] Furthermore, the loss function is the cross-entropy loss function.
[0033] Furthermore, the step of generating emergency command decisions based on the real-time target handling sequence includes: Based on the real-time target handling step sequence, semantic template matching is performed on the device action tags corresponding to each step to convert the action tags into structured operation statements. Based on the structured operation statements, an emergency command text containing equipment names, action instructions, and execution conditions is constructed in chronological order to obtain an emergency command decision.
[0034] In some embodiments, template matching is first performed on each action label in the real-time target handling step sequence based on a pre-built action semantic template library. The semantic template library is organized into a three-dimensional knowledge structure according to equipment category, action type, and action conditions. For example, "operation-object-constraint" templates are constructed for key equipment such as transformers, circuit breakers, isolating switches, and busbars, and corresponding semantic patterns are established for different action types such as "disconnect," "close," "activate / deactivate," and "load switching." When the model outputs an action label such as "Breaker_110kV_A open," the device identifier (Breaker_110kV_A), action opcode (open), and associated execution conditions of the label are parsed. During the template matching stage, the system maps the label to the "circuit breaker disconnection operation template" in the template library using a phrase matching structure based on a Trie tree or a matching mechanism based on vectorized semantic distance calculation. After mapping, the action label is converted into a structured operation statement by calling the parameterized sentence in the template, for example: "Perform a tripping operation on the 110kV A-section circuit breaker, and implement after confirming that the busbar voltage has dropped to 0kV." This structured statement not only retains the equipment name and action instructions, but also automatically embeds the safety preconditions upon which the actions depend. Furthermore, all matched structured operation statements are sorted according to the time sequence of the model output, and a unified format emergency command text is constructed based on the scheduling procedures. For example, when the predicted step sequence is: "Disconnect the main transformer high-voltage switch—Activate the standby transformer—Adjust the low-voltage side load distribution," the system converts the above steps into a continuous instruction text: "Step 1: Disconnect the main transformer #1 high-voltage side circuit breaker and confirm that the current drops to 0; Step 2: Close the standby transformer #2 high-voltage side circuit breaker and confirm that the tie bus voltage returns to normal; Step 3: Reallocate the low-voltage side feeder power according to the load monitoring data." The final generated emergency command text is structured, semantically clear, and has clearly defined execution conditions, and can be directly pushed to the scheduling workbench or mobile terminal.
[0035] This invention also includes a knowledge engineering-based power grid emergency command and decision generation system, applied to any of the aforementioned knowledge engineering-based power grid emergency command and decision generation methods, comprising: The data acquisition module is used to perform time alignment and noise suppression processing on historical power grid fault types, image stream data, PMU measurement data and topology data based on historical fault alarm timestamps to obtain multimodal data sequences. A state-action extraction model is used to perform target detection on the image frames and screen display information of power grid equipment based on the multimodal data sequence, and obtain a perception event sequence containing equipment entity labels, indication status, reading changes, and personnel operations; based on the power grid equipment ontology and fault type ontology, entity alignment and semantic disambiguation processing are performed on the perception event sequence to obtain state-action fragments; The training data generation module is used to perform consistency verification and conflict resolution on the state action segments according to the emergency response rule engine and security constraints to obtain state action data for training. The model training module is used to perform supervised learning training on the Transformer model, based on the state action data and corresponding processing result labels used for training as input and the target disposal step sequence as output, to obtain the Transformer model that has completed training convergence. The decision output module is used to input real-time state and action segments into the completed and converged Transformer model to generate a real-time target handling step sequence, and generate emergency command decisions based on the real-time target handling step sequence.
[0036] The above embodiments are merely descriptions of preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Various modifications and improvements made by those skilled in the art to the technical solutions of the present invention without departing from the spirit of the present invention should fall within the protection scope defined by the claims of the present invention.
Claims
1. A method for generating power grid emergency command decisions based on knowledge engineering, characterized in that, Includes the following steps: S1. Based on historical fault alarm timestamps, time alignment and noise suppression processing are performed on historical power grid fault types, image stream data, PMU measurement data and topology data to obtain multimodal data sequences. S2. Based on the multimodal data sequence, target detection is performed on the power grid equipment image frames and screen display information to obtain a perception event sequence containing equipment entity labels, indication status, reading changes, and personnel operations; based on the power grid equipment entity and fault type entity, entity alignment and semantic disambiguation processing are performed on the perception event sequence to obtain state action segments. S3. Based on the emergency response rule engine and security constraints, perform consistency verification and conflict resolution on the state action segments to obtain state action data for training. S4. Based on the state action data and corresponding processing result labels used for training as input, and the target disposal step sequence as output, supervised learning training is performed through the Transformer model to obtain the Transformer model that has completed training convergence. S5. Input the real-time state and action segments into the Transformer model that has completed training and convergence, generate a real-time target handling step sequence, and generate emergency command decisions based on the real-time target handling step sequence.
2. The power grid emergency command decision generation method based on knowledge engineering according to claim 1, characterized in that, S1 includes the following steps: Based on historical fault alarm timestamps, inter-frame motion estimation is performed on historical image stream data using optical flow method, and PMU measurement data and topology data are time-aligned using global timestamp registration algorithm to obtain synchronous modal data. Based on synchronous modal data, the image frames are subjected to noise suppression and edge enhancement using the Laplacian Gaussian operator, and the PMU measurement data are subjected to outlier removal and trend smoothing using Kalman filtering to obtain the corrected multimodal sequence.
3. The power grid emergency command decision generation method based on knowledge engineering according to claim 1, characterized in that, The target detection based on the multimodal data sequence and the image frames and display information of the power grid equipment includes the following steps: Based on the multimodal data sequence, a convolutional neural network is used to perform equipment region detection and equipment entity label recognition on the power grid equipment image frames to obtain the initial equipment detection results; Based on the initial detection results of the device, the screen display information is processed by optical character recognition algorithm and indicator light color segmentation algorithm to extract text readings and extract indication status, resulting in data segments containing reading changes and indication status. Based on the device entity label and the data segment, image frames within the same time window are temporally correlated to obtain a sequence of perception events including device entity label, indication status, reading changes, and personnel operations.
4. The power grid emergency command decision generation method based on knowledge engineering according to claim 1, characterized in that, The entity alignment and semantic disambiguation processing of the perceived event sequence based on the power grid equipment ontology and the fault type ontology includes: Based on the power grid equipment ontology, a set of ontology nodes containing equipment categories, hierarchical relationships, and functional attributes is constructed, and a set of entities to be matched is generated based on the equipment entity tags extracted from the perception event sequence; Based on the set of entities to be matched, the ontology node set is mapped, including calculating the attribute similarity, structural proximity and functional matching degree of the device tag, and performing ontology node search and matching processing on each entity to be matched to obtain the aligned device entity; Based on the fault type ontology and the aligned device entity, semantic conflict detection is performed on the semantic tags of indication state and reading changes in the perceived event sequence to obtain the state action fragment after semantic disambiguation.
5. The power grid emergency command decision generation method based on knowledge engineering according to claim 4, characterized in that, The attribute similarity, structural proximity, and functional matching degree of the device tags are calculated using cosine similarity.
6. The power grid emergency command decision generation method based on knowledge engineering according to claim 1, characterized in that, S3 includes the following steps: Based on the emergency response rule engine, the state action segments are processed by rule condition matching. By matching the preset equipment interlocking rules, limit violation rules and operating mode constraints, a consistency detection result marking its legality is obtained. Based on the consistency detection results, graph structure verification processing is performed on the conflicting state action segments, including performing connectivity checks and power flow direction checks on the device nodes involved in the actions based on topological connection relationships, to obtain a set of conflict segments marked with conflict types. The action sequence is arranged according to the set of conflicting segments, and illegal actions are replaced by preset constraint replacement rules to obtain state action data for training.
7. The power grid emergency command decision generation method based on knowledge engineering according to claim 1, characterized in that, S4 includes the following steps: Each state action segment in the state action data is sequence encoded, and the fault type, equipment state change and action label are constructed into a model in chronological order and input into the sequence. The model input sequence is fed into a Transformer encoder that includes a multi-head attention mechanism. Feature extraction processing is performed on the temporal dependencies between segments to obtain the encoded temporal feature representation. Based on the temporal feature representation, the target processing step sequence is input into the Transformer decoder, and a prediction segment sequence is generated through self-attention and cross-attention to obtain the prediction processing step sequence; Based on the predicted treatment step sequence and the corresponding target treatment step sequence, the error is calculated using the loss function and gradient descent is performed to update the model until the training converges.
8. The power grid emergency command decision generation method based on knowledge engineering according to claim 7, characterized in that, The loss function is the cross-entropy loss function.
9. The power grid emergency command decision generation method based on knowledge engineering according to claim 1, characterized in that, The process of generating emergency command decisions based on the real-time target handling step sequence includes: Based on the real-time target handling step sequence, semantic template matching is performed on the device action tags corresponding to each step to convert the action tags into structured operation statements. Based on the structured operation statements, an emergency command text containing equipment names, action instructions, and execution conditions is constructed in chronological order to obtain an emergency command decision.
10. A power grid emergency command decision generation system based on knowledge engineering, applied to the power grid emergency command decision generation method based on knowledge engineering as described in any one of claims 1-9, characterized in that, include: The data acquisition module is used to perform time alignment and noise suppression processing on historical power grid fault types, image stream data, PMU measurement data and topology data based on historical fault alarm timestamps to obtain multimodal data sequences. A state-action extraction model is used to perform target detection on the image frames and screen display information of power grid equipment based on the multimodal data sequence, and obtain a perception event sequence containing equipment entity labels, indication status, reading changes, and personnel operations; based on the power grid equipment ontology and fault type ontology, entity alignment and semantic disambiguation processing are performed on the perception event sequence to obtain state-action fragments; The training data generation module is used to perform consistency verification and conflict resolution on the state action segments according to the emergency response rule engine and security constraints to obtain state action data for training. The model training module is used to perform supervised learning training on the Transformer model, based on the state action data and corresponding processing result labels used for training as input and the target disposal step sequence as output, to obtain the Transformer model that has completed training convergence. The decision output module is used to input real-time state and action segments into the completed and converged Transformer model to generate a real-time target handling step sequence, and generate emergency command decisions based on the real-time target handling step sequence.