A power grid line impedance prediction method and system
By combining time series decomposition and derivative dynamic time warping algorithms with the CNN-Transformer model, the noise processing and gradient problems in power grid line impedance prediction are solved, achieving higher prediction accuracy and model training effect.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANDONG UNIV
- Filing Date
- 2023-03-24
- Publication Date
- 2026-04-10
AI Technical Summary
Existing power grid line impedance prediction algorithms have shortcomings in noise handling and gradient vanishing/exploding problems, and cannot effectively extract impedance change trend data, resulting in low prediction accuracy.
We employ k-medoids clustering with distance optimization using time series decomposition and derivative dynamic time warping algorithm, combined with CNN-Transformer model, to predict power grid line impedance, thereby improving accuracy through classification prediction methods.
It effectively reduces noise, extracts the periodicity of curves, improves the accuracy of power grid line impedance prediction, and enhances the training set size and predictive ability of the model.
Smart Images

Figure CN116338322B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of electric power engineering, in particular to a power grid line impedance prediction method and system. BACKGROUND
[0002] The statements in this section merely provide background technology related to the present application and do not necessarily constitute prior art.
[0003] With the full coverage of smart meters and collection, the advanced application of smart meters has become an important means of distribution network operation management, not only promoting the integration of operation and distribution, but also improving the economic and social benefits; at the same time, the data collection frequency and sharing frequency in the power grid are improved from "daily collection, daily sharing" to "hourly collection, real-time sharing", which provides a good foundation for deep mining of smart meter non-metering functions.
[0004] By detecting the total load impedance at the transformer area and the apparent load impedance at the meter, the change trend of the load impedance of the transformer area can be predicted, and the correlation between the total load impedance change of the transformer area and the user load impedance can be analyzed, which is used to find and locate the problem line of poor contact or heavy load damage, and provides basis for line maintenance, reconstruction and fault location. The current line impedance prediction algorithm mostly uses improved traditional algorithm, with the rise of artificial intelligence, modern prediction methods such as machine learning and deep learning are more and more applied in the field of power load prediction.
[0005] The inventor found that the change value of the line impedance of the power grid is related to the power habit, time, temperature and the like of the user, and has the characteristics of periodicity and large noise, and the existing noise filtering scheme often only processes the abnormal data, and cannot effectively extract the trend data of the impedance change; the modern load impedance prediction algorithm mostly uses single algorithm model such as RNN (Recurrent Neural Network, recurrent neural network) and LSTM (Long Short-Term Memory, long short-term memory network), and has problems such as gradient disappearance / gradient explosion when predicting the impedance. SUMMARY
[0006] In order to solve the defects of the prior art, the present application provides a power grid line impedance prediction method and system, which divides a plurality of long-time line impedances into a plurality of sequences after noise reduction for clustering analysis, can effectively reduce the curve noise and extract the periodicity of the curve, and improves the prediction accuracy by the classification prediction method.
[0007] In order to achieve the above purpose, the present application adopts the following technical scheme:
[0008] The first aspect of the present application provides a power grid line impedance prediction method.
[0009] A power grid line impedance prediction method comprises the following processes:
[0010] Obtain impedance history data of a power grid line;
[0011] Perform time series decomposition on the obtained impedance history data to obtain a plurality of trend signal data;
[0012] Cluster the obtained trend signal data using a clustering algorithm optimized by a derivative dynamic time warping algorithm distance to obtain a plurality of classifications;
[0013] Obtain impedance prediction data of the power grid line in a future set time period using a pre-trained prediction model on the trend signal data in the same classification.
[0014] As a further limitation of the first aspect of the application, the time series decomposition on the obtained impedance history data to obtain a plurality of trend signal data comprises:
[0015] The noise signal data is removed and the trend signal data is retained by performing noise reduction processing on the impedance history data using a time series decomposition method.
[0016] As a further limitation of the first aspect of the application, the clustering using a k-medoids clustering algorithm optimized by a derivative dynamic time warping algorithm distance comprises:
[0017] A representative object is randomly selected for each cluster, and the similarity between the remaining objects and the representative object is calculated using a derivative dynamic time warping algorithm to generate a distance matrix, and the objects are assigned to the nearest cluster according to the distance from the representative object.
[0018] Then, the representative objects are repeatedly replaced by non-representative objects until the clustering is completed.
[0019] As a further limitation of the first aspect of the application, after the clustering operation is completed, a CNN-Transformer model is used for prediction, comprising:
[0020] The Transformer model uses a LogSparse self-attention mechanism, and for sequence data of length L, the O(logL) dot products of each unit in each layer are calculated and stacked into O(logL) layers to enable the prediction model to access the information of each unit, and a matrix composed of query vectors (Q), key vectors (K), and value vectors (V) is obtained, and then a one-dimensional dilated convolutional neural network is used to further extract the features of the time series.
[0021] As a further limitation of the first aspect of the application, position encoding is added before the trend signal data is input into the prediction model to give the time series time and sequence information.
[0022] As a further limitation of the first aspect of the application, when training the prediction model, each class of trend signal data is input into the prediction model for training separately, so as to obtain model parameter weights belonging to each class.
[0023] As a further limitation of the first aspect of the application, before prediction using the prediction model, the clustered trend signal data is converted into a frequency domain signal through a synchronous compression wavelet transform, and the transformed frequency domain signal is used as input data of the prediction model.
[0024] The second aspect of the application provides a power grid line impedance prediction system.
[0025] The power grid line impedance prediction system comprises:
[0026] A data acquisition module configured to acquire impedance historical data of a power grid line;
[0027] A trend signal acquisition module configured to perform time series decomposition on the acquired impedance historical data to obtain a plurality of trend signal data;
[0028] A signal clustering module configured to cluster the obtained trend signal data using a clustering algorithm optimized by a derivative dynamic time warping algorithm distance to obtain a plurality of classifications;
[0029] An impedance prediction module configured to use a pre-trained prediction model on trend signal data of the same classification to obtain impedance prediction data of the power grid line for a future set time period.
[0030] The third aspect of the application provides a computer readable storage medium having a program stored thereon, the program being executed by a processor to implement the steps of the power grid line impedance prediction method according to the first aspect of the application.
[0031] The fourth aspect of the application provides an electronic device comprising a memory, a processor, and a program stored on the memory and executable on the processor, wherein the processor implements the steps of the power grid line impedance prediction method according to the first aspect of the application when executing the program.
[0032] Compared with the prior art, the application has the following beneficial effects:
[0033] 1. The application divides a plurality of long-time line impedances into a plurality of sequences for clustering analysis after noise reduction, which can effectively reduce curve noise and extract periodicity of the curve, and through the classification prediction method, the prediction accuracy is improved.
[0034] 2、The original signal is divided into a trend signal and a noise signal in a time series decomposition manner, the trend signal reflects the overall change trend of the signal, removes noise, extracts the trend of the signal, and ensures the accuracy of subsequent prediction.
[0035] 3、The impedance trend signals of different branches of the low-voltage area are classified according to the k-medoids clustering algorithm optimized by the DDTW distance, and the impedance trend signals of each class are trained under the same model, because the power consumption habits of users in the same area are similar, and the impedance change curves of branches are similar, classifying the signals and training them respectively is beneficial to increase the number of training sets and improve the prediction accuracy of the model.
[0036] 4、The prediction model of the present application adopts a CNN-Transformer model, CNN can realize feature extraction of the signal and reduce the dimension of the signal; Transformer has the ability to capture long-distance dependence and interaction, and has great advantages in time series prediction; by combining CNN and Transformer, the prediction accuracy can be effectively improved.
[0037] The advantages of the additional aspects of the present application will be partially given in the following description, partially will become obvious from the following description, or will be known by the practice of the present application. BRIEF DESCRIPTION OF DRAWINGS
[0038] The drawings accompanying the specification of the present application serve to provide a further understanding of the present application, the illustrative embodiments of the present application and the description thereof serve to explain the present application, and do not constitute an improper limitation of the present application.
[0039] Figure 1 A flowchart of a power grid line impedance prediction method provided for embodiment 1 of the present application is shown in the figure.
[0040] Figure 2 A prediction model structure diagram provided for embodiment 1 of the present application is shown in the figure.
[0041] Figure 3 A LogSparse-Attention network module schematic diagram provided for embodiment 1 of the present application is shown in the figure.
[0042] Figure 4 A one-dimensional dilated convolution (1DCNN) structure diagram provided for embodiment 1 of the present application is shown in the figure. DETAILED DESCRIPTION
[0043] The present application will be further described below in conjunction with the drawings and embodiments.
[0044] It should be noted that the following detailed description is exemplary in nature and is intended to provide further description of the application. 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 belongs.
[0045] It is also to be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of example embodiments in accordance with the application. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in this specification, specify the presence of stated features, steps, operations, elements, components, and / or groups thereof, but do not preclude the presence or addition of one or more other features, steps, operations, elements, components, and / or groups thereof.
[0046] The embodiments in the application and the features in the embodiments can be combined with each other without conflict.
[0047] Embodiment 1
[0048] As shown in the following table, the embodiment 1 of the application provides a power grid line impedance prediction method, including the following processes: Figure 1
[0049] S1: Impedance data acquisition
[0050] The data of the application is derived from the low-voltage area user power consumption data of the power consumption information collection system of a certain power grid company, which includes voltage U, current I, power P, etc. The real-time impedance value of each branch is solved by constructing the impedance model of the smart meter of the user and the outlet line of the secondary side of the transformer.
[0051] S2: Time series decomposition
[0052] After calculating the impedance change curve of a branch in a period of time, in order to extract the trend of the impedance change curve, the time series decomposition method is used for data denoising processing. The time series decomposition algorithm is based on the idea of moving average, smoothing the periodic term and highlighting the trend term, as shown in the formula:
[0053]
[0054] Where X is the original signal, X t is the trend term, X s is the seasonal term; AvgPool(·) is used for moving average, and padding operation is performed to keep the sequence length unchanged
[0055] S3: Cluster analysis
[0056] By clustering analysis of the trend signals obtained by the above time series decomposition, the trend signals are divided into several classes (C1, C2...C n ), different classes are respectively predicted, and the same class data is predicted by the same model, and when the trend signal is clustered, the k-medoids clustering algorithm optimized by the DDTW distance is adopted.
[0057] S3.1: DDTW_k-medoids clustering principle
[0058] S3.1.1: First, randomly select a representative object for each cluster; the remaining objects are calculated in the form of DDTW to calculate the similarity with the representative object, and a distance matrix is generated, and the distance from the representative object is assigned to the nearest cluster;
[0059] S3.1.2: Then repeatedly replace the representative object with a non-representative object to improve the quality of clustering;
[0060] S3.1.3: The quality of the clustering result is estimated by a cost function, which evaluates the average dissimilarity between the object and its reference object.
[0061] S3.2: DDTW algorithm
[0062] The derivative dynamic time warping algorithm (DDTW) can measure the similarity of two discrete sequences (which are not necessarily related to time) or the distance between the two sequences. DDTW stretches or shortens the unknown quantity until it is consistent with the length of the reference template. In this process, the unknown sequence will be twisted or bent so that its characteristic quantity corresponds to the standard mode. The DTW algorithm calculates the distance between the corresponding points of the two time series according to the Euclidean distance, and the DDTW replaces the distance formula of the DTW algorithm by estimating the square of the derivative difference between the corresponding points of the two time series, and improves the "singular point" problem in the DTW.
[0063] S4: Model construction
[0064] S4.1: CNN feature extraction
[0065] The present application focuses on the trend of line impedance change in low-voltage area of power grid, and the trend is a discrete time series signal. A large number of experiments have proved that CNN has strong ability in feature extraction, and when CNN is applied to time series, 1D CNN is needed to extract the features of time series.
[0066] Since the modeling length of the time series by CNN is limited by the size of the convolution kernel, if you want to capture longer dependencies, you need to stack many linear layers, which will increase the training time. In order to reduce the complexity of the model and at the same time capture the long-term time series dependencies, the present application designs a time series feature extraction method based on one-dimensional dilated convolution (1DCNN).
[0067] 1DCNN allows interval sampling of the input at convolution, with a sampling rate controlled by the number of layers d in Figure 4 The lowest layer has d = 1, meaning that every point in the input is sampled. The middle layer has d = 2, meaning that every 2nd point in the input is sampled. In general, higher layers use larger values of d. Thus, dilated convolution allows the size of the effective window to grow exponentially with the number of layers. This allows the convolutional network to have a large receptive field with relatively few layers.
[0068] For a one-dimensional time series data x ∈ R n and a filter f : {0,..., k - 1} → R, the calculation formula of 1DCNN is:
[0069]
[0070] where d is the dilated factor and k is the filter size.
[0071] S4.2: Synchronous wavelet transform (SWT)
[0072] The clustered trend signal is converted into a frequency domain signal by synchronous wavelet transform (SWT). SWT is a method of reassignment, which assigns values on a plane to different time-frequency points, with the purpose of "sharpening" the time-frequency representation. It changes the blurring of the wavelet transform result to obtain a clearer time-frequency distribution, and has a higher video resolution than the wavelet transform. The main process is as follows.
[0073] S4.2.1: Discrete wavelet transform
[0074] The discrete wavelet transform can decompose and reconstruct the original signal using a wavelet basis, and can realize noise reduction processing. The formula of the discrete wavelet transform is as follows:
[0075]
[0076] where a is the scale and b is the translation parameter.
[0077] S4.2.2: Phase transform
[0078] The phase transform of the discrete wavelet is:
[0079]
[0080] W f The partial derivative of W
[0081]
[0082] In the formula:
[0083] S4.2.3: Synchronization compression to get T f (w,b)
[0084] The discrete wavelet transform expression of f is defined as:
[0085]
[0086] In the formula: the scale coefficient a is expressed by the form of index, then The frequency grid constitutes the frequency axis, and the definition of the frequency grid is w I , and the time step is Δ t According to the Nyquist sampling theorem, the maximum frequency is
[0087] S4.3: CNN-Transformer model
[0088] The Transformer model is a model based on an encoder-decoder architecture, and the encoder and decoder are stacked based on self-attention modules. The embedding representation of the input sequence and the output sequence will be added with positional encoding, and then input into the encoder and decoder respectively.
[0089] S4.3.1: Positional encoding
[0090] The Transformer model can process time series in parallel, which improves work efficiency, but loses the relevance of sequence order, so it is necessary to add positional encoding to the data before inputting the model, which gives the sequence time and order information. The formula of the fixed positional encoding based on the sine function and the cosine function is as follows:
[0091]
[0092] S4.3.2: LogSparse self-attention mechanism
[0093] The self-attention mechanism is mainly used to determine the correlation between elements in a single input. The initial input of the attention layer is converted into Query, Key, and Value. Assuming that the input sequence is The output sequence is The calculation process of the self-attention mechanism is as follows:
[0094] (1) For each input x i , we first linearly map it to three different spaces to get the query vector , the key vector , and the value vector
[0095] For the whole input sequence X, the process of linear mapping can be written as:
[0096]
[0097] where, are the parameter matrices of linear mapping; Q = [q1, …, q N ], K = [k1, …, k N ], V = [v1, …, v N ] are the matrices composed of query vectors, key vectors, and value vectors, respectively; D k × N is the dimension of the query vector and key vector matrix, D v × N is the dimension of the value vector, where D k , D v is the dimension of the parameter matrix.
[0098] (2) For each query vector q n ∈ Q, the output vector h n can be calculated:
[0099]
[0100] where n, j ∈ [1, N] are the positions of the output and input vector sequences, and a nj represents the weight of the nth output paying attention to the jth input. If the scaled dot product is used as the attention scoring function, the output vector sequence can be written as:
[0101]
[0102] where softmax(·) is a function of column-wise normalization.
[0103] (3) For a sequence of length L, calculating the attention score between each pair of cells will result in O(L 2 ) memory usage, making it difficult to model long sequences with fine-grained and strong long-term dependencies. To address these two problems, the LogSparse-Attention network module is designed. When building the model, O(log L) dot products of each cell in each layer need to be calculated, and stacked to O(log L) layers. The model will be able to access the information of each cell, as shown in Figure 3 .
[0104] S4.3.3: Feedforward Network
[0105] The feed forward network (FFN) goes through this exact same feed forward neural network, which consists of two linear transformations, i.e., two fully connected layers, with a ReLU activation function, which can be represented as:
[0106] FFN(x) = max(0, xW1 + b1)W2 + b2 (11)
[0107] The prediction model of the application adds a 1DCNN Block before the feed forward network of the encoder and the decoder for feature extraction of data.
[0108] S4.4: Model structure table
[0109]
[0110] S5: Prediction analysis
[0111] The trend signals are divided into several classes (C1, C2,..., Cn) through cluster analysis, and then converted into time-frequency signals through synchronous compression wavelet transform. In the training, each class is inputted separately for training, so as to obtain the parameter weight of the overall network belonging to each class. In the test, it is firstly judged which class the sequence to be predicted belongs to, and then the corresponding parameter weight is used for calculation to obtain the test value. The mean square error between the test value and the actual value is calculated to evaluate the accuracy of the prediction model.
[0112] Embodiment 2
[0113] The embodiment 2 of the application provides a power grid line impedance prediction system, comprising:
[0114] A data acquisition module configured to acquire impedance historical data of a power grid line;
[0115] A trend signal acquisition module configured to perform time series decomposition on the acquired impedance historical data to obtain a plurality of trend signal data;
[0116] A signal clustering module configured to cluster the obtained trend signal data by using a derivative dynamic time warping algorithm distance optimized k-medoids clustering algorithm to obtain a plurality of classifications;
[0117] An impedance prediction module configured to use a pre-trained prediction model on the trend signal data of the same classification to obtain impedance prediction data of the power grid line in a future set time period.
[0118] The working method of the system is the same as the power grid line impedance prediction method provided in embodiment 1, and will not be repeated here.
[0119] Embodiment 3
[0120] Embodiment 3 of the present application provides a computer readable storage medium, which stores a program, and the program is executed by a processor to implement the steps in the power grid line impedance prediction method according to Embodiment 1 of the present application.
[0121] Embodiment 4:
[0122] Embodiment 4 of the present application provides an electronic device, which comprises a memory, a processor, and a program stored in the memory and executable on the processor, and the processor implements the steps in the power grid line impedance prediction method according to Embodiment 1 of the present application when executing the program.
[0123] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. The present application can have various modifications and changes for those skilled in the art. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for predicting the impedance of power grid lines, characterized in that, Includes the following processes: Obtain historical impedance data of power grid lines; The acquired historical impedance data is decomposed into a time series to obtain multiple trend signal data. The obtained trend signal data is clustered using a derivative dynamic time warping algorithm and a distance-optimized clustering algorithm to obtain multiple categories. A pre-trained prediction model is used to obtain impedance prediction data for the current power grid line over a set time period in the future for trend signal data of the same category. Clustering is performed using a k-medoids clustering algorithm with distance optimization based on derivative dynamic time warping, including: For each cluster, a representative object is randomly selected. The remaining objects are used to calculate the similarity with the representative object using the derivative dynamic time warping algorithm to generate a distance matrix. The objects are then assigned to the nearest cluster based on their distance from the representative object. Then, non-representative objects are repeatedly replaced with representative objects until the clustering is complete; The prediction model uses a one-dimensional convolutional neural network to extract features from the time series, including: One-dimensional convolutional neural networks allow for interval sampling of the input during convolution, with the lowest sampling rate being the highest, and the sampling rate gradually decreasing from the lowest to the highest layer. After feature extraction, the LogSparse-Transformer model is used for prediction, including: Using the LogSparse self-attention mechanism, for sequence data of length L, the function is to calculate the self-attention value of each unit in each layer. Dot product, stacked to Layers are created so that the prediction model can access information from each unit.
2. The power grid line impedance prediction method as described in claim 1, characterized in that, The acquired historical impedance data was decomposed into a time series to obtain several trend signal data, including: The time series decomposition method is used to denoise historical impedance data, removing noisy signal data and retaining trend signal data.
3. The power grid line impedance prediction method as described in claim 1, characterized in that, During the training of the prediction model, each type of trend signal data is input into the prediction model separately for training, thereby obtaining the model parameter weights belonging to each type. Alternatively, location encoding can be added to the trend signal data before it is input into the predictive model, giving the time series information time and order.
4. The power grid line impedance prediction method as described in claim 1, characterized in that, Before using the prediction model for prediction, the clustered trend signal data is converted into a frequency domain signal through synchronous compressed wavelet transform, and the transformed frequency domain signal is used as the input data of the prediction model.
5. A power grid line impedance prediction system, characterized in that, include: The data acquisition module is configured to acquire historical impedance data of the power grid lines. The trend signal acquisition module is configured to perform time series decomposition on the acquired historical impedance data to obtain multiple trend signal data. The signal clustering module is configured to cluster the obtained trend signal data using a derivative dynamic time warping algorithm distance optimization clustering algorithm to obtain multiple classifications. The impedance prediction module is configured to use a pre-trained prediction model to obtain impedance prediction data for the current power grid line over a set time period in the future, based on trend signal data of the same category. Clustering is performed using a k-medoids clustering algorithm with distance optimization based on derivative dynamic time warping, including: For each cluster, a representative object is randomly selected. The remaining objects are used to calculate the similarity with the representative object using the derivative dynamic time warping algorithm to generate a distance matrix. The objects are then assigned to the nearest cluster based on their distance from the representative object. Then, non-representative objects are repeatedly replaced with representative objects until the clustering is complete; The prediction model uses a one-dimensional convolutional neural network to extract features from the time series, including: One-dimensional convolutional neural networks allow for interval sampling of the input during convolution, with the lowest sampling rate being the highest, and the sampling rate gradually decreasing from the lowest to the highest layer. After feature extraction, the LogSparse-Transformer model is used for prediction, including: Using the LogSparse self-attention mechanism, for sequence data of length L, the function is to calculate the self-attention value of each unit in each layer. Dot product, stacked to Layers are created so that the prediction model can access information from each unit.
6. A computer-readable storage medium having a program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps in the power line impedance prediction method as described in any one of claims 1-4.
7. An electronic device comprising a memory, a processor, and a program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps in the power grid line impedance prediction method as described in any one of claims 1-4.
Citation Information
Patent Citations
Method and system for predicting power
CN103886223A
Road performance predicting method based on clustering classification
CN108090635A