Abstract
In the initial construction process of smart grid dispatching control system in power grid dispatching control center, because different subsystems are in decentralized development, independent operation and independent management, it is easy to reduce data interconnection, which leads to difficulties in data sharing and restricts the information level of the system. The data is multi-source, and the data format is inconsistent, resulting in the application problems that the data can not be shared, accessed, managed, analyzed and mined in real time among different subsystems. In order to solve the problems of data sharing and mining, this paper constructs a knowledge map entity extraction model to study the power grid fault events. Based on the knowledge map theory, the structured and unstructured data related to power grid dispatching are processed to improve the application efficiency of data. Cleaning the preprocessed data to obtain the corresponding entity value and attribute value. The knowledge extraction model of power grid fault event reasoning knowledge mapping is constructed, and the power grid fault event reasoning knowledge edge mapping system is designed to extract the relationship between events and complete data storage. The experimental results show that the text prediction degree of the proposed model is high, which can reach more than 95; The accuracy is 96.71%, the recall rate is 94.88%, and the F1 value is 9.27%. This proves the feasibility of this study, in order to provide data and theoretical support for intelligent management and real-time dispatching of power grid.
Introduction
Reasoning out power grid faults is a useful management tool that ensures the smooth functioning of various power grid production activities. Its primary objective is to guarantee the safe and stable operation of power grid production and provide a dependable power supply to external sources. The specific contents include the data information fed back by various information acquisition equipment, the information reported by monitoring personnel, and then combined with the current, voltage, load, frequency and other related parameters in the actual operation of the power grid [1]. Considering all kinds of situations in the work, judge the operation state of the power grid, automatically issuing operation instructions through the system or other ways, directing operators to manage the field control equipment, or effectively adjusting the work through the automatic control system, including adjusting the output of generators, adjusting the load distribution, switching capacitors and reactors, etc. The ultimate goal is to make the power grid operate continuously, safely and stably [2]. To increase the utilization rate of data in the system, the way is to build an intelligent search engine based on the knowledge map in data application. To establish a strong foundation for the search engine, it is crucial to create a knowledge map in power grid regulation as a first step [3]. By constructing the knowledge map of the power grid fault event reasoning field, the massive dispatching operation process and management data are intelligently analyzed and deeply mined, and the dispatching business data are comprehensively penetrated to realize the correlation analysis of data in the dispatching field, establish the correlation, attribution and synonymy relationship between data, realize data visualization, and improve the accuracy and intelligence of dispatching data retrieval. Provide a unified scheduling data access interface, so that scheduling personnel can quickly obtain the required knowledge and information, and can accurately analyze the potential relationship between the information [4].
According to Reference [5], the fusion mechanism of diverse networks in vehicle networking has been studied. It delves into the switching and selection mechanisms of such networks. The study proposes a multi-attribute decision-making network selection algorithm based on motion prediction, with a focus on the selection mechanism of heterogeneous networks in different scenarios. The motion prediction mechanism based on Markov chain is adopted, and the most suitable network access is selected according to the multi-attribute decision-making network selection algorithm. Practice shows that the algorithm can not only effectively avoid or reduce the ping-pong effect and reduce the number of network switching, but also enable the vehicle-mounted mobile terminal to choose the most suitable network access. Reference [6] explores a scenario of an integrated heterogeneous network, which involves multiple wireless access technologies that work together to provide data transmission services for user equipment. The study assumes that wireless network virtualization is utilized wherein physical base stations accessing the network are transformed into several virtual base stations. To optimize the performance of all users in the network, the joint resource allocation problem is formulated as an optimization problem. Its objective is to achieve maximum energy efficiency of the network. A heuristic algorithm is proposed, which begins with a perfect matching of user pairs and VBS. For each matching pair, the original power allocation and VBS correlation and resource allocation problems are transformed into resource allocation subproblems and VBS correlation subproblems. The study employs the Lagrange duality method and Kuhn-Munkres algorithm to solve the problem. Reference [7] takes into account the various sources, formats, and objectives of data. Therefore, it employs natural language technology to process information from different fields such as industry, administration, public, and private life. The processed data is stored in a structured format in the network database using natural language.
In the following time, with the development of hardware, the computing power of computers has been improved, and artificial intelligence has developed rapidly. Knowledge mapping is divided into horizontal knowledge mapping and vertical knowledge mapping. The horizontal knowledge mapping includes some knowledge of various specialties, linking related knowledge together to form a general knowledge mapping, because the knowledge mapping in this area is constructed because of the inaccuracy of the algorithm or the imperfection of the collected information. Therefore, knowledge maps in this area are mainly used for knowledge search, such as DBpedia, Zhishi. Me, etc. [8]. Vertical knowledge mapping is a knowledge mapping used in professional fields, which is oriented to specific professions or industries. Because of the high accuracy of professional knowledge mapping, through the detailed comparison of experts and professional knowledge and the accuracy in the construction process, vertical knowledge mapping can be used for knowledge reasoning and auxiliary analysis and decision-making in professional fields [9].
This paper studies the knowledge extraction part of power grid fault event reasoning knowledge mapping construction, through the establishment of knowledge extraction model in power grid fault event reasoning knowledge mapping, designs the knowledge extraction system in the power grid failure event reasoning knowledge mapping, and achieves good results in the initial stage of knowledge extraction.
The main innovations of this paper are: The data preprocessing module is responsible for handling repetitive values, abnormal values, missing values, and noisy data in the dataset. By processing the data in this manner, it can be readily utilized in subsequent modules to address the data processing challenge. Obtaining the position embedding of the sentence through the Transformer model, inputting the position embedding into the BiGRU model, and outputting the corresponding tag sequence. Finally, calculating the value of the final tag sequence through the CRF model, obtaining the value of the corresponding entity and the attribute value corresponding to the entity, and solving the problem of entity recognition. By leveraging TensorFlow, the model training speed is significantly enhanced during the subsequent training process. This approach eliminates certain calculation processes, reduces the amount of code written during development, and resolves the challenge of development efficiency.
Entity data processing based on knowledge map
Knowledge map entity extraction
Knowledge map entity extraction is to extract events from text data, and three parts work together to complete the function of knowledge extraction, namely Transformer model, BiGRU model and CRF model. Finally, complete the task of knowledge extraction through the function of each model of the three parts [10].
Transformer model
Use the Transformer model to get the positional embedding, as shown in Fig. 1.

