A dynamic knowledge graph-based relay protection defect diagnosis method and device

By using a dynamic knowledge graph method to collect and process multi-source heterogeneous data in real time, and combining entity extraction, relationship mining and probabilistic reasoning, the problem of data fragmentation and cross-scenario adaptation in relay protection defect diagnosis is solved, thereby improving the accuracy and efficiency of diagnosis and adapting to the complex environment of new power systems.

CN122064971BActive Publication Date: 2026-07-24WENZHOU ELECTRIC POWER BUREAU
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
WENZHOU ELECTRIC POWER BUREAU
Filing Date
2026-04-10
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Existing technologies for fault diagnosis in relay protection suffer from problems such as data fragmentation, low diagnostic efficiency, weak cross-scenario adaptability, strong subjectivity of diagnostic results, and failure to effectively integrate multi-source heterogeneous data, resulting in limited accuracy of diagnostic results and high operation and maintenance costs.

Method used

The method employs dynamic knowledge graphs to collect multi-source heterogeneous data in real time, extracts entities using the MacBERT-BiLSTM-CRF model, mines relationships using the GNN model, performs probabilistic reasoning using Bayesian networks, and evaluates the consistency of diagnostic results through grey relational analysis to generate a diagnostic report.

Benefits of technology

It improves the accuracy and scenario adaptability of relay protection defect diagnosis, realizes dynamic adaptation and deep diagnostic reasoning for new power systems, and reduces operation and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122064971B_ABST
    Figure CN122064971B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on dynamic knowledge graph's relay protection defect diagnosis method and device, belong to relay protection defect diagnosis field, the method is: real-time acquisition first data set in power system, and the first data set is standardized, generates second data set;Second data set is input to MacBERT-BiLSTM-CRF model and is extracted to entity, obtain multiple entities;According to second data set and each entity updates graph structure data, and graph structure data is input to GNN model and is mined to relationship, obtain multiple entity relations;According to each entity and each entity relation updates knowledge graph, based on knowledge graph and the real-time data of target relay protection device carries out rule reasoning, obtains first diagnostic result and is carried out probability reasoning by Bayes network, obtains second diagnostic result;Based on second diagnostic result and real-time data carries out grey correlation degree analysis, obtains consistency evaluation result, when consistency evaluation result is greater than first threshold value, generates and outputs diagnostic report.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of relay protection defect diagnosis, and in particular to a method and apparatus for relay protection defect diagnosis based on dynamic knowledge graph. Background Technology

[0002] Relay protection devices are the "first line of defense" for the safe and stable operation of power systems, and their operational reliability directly determines the timeliness of grid fault isolation and power supply stability. As new power systems evolve towards high-proportion renewable energy integration, power electronics, and dynamic topology, the operating environment of relay protection devices is becoming increasingly complex, and the types of defects are becoming more diverse and concealed. Typical examples include single-event failure of chip-based protection, implicit aging of secondary virtual circuits, and protection logic adaptation defects caused by renewable energy integration.

[0003] Traditional relay protection defect diagnosis relies on manual experience and offline analysis, which has three major pain points: First, defect data is fragmented, with maintenance records, setting sheets, and test reports mostly stored as unstructured text or scanned documents, lacking a unified semantic association and integration mechanism; second, diagnostic efficiency is low, relying excessively on the professional experience of maintenance personnel to match defects and fault root causes, making it difficult to cope with the need for rapid processing of massive defect data; third, cross-scenario adaptability is weak, failing to effectively associate defect evolution patterns across different equipment types and operating environments, and struggling to adapt to the dynamic operating characteristics of new power systems. To address these challenges, knowledge graph technology, with its powerful multi-source data integration and semantic association capabilities, has been gradually introduced into the field of relay protection defect diagnosis. This technology achieves semantic organization of defect data by structurally modeling defect-related entities (such as defect type, equipment model, and fault location) and relationships (such as "caused," "associated," and "triggered"), providing core data support for intelligent diagnosis. Currently, the application of knowledge graphs in the field of relay protection has become a research hotspot. Related technologies mostly focus on entity extraction, relation definition, and graph construction from defect texts. However, existing knowledge graph-based relay protection defect diagnosis technologies still have the following significant technical shortcomings: First, existing knowledge graphs are mostly static, built in a "one-time construction + manual update" model, making it difficult to automatically integrate newly added defect data. In new power systems, the types of relay protection defects are constantly increasing (such as single-event effect defects in chip-based protection or protection logic adaptation defects caused by new energy access). Maintenance records, setting sheets, and inspection reports are generated in real time, but existing technologies rely on maintenance personnel to manually label new entities and define new relationships, causing graph updates to lag significantly behind the actual defect evolution process and failing to cover new defect scenarios. Second, the diagnostic functions of existing technologies are mostly limited to simple "entity-relationship" association queries (such as querying common fault causes corresponding to a certain defect type), lacking a deep reasoning mechanism. Specifically: first, it cannot quantify the correlation probability between defects (such as the causal correlation strength between "poor secondary circuit contact" and "protection maloperation"); second, it lacks cross-device and cross-scenario reasoning capabilities (such as the inability to associate common defects in different substations and different types of protection devices); and third, the reasoning process does not incorporate real-time equipment operating status (such as secondary circuit monitoring data and ambient temperature), resulting in highly subjective and limited-accuracy diagnostic results. Third, existing technologies lack a closed-loop verification process for diagnostic results. The reasoned output of defect causes and handling suggestions lacks a mechanism for comparison and verification with on-site measured data. Existing auxiliary decision-making processes only provide suggestions based on graph association, without combining measured information such as secondary circuit optical power data or protection waveform data to correct reasoning biases. This leads to diagnostic results that may not match actual operating conditions, still requiring manual review, and failing to truly reduce operation and maintenance costs and improve diagnostic efficiency. Fourth, the knowledge graph data sources of existing technologies are relatively singular, mainly relying on defect text (such as operation and maintenance records or setting sheets), and failing to effectively integrate multi-source heterogeneous data from the relay protection system. Specifically, this includes: first, a lack of equipment status data (such as component aging degree or secondary circuit insulation status); second, a lack of integration of environmental impact data (such as temperature, humidity, or electromagnetic interference intensity); and third, neglect of dynamic data such as protection action waveforms and remote operation and maintenance messages, resulting in insufficient semantic association dimensions of the graph and limiting the comprehensiveness and accuracy of diagnostic reasoning. Summary of the Invention

[0004] This invention provides a method and apparatus for diagnosing relay protection defects based on dynamic knowledge graphs, which can improve the accuracy and scenario adaptability of relay protection defect diagnosis.

[0005] This invention provides a method for diagnosing relay protection defects based on dynamic knowledge graphs, including: A first dataset is collected in real time from the power system, and the first dataset is standardized to generate a second dataset; wherein, the first dataset includes: defect text data, equipment status data, environmental data, and dynamic operation data; The second dataset is input into a pre-trained MacBERT-BiLSTM-CRF model so that the MacBERT-BiLSTM-CRF model can extract entities based on the second dataset to obtain multiple entities; The pre-constructed graph structure data is updated based on the second dataset and each entity, and the updated graph structure data is input into the pre-trained GNN model so that the GNN model can perform relation mining based on the graph structure data to obtain multiple entity relations. The pre-built knowledge graph is updated according to each entity and the relationship between each entity. Rule reasoning is performed based on the updated knowledge graph and the real-time data of the target relay protection device to obtain a first diagnostic result. Based on the first diagnostic result, probabilistic reasoning is performed through a pre-built Bayesian network to obtain a second diagnostic result. Grey relational analysis is performed based on the second diagnostic result and real-time data to obtain a consistency evaluation result. When the consistency evaluation result is greater than a preset first threshold, a diagnostic report is generated and output based on the second diagnostic result.

[0006] This invention, through real-time acquisition and standardization of multi-source heterogeneous data, transforms raw data from different sources into a dataset with a unified standard. By employing the MacBERT-BiLSTM-CRF model for entity extraction, it provides new entity elements to the knowledge graph, enabling the knowledge graph to synchronize with the defect evolution process. By updating the graph structure data based on new entities and utilizing a GNN model for relation mining, it provides new relational elements to the knowledge graph, further synchronizing it with the defect evolution process. Through rule-based reasoning based on the updated knowledge graph, and further probabilistic reasoning using a Bayesian network, it integrates logical judgment and probabilistic evaluation, improving the accuracy of defect diagnosis results. By performing grey relational analysis based on defect diagnosis results and real-time data and setting a consistency threshold, it verifies the defect diagnosis results before output, further improving the accuracy of the final defect diagnosis results. Compared to the problems of existing technologies in dynamically adapting to new scenarios and deep diagnostic reasoning, this application can improve the accuracy and scenario adaptability of relay protection defect diagnosis.

[0007] Furthermore, the real-time acquisition of a first dataset from the power system, and the standardization of the first dataset to generate a second dataset, includes: Data preprocessing is performed on the defective text data to generate the first text dataset; Semantic similarity matching is performed on each text data in the first text dataset to generate a second text dataset; Data preprocessing is performed on equipment status data, environmental data, and dynamic operation data to generate the first structured dataset; Evidence combination rules are used to fuse the structured data in the first structured dataset to generate a second structured dataset; Based on timestamps and unique device identifiers, the second text dataset and the second structured dataset are associated and fused to generate a second dataset.

[0008] The embodiments of the present invention can achieve efficient integration of text and structured data by classifying and preprocessing multi-source heterogeneous data, semantic matching and evidence fusion, thereby enhancing the correlation strength of the dataset.

[0009] Further, the second dataset is input into a pre-trained MacBERT-BiLSTM-CRF model, so that the MacBERT-BiLSTM-CRF model performs entity extraction based on the second dataset to obtain multiple entities, including: The second dataset is encoded into a number sequence based on a pre-built domain dictionary, and the number sequence is then semantically encoded using the MacBERT module in the MacBERT-BiLSTM-CRF model to obtain a semantic feature vector. Temporal feature vectors are obtained by performing temporal dependency modeling on the semantic feature vectors using the BiLSTM module in the MacBERT-BiLSTM-CRF model. The temporal feature vector is sequence labeled and decoded using the CRF module in the MacBERT-BiLSTM-CRF model to output an entity label sequence. Multiple first entities are extracted from the second dataset based on the entity label sequence; Align each of the first entities with a pre-built standard terminology library in the field of relay protection to obtain multiple second entities; Each of the second entities is assigned a unique identifier and associated with the corresponding attribute information in the second dataset to obtain multiple entities.

