Multi-label composite harmonic source identification method based on knowledge representation and Transform fusion
By combining TransR knowledge representation and Transformer model, accurate identification of composite harmonic sources in complex power grid environments is achieved, which solves the shortcomings of traditional methods in feature extraction and recognition accuracy, improves the recognition accuracy and interpretability of the model. in high-dimensional and time-varying power data.
Patent Information
- Application Number
- CN202310750215.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-25
- Publication Date
- 2024-12-27
AI Technical Summary
Traditional harmonic source identification technology is difficult to accurately identify composite harmonic sources in complex power grid environments, and relies on a large amount of prior knowledge and computing resources to effectively utilize big data, resulting in insufficient recognition accuracy and adaptability.
Using a multi-label classification model based on TransR knowledge representation and Transformer, the harmonic data features are extracted independently through time-frequency feature analysis and multi-head attention mechanism to achieve accurate identification of composite harmonic sources, overcoming the insufficient feature extraction of traditional methods and Identification problems with low accuracy.
Improves the recognition accuracy of composite harmonic sources and interpretability of the model, has good noise resistance and generalization capabilities, and can be applied to high-dimensional, time-varying, and nonlinear power data, solving the traditional method for complex feature fitting and data-driven identification deficiency.
Smart Images

Figure HDA0004300876760000011 
Figure HDA0004300876760000012
Abstract
Description
Technical Field
[0001] The invention relates to a multi-label composite harmonic source identification method based on TransR knowledge representation and Transformer, and belongs to the technical field of power big data processing. Background Art
[0002] In recent years, my country's energy green and low-carbon transformation has made important progress, and renewable energy installations have gradually become the main body of my country's new power generation installations. However, the large-scale integration of clean energy into the power grid has increased the randomness and volatility of the power grid. In addition, due to the rapid development of ultra-high voltage and smart grids, a large number of new power electronic devices and nonlinear loads have been connected to the power grid, and the new power system has shown high penetration, power electronics, and multi-source multi-conversion characteristics. Correspondingly, the harmonic problem in the distribution network has also undergone a fundamental change. The sources of harmonics are richer, the generation mechanism is more complex, and the situation of compound harmonic sources is becoming more common.
[0003] Traditional harmonic source identification technologies are mostly based on mathematical statistics methods and rely on prior knowledge combined with mechanism analysis to build mathematical models. The data identification accuracy is low and the universality is poor. Due to the development of new power systems, the harmonic data of distribution networks has high-dimensional, time-varying, and nonlinear characteristics, high complexity, and difficulty in characterization. The primary problem faced by harmonic source identification is that it is difficult to establish an accurate mathematical model under the condition of complex harmonic sources at the common connection point, or to use a simple mathematical model to describe its complex characteristics and time-frequency characteristics.
[0004] At present, the existing harmonic source identification methods are mainly divided into single-point method and multi-point method. The single-point method refers to harmonic analysis through the measurement value of a monitoring point, which is more suitable for situations where the harmonic source is single and concentrated. The single-point method includes: harmonic power method and harmonic impedance method, etc. The harmonic power method is more inclined to qualitatively judge whether there is a harmonic source in the power grid and to directional analyze whether the harmonic source is from the system measurement or the user side; the harmonic impedance method requires accurate harmonic impedance information to quantitatively identify the harmonic source, but because the actual power system is nonlinear and time-varying, the harmonic source is not fixed, and it is difficult to extract accurate impedance data. The multi-point method includes: harmonic state estimation and harmonic flow analysis, which can determine the location of the harmonic source in the system based on the topological map information, but cannot identify the specific type of the harmonic source.
[0005] Traditional methods based on mathematical statistics and prior knowledge combined with mechanism analysis to build models have shortcomings in completing this work. The root causes are at least the following three points: First, modeling of measured data in the real world requires a lot of prior knowledge support, and the quality of modeling directly affects the performance of the model and the accuracy of reconstructed data. In complex power grid environments, the factors that generate harmonics are becoming more and more complex. It is more difficult to fully and accurately grasp the mechanism of harmonic generation and build a harmonic source identification model, and its practicality and adaptability are poor; second, the method based on mechanism analysis does not make full use of the massive data generated by intelligent monitoring equipment in the big data era. The fitting results cannot reflect all the information of the harmonic source, cannot intuitively and effectively express the characteristics of the composite harmonic source, and requires a lot of calculations for feature extraction; third, data is not easy to obtain. For example, harmonic impedance, harmonic phase angle and topological structure cannot be directly obtained from the monitoring device in practice.
[0006] New energy grids are characterized by intermittency, random volatility and control complexity. The traditional harmonic source mechanism model is subject to certain limitations in application. Data-driven methods can break the barriers of harmonic mechanisms and make up for the shortcomings of mechanism models. The modeling process of harmonic source classification is divided into two steps: feature extraction and pattern classification. Among them, the multi-label classification method has an advantage in solving the problem of compound disturbance classification. Transformer, as an emerging model developed in recent years, has a relatively simple model structure and performs very well in processing sequence problems. Transformer is a typical model currently studied in the field of deep learning on data enhancement. It has the characteristics of not requiring modeling, relying entirely on data-driven methods, and being able to adaptively learn the potential characteristics of data.
[0007] This paper proposes a multi-label classification model that integrates knowledge representation and Transformer, and uses a data-driven approach to realize the identification of composite harmonic sources under new power systems. First, the frequency domain features of harmonic monitoring data at different times are extracted and triples are constructed; then, the time-frequency feature vector is obtained through knowledge representation through TransR. At the same time, the collection of time-frequency features increases the inter-class difference of composite harmonic data and improves the recognition accuracy. TransR knowledge representation provides rich semantic information and relationship representation, which increases the interpretability of the model; then the time-frequency feature vector is input into the Transformer model for training to learn the data features of different harmonic sources. The Transformer model can extract the features of different harmonic sources well through the multi-head attention mechanism to achieve accurate identification; finally, the fusion data is decoupled based on the multi-label classification method to achieve accurate identification of composite harmonic sources. It overcomes the problems of insufficient feature extraction and low recognition accuracy that may be caused by traditional methods based on mechanism model recognition. In addition, the model can be applied to other data with more complex features. It only needs to increase the number of Transformer modules and multi-head attention mechanisms as the complexity increases to ensure the full extraction of the potential features of the data, thereby achieving high-precision recognition and classification of the data, and has extremely high generalization ability and stability. Summary of the invention
[0008] The purpose of the present invention is to provide a new multi-label composite harmonic source data identification method based on knowledge representation and Transformer to address the problems that traditional harmonic source identification methods are difficult to fully extract power data features with complex feature relationships, and do not pay enough attention to composite harmonic source data, resulting in low data recognition accuracy.
[0009] The present invention adopts the Transformer model with powerful autonomous feature extraction capability as the main architecture, and combines TransR knowledge representation to construct a knowledge graph for harmonic data with complex features. Extracting features from the two dimensions of time and frequency can expand the difference between data and increase the recognition accuracy of complex harmonic sources. TransR knowledge representation converts semantic information into feature vectors and then integrates them into the harmonic source data sequence, which not only enriches the data features, but also constructs a knowledge graph to increase the interpretability of the model. The method of the present invention also has good noise resistance and generalization ability.
[0010] A multi-label composite harmonic source identification method based on knowledge representation and Transformer fusion is proposed. The method can be divided into three major processes. First, the time-frequency feature analysis of the harmonic source data is performed, and the knowledge graph is constructed through the TransR semantic representation. Then, the Transformer model is trained to further extract features. Finally, the composite data is decoupled based on multi-label classification to realize the classification and identification of composite harmonic sources. The specific steps of the three parts are as follows:
[0011] The steps of TransR time-frequency feature analysis are:
[0012] Step 1: Extract semantic features of each current amplitude of different harmonic sources at different times and construct a triple with the structure of (h, r, t), where h, r, t correspond to the head entity, relation, and tail entity respectively;
[0013] Step 2: Take the triples in step 1 as positive samples and construct negative samples based on the positive samples. The construction process keeps the relationship unchanged and replaces the head entity or tail entity with other entities that are different from the positive samples;
[0014] Step 3: Input the positive and negative samples into the score function F(x) of TransR respectively, and obtain the loss values A and B respectively. Through iterative optimization, the loss value (AB) / 2 is continuously approached to zero, so as to continuously weaken the head-tail entity relationship of the negative samples and strengthen the relationship between the head-tail entities of the positive samples.
[0015] Step 4: Concatenate the entity relationship vector set with semantic information generated in step 3 with the composite harmonic source data to obtain the training sample set of the Transformer model.
[0016] The steps for training the Transformer model are:
[0017] Step 1: Get the input sample and perform Layer Normalization to stabilize the model training process;
[0018] Step 2: Train a multi-head attention mechanism and input multiple self-attention mechanisms in parallel. Each attention mechanism learns a different representation space and generates different attention weights by calculating the similarity scores between queries, keys, and values;
[0019] Step 3: Perform residual connection to skip some layers of the input signal and add it to the output of that layer to help information flow better between layers;
[0020] Step 4: Perform the Layer Normalization operation again to normalize the output of the sub-layer so that the mean of the output is 0 and the variance is 1;
[0021] Step 5: A feed-forward neural network that maps the representation of each position to a higher-dimensional space and then reduces it back to the original dimension, with ReLU activations in the middle layers;
[0022] Step 6: Residual connection, which skips some layers and adds the input signal to the output of that layer to help information flow better between layers;
[0023] Step 7: Repeat the previous 5 steps until the data features are fully extracted and the feature vector is generated.
[0024] The steps for multi-label classification are:
[0025] Step 1: Input the feature vector obtained by Transformer model training into the global average pooling layer. The middle layer uses ReLU activation. Global average pooling averages the features of each channel of the entire feature vector to obtain a scalar value, reducing the spatial dimension of the input feature vector.
[0026] Step 2: Finally, use full connection and sigmoid activation function to output the judgment probability. Sigmoid is also called Logistic function, which is used for hidden layer neuron output. Its value range is (0,1). It can map a real number to the interval (0,1). Ideally, when the input is real data, the discriminator output is 1, and when the input is fake data, the discriminator output is 0.
[0027] Compared with the prior art, the method of the present invention has the following advantages:
[0028] (1) The present invention adopts deep learning technology, which can effectively avoid the cumbersome and complicated steps of traditional feature extraction and the difficulty in fitting complex features;
[0029] (2) In the distribution network, the temporal and spatial characteristics of power data are complex, and the upper and lower relationships are close. It often has complex characteristics such as high dimension, time variation, and nonlinearity. If traditional mathematical modeling is used to extract power data features, a large amount of prior knowledge support is required. The quality of modeling directly affects the performance of the model and the accuracy of reconstructed data. Using the model to fit complex features requires a huge amount of calculation, which may even be unbearable. The multi-label method based on knowledge representation and Transformer in the present invention can effectively solve the above problems;
[0030] (3) Training data samples are constructed from the two dimensions of time and frequency. Harmonic data features are fully extracted through TransR to increase the feature differences between composite data. The TransR layer is combined with the Transformer model to provide better representation learning and reasoning capabilities, enhance the model's ability to model entity relationships, increase the interpretability of the model, and enhance the overall generalization and robustness of the model.
[0031] (4) The model is trained based on a large amount of harmonic current data collected by the power system monitoring device, without considering conditions such as harmonic impedance, which solves the problem of unknown harmonic network parameters and asynchronous data at each monitoring point. A high accuracy rate was achieved in the experimental process of real data and simulated data, proving that the model has good generalization ability. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 It is a multi-label recognition network structure diagram based on knowledge representation and Transformer.
[0033] Figure 2 It is the TransR knowledge representation structure diagram. DETAILED DESCRIPTION
[0034] The following is combined with Figure 1 , Attachment Figure 2 The embodiments and examples provide a detailed introduction to the multi-label composite harmonic source identification method based on knowledge representation and Transformer, but the implementation of the present invention is not limited to this.
[0035] Example:
[0036] like Figure 1 As shown, the multi-label classification network structure based on knowledge representation and Transformer in this embodiment uses Transformer to construct the main model and build a model containing knowledge representation and multi-label classification.
[0037] like Figure 2 As shown, this embodiment generates semantic triples, uses the triples as input to the TransR module to learn semantic knowledge, and adds the trained entity relationship vectors to obtain an interpretable vector. It provides rich semantic information and relationship representation, fully extracts time-frequency features, increases the model's expression and reasoning capabilities, and improves model performance.
[0038] The present invention provides a multi-label composite harmonic source identification method based on knowledge representation and Transformer, which belongs to the technical field of power big data processing. The method can autonomously learn the characteristics of different harmonic source data by using the Transformer model, combine TransR for knowledge representation to obtain the time-frequency feature vector, and finally decouple the fused data based on the multi-label classification method to realize the accurate identification of the composite harmonic source. The simultaneous acquisition of time-frequency features increases the inter-class difference of the composite harmonic data and improves the recognition accuracy. TransR knowledge representation provides rich semantic information and relationship representation, which increases the interpretability of the model. TTM performs very well in solving the problem of composite harmonic source classification, and lays the foundation for further solving the problem of harmonic tracing and the division of responsibilities of multiple harmonic sources. The present invention is completely data-driven, and overcomes the limitation that only a single formula or equation based on the mechanism cannot be accurately solved in a complex power grid environment. The use of this method avoids the disadvantages of the traditional method such as the difficulty in obtaining harmonic impedance and the difficulty in measuring equations, and can accurately identify and classify composite harmonic sources.
Claims
1. A multi-label composite harmonic source identification method based on knowledge representation and Transformer fusion. The time-frequency feature vector is obtained through TransR for knowledge representation. At the same time, the time-frequency features are collected to increase the inter-class differences of the composite harmonic data. The time-frequency feature vector is then input into the Transformer model for training to learn the data features of different harmonic sources. The Transformer model can extract the features of different harmonic sources well through the multi-head attention mechanism to achieve accurate identification. Finally, the fused data is decoupled based on the multi-label classification method to achieve accurate identification of the composite harmonic source. The specific steps are as follows: Step 1: Analyze the time-frequency characteristics of the harmonic source data and construct a knowledge graph through TransR semantic representation; Step 2: Train the Transformer model and further perform feature extraction; Step 3: Decouple the composite data based on multi-label classification to achieve classification and identification of composite harmonic sources.
2. According to claim 1, a multi-label composite harmonic source identification method based on knowledge representation and Transformer fusion is characterized in that: The steps of TransR time-frequency feature analysis are: Step 1: Extract semantic features of each current amplitude of different harmonic sources at different times and construct a triple with the structure of (h, r, t), where h, r, t correspond to the head entity, relation, and tail entity respectively; Step 2: Take the triples in step 1 as positive samples and construct negative samples based on the positive samples. The construction process keeps the relationship unchanged and replaces the head entity or tail entity with other entities that are different from the positive samples; Step 3: Input the positive and negative samples into the score function F(x) of TransR respectively, and obtain the loss values A and B respectively. Through iterative optimization, the loss value (AB) / 2 is continuously approached to zero, so as to continuously weaken the head-tail entity relationship of the negative samples and strengthen the relationship between the head-tail entities of the positive samples. Step 4: Concatenate the entity relationship vector set with semantic information generated in step 3 with the composite harmonic source data to obtain the training sample set of the Transformer model.
3. According to claim 1, a multi-label composite harmonic source identification method based on knowledge representation and Transformer fusion is characterized in that: The steps for training the Transformer model are: Step 1: Get the input sample and perform Layer Normalization to stabilize the model training process; Step 2: Train a multi-head attention mechanism and input multiple self-attention mechanisms in parallel. Each attention mechanism learns a different representation space and generates different attention weights by calculating the similarity scores between queries, keys, and values; Step 3: Perform residual connection to skip some layers of the input signal and add it to the output of that layer to help information flow better between layers; Step 4: Perform the Layer Normalization operation again to normalize the output of the sub-layer so that the mean of the output is 0 and the variance is 1; Step 5: A feed-forward neural network that maps the representation of each position to a higher-dimensional space and then reduces it back to the original dimension, with ReLU activations in the middle layers; Step 6: Residual connection, which skips some layers and adds the input signal to the output of that layer to help information flow better between layers; Step 7: Repeat the previous 5 steps until the data features are fully extracted and the feature vector is generated.
4. According to claim 1, a multi-label composite harmonic source identification method based on knowledge representation and Transformer fusion is characterized in that: The steps for multi-label classification are: Step 1: Input the feature vector obtained by Transformer model training into the global average pooling layer. The middle layer uses ReLU activation. Global average pooling averages the features of each channel of the entire feature vector to obtain a scalar value, reducing the spatial dimension of the input feature vector. Step 2: Finally, use full connection and sigmoid activation function to output the judgment probability. Sigmoid is also called Logistic function, which is used for hidden layer neuron output. Its value range is (0,1). It can map a real number to the interval (0,1). Ideally, when the input is real data, the discriminator output is 1, and when the input is fake data, the discriminator output is 0.