Structure diagram of knowledge extraction model.
The sentence in the text is input into the transformer model, and the positional embedding of the relevant sentence is obtained after the operation of the transformer model, and then the positional embedding is input into the next layer of model [11].
While constructing the model, we must define certain parameters that are relevant to the model’s principle and the subject’s actual situation. This is necessary to ensure the model’s effectiveness. There are embedding layer, encoder layer, definition of loss function, definition of related optimization function, decoder layer, multi _ head _ attention _ layer attention mechanism and some residual and softmax calculations, Feed _ forward _ layer, etc. [12]. The structure is shown in Fig. 2.
The input sentence represents the corpus processed in the previous module in units of separately formed sentences.

Positional embedding obtained from transformer.
According to the principle of the BiGRU model, a two-layer GRU model is built, and the number of GRU cells is determined according to the actual needs. The purpose of this model is to use the results of the previous part of Transformer model as the input of the model. The final result obtained from the BiGRU model is the result positional embedding in the Transformer model, which passes through the label sequence of the model one by one. The label sequence passes through the final CRF probability calculation to determine which words belong to the event, and which words do not belong to events [13]. In the input aspect of the model, because it is impossible to dynamically change the size of the BiGRU input unit according to the length of positional embedding in the model training process, it is necessary to reserve enough input length in advance. 0 is used to complement [14].
CRF model
The CRF model’s primary purpose is to compute the probability of each sequence in the label sequence. It then identifies the portion of the sequence that pertains to the event by determining the sequence with the highest probability. Wherein, the output label sequence of the BiGRU model is a matrix, each column has five numbers, and each row of numbers in the column represents the probability in the BIOES mode. The input of CRF is a sequence, so the result label sequence of the BiGRU takes each row as a sequence as the input of CRF model. It then calculates the probability of the column, compares the maximum value in the label sequence, and then determines which meta-sentences belong to the event according to the probability in the label sequence [15]. The model structure is shown in Fig. 3.