[0010] The embodiments of the present invention use MacBERT for semantic encoding, BiLSTM for modeling temporal dependencies, CRF for decoding and annotation, and integrate domain dictionaries and terminology alignment, which can improve the accuracy of entity extraction.

[0011] Further, updating the pre-built graph structure data based on the second dataset and each of the entities includes: Each of the aforementioned entities is added as a new node to the graph structure data; Based on the second dataset, determine the association between each newly added node and the existing nodes in the graph structure data; Based on the aforementioned relationships, edges are established between the newly added node and the existing node to update the graph structure data.

[0012] The embodiments of the present invention dynamically add entities as nodes to the graph structure and establish associated edges, thereby enabling real-time expansion and structural updates of the knowledge graph.

[0013] Furthermore, the updated graph structure data is input into a pre-trained GNN model, enabling the GNN model to perform relation mining based on the graph structure data to obtain multiple entity relations, including: The neighborhood information of each node in the graph structure data is aggregated through the GCN layer in the GNN model to generate an updated node embedding vector. Based on the node embedding vectors, relationship prediction is performed on each pair of nodes in the graph structure data, and the relationship between each pair of nodes is output; wherein, each relationship corresponds to a prediction confidence level; The relationships are filtered based on a pre-built relation rule base in the field of relay protection, and the relationships with a prediction confidence greater than or equal to a preset second threshold are taken as entity relationships among all remaining relationships.

[0014] This invention uses GNN to aggregate neighborhood information for relationship prediction and filters based on a domain rule base and confidence level to uncover hidden entity relationships and improve the accuracy of relationship discovery.

[0015] Furthermore, the first diagnostic result obtained by performing rule-based reasoning based on the updated knowledge graph and real-time data of the target relay protection device includes: The target defect features are extracted from the real-time data, and the target defect features are matched with a predefined expert rule base for relay protection to select at least one association rule, forming a first association rule set; Multiple entity relationships related to the target relay protection device are extracted from the knowledge graph, and the first association rule set is filtered according to each entity relationship to obtain the second association rule set; The defect type and first confidence level corresponding to each association rule in the second association rule set are used as the first diagnostic result; wherein the first confidence level is determined according to the preset priority of each association rule in the expert rule base of the relay protection field.

[0016] This invention enables rule-based preliminary diagnosis and improves the logical consistency of diagnostic results by matching real-time defect features with an expert rule base and combining them with entity relationships in a knowledge graph for rule filtering and priority confidence calculation.

[0017] Furthermore, the step of obtaining a second diagnostic result based on the first diagnostic result through probabilistic reasoning using a pre-constructed Bayesian network includes: Using each defect type in the first diagnostic result as the target node, and the entity relationship corresponding to each defect type in the knowledge graph as the probabilistic dependency between nodes, the posterior probability of each defect type is calculated through the Bayesian network. The first confidence level corresponding to each defect type is updated according to the posterior probability to obtain multiple second confidence levels; Real-time data related to each of the defect types in the target relay protection device are acquired, and each of the second confidence levels is calibrated based on the real-time data to obtain multiple third confidence levels; Each of the third confidence levels is compared with a preset third threshold. The defect types corresponding to the third confidence levels that are less than the third threshold are removed. Based on the remaining defect types, the knowledge graph is traced back in reverse to construct multiple inference chains. The remaining defect types, along with their corresponding third confidence levels and inference chains, are used as the second diagnostic result.

[0018] The embodiments of the present invention use Bayesian networks for probabilistic reasoning, real-time data calibration, and inference chain construction, which can quantify the probability of occurrence of defect types and enhance the reliability of diagnostic results.

[0019] Further, the gray relational analysis based on the second diagnostic result and real-time data is performed to obtain a consistency assessment result. When the consistency assessment result is greater than a preset first threshold, a diagnostic report is generated and output based on the second diagnostic result, including: From the pre-built defect feature standard library, query the features corresponding to each defect type in the second diagnostic result, and generate multiple first feature vectors; Multiple second feature vectors are generated based on real-time data corresponding to each of the aforementioned defect types; Calculate the grey relational coefficient sequence between the first feature vector and the second feature vector corresponding to each of the aforementioned defect types; Each gray relation coefficient in each gray relation coefficient sequence is weighted and summed to obtain multiple comprehensive relation degrees, and the comprehensive relation degrees are used as the consistency evaluation results. If the consistency assessment result is greater than a preset first threshold, a diagnostic report is generated based on the defect type and reasoning chain corresponding to the consistency assessment result.

[0020] This invention uses grey relational analysis to compare diagnostic results with real-time data features, which can assess the consistency between diagnostic results and actual working conditions and improve the accuracy of output reports.

[0021] Furthermore, after generating and outputting a diagnostic report based on the second diagnostic result when the consistency assessment result is greater than a preset first threshold, the method further includes: When the consistency evaluation result is less than or equal to the first threshold, the inference parameters are adjusted and rule inference and probabilistic inference are performed again.

[0022] The embodiments of the present invention can achieve closed-loop optimization and adaptive correction of the diagnostic process by adjusting the inference parameters and re-inferring when the consistency threshold is not met.

[0023] Another embodiment of the present invention provides a relay protection defect diagnosis device based on dynamic knowledge graph, including: a data acquisition module, an entity extraction module, a relationship mining module, a diagnostic reasoning module, and a result output module; The data acquisition module is used to acquire a first dataset from the power system in real time and to standardize the first dataset to generate a second dataset; wherein, the first dataset includes: defect text data, equipment status data, environmental data, and dynamic operation data; The entity extraction module is used to input the second dataset into the pre-trained MacBERT-BiLSTM-CRF model, so that the MacBERT-BiLSTM-CRF model can extract entities based on the second dataset to obtain multiple entities; The relationship mining module is used to update the pre-constructed graph structure data according to the second dataset and each entity, and input the updated graph structure data into the pre-trained GNN model so that the GNN model can perform relationship mining based on the graph structure data to obtain multiple entity relationships; The diagnostic reasoning module is used to update the pre-built knowledge graph according to each entity and the relationship between each entity, perform rule reasoning based on the updated knowledge graph and the real-time data of the target relay protection device to obtain a first diagnostic result, and perform probabilistic reasoning through a pre-built Bayesian network based on the first diagnostic result to obtain a second diagnostic result. The result output module is used to perform grey relational analysis based on the second diagnostic result and real-time data to obtain a consistency evaluation result. When the consistency evaluation result is greater than a preset first threshold, a diagnostic report is generated and output based on the second diagnostic result. Attached Figure Description

[0024] Figure 1 This is a flowchart illustrating an embodiment of the relay protection defect diagnosis method based on dynamic knowledge graph provided by the present invention. Figure 2 A flowchart illustrating an embodiment of the knowledge graph dynamic update method provided by the present invention; Figure 3 This is a flowchart illustrating another embodiment of the relay protection defect diagnosis method based on dynamic knowledge graph provided by the present invention. Figure 4 This is a schematic diagram of the structure of an embodiment of the relay protection defect diagnosis system based on dynamic knowledge graph provided by the present invention; Figure 5 This is a schematic diagram of another embodiment of the relay protection defect diagnosis system based on dynamic knowledge graph provided by the present invention. Figure 6 This is a schematic diagram of the structure of an embodiment of the relay protection defect diagnosis device based on dynamic knowledge graph provided by the present invention. Detailed Implementation

[0025] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0026] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.

[0027] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.

[0028] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0029] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.

[0030] In the description of the embodiments of this application, the term "multiple" refers to two or more (including two), similarly, "multiple sets" refers to two or more (including two sets), and "multiple pieces" refers to two or more (including two pieces).

[0031] See Figure 1 To address the problems of existing technologies in dynamically adapting to new scenarios and in deep diagnostic reasoning, an embodiment of the present invention provides a relay protection defect diagnosis method based on dynamic knowledge graphs, including steps S101 to S105: Step S101: Collect the first dataset from the power system in real time, and standardize the first dataset to generate the second dataset; wherein, the first dataset includes: defect text data, equipment status data, environmental data and dynamic operation data.

[0032] It should be noted that the real-time acquisition of the first dataset from the power system and the standardization of the first dataset to generate the second dataset refers to the simultaneous acquisition of defect text data (such as operation and maintenance records, setting sheets, test reports, and fault analysis documents), equipment status data (such as the aging degree of relay protection device components, secondary circuit insulation resistance, optical power, and circuit resistance), environmental data (such as temperature, humidity, electromagnetic interference intensity, and dust concentration in substations), and dynamic operation data (such as protection action waveform data, remote operation and maintenance messages, and new energy access power fluctuation data). Furthermore, operations such as format unification, missing value imputation, outlier correction, and dimensional normalization are performed on the above multi-source heterogeneous data to form a standardized data set with consistent structure and time sequence alignment.

[0033] Preferably, the real-time acquisition of a first dataset from the power system, and the standardization of the first dataset to generate a second dataset, includes: Data preprocessing is performed on the defective text data to generate the first text dataset; Semantic similarity matching is performed on each text data in the first text dataset to generate a second text dataset; Data preprocessing is performed on equipment status data, environmental data, and dynamic operation data to generate the first structured dataset; Evidence combination rules are used to fuse the structured data in the first structured dataset to generate a second structured dataset; Based on timestamps and unique device identifiers, the second text dataset and the second structured dataset are associated and fused to generate a second dataset.

[0034] In one embodiment, defective text data can be collected using a combination of Optical Character Recognition (OCR) and manual data entry. For paper documents or scanned copies, text can be automatically extracted using an OCR recognition module deployed on the substation's operation and maintenance terminal. For electronic documents, they can be directly read through a file parsing interface, supporting multiple formats such as PDF, Word, and TXT.