Schematic diagram of the BiGRU-CRF functional model.
In this part, in addition to solving knowledge extraction, the work of attribute extraction in knowledge extraction is also partially implemented. First, the corresponding words are selected according to the label sequence, and then the repeated parts are removed, and the remaining words are used as the attributes of the events extracted from the sentence [16].
Data cleaning includes the processing of missing values and noise data in the data.
Missing value processing
Deletion method: for structured data, when the number of attributes of each piece of data is not large, if there is a missing value in a piece of data, the data will be deleted directly [17]. Interpolation method: similarly, for structured data, when there are many attributes in each piece of data, the interpolation method can be used to fill the data with missing values [18].
Popular imputation techniques comprise mean imputation, regression imputation, maximum likelihood estimation imputation, and various other imputation methods. The deletion method is ideal for large sample sizes where the missing value data records constitute a small proportion of the total sample. Its advantages are simple, convenient, fast and easy to implement [19].
Noise filtering
Noise data is erroneous information that exists randomly in the dataset. Its presence impacts the actual value of the dataset. Popular noise data filtering techniques include regression, mean smoothing, outlier analysis, and wavelet method. The regression method involves fitting a function to the data, smoothing it, and then using the smoothed function value as the replacement for the original data. This method is relatively simple and easy to implement, and only needs to find the corresponding regression function, but it may also cause the problem of “false regression” because of the simple and crude regression model. The results are relatively poor when there is a causal relationship between variables [20]. Thus, it is important to employ visual methods to assess the data trend before determining whether regression can be utilized to fit the corresponding data. Mean smoothing is a technique that replaces the original data with the mean of several adjacent data points for variables with sequence characteristics. When dealing with data that exhibits sinusoidal time series characteristics, the mean smoothing method may yield improved outcomes. However, it is easy to blur the details and edges of the data [21].
Fault event reasoning model of power grid
Once the power grid fault event data has been cleaned and mapped according to knowledge, the power grid fault event reasoning model is established, thereby completing the power data processing. Figure 4 illustrates the overall architecture of the power grid fault event reasoning system.

Overall structure of the system.
The modules within the system architecture are connected via data links, and the corresponding system is designed using the Python programming language.
The primary objective of electric power data preprocessing is to cleanse the data used for knowledge extraction in the field of power grid fault event reasoning. This involves reviewing and verifying the data prior to knowledge and relationship extraction. The non-text data processing part is mainly used for processing data recorded in tables formed by equipment parameters and pictures, arranging the descriptive data in the tables and the data in the pictures to form text data by using manual or related picture to text software, and then processing missing values, abnormal values, dirty data or repeated values. Finally, the text data can be used [22].
Another work of data preprocessing is to deal with the noise in the data. Noise refers to the random error in the data. In the actual production process, the random error generated under normal circumstances is normal, but the error will still affect the function of the data application part, so it is still necessary to filter the noise in the data [23].
Data preprocessing involves not only data cleansing but also effective pre-processing of the data to make it readily usable. First of all, we need to organize the sentences in the original text data into usable corpus in terms of single sentences and phrases.
Dividing the relationship between power failure events
The function of relation extraction is to determine a relation between events. Therefore, when it is an independent task, the general idea is to extract events first and then determine the relationship between events. However, the research results or related papers of this way of thinking have no relevant findings [24]. The BiGRU model of knowledge extraction is combined with another Attention to extract the relationship between events. The BiGRU component extracts the corresponding label sequence of a sentence, which is then utilized to execute relation extraction. The Attention technique is employed to facilitate multi-classification of related relations [25].
In the Attention, the multi-classification task uses the softmax classifier to predict the classification labels of sentences. In this section, the calculation process is expressed as Formula (1) and Formula (2) with the previous label sequence as an input.
The loss function denotes the negative log-likelihood function of the actual categorical label, which is formulated as Formula (3).
Through the principle of the above formula, the corresponding CRF model is constructed, and then the parameters are trained, and finally the relationship in the event is extracted.
The purpose of data storage is to preserve the outcomes of knowledge extraction via the Redis database storage system. Because the Redis uses the Key-Value form to store relevant data, an event is used as the Key. The attribute is used as the value of the Key, and then the corresponding Key-Value pair is formed and stored in the database storage system [26].
The first is the need for data processing of events and attributes stored in Redis. Because the Redis contains five data structure types, the data in this topic does not need ordered sort and hash as related data structures. The list contains repeated data but the attribute does not contain the actual data type. Therefore, the data structure types used in the Redis are mainly string and set. Where, string is used as the stored key value and also represents the corresponding event; the set is used as the attribute value corresponding to the event and as the corresponding value.
Experimental results and analysis
Experimental environment
To validate the overall effectiveness of the proposed model, it is imperative to conduct experimental testing. The IEEE14-node power grid structure simulation system is constructed by using MATLAB simulation software and simulink, and the simplified distribution network topology simulation model is shown in Fig. 5.

Structure diagram of IEEE 14-node system.
In Fig. 5, L1-L4 are overhead lines and L5-L9 are cable lines; L10-L13 are cable lines. The basic parameters of various lines are set as Table 1.
Simulation parameters
The dataset employed in this study is derived from power grid fault event reasoning data obtained from a power grid company. The dataset comprises a training set and a test set. The training set contains 34.2k sentences and 1547.8k words, while the test set consists of 2.9k sentences and 109.3k words. Due to the model’s large scale and the considerable amount of training data required, complete model training is time-consuming. If only a small part of data is sampled for training, the model may be in an under-fitting state, and the experimental conclusions obtained in this state may be inconsistent with those obtained in complete training. Therefore, it is necessary to select appropriate parameters to complete data set tuning. The learning rate is employed to regulate the model’s training speed. A high learning rate may cause the model to fluctuate during training, while a low learning rate may result in slow training. The regularization coefficient is primarily utilized to prevent over-fitting. Activation function is used to introduce nonlinear transformation, which affects the expressive ability of the model. Through the learning rate, regularization coefficient, activation function and other parameters, the data set of the experiment is optimized. The specific parameter tuning values are shown in Table 2.
Data set tuning parameter settings
Data set tuning parameter settings
When it comes to labeling strategies and evaluation metrics, named event recognition adopts various labeling strategies including BIO mode, BIOE mode, and BIOES mode. This paper employs the BIOES annotation strategy, where B (Begin) signifies the beginning of an event, I (Intermediate) denotes the middle section, O (Other) represents characters unrelated to the tag, E (End) indicates the end, and S (Single) signifies a single character.
Data before data preprocessing is shown in Table 3.
Before data preprocessing
The result data after data preprocessing is shown in Table 4.
After data preprocessing
In Table 3, the normal text data takes a sentence or a short sentence with complete meaning as a paragraph. Table 4 is the text data after Pretreatment, and the relevant content of Pretreatment is added.
Under the premise of setting the experimental environment in Section 4.1, the evaluation of power grid fault event reasoning is conducted using accuracy rate, recall rate, and F1 value as the test criteria. The testing process is outlined below:
Step 1: Write the power grid fault event reasoning crawler script with Python, build the knowledge map database with Secondary, and Neo4 j the ontology definition with Protege.
Step 2: Use Python programming language to train and optimize the model, use PyTorch to build the model training process, use Scikit-learn to evaluate the model, and use tools such as SpaCy to extract entities.
Step 3: In Python environment, NLTK natural language processing tools are used for data preprocessing and entity extraction of power grid fault event processing, and Jupyter Notebook interactive tools are used for testing and visual display of results.
Step 4: Python is utilized to compose the analysis code, which enables the model to be evaluated based on accuracy rate, recall rate, F1 value, and other relevant metrics. The results are displayed in the Jupyter Notebook interface.
In the process of software implementation, appropriate tools and technologies are selected according to the actual situation, and knowledge map construction, model training, experimental testing and result analysis are carried out to achieve more accurate and efficient experimental results.
Analysis of data results
Text data preprocessing result
In order to input the data into the model for named event recognition, the text data is preprocessed. Set T1 text and T2 text. T1 text data is power grid fault data. The specific content is that at 14 : 20 on October 10, 2022, a power grid fault occurred in a city in a province, resulting in a power outage for the majority of residents. The estimated recovery time is 3 hours. The cause of the accident is under investigation. T2 text data is emergency notification data, the specific content is 11 : 50 on February 11th, 2023. Due to major power grid equipment failure, the whole area was blacked out. The fault location is located in the power bureau of a city center in a province, and it is being urgently handled. The estimated repair time is 6 hours. Please understand. T1 text and T2 text need to be processed, and the higher the predicted value, the better the data preprocessing effect. The processed results are shown in Fig. 6.