[0035] In one embodiment, device status data can be acquired in real time using sensors deployed on the relay protection device and secondary circuit. Specifically, the insulation resistance of the secondary circuit is acquired using an insulation resistance sensor, the optical power using an optical power sensor, and the circuit resistance using a high-precision resistance sensor. The acquisition frequency is once per minute, and data transmission uses the Bluetooth Low Energy (BLE) protocol to ensure that the acquisition process does not affect the normal operation of the device.

[0036] In one embodiment, environmental data can be collected through existing environmental monitoring terminals within the substation, with the addition of an electromagnetic interference intensity acquisition module (e.g., using an electromagnetic induction sensor with a measurement range of 10Hz-1GHz and a measurement accuracy of...). The data is accessed through an industrial Ethernet network.

[0037] In one embodiment, dynamic operation data can be obtained through the interface of the relay protection information management substation, which can acquire protection action recording data and remote operation and maintenance messages. It can also acquire photovoltaic or wind power fluctuation data through the interface of the new energy power station monitoring system. The data acquisition frequency is 100Hz to ensure that the dynamic characteristics of the fault moment are captured.

[0038] In one embodiment, data preprocessing of defective text data may include: removing invalid characters (such as special symbols or garbled characters) and filtering duplicate text using regular expression matching; mapping terms based on a dictionary in the field of relay protection to unify professional terms (such as unifying "CT" as "current transformer" and "PT" as "voltage transformer"); segmenting words using the jieba word segmentation tool and extracting text features through the bag-of-words (BoW) model to generate structured text data.

[0039] In one embodiment, data preprocessing of device status data, environmental data, and dynamic operation data may include: employing... The criteria identify abnormal data (such as sudden values ​​caused by sensor failures), remove them, and then supplement the missing data through linear interpolation; min-max normalization is used to map data of different dimensions to the [0,1] interval; based on the timestamp, data from different acquisition frequencies are uniformly aligned to 100Hz to ensure data time sequence consistency.

[0040] In one embodiment, the preprocessed text data is merged by semantic similarity matching; the preprocessed structured data is fused by improved evidence combination rules, and the data conflict problem is solved by assigning weights to different sensor data (determined based on sensor accuracy, with higher accuracy resulting in greater weights).

[0041] In one embodiment, the preprocessed text data and structured data are associated with the unique device identifier (such as device number) based on the timestamp, forming a multi-dimensional data association table of "device-time-state-environment-defect text". For example, the insulation resistance data of "No. 2 main transformer protection device" at "2025-06-10 14:30", the ambient temperature data at that time, and the corresponding operation and maintenance record text data are associated.

[0042] Step S102: Input the second dataset into the pre-trained MacBERT-BiLSTM-CRF model so that the MacBERT-BiLSTM-CRF model can extract entities based on the second dataset to obtain multiple entities.

[0043] It should be noted that inputting the second dataset into the pre-trained MacBERT-BiLSTM-CRF model, so that the MacBERT-BiLSTM-CRF model can extract entities based on the second dataset and obtain multiple entities, means that the pre-trained "masked language model-bidirectional long short-term memory network-conditional random field" (MacBERT-BiLSTM-CRF) fusion model is used to identify and extract entity objects that conform to the semantic definition of the relay protection field from the standardized second dataset. Among them, the MacBERT module is responsible for understanding the deep semantics of the text, the BiLSTM module captures the contextual temporal dependencies, and the CRF module optimizes the global consistency between entity boundaries and label sequences, and finally outputs a structured set of entities.

[0044] Preferably, the second dataset is input into a pre-trained MacBERT-BiLSTM-CRF model so that the MacBERT-BiLSTM-CRF model extracts entities based on the second dataset to obtain multiple entities, including: The second dataset is encoded into a number sequence based on a pre-built domain dictionary, and the number sequence is then semantically encoded using the MacBERT module in the MacBERT-BiLSTM-CRF model to obtain a semantic feature vector. Temporal feature vectors are obtained by performing temporal dependency modeling on the semantic feature vectors using the BiLSTM module in the MacBERT-BiLSTM-CRF model. The temporal feature vector is sequence labeled and decoded using the CRF module in the MacBERT-BiLSTM-CRF model to output an entity label sequence. Multiple first entities are extracted from the second dataset based on the entity label sequence; Align each of the first entities with a pre-built standard terminology library in the field of relay protection to obtain multiple second entities; Each of the second entities is assigned a unique identifier and associated with the corresponding attribute information in the second dataset to obtain multiple entities.

[0045] In one embodiment, the sample set construction process of the MacBERT-BiLSTM-CRF model is as follows: the training set, validation set, and test set are divided in a 7:2:1 ratio to ensure coverage of core entity types such as line protection devices and optical power attenuation; a dictionary containing 5000+ core terms (including "line protection device", "optical power attenuation", and "ambient temperature") is constructed based on a terminology database for relay protection; manual annotation is performed using the BIO annotation system, with rules including B-DEFECT (defect entity start), I-DEFECT (defect entity middle), B-EQUIP (equipment entity start), I-EQUIP (equipment entity middle), B-ENV (environment entity start), and O (non-entity). Example The annotation reads: "The No. 3 [B-EQUIP] line [I-EQUIP] protection device [I-EQUIP] is experiencing [B-DEFECT] optical power [I-DEFECT] attenuation [I-DEFECT], the on-site [B-ENV] ambient [I-ENV] temperature [I-ENV] is 28℃ [O], and the maintenance record shows that the equipment [I-EQUIP] has been in operation for 5 years [O]". The BIO tags are converted into digital codes (B-DEFECT=1, I-DEFECT=2, B-EQUIP=3, I-EQUIP=4, B-ENV=5 and O=0), and a tag mapping table is generated.

[0046] In one embodiment, the training process of the MacBERT-BiLSTM-CRF model is as follows: Initialize the MacBERT-base model (freeze the first 6 layers, fine-tune the last 6 layers, input sequence length 128), 2-layer bidirectional LSTM (hidden layer dimension 256, dropout rate 0.3) and CRF module; set the batch size to 32, the number of iterations to 100, and the initial learning rate to 0.001 (Adam optimizer, decaying to 0.8 every 20 rounds), and train with the joint loss function of cross-entropy + CRF. The CRF layer is specifically designed to learn entity boundary constraints (such as B-EQUIP followed only by I-EQUIP or O, to avoid entity boundary confusion); in each round, the accuracy, recall and F1 score are evaluated using the validation set. If the F1 score is stable above 96% for 10 consecutive rounds, an early stopping mechanism is triggered to retain the optimal parameters to prevent overfitting and ensure that the model can accurately identify various entities in the examples.

[0047] In one embodiment, the text input to the MacBERT-BiLSTM-CRF model is "Optical power attenuation of line protection device No. 4, ambient temperature 30℃, equipment operating years 4 years". The entity extraction process is as follows: the text is encoded into a numerical sequence according to the domain dictionary (padded with zeros if less than 128 characters, truncated if more than 128 characters). After inputting into the model, the MacBERT module captures the deep semantic association between "optical power attenuation" and "line protection device", the BiLSTM module captures the temporal dependency relationship between the equipment name and the defect name, and the CRF module outputs the optimal label sequence. The label sequence is parsed to extract entity fragments. For entities with fuzzy boundaries (such as "optical power attenuation" being mistakenly divided into two fragments), they are merged into complete entities by calculating character semantic similarity (similarity ≥ 92%) to generate the original entity set. Examples: ("Line protection device No. 4", EQUIP, index 0-7), ("optical power attenuation", DEFECT, index 9-14), ("ambient temperature", ENV, index 16-18).

[0048] Furthermore, the Levenshtein distance algorithm is used to match the original entity set with the standard terminology library in the field of relay protection (alignment is defined as similarity ≥ 90%), such as aligning "optical power attenuation" to the standard term "optical power attenuation fault". Duplicate entities in the same text are merged and their occurrence count is recorded. A unique ID is assigned to each entity (format: type abbreviation-serial number), and attribute information (such as equipment operating years or ambient temperature value) in the second dataset is associated to form a standardized entity set. Examples: ("Line Protection Device No. 4", EQUIP, EQUIP-003, attributes: operating years 4 years, installation location No. 1 substation), ("Optical Power Attenuation Fault", DEFECT, DEFECT-013, attributes: occurrence time 2025-06-15 14:20), ("Ambient Temperature", ENV, ENV-004, attributes: value 30℃).

[0049] Step S103: Update the pre-constructed graph structure data according to the second dataset and each entity, and input the updated graph structure data into the pre-trained GNN model so that the GNN model can perform relation mining based on the graph structure data to obtain multiple entity relations.

[0050] It should be noted that updating the pre-built graph structure data according to the second dataset and each entity means: adding multiple entities obtained in the entity extraction step as new nodes to the pre-built graph structure data, and establishing semantic associations or temporal causal relationships between these new nodes and existing nodes in the graph structure based on the temporal sequence, device identification and status information contained in the second dataset, thereby dynamically expanding and correcting the topology and attributes of the graph structure to form a basic graph representation of the knowledge graph that reflects the latest data status.

[0051] Preferably, updating the pre-built graph structure data based on the second dataset and each of the entities includes: Each of the aforementioned entities is added as a new node to the graph structure data; Based on the second dataset, determine the association between each newly added node and the existing nodes in the graph structure data; Based on the aforementioned relationships, edges are established between the newly added node and the existing node to update the graph structure data.