Accuracy of T-1 and T-2.
According to Fig. 6, in the test results of data preprocessing, both T1 text and T2 text can get the expected results. The pretreatment results of text data are all above 95. This is because the model results are realized in knowledge extraction, so in the process of training and testing, model training and result testing are optimized.
The evaluation index of named event recognition is accuracy (P). The accuracy P represents the proportion of the correct result value in the training results to all the training data. The specific formula is:
Where T p is the number of events correctly identified by the model. F p is the number of irrelevant events identified by the model. Different models were trained for 20000 times, and the accuracy of each round of training was recorded during the training process. The accuracy results of different models are shown in Table 5.
Accuracy results of each model
In Table 5, the model is compared with other models. In the relation extraction part, the relation between events in a sentence is classified by the idea of multi-classification. And relation extraction is carried out on sentences containing two or more two events. Therefore, the accuracy of the model is improved.
The evaluation index of named event recognition is recall (R). The recall R is the proportion of the recall target category in the field of concern. The specific formula is:
Where F n is the amount of events that are relevant but not recognized by the model. The recall results of different models are shown in Table 6.
Recall results of each model
The higher the recall rate, it means that the model used can handle more power event data, and the network power resources are being fully utilized. As can be seen from Table 6, the proposed model can achieve a recall rate of 70.23%, which can ensure the full utilization of power resources to a certain extent, ensure the better power data processing effect, and will not affect the normal operation of other applications. However, other models have low recall rate, which is easy to waste resources and reduce the effect of power data processing.
The F1 value is a statistical measure employed to assess the precision of binary classification models. It considers both the accuracy and recall of the classification model and can be interpreted as a weighted average of these two metrics. The F1 value ranges from 0 to 1, with higher values indicating superior model performance. The formula for F1 value is as follows:
The relation extraction results of this subject are compared with the results of other relation extraction models, and the F1 value is used as the result for comparison. The results are shown in Table 7.
F1 value results of each model
The experimental results in Table 7 show that the proposed model is superior to other models, and the numerical result can reach 2.000218. However, the F1 values of other models can satisfy more than 5, but they are still significantly lower than the F1 values of the proposed model. This could be attributed to the knowledge map’s entity extraction of power events using the transformer model, BiGRU model, and CRF model. This approach enhances the transmission efficiency of power event data in the Internet of Things, thereby improving the overall data transmission effectiveness.
Given the assortment of power grid fault data and diverse knowledge extraction methods, this paper introduces the entity extraction model of knowledge map to study power grid fault event reasoning. Transformer-BiGRU-CRF model is designed to extract knowledge mapping events from text data, which improves the effect of attribute extraction of power fault events. Use deletion method and difference method to clean up the missing values in the data; Using regression method to deal with noise data in data. Construct a power grid fault event reasoning model to preprocess the cleaned power text data to improve the prediction degree; Extracting classification labels of predicted sentences through relationships. The corresponding power events are stored by setting the character string as the storage key value, which enhances the processing efficiency of power fault events. The experimental findings indicate that the proposed model is effective in handling power failure events, and has a high degree of prediction when preprocessing data, a high accuracy when analyzing data, a high recall rate and a high F1 value. As a result, the model can be efficiently implemented in real-world power systems. However, the reasoning process of the large-scale knowledge map requires significant time and computing resources, which can be challenging. Consequently, future research should focus on optimizing the platform using deep learning algorithms such as neural networks to enhance the model’s efficiency and performance.
Declaration
The authors declare that there are no conflicts of interest regarding the publication of this paper.
Footnotes
Acknowledgments
The study was supported by “Research on intelligent construction method of power grid accident reserve plan based on knowledge graph” (Grant No. SGSHQP00HBJS2103818).