[0052] In one embodiment, let the standardized entities used to construct the graph structure data be EQUIP-003, DEFECT-013, and ENV-004. The construction process of the graph structure data is as follows: Standardized entities are used as graph nodes, and associated with core attributes (EQUIP-003: Type = Line Protection Device, Service Life = 4 years; DEFECT-013: Severity Level = General); An undirected edge is established based on the co-occurrence relationship (EQUIP-003 and DEFECT-013 belong to the same maintenance record), with the edge attribute "Co-occurrence Count = 1"; Based on data correlation (… A directed edge is established with a correlation coefficient of 0.73 (≥0.7) between ambient temperature 30℃ and optical power attenuation. The edge attribute "correlation coefficient = 0.73" is used to normalize the edge attribute to the [0,1] interval to unify the data scale. The final graph structure data includes a node set, an initial edge set, and node / edge attributes. The node set is {EQUIP-003, DEFECT-013, ENV-004}, and the initial edge set is {(EQUIP-003, DEFECT-013), (ENV-004, DEFECT-013)}.

[0053] It should be noted that inputting the updated graph structure data into a pre-trained GNN model, so that the GNN model can perform relation mining based on the graph structure data to obtain multiple entity relations, means: using a trained graph neural network (GNN) to perform feature learning and relation reasoning on graph structure data containing newly added entity nodes and updated associated edges; the model updates the embedding representation of each node through multiple rounds of neighborhood information aggregation, so that it integrates local graph structure information and node attributes, and then performs relation classification prediction based on the embedding vectors of node pairs to identify potential semantic associations, causal dependencies or temporal influence relationships between entities; finally, it outputs a set of entity relations with confidence scores.

[0054] Preferably, the updated graph structure data is input into a pre-trained GNN model so that the GNN model performs relation mining based on the graph structure data to obtain multiple entity relations, including: The neighborhood information of each node in the graph structure data is aggregated through the GCN layer in the GNN model to generate an updated node embedding vector. Based on the node embedding vectors, relationship prediction is performed on each pair of nodes in the graph structure data, and the relationship between each pair of nodes is output; wherein, each relationship corresponds to a prediction confidence level; The relationships are filtered based on a pre-built relation rule base in the field of relay protection, and the relationships with a prediction confidence greater than or equal to a preset second threshold are taken as entity relationships among all remaining relationships.

[0055] In one embodiment, the training process of the GNN model is as follows: Initialize a 3-layer GCN (output dimension 128 / 64 / 32, ReLU activation function, dropout rate 0.2); divide the training set and validation sample set into an 8:2 ratio, control the positive and negative sample ratio to 1:1 to avoid model bias; aggregate node features through the neighborhood of the GCN layer (such as the feature fusion of EQUIP-003 and attribute information of DEFECT-013 to strengthen entity association features); train the model with cross-entropy loss function and Adam optimizer (learning rate 0.0005, batch size 64), and introduce rules from the relay protection field (such as "line protection devices and optical power attenuation should first establish an 'existence' relationship, and ambient temperature and optical power attenuation can establish an 'influence' relationship") as regularization terms to constrain the training direction of the model and retain the parameters with the highest accuracy on the validation set.

[0056] In one embodiment, let the newly added entity be ENV-005 "Ambient humidity 65%". The relationship mining process is as follows: add the newly added entity ENV-005 to the graph structure data, re-aggregate the node features of the entire graph through the GCN layer, and update the node embedding vector; input the candidate pairs of the newly added entity and existing entities (such as ENV-005 and DEFECT-013, ENV-005 and EQUIP-003) into the GNN model to obtain the relationship type probability distribution; select the relationship type with the highest probability, assign a confidence score to the probability value, and output the structured original relationship. Examples: (EQUIP-003, Existence, DEFECT-013, 0.93), (ENV-004, Influence, DEFECT-013, 0.88), (ENV-005, Influence, DEFECT-013, 0.65).

[0057] Furthermore, based on the relationship rule base in the relay protection field, illegal relationships are filtered out, and relationships with a confidence level ≥ 0.7 are retained. Relationships with a confidence level of 0.65 are marked as "pending review". Relationships pending review are pushed to the operation and maintenance personnel interface for manual verification (if it is confirmed that 65% humidity exacerbates optical power attenuation, they are added to the high-quality relationship set; otherwise, they are stored in the blacklist and will not be mined for similar relationships in the future). Finally, a high-quality relationship set that can be used for graph updates is formed, with a mining accuracy rate ≥ 92%.

[0058] In summary, the complete dynamic update process of a knowledge graph is as follows: Figure 2 As shown in the diagram, the pre-built knowledge graph defines three core entities (defect entities, equipment entities, and environment entities), two core relationships (association relationships: such as "equipment-existence-defect"; causal relationships: such as "defect-cause-failure phenomenon"), and entity attributes (e.g., defect entity attributes include defect type, occurrence time, and severity level; equipment entity attributes include equipment model, years of operation, and installation location). A graph database (Neo4j) is used to store the knowledge graph data. Graph databases have efficient association query capabilities, which can quickly support subsequent diagnostic reasoning. A data backup mechanism is also established, using a distributed storage architecture to ensure data security. Newly extracted entities and newly mined relationships are automatically written into the graph database, completing the initial graph update. Simultaneously, a manual review process is triggered. Maintenance personnel view the newly added knowledge through the system interface, and after confirming its accuracy, complete the final update. If errors are found, the update can be rejected and corrected to ensure the accuracy of the graph.

[0059] Step S104: Update the pre-built knowledge graph according to each entity and the relationship between each entity, perform rule reasoning based on the updated knowledge graph and the real-time data of the target relay protection device to obtain a first diagnostic result, and perform probabilistic reasoning through a pre-built Bayesian network based on the first diagnostic result to obtain a second diagnostic result.

[0060] It should be noted that the rule-based reasoning based on the updated knowledge graph and the real-time data of the target relay protection device to obtain the first diagnostic result means: extracting key defect features from the real-time operation data of the target relay protection device, matching them with entities, relationships and attributes stored in the updated knowledge graph, and calling the predefined expert rule base for relay protection to filter out fault association rules that match the current features through logical inference; on this basis, combining the semantic relationships between entities in the knowledge graph to verify and prioritize the candidate rules, and finally generating a preliminary diagnostic conclusion set containing several candidate defect types and their corresponding confidence levels.

[0061] Preferably, the step of performing rule-based reasoning based on the updated knowledge graph and real-time data of the target relay protection device to obtain the first diagnostic result includes: The target defect features are extracted from the real-time data, and the target defect features are matched with a predefined expert rule base for relay protection to select at least one association rule, forming a first association rule set; Multiple entity relationships related to the target relay protection device are extracted from the knowledge graph, and the first association rule set is filtered according to each entity relationship to obtain the second association rule set; The defect type and first confidence level corresponding to each association rule in the second association rule set are used as the first diagnostic result; wherein the first confidence level is determined according to the preset priority of each association rule in the expert rule base of the relay protection field.

[0062] In one embodiment, a structured graph data of the knowledge graph includes: EQUIP-002 "Line 3 protection device", DEFECT-012 "Optical power attenuation fault", ENV-003 "Ambient temperature" and the associated relationships: EQUIP-002-existence-DEFECT-012, ENV-003-influence-DEFECT-012; the real-time data of the target relay protection device (Line 3 protection device) includes: optical power 1.2dBm (standard value 1.5-2.0dBm) and ambient temperature 28°C. The preparation process for inference data is as follows: Extract the core attributes of the entities (EQUIP-002: 5 years of operation, installation location: Substation No. 1; DEFECT-012: moderate severity level), convert the relationship type into inference identifiers (existence = 01, impact = 02), and generate a 3×3 node-relationship feature matrix; decompose the expert rules into "fault characteristics - investigation direction" key-value pairs (such as "abnormal optical power + normal temperature → prioritize investigation of secondary circuit contact failure and optical power sensor failure"), and establish a hash index to improve matching efficiency; based on the fault occurrence time, extract the time series data of 5 minutes before and after, and only retain core parameters such as optical power and temperature; summarize the typical characteristics of optical power attenuation from historical data (secondary circuit contact failure corresponds to optical power fluctuation > 3dB, sensor failure corresponds to stable low optical power), and build a feature library for quantitative inference.

[0063] Furthermore, the target defect characteristics of the No. 3 line protection device are optical power of 1.2dBm (abnormal) and ambient temperature of 28℃ (normal, standard range 15-35℃). By matching the target defect characteristics with the expert rule base index in the relay protection field, two association rules were selected (Rule 1: Abnormal optical power + normal temperature → poor secondary circuit contact, high priority; Rule 2: Stable low optical power → optical power sensor failure, medium priority). The entity association relationship was confirmed by combining the map data, and the correlation between the candidate defects and the equipment was verified (the secondary circuit entity exists in the map of the No. 3 line protection device, and the sensor failure is temporarily reserved for subsequent quantitative verification). An initial confidence level was assigned according to the rule priority, with 0.8 for the core rule and 0.7 for the secondary rule, generating the result set: {poor secondary circuit contact (confidence level 0.8, rule 1), optical power sensor failure (confidence level 0.7, rule 2)}.

[0064] It should be noted that, based on the first diagnostic result, the second diagnostic result is obtained by probabilistic reasoning through a pre-constructed Bayesian network. This means that each candidate defect type in the first diagnostic result is used as the input of the core node in the Bayesian network. Combined with the conditional probability distribution in the network that has been trained based on historical data, the posterior probability of each defect type under the given real-time data and graph association is calculated. The probability is further calibrated by integrating the real-time monitoring data of the target device, and low-confidence hypotheses are filtered according to the probability threshold. Finally, a set of in-depth diagnostic results with quantified probability weights and traceable reasoning paths is output.

[0065] Preferably, the step of obtaining a second diagnostic result based on the first diagnostic result through probabilistic reasoning using a pre-constructed Bayesian network includes: Using each defect type in the first diagnostic result as the target node, and the entity relationship corresponding to each defect type in the knowledge graph as the probabilistic dependency between nodes, the posterior probability of each defect type is calculated through the Bayesian network. The first confidence level corresponding to each defect type is updated according to the posterior probability to obtain multiple second confidence levels; Real-time data related to each of the defect types in the target relay protection device are acquired, and each of the second confidence levels is calibrated based on the real-time data to obtain multiple third confidence levels; Each of the third confidence levels is compared with a preset third threshold. The defect types corresponding to the third confidence levels that are less than the third threshold are removed. Based on the remaining defect types, the knowledge graph is traced back in reverse to construct multiple inference chains. The remaining defect types, along with their corresponding third confidence levels and inference chains, are used as the second diagnostic result.

[0066] In one embodiment, each defect type in the first diagnostic result is used as the core node, and auxiliary nodes such as the equipment's operating years, optical power value, and temperature are associated. The relationship "operating years ≥ 5 years → poor secondary circuit contact" in the knowledge graph is used as the probabilistic dependency between nodes. Conditional probabilities are calculated based on historical datasets. For example, the probability of poor secondary circuit contact is 72% when the operating years are 5 years, the probability of sensor failure is 65% when the optical power is 1.2dBm, and the probability of failure is 90% when the temperature is 28℃. Real-time data is substituted into Bayes' theorem. Calculate and update the confidence level. Example: Update the confidence level for poor secondary circuit contact to... The confidence level for optical power sensor failure has been updated to... .

[0067] Furthermore, the insulation resistance data of the secondary circuit of the No. 3 line protection device was supplemented (1.8MΩ, slightly lower than the standard value of 2MΩ). Since the correlation between insulation resistance and poor contact is 0.86, the confidence level for poor contact in the secondary circuit was calibrated to 0.91. Candidate defects with a confidence level <0.7 were eliminated (optical power sensor failure, 0.54, was eliminated), retaining only the core defects. Specifically, fault records of similar equipment in the same substation can be queried using a knowledge graph, adding cross-scenario support weight for poor contact in the secondary circuit. Simultaneously, based on cross-scenario data inference, a warning message is output: "It is recommended to investigate the secondary circuit of the same type of line protection device in Substation No. 1."

[0068] Furthermore, based on the causal relationships of the knowledge graph, the defect evolution path is traced backward, and the process is completed by combining real-time and historical data to form an example chain: "5 years of operation of the No. 3 line protection device (equipment attribute) → 1.8MΩ decrease in secondary circuit insulation resistance (real-time data) → poor secondary circuit contact (core defect) → abnormal attenuation of optical power by 1.2dBm (fault phenomenon), with no significant impact from an ambient temperature of 28℃ (environmental data)". By comparing with historical data, the logical consistency of "long operating years → decreased insulation resistance → poor contact" is verified (historical matching rate 88%). Secondary circuit resistance data (0.1Ω, normal) is added to eliminate other interfering factors and ensure that the chain is unbroken. The corresponding data sources (knowledge graph, real-time data, or historical data) for each link are labeled to improve traceability.

[0069] Step S105: Perform grey relational analysis based on the second diagnostic result and real-time data to obtain a consistency evaluation result. When the consistency evaluation result is greater than a preset first threshold, generate and output a diagnostic report based on the second diagnostic result.

[0070] It should be noted that, based on the second diagnostic result and real-time data, grey relational analysis is performed to obtain a consistency assessment result. When the consistency assessment result is greater than a preset first threshold, generating and outputting a diagnostic report based on the second diagnostic result means: performing grey relational analysis on the standard feature vectors corresponding to each defect type in the second diagnostic result and the actual feature vectors extracted from the real-time data of the target device, and obtaining the comprehensive correlation degree through the weighted summation of the correlation coefficient sequence, which serves as a quantitative indicator to measure the consistency between the diagnostic result and the actual working conditions; if the comprehensive correlation degree exceeds the preset threshold, the diagnostic result is determined to be credible, and the defect type, probability weight, reasoning chain, and processing suggestions in the second diagnostic result are automatically integrated to generate a structured diagnostic report, which is output through a designated channel; if the threshold is not exceeded, a re-reasoning or manual review process is triggered.

[0071] Preferably, the step of performing grey relational analysis based on the second diagnostic result and real-time data to obtain a consistency evaluation result, and generating and outputting a diagnostic report based on the second diagnostic result when the consistency evaluation result is greater than a preset first threshold, includes: From the pre-built defect feature standard library, query the features corresponding to each defect type in the second diagnostic result, and generate multiple first feature vectors; Multiple second feature vectors are generated based on real-time data corresponding to each of the aforementioned defect types; Calculate the grey relational coefficient sequence between the first feature vector and the second feature vector corresponding to each of the aforementioned defect types; Each gray relation coefficient in each gray relation coefficient sequence is weighted and summed to obtain multiple comprehensive relation degrees, and the comprehensive relation degrees are used as the consistency evaluation results. If the consistency assessment result is greater than a preset first threshold, a diagnostic report is generated based on the defect type and reasoning chain corresponding to the consistency assessment result.

[0072] Preferably, after generating and outputting a diagnostic report based on the second diagnostic result when the consistency assessment result is greater than a preset first threshold, the method further includes: When the consistency evaluation result is less than or equal to the first threshold, the inference parameters are adjusted and rule inference and probabilistic inference are performed again.

[0073] In one embodiment, validation data matching is required before performing grey relational analysis, including: extracting the core features of the reasoning from the second diagnostic result and generating a feature vector containing the reasoning result, for example: defect type: poor secondary circuit contact, confidence level: 0.91, key influencing factors: 5 years of operation and decrease in insulation resistance; unifying the dimensions of the measured data (insulation resistance and optical power are retained to 1 decimal place, and circuit resistance is retained to 2 decimal places), removing data irrelevant to the defect (ambient temperature 28℃, no effect), and generating a second feature vector, for example: insulation resistance: 1.8MΩ, optical power: 1.2dBm, circuit resistance: 0.1Ω; retrieving the corresponding features from a pre-built defect feature standard library and generating a first feature vector, for example: insulation Resistance: 1-2MΩ, Optical power fluctuation: >3dB, Loop resistance: <0.2Ω; The inference results are correlated with the measured data based on the unique identifier of the equipment to ensure data correspondence; A "feature item mapping" mechanism is used to match the core features in three types of vectors to generate matching pairs. Examples: Insulation resistance (inference correlation: decreasing → measured: 1.8MΩ → standard: 1-2MΩ), Optical power (inference correlation: fluctuation → measured: 1.2dBm (fluctuation 6dB) → standard: >3dB), Loop resistance (inference correlation: normal → measured: 0.1Ω → standard: <0.2Ω); If there are no feature mismatches, a matching completion prompt is generated. If there are feature misalignments (e.g., the inference correlation is affected by temperature but the measured temperature is normal), the mismatched features are marked for manual review.

[0074] Furthermore, using the first eigenvector as the reference sequence The second feature vector is the comparison sequence. ( (These correspond to insulation resistance, optical power, and loop resistance, respectively). The correlation coefficients for the three features, calculated using the grey relational coefficient formula, are 0.92, 0.89, and 0.95, respectively. The comprehensive correlation degree is obtained by weighting and summing the coefficients according to the feature weights (insulation resistance 0.4, optical power 0.4, and loop resistance 0.2). The result is greater than the preset first threshold of 0.8, indicating that the consistency is up to standard and the reasoning result is reliable. It is confirmed that the defect of the protection device of line 3 is poor contact in the secondary circuit.

[0075] Furthermore, if the calculated overall correlation degree is less than the first threshold, a "re-inference" instruction is sent, along with mismatch features, prompting for adjustment of inference parameters (such as increasing the weight of loop resistance) and a second inference, until verification is passed and a confirmation instruction is generated.

[0076] In one embodiment, the diagnostic report can be written in sections of "Defect Overview - Reasoning Chain - Verification Result - Handling Recommendation". Example: Defect Overview (Equipment No. EQUIP-002, Defect Type: Poor Secondary Circuit Contact, Severity Level: Moderate, Occurrence Time: 2025-06-15 14:20), Reasoning Chain (Complete reproduction of the previous chain of "Years of Operation → Decreased Insulation Resistance → Poor Contact → Optical Power Attenuation"), Verification Result (Overall Correlation 0.91, Feature Matching Consistent, Verification Passed), Handling Recommendation ("Tighten the secondary circuit terminals, retest the insulation resistance to ≥2MΩ, recommended to be completed within 3 days").

[0077] In one embodiment, the diagnostic report can be matched to the output channel according to its severity level. For example, if it is a general level, the complete report can be pushed through a pop-up window on the system monitoring center interface or the mobile APP of the maintenance personnel; if it is a serious defect (such as malfunction of associated protection), an additional SMS alert can be triggered and sent to the maintenance manager simultaneously. After each channel pushes the report, a read receipt is generated, and the system records the push time, recipient, and read status. At the same time, the diagnostic report, push receipt, and equipment maintenance file are linked and archived for subsequent traceability and query.

[0078] This invention, through real-time acquisition and standardization of multi-source heterogeneous data, transforms raw data from different sources into a dataset with a unified standard. By employing the MacBERT-BiLSTM-CRF model for entity extraction, it provides new entity elements to the knowledge graph, enabling the knowledge graph to synchronize with the defect evolution process. By updating the graph structure data based on new entities and utilizing a GNN model for relation mining, it provides new relational elements to the knowledge graph, further synchronizing it with the defect evolution process. Through rule-based reasoning based on the updated knowledge graph, and further probabilistic reasoning using a Bayesian network, it integrates logical judgment and probabilistic evaluation, improving the accuracy of defect diagnosis results. By performing grey relational analysis based on defect diagnosis results and real-time data and setting a consistency threshold, it verifies the defect diagnosis results before output, further improving the accuracy of the final defect diagnosis results. Compared to the problems of existing technologies in dynamically adapting to new scenarios and deep diagnostic reasoning, this application can improve the accuracy and scenario adaptability of relay protection defect diagnosis.

[0079] Optionally, in this embodiment of the invention, the real-time acquisition of a first dataset from the power system and the standardization of the first dataset to generate a second dataset includes: Data preprocessing is performed on the defective text data to generate the first text dataset; Semantic similarity matching is performed on each text data in the first text dataset to generate a second text dataset; Data preprocessing is performed on equipment status data, environmental data, and dynamic operation data to generate the first structured dataset; Evidence combination rules are used to fuse the structured data in the first structured dataset to generate a second structured dataset; Based on timestamps and unique device identifiers, the second text dataset and the second structured dataset are associated and fused to generate a second dataset.

[0080] The embodiments of the present invention can achieve efficient integration of text and structured data by classifying and preprocessing multi-source heterogeneous data, semantic matching and evidence fusion, thereby enhancing the correlation strength of the dataset.

[0081] Optionally, in this embodiment of the invention, the step of inputting the second dataset into a pre-trained MacBERT-BiLSTM-CRF model, so that the MacBERT-BiLSTM-CRF model performs entity extraction based on the second dataset to obtain multiple entities, including: The second dataset is encoded into a number sequence based on a pre-built domain dictionary, and the number sequence is then semantically encoded using the MacBERT module in the MacBERT-BiLSTM-CRF model to obtain a semantic feature vector. Temporal feature vectors are obtained by performing temporal dependency modeling on the semantic feature vectors using the BiLSTM module in the MacBERT-BiLSTM-CRF model. The temporal feature vector is sequence labeled and decoded using the CRF module in the MacBERT-BiLSTM-CRF model to output an entity label sequence. Multiple first entities are extracted from the second dataset based on the entity label sequence; Align each of the first entities with a pre-built standard terminology library in the field of relay protection to obtain multiple second entities; Each of the second entities is assigned a unique identifier and associated with the corresponding attribute information in the second dataset to obtain multiple entities.

[0082] The embodiments of the present invention use MacBERT for semantic encoding, BiLSTM for modeling temporal dependencies, CRF for decoding and annotation, and integrate domain dictionaries and terminology alignment, which can improve the accuracy of entity extraction.

[0083] Optionally, in this embodiment of the invention, updating the pre-built graph structure data according to the second dataset and each of the entities includes: Each of the aforementioned entities is added as a new node to the graph structure data; Based on the second dataset, determine the association between each newly added node and the existing nodes in the graph structure data; Based on the aforementioned relationships, edges are established between the newly added node and the existing node to update the graph structure data.

[0084] The embodiments of the present invention dynamically add entities as nodes to the graph structure and establish associated edges, thereby enabling real-time expansion and structural updates of the knowledge graph.

[0085] Optionally, in this embodiment of the invention, the step of inputting the updated graph structure data into a pre-trained GNN model, so that the GNN model performs relation mining based on the graph structure data to obtain multiple entity relations, including: The neighborhood information of each node in the graph structure data is aggregated through the GCN layer in the GNN model to generate an updated node embedding vector. Based on the node embedding vectors, relationship prediction is performed on each pair of nodes in the graph structure data, and the relationship between each pair of nodes is output; wherein, each relationship corresponds to a prediction confidence level; The relationships are filtered based on a pre-built relation rule base in the field of relay protection, and the relationships with a prediction confidence greater than or equal to a preset second threshold are taken as entity relationships among all remaining relationships.

[0086] This invention uses GNN to aggregate neighborhood information for relationship prediction and filters based on a domain rule base and confidence level to uncover hidden entity relationships and improve the accuracy of relationship discovery.

[0087] Optionally, in this embodiment of the invention, the step of performing rule-based reasoning based on the updated knowledge graph and real-time data of the target relay protection device to obtain the first diagnostic result includes: The target defect features are extracted from the real-time data, and the target defect features are matched with a predefined expert rule base for relay protection to select at least one association rule, forming a first association rule set; Multiple entity relationships related to the target relay protection device are extracted from the knowledge graph, and the first association rule set is filtered according to each entity relationship to obtain the second association rule set; The defect type and first confidence level corresponding to each association rule in the second association rule set are used as the first diagnostic result; wherein the first confidence level is determined according to the preset priority of each association rule in the expert rule base of the relay protection field.

[0088] This invention enables rule-based preliminary diagnosis and improves the logical consistency of diagnostic results by matching real-time defect features with an expert rule base and combining them with entity relationships in a knowledge graph for rule filtering and priority confidence calculation.

[0089] Optionally, in this embodiment of the invention, obtaining a second diagnostic result based on the first diagnostic result through probabilistic reasoning using a pre-constructed Bayesian network includes: Using each defect type in the first diagnostic result as the target node, and the entity relationship corresponding to each defect type in the knowledge graph as the probabilistic dependency between nodes, the posterior probability of each defect type is calculated through the Bayesian network. The first confidence level corresponding to each defect type is updated according to the posterior probability to obtain multiple second confidence levels; Real-time data related to each of the defect types in the target relay protection device are acquired, and each of the second confidence levels is calibrated based on the real-time data to obtain multiple third confidence levels; Each of the third confidence levels is compared with a preset third threshold. The defect types corresponding to the third confidence levels that are less than the third threshold are removed. Based on the remaining defect types, the knowledge graph is traced back in reverse to construct multiple inference chains. The remaining defect types, along with their corresponding third confidence levels and inference chains, are used as the second diagnostic result.

[0090] The embodiments of the present invention use Bayesian networks for probabilistic reasoning, real-time data calibration, and inference chain construction, which can quantify the probability of occurrence of defect types and enhance the reliability of diagnostic results.

[0091] Optionally, in this embodiment of the invention, the step of performing grey relational analysis based on the second diagnostic result and real-time data to obtain a consistency evaluation result, and generating and outputting a diagnostic report based on the second diagnostic result when the consistency evaluation result is greater than a preset first threshold, includes: From the pre-built defect feature standard library, query the features corresponding to each defect type in the second diagnostic result, and generate multiple first feature vectors; Multiple second feature vectors are generated based on real-time data corresponding to each of the aforementioned defect types; Calculate the grey relational coefficient sequence between the first feature vector and the second feature vector corresponding to each of the aforementioned defect types; Each gray relation coefficient in each gray relation coefficient sequence is weighted and summed to obtain multiple comprehensive relation degrees, and the comprehensive relation degrees are used as the consistency evaluation results. If the consistency assessment result is greater than a preset first threshold, a diagnostic report is generated based on the defect type and reasoning chain corresponding to the consistency assessment result.

[0092] This invention uses grey relational analysis to compare diagnostic results with real-time data features, which can assess the consistency between diagnostic results and actual working conditions and improve the accuracy of output reports.

[0093] Optionally, in this embodiment of the invention, after generating and outputting a diagnostic report based on the second diagnostic result when the consistency assessment result is greater than a preset first threshold, the method further includes: When the consistency evaluation result is less than or equal to the first threshold, the inference parameters are adjusted and rule-based inference and probabilistic inference are performed again.

[0094] The embodiments of the present invention can achieve closed-loop optimization and adaptive correction of the diagnostic process by adjusting the inference parameters and re-inferring when the consistency threshold is not met.

[0095] like Figure 3 As shown, based on the above-described method embodiments, another embodiment of the relay protection defect diagnosis method based on dynamic knowledge graphs is provided, applicable to situations such as... Figure 4 The relay protection defect diagnosis system based on dynamic knowledge graph shown includes steps S1 to S5. Step S1 involves the multi-source heterogeneous data acquisition layer collecting four types of data in real time: defect text, equipment status, environment, and dynamic operation. The data is then uploaded to the data preprocessing and fusion layer via the corresponding acquisition devices and transmission protocols. Executing step S1 is equivalent to performing the action of "real-time acquisition of the first dataset in the power system" described in step S101.

[0096] Step S2: The data preprocessing and fusion layer performs preprocessing such as cleaning, standardization, and time-series alignment on the uploaded data, and then achieves multi-source data fusion through improved evidence combination rules to generate multi-dimensional related data; wherein, executing step S2 is equivalent to executing the action of "standardizing the first dataset to generate the second dataset" described in step S101.

[0097] Step S3: After detecting newly added fused data, the knowledge graph dynamic update process is triggered. The graph is initially updated through entity extraction and relationship mining, and the final update is completed after manual review. If no new data is detected, the system will perform regular updates once a day to ensure the timeliness of the graph. Here, executing step S3 is equivalent to executing the action of "updating the pre-built knowledge graph according to each entity and each entity relationship" as described in steps S102, S103 and S104.

[0098] In step S4, the intelligent diagnostic reasoning layer calls the dynamically updated knowledge graph and combines it with the fused real-time data to achieve deep diagnostic reasoning through "rule reasoning + probabilistic reasoning," generating preliminary results such as defect type, fault cause, and reasoning chain. Executing step S4 is equivalent to executing the action described in step S104: "Perform rule reasoning based on the updated knowledge graph and the real-time data of the target relay protection device to obtain a first diagnostic result, and based on the first diagnostic result, perform probabilistic reasoning through a pre-constructed Bayesian network to obtain a second diagnostic result."

[0099] Step S5: The result verification and output layer matches the preliminary inference results with the on-site measured data and achieves self-verification through grey relational analysis. If the verification is successful, a standardized diagnostic report is generated and output through multiple channels. If the verification fails, the inference parameters are adjusted and the process returns to step 4 for re-inference. Executing step S5 is equivalent to executing step S105.

[0100] The embodiments of the present invention, through a closed-loop design of "data-map-reasoning-verification", can ensure the reliability and practicality of diagnostic results.

[0101] In one embodiment, the hardware device connection relationship of the relay protection defect diagnosis system based on dynamic knowledge graph is as follows: Figure 5 As shown, it includes a data acquisition terminal, an edge computing node, a cloud server, a storage device, and an output device; The data acquisition terminal is used to realize the real-time acquisition of multi-source data; it includes an OCR recognition terminal, an insulation resistance sensor, an optical power sensor, a resistance sensor, an electromagnetic interference sensor, and an environmental monitoring terminal, all of which are deployed at the substation site; and it communicates with edge computing nodes via Bluetooth and industrial Ethernet.

[0102] The edge computing node is used to run the data preprocessing and fusion module to clean, standardize and fuse real-time data, reducing the pressure on cloud data transmission; it adopts an industrial-grade edge server (configuration: CPU is Intel Core i7-12700H, memory is 32GB, storage is 512GB SSD) and is deployed locally in the substation; it communicates with the cloud server through fiber optic cable and with the data acquisition terminal through Bluetooth or industrial Ethernet.

[0103] The cloud server is used to run the knowledge graph dynamic update module, intelligent diagnostic reasoning module, and result verification and output module to realize graph update, deep reasoning and result processing; it adopts a distributed cloud server cluster (consisting of 3 main servers and 2 backup servers, each with the following configuration: CPU Intel Xeon Gold 6330, memory 64GB, storage 2TB SSD); it communicates with edge computing nodes, storage devices and output devices through fiber optics.

[0104] The storage device is used to store the collected raw data, preprocessed fused data, knowledge graph data, and diagnostic reports; it adopts a distributed storage array (storage capacity ≥100TB, supporting RAID5 redundancy backup); and communicates with the cloud server through optical fiber to ensure data read / write speed and security.

[0105] The output devices are used to output diagnostic reports and early warning information; including a substation monitoring center display screen, a mobile APP for maintenance personnel, and an SMS gateway; the monitoring center display screen is connected to the cloud server via an HDMI interface, and the mobile APP and SMS gateway communicate with the cloud server via a 4G / 5G network.

[0106] This invention adopts a deployment mode of "on-site data acquisition - edge processing - cloud analysis," which can ensure rapid processing of real-time data and achieve in-depth analysis by relying on cloud computing power. By adopting a distributed architecture (cloud server cluster and distributed storage), the stability and reliability of system operation can be ensured. By using multi-channel output devices, maintenance personnel can obtain diagnostic information in a timely manner.

[0107] like Figure 6 As shown, based on the above method embodiments, corresponding apparatus embodiments are provided; An embodiment of the present invention provides a relay protection defect diagnosis device based on dynamic knowledge graph, including: a data acquisition module 601, an entity extraction module 602, a relationship mining module 603, a diagnostic reasoning module 604, and a result output module 605; The data acquisition module 601 is used to acquire a first dataset from the power system in real time and perform standardization processing on the first dataset to generate a second dataset; wherein, the first dataset includes: defect text data, equipment status data, environmental data and dynamic operation data; The entity extraction module 602 is used to input the second dataset into the pre-trained MacBERT-BiLSTM-CRF model, so that the MacBERT-BiLSTM-CRF model can extract entities based on the second dataset to obtain multiple entities; The relationship mining module 603 is used to update the pre-constructed graph structure data according to the second dataset and each entity, and input the updated graph structure data into the pre-trained GNN model so that the GNN model can perform relationship mining based on the graph structure data to obtain multiple entity relationships; The diagnostic reasoning module 604 is used to update the pre-built knowledge graph according to each entity and the relationship between each entity, perform rule reasoning based on the updated knowledge graph and the real-time data of the target relay protection device to obtain a first diagnostic result, and perform probabilistic reasoning through a pre-built Bayesian network based on the first diagnostic result to obtain a second diagnostic result. The result output module 605 is used to perform grey relational analysis based on the second diagnostic result and real-time data to obtain a consistency evaluation result. When the consistency evaluation result is greater than a preset first threshold, a diagnostic report is generated and output based on the second diagnostic result.

[0108] Optionally, in this embodiment of the invention, the data acquisition module 601 includes: a first preprocessing submodule, a text dataset submodule, a second preprocessing submodule, a structured dataset submodule, and an association fusion submodule; The first preprocessing submodule is used to preprocess the defective text data to generate a first text dataset; The text dataset submodule is used to perform semantic similarity matching on each text data in the first text dataset to generate a second text dataset; The second preprocessing submodule is used to preprocess equipment status data, environmental data, and dynamic operation data to generate a first structured dataset; The structured dataset submodule is used to perform evidence combination rule fusion on each structured data in the first structured dataset to generate a second structured dataset. The association and fusion submodule is used to associate and fuse the second text dataset and the second structured dataset based on the timestamp and the device's unique identifier to generate a second dataset.

[0109] The embodiments of the present invention can achieve efficient integration of text and structured data by classifying and preprocessing multi-source heterogeneous data, semantic matching and evidence fusion, thereby enhancing the correlation strength of the dataset.

[0110] Optionally, in this embodiment of the invention, the entity extraction module 602 includes: a MacBERT submodule, a BiLSTM submodule, a CRF submodule, a first entity submodule, a second entity submodule, and a third entity submodule; The MacBERT submodule is used to encode the second dataset into a number sequence based on a pre-built domain dictionary, and to perform contextual semantic encoding on the number sequence through the MacBERT module in the MacBERT-BiLSTM-CRF model to obtain a semantic feature vector; The BiLSTM submodule is used to perform temporal dependency modeling on the semantic feature vector through the BiLSTM module in the MacBERT-BiLSTM-CRF model to obtain a temporal feature vector. The CRF submodule is used to perform sequence labeling and decoding on the temporal feature vector through the CRF module in the MacBERT-BiLSTM-CRF model, and output the entity label sequence. The first entity submodule is used to extract multiple first entities from the second dataset according to the entity label sequence; The second entity submodule is used to align each of the first entities with a pre-built standard terminology library in the field of relay protection to obtain multiple second entities; The third entity submodule is used to assign a unique identifier to each of the second entities and associate it with the corresponding attribute information in the second dataset to obtain multiple entities.

[0111] The embodiments of the present invention use MacBERT for semantic encoding, BiLSTM for modeling temporal dependencies, CRF for decoding and annotation, and integrate domain dictionaries and terminology alignment, which can improve the accuracy of entity extraction.

[0112] Optionally, in this embodiment of the invention, the relationship mining module 603 includes: a first graph structure update submodule, a second graph structure update submodule, and a third graph structure update submodule; The first graph structure update submodule is used to add each entity as a new node to the graph structure data; The second graph structure update submodule is used to determine the association between each newly added node and the existing nodes in the graph structure data based on the second dataset; The third graph structure update submodule is used to establish edges between the newly added node and the existing node according to the association relationships, so as to update the graph structure data.

[0113] The embodiments of the present invention dynamically add entities as nodes to the graph structure and establish associated edges, thereby enabling real-time expansion and structural updates of the knowledge graph.

[0114] Optionally, in this embodiment of the invention, the relationship mining module 603 further includes: a first relationship submodule, a second relationship submodule, and a third relationship submodule; The first relational submodule is used to aggregate the neighborhood information of each node in the graph structure data through the GCN layer in the GNN model to generate an updated node embedding vector. The second relation submodule is used to predict the relationship between each pair of nodes in the graph structure data based on the embedding vectors of each node, and output the relationship between each pair of nodes; wherein, one relationship corresponds to one prediction confidence. The third relation submodule is used to filter each relation based on a pre-built relation rule library in the field of relay protection, and to take the relation whose prediction confidence is greater than or equal to a preset second threshold as an entity relation among all the remaining relations.

[0115] This invention uses GNN to aggregate neighborhood information for relationship prediction and filters based on a domain rule base and confidence level to uncover hidden entity relationships and improve the accuracy of relationship discovery.

[0116] Optionally, in this embodiment of the invention, the diagnostic reasoning module 604 includes: a rule matching submodule, a rule filtering submodule, and a first diagnostic result submodule; The rule matching submodule is used to extract target defect features from the real-time data, match the target defect features with a predefined expert rule base for relay protection, and filter out at least one association rule to form a first association rule set. The rule filtering submodule is used to extract multiple entity relationships related to the target relay protection device from the knowledge graph, and filter the first association rule set according to each entity relationship to obtain a second association rule set; The first diagnostic result submodule is used to take the defect type and first confidence level corresponding to each association rule in the second association rule set as the first diagnostic result; wherein the first confidence level is determined according to the preset priority of each association rule in the expert rule base of the relay protection field.

[0117] This invention enables rule-based preliminary diagnosis and improves the logical consistency of diagnostic results by matching real-time defect features with an expert rule base and combining them with entity relationships in a knowledge graph for rule filtering and priority confidence calculation.

[0118] Optionally, in this embodiment of the invention, the diagnostic reasoning module 604 further includes: a posterior probability submodule, a confidence update submodule, a confidence calibration submodule, an inference chain submodule, and a second diagnostic result submodule; The posterior probability submodule is used to calculate the posterior probability of each defect type by taking each defect type in the first diagnostic result as the target node and the entity relationship corresponding to each defect type in the knowledge graph as the probability dependency between the nodes through the Bayesian network. The confidence update submodule is used to update the first confidence level corresponding to each defect type according to the posterior probability to obtain multiple second confidence levels; The confidence calibration submodule is used to acquire real-time data related to each of the defect types in the target relay protection device, and calibrate each of the second confidence levels based on the real-time data to obtain multiple third confidence levels; The reasoning chain submodule is used to compare each of the third confidence levels with a preset third threshold, remove the defect types corresponding to the third confidence levels that are less than the third threshold, and perform reverse tracing in the knowledge graph based on the remaining defect types to construct multiple reasoning chains. The second diagnostic result submodule is used to take the remaining defect types and their corresponding third confidence level and inference chain as the second diagnostic result.

[0119] The embodiments of the present invention use Bayesian networks for probabilistic reasoning, real-time data calibration, and inference chain construction, which can quantify the probability of occurrence of defect types and enhance the reliability of diagnostic results.

[0120] Optionally, in this embodiment of the invention, the result output module 605 includes: a first feature vector submodule, a second feature vector submodule, a grey relational coefficient submodule, a comprehensive relational degree submodule, and a diagnostic report submodule; The first feature vector submodule is used to query features corresponding to each defect type in the second diagnostic result from a pre-built defect feature standard library, and generate multiple first feature vectors; The second feature vector submodule is used to generate multiple second feature vectors based on real-time data corresponding to each of the defect types; The grey relational coefficient submodule is used to calculate the grey relational coefficient sequence between the first feature vector and the second feature vector corresponding to each defect type. The comprehensive correlation degree submodule is used to perform weighted summation on each gray correlation coefficient in each gray correlation coefficient sequence to obtain multiple comprehensive correlation degrees, and use the comprehensive correlation degree as the consistency evaluation result. The diagnostic report submodule is used to generate a diagnostic report based on the defect type and reasoning chain corresponding to the consistency assessment result if the consistency assessment result is greater than a preset first threshold.

[0121] This invention uses grey relational analysis to compare diagnostic results with real-time data features, which can assess the consistency between diagnostic results and actual working conditions and improve the accuracy of output reports.

[0122] Optionally, in this embodiment of the invention, a re-inference submodule is further included after the result output module 605; The re-inference submodule is used to adjust the inference parameters and re-perform rule inference and probability inference when the consistency evaluation result is less than or equal to the first threshold.

[0123] The embodiments of the present invention can achieve closed-loop optimization and adaptive correction of the diagnostic process by adjusting the inference parameters and re-inferring when the consistency threshold is not met.

[0124] It is understood that the above-described device embodiments correspond to the method embodiments of the present invention, and can implement the relay protection defect diagnosis method based on dynamic knowledge graph provided by any of the above-described method embodiments of the present invention.

[0125] This invention employs a data acquisition module 601 to collect multi-source heterogeneous data in real time and perform standardization processing, transforming raw data from different sources into a dataset with a unified standard. An entity extraction module 602 uses a MacBERT-BiLSTM-CRF model for entity extraction, providing new entity elements to the knowledge graph and enabling it to synchronize with the defect evolution process. A relationship mining module 603 updates the graph structure data based on new entities and uses a GNN model for relationship mining, providing new relationship elements to the knowledge graph and ensuring it synchronizes with the defect evolution process. A diagnostic reasoning module 604 performs rule-based reasoning based on the updated knowledge graph and further uses a Bayesian network for probabilistic reasoning, integrating logical judgment and probabilistic evaluation to improve the accuracy of defect diagnosis results. A result output module 605 performs grey relational analysis based on the defect diagnosis results and real-time data and sets a consistency threshold, verifying the defect diagnosis results before output and further improving the accuracy of the final defect diagnosis results. Compared to the problems of existing technologies in dynamically adapting to new scenarios and deep diagnostic reasoning, this application can improve the accuracy and scenario adaptability of relay protection defect diagnosis.

[0126] 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.

[0127] Based on the above embodiment of a relay protection defect diagnosis method based on dynamic knowledge graph, another embodiment of the present invention provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements a relay protection defect diagnosis method based on dynamic knowledge graph according to any embodiment of the present invention.

[0128] For example, in this embodiment, the computer program can be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the terminal device.

[0129] The terminal device may be a desktop computer, laptop, handheld computer, or cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.

[0130] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the terminal device, connecting all parts of the terminal device via various interfaces and lines.

[0131] Based on the above-described method embodiments, another embodiment of the present invention provides a computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to execute the relay protection defect diagnosis method based on dynamic knowledge graph described in any of the above-described method embodiments of the present invention.

[0132] The modules / units integrated in the device / terminal equipment, if implemented as software functional units and sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.

[0133] 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 diagnosing relay protection defects based on dynamic knowledge graphs, characterized in that, include: A first dataset is collected in real time from the power system, and the first dataset is standardized to generate a second dataset; wherein, the first dataset includes: defect text data, equipment status data, environmental data, and dynamic operation data; The second dataset is input into a pre-trained MacBERT-BiLSTM-CRF model so that the MacBERT-BiLSTM-CRF model can extract entities based on the second dataset to obtain multiple entities; The pre-constructed graph structure data is updated based on the second dataset and each entity, and the updated graph structure data is input into the pre-trained GNN model so that the GNN model can perform relation mining based on the graph structure data to obtain multiple entity relations. The pre-constructed knowledge graph is updated based on the entities and their relationships. Target defect features are extracted from the real-time data and matched against a predefined expert rule base for relay protection to select at least one association rule, forming a first association rule set. Multiple entity relationships related to the target relay protection device are extracted from the knowledge graph, and the first association rule set is filtered based on these relationships to obtain a second association rule set. The defect type and first confidence level corresponding to each association rule in the second association rule set are used as the first diagnostic result. The first confidence level is determined based on the preset priority of each association rule in the expert rule base for relay protection. Each defect type in the first diagnostic result is used as the target node, and each... The entity relationships corresponding to the aforementioned defect types in the knowledge graph are probabilistic dependencies between nodes. A pre-constructed Bayesian network is used to calculate the posterior probability of each defect type. The first confidence level corresponding to each defect type is updated based on the posterior probability to obtain multiple second confidence levels. Real-time data related to each defect type in the target relay protection device is acquired, and each second confidence level is calibrated based on the real-time data to obtain multiple third confidence levels. Each third confidence level is compared with a preset third threshold. Defect types corresponding to third confidence levels below the third threshold are removed, and the remaining defect types are used for reverse tracing in the knowledge graph to construct multiple inference chains. The remaining defect types, along with their corresponding third confidence levels and inference chains, are used as the second diagnostic result. Grey relational analysis is performed based on the second diagnostic result and real-time data to obtain a consistency evaluation result. When the consistency evaluation result is greater than a preset first threshold, a diagnostic report is generated and output based on the second diagnostic result.

2. The relay protection defect diagnosis method based on dynamic knowledge graph as described in claim 1, characterized in that, The first dataset from the real-time power system is acquired, and the first dataset is standardized to generate a second dataset, including: Data preprocessing is performed on the defective text data to generate the first text dataset; Semantic similarity matching is performed on each text data in the first text dataset to generate a second text dataset; Data preprocessing is performed on equipment status data, environmental data, and dynamic operation data to generate the first structured dataset; Evidence combination rules are used to fuse the structured data in the first structured dataset to generate a second structured dataset; Based on timestamps and unique device identifiers, the second text dataset and the second structured dataset are associated and fused to generate a second dataset.

3. The relay protection defect diagnosis method based on dynamic knowledge graph as described in claim 1, characterized in that, The second dataset is input into a pre-trained MacBERT-BiLSTM-CRF model, so that the MacBERT-BiLSTM-CRF model extracts entities based on the second dataset, resulting in multiple entities, including: The second dataset is encoded into a number sequence based on a pre-built domain dictionary, and the number sequence is then semantically encoded using the MacBERT module in the MacBERT-BiLSTM-CRF model to obtain a semantic feature vector. Temporal feature vectors are obtained by performing temporal dependency modeling on the semantic feature vectors using the BiLSTM module in the MacBERT-BiLSTM-CRF model. The temporal feature vector is sequence labeled and decoded using the CRF module in the MacBERT-BiLSTM-CRF model to output an entity label sequence. Multiple first entities are extracted from the second dataset based on the entity label sequence; Align each of the first entities with a pre-built standard terminology library in the field of relay protection to obtain multiple second entities; Each of the second entities is assigned a unique identifier and associated with the corresponding attribute information in the second dataset to obtain multiple entities.

4. The relay protection defect diagnosis method based on dynamic knowledge graph as described in claim 1, characterized in that, The step of updating the pre-built graph structure data based on the second dataset and each of the entities includes: Each of the aforementioned entities is added as a new node to the graph structure data; Based on the second dataset, determine the association between each newly added node and the existing nodes in the graph structure data; Based on the aforementioned relationships, edges are established between the newly added node and the existing node to update the graph structure data.

5. The relay protection defect diagnosis method based on dynamic knowledge graph as described in claim 1, characterized in that, The updated graph structure data is input into a pre-trained GNN model so that the GNN model can perform relation mining based on the graph structure data to obtain multiple entity relations, including: The neighborhood information of each node in the graph structure data is aggregated through the GCN layer in the GNN model to generate an updated node embedding vector. Based on the node embedding vectors, relationship prediction is performed on each pair of nodes in the graph structure data, and the relationship between each pair of nodes is output; wherein, each relationship corresponds to a prediction confidence level; The relationships are filtered based on a pre-built relation rule base in the field of relay protection, and the relationships with a prediction confidence greater than or equal to a preset second threshold are taken as entity relationships among all remaining relationships.

6. The relay protection defect diagnosis method based on dynamic knowledge graph as described in claim 1, characterized in that, The process involves performing grey relational analysis based on the second diagnostic result and real-time data to obtain a consistency assessment result. When the consistency assessment result exceeds a preset first threshold, a diagnostic report is generated and output based on the second diagnostic result, including: From the pre-built defect feature standard library, query the features corresponding to each defect type in the second diagnostic result, and generate multiple first feature vectors; Multiple second feature vectors are generated based on real-time data corresponding to each of the aforementioned defect types; Calculate the grey relational coefficient sequence between the first feature vector and the second feature vector corresponding to each of the aforementioned defect types; Each gray relation coefficient in each gray relation coefficient sequence is weighted and summed to obtain multiple comprehensive relation degrees, and the comprehensive relation degrees are used as the consistency evaluation results. If the consistency assessment result is greater than a preset first threshold, a diagnostic report is generated based on the defect type and reasoning chain corresponding to the consistency assessment result.

7. A relay protection defect diagnosis device based on dynamic knowledge graph, characterized in that, include: The system includes a data acquisition module, an entity extraction module, a relationship mining module, a diagnostic reasoning module, and a results output module. The data acquisition module is used to acquire a first dataset from the power system in real time and to standardize the first dataset to generate a second dataset; wherein, the first dataset includes: defect text data, equipment status data, environmental data, and dynamic operation data; The entity extraction module is used to input the second dataset into the pre-trained MacBERT-BiLSTM-CRF model, so that the MacBERT-BiLSTM-CRF model can extract entities based on the second dataset to obtain multiple entities; The relationship mining module is used to update the pre-constructed graph structure data according to the second dataset and each entity, and input the updated graph structure data into the pre-trained GNN model so that the GNN model can perform relationship mining based on the graph structure data to obtain multiple entity relationships; The diagnostic reasoning module is used to update a pre-built knowledge graph based on each entity and its relationships, extract target defect features from the real-time data, match the target defect features with a predefined expert rule base for relay protection, and filter out at least one association rule to form a first association rule set; extract multiple entity relationships related to the target relay protection device from the knowledge graph, and filter the first association rule set according to each entity relationship to obtain a second association rule set; use the defect type and first confidence level corresponding to each association rule in the second association rule set as a first diagnostic result; wherein the first confidence level is determined according to the preset priority of each association rule in the expert rule base for relay protection; and use each defect type in the first diagnostic result as the target node. The system calculates the posterior probability of each defect type using a pre-constructed Bayesian network, with the entity relationships corresponding to each defect type in the knowledge graph as the probabilistic dependencies between nodes. It then updates the first confidence level corresponding to each defect type based on the posterior probability, obtaining multiple second confidence levels. Real-time data related to each defect type in the target relay protection device is acquired, and each second confidence level is calibrated based on the real-time data, obtaining multiple third confidence levels. Each third confidence level is compared with a preset third threshold, and defect types corresponding to third confidence levels below the third threshold are removed. The remaining defect types are then used for reverse tracing in the knowledge graph to construct multiple inference chains. The remaining defect types, their corresponding third confidence levels, and inference chains are used as the second diagnostic result. The result output module is used to perform grey relational analysis based on the second diagnostic result and real-time data to obtain a consistency evaluation result. When the consistency evaluation result is greater than a preset first threshold, a diagnostic report is generated and output based on the second diagnostic result.