Zone area HPLC (High Performance Liquid Chromatography) data cleaning method and system based on complex environment
Through the improved Informer model, the data cleaning of electrical data in the high-speed power line carrier HPLC communication network is solved, and the problems of low data acquisition success rate and difficulty in fault location are achieved, achieving more efficient and accurate data acquisition and troubleshooting.
Patent Information
- Application Number
- CN202411767340.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-03-28
AI Technical Summary
In the field of power technology, high-speed power line carrier HPLC communication networks frequently have off-grid access due to electromagnetic interference, frequent topological changes, and self-healing functions, resulting in low data acquisition success rate, and existing tools are difficult to locate faulty nodes in time, which increases the difficulty of troubleshooting.
The Informer model improved based on the self-attention mechanism is used to preprocess and train the electrical data collected by the high-speed power line carrier HPLC in the table area. The real electrical data in the sliding window is predicted to determine whether the data is abnormal, and the noise, dirty, irrelevant and incomplete data are screened and identified.
It improves the accuracy of identifying abnormal data, reduces time complexity and memory usage, enhances the efficiency and accuracy of data cleaning, and ensures the reliability and accuracy of data acquisition.
Smart Images

Figure CN119719622A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power data processing, and in particular to a method and system for cleaning HPLC data in a complex environment. Background Art
[0002] In the field of power technology, the power substation mainly refers to the power supply range and area that a power supply transformer can cover. At present, the substation is mainly divided into four categories: urban residential substation, commercial substation, industrial substation and agricultural substation. Different substations cover different ranges and use different functions, and the cost and amount of electricity are also quite different. The electric energy meter used to calculate the total power consumption within the power supply range is called the substation total electric energy meter. Because the electric energy meter of a substation often includes residential electricity and commercial electricity, the data is relatively complex under certain circumstances. In order to analyze the data and count the use cycle of power data, effective data collection is required. High-speed power line carrier HPLC network status Due to the complex on-site electromagnetic environment, the data collector has electromagnetic interference problems and many interference factors, and its topology changes frequently, making it difficult to locate nodes with more communication problems; and because of the self-healing function of the high-speed power line carrier HPLC communication network, some communication units will frequently go off the network and enter the network, resulting in a low success rate of data collection; in addition, the on-site troubleshooting tools are simple and cannot respond to network status information in a timely manner. It often takes repeated searches to locate the faulty node, which increases the difficulty of troubleshooting.
[0003] The completion of the high-speed power line carrier HPLC communication network has improved the efficiency of collecting electricity information and provided solid basic data for promoting energy efficiency management, energy conservation and emission reduction, and low-carbon economic models. Through the implementation of the high-speed power line carrier HPLC substation intelligent operation and maintenance demonstration project based on online detection, the efficiency of on-site high-speed power line carrier HPLC network fault elimination can be improved, thereby improving the success rate of data collection of high-speed power line carrier HPLC communication units, which will be conducive to the overall improvement of the utilization rate of high-speed power line carrier HPLC communication equipment and fully tap and exert its asset value. In the existing smart grid, high-speed power line carrier HPLC technology has a core position. In order for the smart grid to achieve the purpose of accurate sensing, fast communication, and automatic control, the collected data needs to be cleaned.
[0004] The high-frequency data collection of HPLC has more time series data, so long sequence time-series forecasting (LSTF) can be used, that is, using a large amount of time series data about past behaviors to make long-term predictions, which plays an important role in many fields, such as sensor network monitoring, energy and smart grid management, economics and finance, and disease transmission analysis. With the growing demand for predictions, the prediction model must have stronger prediction capabilities. In response to the problem of long-term predictions, many experts and scholars have turned their attention to the Transformer model. The Transformer model was proposed by the Google Machine Translation Team in 2017. It is a neural network based on the attention mechanism and has been widely used in fields such as Natural Language Processing (NLP). The Transformer model completely abandons network structures such as Recurrent Neural Network (RNN) and Convolutional Neural Networks (CNN). Instead, it is based on the encoder and decoder architecture and uses the self-attention mechanism to calculate its input and output representations. In theory, it can reduce the maximum propagation path length of the network input signal to O(1) and avoid repetition and convolution. Therefore, the Transformer model has great potential to solve the LSTF problem.
[0005] However, the computation of its self-attention mechanism, memory consumption, and efficiency of the Transformer framework have become bottlenecks for the Transformer model to solve the LSTF problem. There have been some discussions and studies on improving the efficiency of self-attention, such as SparseTransformer, LogSparse Transformer, and Longformer. All three use heuristic methods to solve the quadratic computational complexity of self-attention. When the input / output data length is L, the complexity of the self-attention mechanism can be reduced to O(LlogL) in theory, but the efficiency gain of these methods is limited. Reformer reduces the complexity to O(LlogL) through local-sensitive hash self-attention, but it is only applicable to extremely long sequences. Recently, the Linformer model proposed by Sinong Wang has a linear complexity of only O(L), but in practical applications, the item matrix cannot focus on long sequence inputs, which may cause the complexity to increase to O(L2). Transformer-XL and Compressive Transformer use auxiliary hidden states to capture long-range dependencies, which may increase the quadratic computational complexity of self-attention.
[0006] When the HPLC high-frequency acquisition model is used, the architecture of the acquisition system is affected by the channel and the external environment, and there are noisy data, dirty data, irrelevant data, and incomplete data, which are all problems that need to be solved urgently. In particular, it is necessary to consider the two important factors of HPLC and transmission distance that cannot be graded, and design a reliable high-frequency acquisition method based on HPLC. According to the current status of data acquisition in different substations, there is a large gap in data acquisition between different professional stacks, so there are many problems, such as data noise, data missing, and data oversampling. It is necessary to realize the substation data minute-level same-frequency data acquisition and household transformer phase identification from three levels: minute-level same-frequency data acquisition and phase identification of intelligent edge devices to ensure the normal operation status and acquisition accuracy of intelligent edge devices; minute-level same-frequency data acquisition of concentrators and collectors to ensure the normal operation status and acquisition accuracy of concentrators and collectors; full-link monitoring of minute-level same-frequency data acquisition of local communication and upper-level communication equipment to ensure the normal end-to-end full-link operation status of local communication and upper-level communication equipment.
[0007] The main problems of HPLC can be summarized as follows:
[0008] (1) HPLC technology mainly uses existing power lines for data transmission, which has the advantages of low cost and perfect line deployment. However, the problems of power line transmission are line impedance matching, multipath reflection and noise interference. In long-distance transmission, data information will be distorted.
[0009] (2) HPLC collects data at different frequencies for different stations, and the collected data are quite different. The real-time data is collected every 15 minutes. HPLC can currently collect data at a high frequency, but the collected data is relatively complex and difficult to process. Summary of the invention
[0010] In order to solve the deficiencies in the prior art, the present invention provides a method for cleaning HPLC data in a complex environment, which can solve the technical problem that the equipment data in different areas are messy and easily distorted.
[0011] The present invention adopts the following technical solution.
[0012] A method for cleaning HPLC data in a complex environment comprises the following steps:
[0013] The electrical data of the high-speed power line carrier HPLC in the substation area is collected to form a data set, and the data set is preprocessed and divided to obtain a training data set;
[0014] Improve the Informer model based on the self-attention mechanism, and train the improved Informer model with the training data set;
[0015] Based on the real electrical data used in the sliding window, the electrical data is input into the improved Informer model after training to predict the electrical data. Whether the real electrical data is abnormal is determined based on whether the real electrical data value conforms to the distribution of the predicted value in the sliding window.
[0016] Preferably, the electrical data collected by the high-speed power line carrier HPLC in the substation area is formed into a data set, and the data set is preprocessed and divided to obtain a training data set, which specifically includes:
[0017] Collect area data according to the set time interval;
[0018] Mapping the collected area characteristic data into vector data, and performing standardization on the area characteristic data in the vector, mapping the processed data between [0, 1] to obtain a standardized vector;
[0019] The standardized vector data is divided into training set, test set and validation set according to the set ratio, the divided data set is used as the training data set, and feature labels are set for the data of the test set and validation set.
[0020] Preferably, the collected area data is mapped into a vector form, and the obtained vector X is:
[0021] X={x1,x2,…,x 15}
[0022] Among them, x1 is the active power meter, x2 is the reactive power, x3 is the voltage distribution, x4 is the grid current, x5 is the power quality, x6 is the switch status, x7 is the real-time voltage, x8 is the real-time current, x9 is the three-phase unbalance limit statistics, x 10 Support load imbalance, x 11 Timely phase change load balance adjustment, x 12 Statistical voltage qualification rate information, x 13 Low voltage alarm reporting, x 14 Wiring abnormality alarm, x 15 Suspected power outage perception warning.
[0023] Preferably, a corresponding feature label is set for each sample parameter in the test set and the validation set to obtain a feature label vector Y = {y1, y2, ..., y 15}, each sample parameter corresponds to a feature label y i , and i=1, 2,...15;
[0024] Among them, y1 is the data source ID, y2 is the line loss rate, y3 is the voltage distribution level, y4 is the current intensity, y5 is the power factor, y6 is the data collection time, y7 is the voltage transmission frequency, y8 is the current transmission frequency, y9 is the check code, y 10 is the signal strength, y11 is the power consumption, y 12 is the pass rate ratio, y 13 is the data packet sequence number, y 14 is the data transmission delay and y15 is the terminal device ID.
[0025] Preferably, the Informer model is improved based on the self-attention mechanism, and the training data set is combined, the loss function is constructed, and the improved Informer model is trained using an optimization algorithm, specifically including:
[0026] The Informer model is improved based on the self-attention mechanism. The improved Informer model includes an input module, an encoder, a decoder and an output module, wherein the input module includes a position code, the encoder includes a multi-head sparse self-attention layer, a normalization layer and a feedforward neural network, the decoder includes an occluded multi-head sparse self-attention layer, a normalization layer, a multi-head sparse self-attention layer and a feedforward neural network, and the output module includes a fully connected layer and a normalization layer; wherein the encoder is used to encode the input data sequence, learn the internal features of the input data, and obtain the long-term dependency of the long sequence input, and the decoder predicts all outputs of the long sequence through the forward process to realize the dynamic decoding process;
[0027] During the training process, the mean square error (MSE) is calculated as the loss function, and the ADM optimization algorithm is used to train and optimize the improved Informer model.
[0028] Preferably, the multi-head sparse self-attention layer is used to concatenate the information obtained by each head, and linearly transform the concatenated matrix into a new vector as the final attention value:
[0029] MultiHead(Q,K,V)=Concat(head1,…head m )
[0030]
[0031] Where: MultiHead(Q, K, V) is the final attention value, are the weight matrices of the i-th attention Q, K, and V, respectively, and W O is the multi-head attention weight matrix, m is the number of attention heads, and the Concat(·) function is used to concatenate the attention heads.
[0032] Preferably, the normalization layers in the encoder and decoder operate as follows:
[0033] o=LayerNorm(x,Sublayer(x))
[0034] Where o represents the output of the normalization layer, x represents the input of the encoder or decoder, Sublayer(·) contains a multi-head sparse attention mechanism and a feedforward neural network, and LayerNorm(·) is the layer normalization function.
[0035] Preferably, the position coding is used to perform position coding on the input sequence to distinguish different positions, wherein the odd and even position codings are respectively as shown in the following formulas:
[0036]
[0037] Where, PE (p,2i+1) Indicates the code for odd position 2i+1; PE (p,2i) represents the code of even position 2i; p represents the position of input code, d model Represents the dimension of the input vector, and i represents the i-th dimension in the vector.
[0038] Preferably, based on the real electrical data collected in the sliding window, the electrical data is input into the trained improved Informer model for prediction, and whether the real electrical data is abnormal is judged according to whether the real electrical data value conforms to the distribution of the predicted value in the sliding window, specifically including:
[0039] The HPLC data xt of the station area at time t is collected as monitoring data, and the monitoring data is preprocessed to obtain standard vector data. The standard vector data is input into the trained improved Informer model to obtain L y The prediction data set pt of length is used to detect whether the data is abnormal according to whether the real electrical data value of the substation conforms to the distribution of the prediction data set pt in its sliding window;
[0040] Select the input monitoring data x t Centered, front-to-back length L y , calculate the mean μ of the predicted values within the window t and standard deviation σ t ;
[0041] Set the weight coefficient k value for the monitoring data x t , if |x is satisfied t -μ t |>kσ t The condition indicates that the monitoring data is an abnormal point, otherwise it is judged as a non-abnormal point.
[0042] A complex environment-based HPLC data cleaning system for a station area, used to implement the complex environment-based HPLC data cleaning method for a station area, comprising: a data acquisition module, a data processing module, a model building module, a model training module, a data prediction module and an abnormality judgment module;
[0043] The data acquisition module is used to collect electrical data from the high-speed power line carrier HPLC in the substation area to form a data set;
[0044] The data processing module is used to preprocess and divide the data set to obtain the training data set;
[0045] The model building module improves the Informer model based on the self-attention mechanism to obtain an improved Informer model;
[0046] The model training module is used to combine the training data set, construct the loss function and use the optimization algorithm to train the improved Informer model;
[0047] The data prediction module uses the real electrical data in the sliding window and inputs it into the trained and improved Informer model to predict the electrical data.
[0048] The abnormality judgment module is used to judge whether the real electrical data is abnormal according to whether the real electrical data value conforms to the distribution of the predicted value in its sliding window.
[0049] The present invention also provides a terminal, comprising a processor and a storage medium;
[0050] The storage medium is used to store instructions;
[0051] The processor is used to operate according to the instructions to execute the steps of the complex environment-based benchtop HPLC data cleaning method.
[0052] The present invention also proposes a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the complex environment-based station HPLC data cleaning method are implemented.
[0053] The beneficial effect of the present invention lies in that, compared with the prior art, the present invention proposes a data cleaning method based on an improved Informer model, which screens, identifies and deletes noise data, dirty data, irrelevant data and incomplete data in the collected data; the present invention adopts an improved Informer model, which has significant advantages in long time series prediction, not only reducing the time complexity and memory usage to O(LlogL) through the sparse self-attention mechanism, but also using the self-attention distillation operation to highlight attention, proposing a generative decoder, thereby avoiding the propagation of cumulative errors, and using the improved Informer model to perform abnormal judgment on the station area data in complex environments, which can improve the accuracy of identifying abnormal data. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 It is a flow chart of the HPLC data cleaning method of the station area based on complex environment in the present invention;
[0055] Figure 2 It is a structural diagram of the improved Informer model in the present invention;
[0056] Figure 3 It is a structural diagram of the complex environment-based HPLC data cleaning system of the present invention. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical scheme and advantages of the present invention clearer, the technical scheme of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. The embodiments described in this application are only part of the embodiments of the present invention, not all of them. Based on the spirit of the present invention, other embodiments obtained by ordinary technicians in this field without creative work are all within the scope of protection of the present invention.
[0058] like Figure 1 As shown, the present invention proposes a method for cleaning HPLC data in a complex environment, which is used for data collected by HPLC in a complex environment. The method specifically comprises the following steps:
[0059] Step 1: collect the characteristic data of the substation area through HPLC of the high-speed power line carrier in the substation area to form a data set, and normalize the data set using the Z-score standardization algorithm, and divide the processed data set into a training set, a test set and a validation set;
[0060] The present invention uses historical data and real-time collected data to model the time series, and then uses the established model to monitor possible problems and power loads in the future for prediction. Because of the complex environment of the substation, the data collected by HPLC technology is relatively messy, and the Informer model needs to be able to better clean the data between 0-1, so the data is pre-processed to facilitate subsequent operations.
[0061] Step 1-1, collect data from the substation area at a set time interval, and divide the collected data into a training set, a test set, and a validation set;
[0062] The present invention is aimed at cleaning the data of substations in complex environments. Complex substations refer to substations that include multiple types, such as urban residential substations, commercial substations, industrial substations and agricultural substations. The data of different substations are quite different, and the data capacity between the four major substations of urban residential substations, commercial substations, industrial substations and agricultural substations is also different. For example, the industrial substation generates data 24 hours a day, and the data of the agricultural substation varies greatly by season.
[0063] Preferably, the time interval is set to 1 minute, and the area characteristic data is collected once every 1 minute, so that 1440 pieces of data information can be obtained throughout the day.
[0064] The characteristic data of the substation area is collected using HPLC technology. HPLC supports high-frequency data collection, so the data is recorded every minute. The collected data will contain certain noise and junk data that need to be processed.
[0065] Further preferably, the types of characteristic data of the substation collected each time include active power meter, reactive power, voltage distribution, grid-connected current, power quality, switch status, real-time voltage, real-time current, three-phase unbalance over-limit statistics, support for load imbalance, timely phase change load balancing adjustment, statistical voltage qualification rate information, low voltage alarm reporting, abnormal wiring alarm, and suspected power outage perception warning data.
[0066] Step 1-2, mapping the collected area characteristic data into vector data, and performing standardization processing on each area characteristic data in the vector, mapping the processed data between [0, 1], and obtaining a standardized vector;
[0067] The present invention uses a deep learning algorithm to clean the area data, which requires a large amount of data. The collected area data is mapped into a vector form: X = {x1, x2, ..., x 15}, where x1 is the active power meter, x2 is the reactive power, x3 is the voltage distribution, x4 is the grid current, x5 is the power quality, x6 is the switch status, x7 is the real-time voltage, x8 is the real-time current, x9 is the three-phase unbalanced limit statistics, x10 supports load imbalance, x 11 Timely phase change load balance adjustment, x 12 Statistical voltage qualification rate information, x 13 Low voltage alarm reporting, x 14 Wiring abnormality alarm, x 15 Suspected power outage perception warning.
[0068] When the data at the input end of the informer is close to the average value of "0", the learning efficiency of the deep learning algorithm is the best. Therefore, the present invention preferably uses the maximum and minimum value normalization for the collected data to map the data to [0, 1]. The normalization function is as follows:
[0069]
[0070] Among them, x t is the relevant characteristic parameter of the area collected at time t, x max is the maximum value of the collected sample parameters, x min is the minimum value of the collected sample parameters, It is the standardized result of the relevant characteristic parameters of the substation collected at time t.
[0071] After standardizing the vector X, a standard vector X′ is obtained, which is used as the input data of the subsequent model.
[0072] Step 1-3, divide the standardized vector data into three components: training set, test set and validation set according to a certain ratio, so as to better train and evaluate more accurately. The division ratio can be selected as 7:2:1, and set feature labels for the data of the test set and validation set;
[0073] The datasets D1, D2, and D3 are divided according to the ratio, and the dataset D1 is used as the training sequence, the dataset D2 is used as the test sequence, and the dataset D3 is used as the validation set. The validation set D3 is used to evaluate the accuracy of the Infomer model.
[0074] Furthermore, a corresponding feature label is set for each sample parameter in the test set and the validation set to obtain a feature label vector Y = {y1, y2, ..., y 15}, used as a validation for subsequent model training, each sample parameter corresponds to a feature label y i , i=1,2,…15.
[0075] The definition of feature tags specifically includes: y1 is the data source ID, y2 is the line loss rate, y3 is the voltage distribution level, y4 is the current intensity, y5 is the power factor, y6 is the data collection time, y7 is the voltage transmission frequency, y8 is the current transmission frequency, y9 is the check code, y 1o is the signal strength, y 11 is the power consumption, 12 is the pass rate ratio, y 13 is the data packet sequence number, y 14 is the data transmission delay and y15 is the terminal device ID.
[0076] Step 2: Build an Informer model with a self-attention mechanism, use the normalized training set as the input of the Informer model, calculate the mean square error (MSE) of the training model as the loss function, use the ADM optimization algorithm to train and optimize the Informer model, and set a random inactivation layer to prevent overfitting of the model.
[0077] The data of the equipment in the substation under normal operation is usually distributed near a one-dimensional manifold. When a large measurement error is introduced due to sensor anomalies or system disturbances, it is manifested in the monitoring data as isolated singular points that deviate from the expected value; when the equipment state is abnormal, it is manifested as continuous singular points. The Informer prediction model has good prediction capabilities in LSTF. The present invention adds a self-attention mechanism to the Informer model to determine whether it is abnormal data based on the degree of deviation between the true value and the predicted value.
[0078] The improved Informer model adopted by the present invention adopts the ProbSparse Self-attention (PS) mechanism, which is more suitable for processing time issues related to power data compared with the self-attention mechanism. The sparse self-attention mechanism reduces the cascade input by half through self-attention distillation to highlight the attention, and integrates the generative decoder to obtain long sequence output, obtain valuable data information, and can filter out useless data.
[0079] Furthermore, for the sparse self-attention mechanism adopted by the present invention: Transformer self-attention value Attention(Q, K, V) is as follows:
[0080]
[0081] in: is the query matrix, is the key matrix, are value matrices. These three matrices are composed of the input matrix X feed_en Respectively with the corresponding weight matrix W Q , WK , W V Multiplying them, we can get: d is the dimension of Q, K, V matrices, and input matrix X feed_en From step 1-1 Let q i , k i 、v i The i-th row of the matrix representing Q, K, and V, respectively, is the attention value of the i-th query vector Attention(q i , K, V) is expressed using the kernel smoothing method as:
[0082]
[0083] in: ∑ represents summation, k(q i k j ) is an asymmetric exponential kernel The operations of combining the value vector and obtaining the output in the self-attention mechanism are based on calculating the probability p(k j |q i ), although this operation enhances the prediction ability, it sacrifices computational cost and memory, that is, the calculation of probability p requires a second dot product calculation and occupies O(L Q L K ) size of memory, O(L Q L K ) is the length of Q and K matrices.
[0084] At present, the probability distribution of attention has potential sparsity. If we conduct a qualitative analysis of the typical self-attention learning attention mode, we will find that it obeys the long-tail distribution, that is, the dot product calculation results of a few query vectors and key vectors dominate the distribution after the SoftMax operation. This sparse distribution has practical significance: an element in the sequence generally has a high correlation with only a few elements. Such highly correlated query vectors are called sparse query vectors. The core idea of the sparse self-attention mechanism is to find sparse query vectors, so as to only calculate the attention values of these query vectors, thereby optimizing the computational efficiency.
[0085] According to formula (3), the attention of the i-th query vector to all key vectors is defined as q(k j |q i ), the output is a combination of value vectors. If there exists q(k j |q i ) Approximately uniform distribution The self-attention value becomes the discrete sum of the value vector, while the attention value of the sparse query vector is far from uniform distribution. Therefore, the correlation between p and q is used to distinguish which sparse query vectors get the main attention. The relationship between p and q KL(q||p) is calculated by the KL divergence theorem:
[0086]
[0087] In general, the constant term is ignored, and the sparsity evaluation formula M(q i , k):
[0088]
[0089] The first term is to calculate the query vector q i The second term is the arithmetic mean of the LSE (Log-Sum-Exp) on all key vectors. If the i-th query vector obtains a larger sparsity evaluation value M(q i , K), then its attention probability p is very likely to be at the head of the long-tail attention distribution.
[0090] According to the definition of sparsity, each key vector is only calculated with the first U query vectors of the sparsity evaluation value, and the sparse self-attention machine Attention(q i , K, V):
[0091]
[0092] in, is a sparse matrix of the same size as q and contains only the first u query vectors of the sparsity evaluation value M(qi, K). Under the control of the constant sampling factor c, set u = c*lnL Q , which makes the complexity of sparse self-attention to calculate the dot product value of each pair of query keys only O(lnL Q ). And the memory usage of each layer remains O(L K LqCy Q However, the sparsity M(q i , K), then all dot product pairs need to be calculated, and the computational complexity may become 0 (L Q L K ) squared, and there are potential numerical stability issues in LSE calculation. Therefore, an approximate method for evaluating the sparsity of the query vector is adopted: for each query vector and The boundary can be obtained as lnL k <<M(q i, K)<< This condition also holds when the query vector qi∈K. Through the above introduction, we can get an approximate method, namely the maximum mean sparsity evaluation
[0093]
[0094] Since the dot product result follows the assumption of long-tail distribution, when calculating the sparsity evaluation of each query vector, only random sampling U = L is required Q LqCy k dot product pairs to calculate That's it, because The max operator in is insensitive to zero values and is numerically stable, so the other dot product pairs are padded with zeros. In addition, in practice, the input lengths of the query vector and the key vector are usually equal, i.e., L Q =L K =L, so the overall time complexity and space complexity of sparse self-attention is only O(LlnL). This method can solve the quadratic computational complexity problem of Tansformer self-attention mechanism.
[0095] Self-attention distillation operation: The encoder is mainly used to obtain long-term dependencies of long sequence inputs. After the input representation, the input sequence X t Transformed to As a natural consequence of the sparse self-attention mechanism, the encoder's feature maps result in redundant combinations of value matrices. Therefore, a distillation operation is used to privilege the dominant features and generate focused self-attention feature maps in the next layer, which greatly reduces the dimension of the input matrix, allowing longer sequence inputs. Inspired by the dilated convolution, the distillation process from layer j to layer j+1 is as follows:
[0096]
[0097] Among them, [·]AB contains the basic operations in multi-head sparse self-attention and attention blocks, Cony1d(·) represents a one-dimensional convolution operation on the time series, and ELU(·) is used as the activation function, and finally a maximum pooling operation with a step size of 2 is performed, so that after stacking one layer, X t to half its length, which reduces the overall memory usage to O((2-∈)LlogL), where ∈ is a small number.
[0098] To enhance the robustness of the distillation operation, we construct multiple copies of the master sequence, each of which is half the length of the previous one, and gradually reduce the number of self-attention distillation layers by dropping one layer at a time so that their output sizes are aligned to L is the length of the first copy. Finally, the outputs of all stacks are connected to obtain the implicit observations of the final encoder. By adding the self-attention distillation operation, the present invention can gradually reduce the size of the feature map without consuming too much memory in the computational space, and can solve the problem of high memory usage of Transformer.
[0099] Informer use attachment Figure 2 The standard decoder architecture shown in Figure 1 consists of a stack of 2 multi-head attention layers. Generative inference is used to alleviate the problem of output speed drops during long-term prediction. Decoder input Take the following vector form:
[0100]
[0101] in, is a placeholder for the sequence waiting to be predicted, The default setting is 0. By setting the masked dot product to -∞, future data information is masked in the sparse self-attention calculation, avoiding the autoregression problem. Finally, a fully connected layer is used to obtain the final output, whose output dimension is d y Depends on whether the model is performing univariate or multivariate forecasting.
[0102] In dynamic decoding of NLP, a single character is used as the starting character The present invention is extended to a generation method, that is, L before the time period to be predicted token A sequence of known length is The decoder predicts all outputs of a long sequence through such a forward process, thus getting rid of the time-consuming dynamic decoding method in the trivial encoder-decoder architecture. After the decoder, each predicted bit gets a vector, which is then input to the fully connected layer to get the prediction result in one step, solving the efficiency problem of Transformer in predicting long-term outputs.
[0103] The improved Informer model is constructed for data cleaning in the substation area: the data of the substation equipment under normal operation is usually distributed near a one-dimensional manifold, and when a large measurement error is introduced due to sensor anomalies or system disturbances, it is manifested in the monitoring data as isolated singular points that deviate from the expected value; when the equipment state is abnormal, it is manifested as continuous singular points. Since the Informer prediction model has good prediction ability in LSTF, the present invention determines whether it is abnormal data by the degree of deviation between the true value and the predicted value.
[0104] Furthermore, the improved Informer model architecture constructed by the present invention is shown in the attached Figure 2As shown, the improved Informer model includes an input module 1, an encoder 2, a decoder 3 and an output module 4, wherein the input module 1 includes a positional code, the encoder 2 includes a multi-head sparse self-attention layer, a normalization layer and a feedforward neural network, the decoder 3 includes an occluded multi-head sparse self-attention layer, a normalization layer, a multi-head sparse self-attention layer and a feedforward neural network, and the output module 4 includes a fully connected layer and a normalization layer.
[0105] Among them, the multi-head sparse self-attention layer is mainly used for feature extraction, the fully connected layer provides nonlinear transformation, and the residual connection and normalization layer can prevent the network from gradient explosion. The encoder is responsible for encoding the input electrical data sequence and learning the internal features of the input sequence. Its core principle is the sparse self-attention mechanism (as shown in 2-1). The sparse self-attention mechanism characterizes the degree of association by calculating the similarity between sample points in the input sequence. This relationship reflects the importance of different sample points, and adjusts the weight of each sample point to filter out a small amount of important information, so that the model focuses on more important information, and finally maps it into an intermediate vector containing the input information. The sparse self-attention mechanism reduces the dependence on external information by connecting different positions of a single sequence to calculate the encoding method, and is better at capturing long-distance dependent features in the data. At the same time, it uses sparsity evaluation to reduce the space and time complexity of the operation. The specific steps are as follows:
[0106] (1) Randomly sample part of the key vector for each query vector;
[0107] (2) Calculate the sparsity evaluation of each query vector;
[0108] (3) Select u query vectors with the highest sparsity evaluation, and the default value of u is set to 5*lnL;
[0109] (4) Only the dot product results of u query vectors and all key vectors are calculated to obtain the result of self-attention;
[0110] (5) The remaining Lu query vectors are not calculated, and the input value matrix of the self-attention layer is directly taken as the output, ensuring that the input and output sequence lengths of each sparse self-attention layer are L.
[0111] A single sparse self-attention mechanism can only focus on important information in one representation space. In order to enable the model to simultaneously pay attention to information from different positions and different subspaces, the Informer model uses a multi-head sparse attention mechanism to synthesize the importance of the information contained in the input sequence. In fact, it is to splice the information obtained by each head and linearly transform the matrix obtained after splicing into a new vector, which is the final attention value, as shown in Equation (10) and Equation (11):
[0112] MultiHead(Q,K,V)=Concat(head1,…head m ) (10)
[0113]
[0114] In the formula, is the weight matrix of the i-th attention Q, K, V, W O is the multi-head attention weight matrix, m is the number of attention heads, d model = d*m, Concat(·) function is used to concatenate the attention heads, head1…head m Represents the 1st to mth attention heads.
[0115] The decoder is responsible for decoding the intermediate vector output by the encoder into an output sequence. Its core principles are the encoder-decoder multi-head sparse attention mechanism and the occluded multi-head sparse self-attention mechanism. The encoder sends the learned and encoded information to the decoder through the encoder-decoder attention layer, providing the decoder with the dependency between the input data and the predicted data, thereby improving the accuracy of data prediction. The encoder-decoder multi-head sparse attention mechanism is different from the encoder's multi-head sparse self-attention mechanism. Its key matrix K and value matrix V come from the output of the encoder, containing the information of the input sequence, and the query matrix Q comes from the output of the occluded multi-head sparse self-attention mechanism module, containing the information of the predicted data.
[0116] In order to predict the output in chronological order during the decoding process, the decoder introduces an occluded multi-head sparse self-attention mechanism module. Because the predicted data is known during the model training process, the decoder decodes the sequence at each time step simultaneously based on the parallel computing characteristics. However, in the decoder test phase, the output at the current moment should not be affected by subsequent data. Therefore, when calculating the scaled dot product attention, the masked dot product is set to -∞, thereby meeting the requirement of hiding subsequent nodes and avoiding the autoregression problem.
[0117] In order to solve the problem that the increase in network depth affects the accuracy of data prediction, residual connection operations are added between each sub-layer of the encoder and decoder, focusing on the differences before and after training, thereby alleviating the gradient disappearance and explosion problems and improving the training effect. At the same time, in order to speed up network convergence and improve network generalization ability, each sub-layer also uses layer normalization operation, as shown in formula (12):
[0118] o=LayerNorm(x, Sublayer(x)) (12)
[0119] Where o is the result after layer normalization, Sublayer(·) includes a multi-head sparse attention mechanism and a feedforward neural network, and LayerNorm(·) is the layer normalization function.
[0120] The sparse self-attention mechanism can find the connection between each feature, but cannot perceive their relative position relationship. In the scenario of time series data prediction, the position information of the vector in the sequence represents the moment information, which plays a vital role in time series data prediction. To solve this problem, additional position encoding information is added to the input sequence of the encoder and decoder to distinguish different positions. This process corresponds to the attached Figure 2 The position coding and even and odd position coding in are shown in equation (13) and equation (14) respectively:
[0121]
[0122] Where: PE (p,2i+1) Indicates the code for odd position 2i+1; PE (p,2i) represents the code of even position 2i; p represents the position of input code, d model Represents the dimension of the input vector, and i represents the i-th dimension in the vector.
[0123] Step 3: Use the trained improved Informer model to predict the electrical data based on the real electrical data in the sliding window, and judge whether the real electrical data is abnormal according to whether the real electrical data value conforms to the distribution of the predicted value in the sliding window.
[0124] In step 3, the improved Informer model is used to predict the values within the sliding window interval of the test set. The predicted values and true values output by the model are combined to determine whether the true values are consistent with the distribution of the predicted values within the sliding window to detect whether the data is abnormal, and the weight coefficient k value is set; then, combined with the continuity of the abnormal points, the abnormal data type and the abnormal time of the equipment are determined; finally, the noise data in the abnormal data is replaced with the predicted value to form a normal data set for storage.
[0125] Step 3 specifically includes:
[0126] Step 3-1, collect the HPLC data x of the station area at time t t As monitoring data, the monitoring data is preprocessed to obtain standard vector data, and the standard vector data is input into the trained improved Informer model to obtain L y The length of the prediction dataset p t , according to whether the actual area electrical data value conforms to the prediction data set p in the sliding window t The distribution of the data is used to detect whether the data is abnormal;
[0127] Step 3-2, select the input monitoring data x t Center, front and back L y The length of the window is used to calculate the mean μ of the predicted values within the window. t and standard deviation σ t ;
[0128] Although the quantitative equipment data of the substation does not follow a normal distribution, the outliers can be mathematically expressed as several times the standard deviation away from the mean.
[0129] Set the weight coefficient k value for the monitoring data x t , if |x t -μ t |>kσ t The condition indicates that the monitoring data is an abnormal point.
[0130] For monitoring data x t The abnormal judgment of depends only on the distribution of the predicted value in the window at time t, and is not affected by other abnormal monitoring data.
[0131] Step 3-3, determine the data type based on the abnormal point situation:
[0132] If this point is not an abnormal point, it is determined to be normal data and directly stored in the normal data set library;
[0133] If this point is judged as an outlier, and is distributed continuously with the previous outlier, that is, it is continuously distributed on the time scale n If a value is judged as an abnormal value, it is considered that the device status is abnormal during this period, and the time of occurrence is recorded; c n The value of can be set by those skilled in the art according to actual conditions.
[0134] If this point is an isolated outlier, it is considered to be noise data, which is replaced with the predicted value and stored in the normal data set library.
[0135] like Figure 3 As shown, the present invention also proposes a complex environment-based HPLC data cleaning system for a station area, which is used to implement the above-mentioned complex environment-based HPLC data cleaning method for a station area, and the system includes a data acquisition module, a data processing module, a model building module, a model training module, a data prediction module and an abnormality judgment module;
[0136] The data acquisition module is used to collect electrical data from the high-speed power line carrier HPLC in the substation area to form a data set;
[0137] The data processing module is used to preprocess and divide the data set to obtain the training data set;
[0138] The model building module improves the Informer model based on the self-attention mechanism to obtain an improved Informer model;
[0139] The model training module is used to combine the training data set, construct the loss function and use the optimization algorithm to train the improved Informer model;
[0140] The data prediction module uses the real electrical data in the sliding window and inputs it into the trained and improved Informer model to predict the electrical data.
[0141] The abnormality judgment module is used to judge whether the real electrical data is abnormal according to whether the real electrical data value conforms to the distribution of the predicted value in its sliding window.
[0142] The beneficial effect of the present invention is that, compared with the prior art, the present invention can improve the accuracy of identifying abnormal data by performing abnormal judgment on the station area data in a complex environment through the improved Informer model.
[0143] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.
[0144] Computer readable storage medium can be a tangible device that can hold and store instructions used by an instruction execution device. Computer readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive list) of computer readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a convex structure in a groove on which instructions are stored, and any suitable combination thereof. The computer readable storage medium used here is not interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated by a waveguide or other transmission medium (for example, a light pulse by an optical fiber cable), or an electrical signal transmitted by a wire.
[0145] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0146] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages-such as Smalltalk, C++, etc., and conventional procedural programming languages-such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network-including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA) may be personalized by utilizing the state information of a computer-readable program instruction, and the electronic circuit may execute a computer-readable program instruction, thereby realizing various aspects of the present disclosure.
[0147] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents, and any modifications or equivalent replacements that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for cleaning HPLC data in a complex environment, characterized in that: The steps include: The electrical data of the high-speed power line carrier HPLC in the substation area is collected to form a data set, and the data set is preprocessed and divided to obtain a training data set; Improve the Informer model based on the self-attention mechanism, including adding a multi-head sparse self-attention layer to the Informer model, and train the improved Informer model with the training dataset; Based on the real electrical data used in the sliding window, the electrical data is input into the improved Informer model after training to predict the electrical data. Whether the real electrical data is abnormal is determined based on whether the real electrical data value conforms to the distribution of the predicted value in the sliding window.
2. A method for cleaning HPLC data in a complex environment according to claim 1, characterized in that: The electrical data collected by the high-speed power line carrier HPLC in the substation area is formed into a data set, and the data set is preprocessed and divided to obtain a training data set, which specifically includes: Collect area data according to the set time interval; Mapping the collected area characteristic data into vector data, and performing standardization on the area characteristic data in the vector, mapping the processed data between [0, 1] to obtain a standardized vector; The standardized vector data is divided into training set, test set and validation set according to the set ratio, the divided data set is used as the training data set, and feature labels are set for the data of the test set and validation set.
3. A method for cleaning HPLC data in a complex environment according to claim 2, characterized in that: The collected area data is mapped into a vector form, and the obtained vector X is: X={x1,x2,…,x 15 } Among them, x1 is the active power meter, x2 is the reactive power, x3 is the voltage distribution, x4 is the grid current, x5 is the power quality, x6 is the switch status, x7 is the real-time voltage, x8 is the real-time current, x9 is the three-phase unbalance limit statistics, x 10 Support load imbalance, x 11 Timely phase change load balance adjustment, x 12 Statistical voltage qualification rate information, x 13 Low voltage alarm reporting, x 14 Wiring abnormality alarm, x 15 Suspected power outage perception warning.
4. A method for cleaning HPLC data in a complex environment according to claim 2, characterized in that: Set the corresponding feature label for each sample parameter in the test set and the validation set, and obtain the feature label vector Y = {y1, y2, ..., y 15 }, each sample parameter corresponds to a feature label y i , and i=1,2,…15; Among them, y1 is the data source ID, y2 is the line loss rate, y3 is the voltage distribution level, y4 is the current intensity, y5 is the power factor, y6 is the data collection time, y7 is the voltage transmission frequency, y8 is the current transmission frequency, y9 is the check code, y 10 is the signal strength, y 11 is the power consumption, 12 is the pass rate ratio, y 13 is the data packet sequence number, y 14 is the data transmission delay and y15 is the terminal device ID.
5. A method for cleaning data of HPLC in a complex environment according to claim 1, characterized in that: The Informer model is improved based on the self-attention mechanism. The training data set is combined, the loss function is constructed, and the optimization algorithm is used to train the improved Informer model. Specifically, the following steps are performed: The Informer model is improved based on the self-attention mechanism. The improved Informer model includes an input module, an encoder, a decoder and an output module, wherein the input module includes a position code, the encoder includes a multi-head sparse self-attention layer, a normalization layer and a feedforward neural network, the decoder includes an occluded multi-head sparse self-attention layer, a normalization layer, a multi-head sparse self-attention layer and a feedforward neural network, and the output module includes a fully connected layer and a normalization layer; wherein the encoder is used to encode the input data sequence, learn the internal features of the input data, and obtain the long-term dependency of the long sequence input, and the decoder predicts all outputs of the long sequence through the forward process to realize the dynamic decoding process; During the training process, the mean square error (MSE) is calculated as the loss function, and the ADM optimization algorithm is used to train and optimize the improved Informer model.
6. A method for cleaning data of HPLC in a complex environment according to claim 5, characterized in that: The multi-head sparse self-attention layer is used to concatenate the information obtained from each head and linearly transform the concatenated matrix into a new vector as the final attention value: MultiHead(Q,K,V)=Concat(head1,…head m ) Where: MultiHead(Q, K, V) is the final attention value, are the weight matrices of the i-th attention Q, K, and V, respectively, and W 0 is the multi-head attention weight matrix, m is the number of attention heads, and the Concat(·) function is used to concatenate the attention heads.
7. A method for cleaning HPLC data in a complex environment according to claim 5, characterized in that: The operation of the normalization layer in the encoder and decoder is as follows: o=LayerNorm(x,Sublayer(x)) Where o represents the output of the normalization layer, x represents the input of the encoder or decoder, Sublayer(·) contains a multi-head sparse attention mechanism and a feedforward neural network, and LayerNorm(·) is the layer normalization function.
8. A method for cleaning HPLC data in a complex environment according to claim 5, characterized in that: The position coding is used to perform position coding on the input sequence to distinguish different positions, wherein the odd and even position codings are respectively shown as follows: Where, PE (p,2i+1) Indicates the code for odd position 2i+1; PE (p,2i) represents the code of even position 2i; p represents the position of input code, d model Represents the dimension of the input vector, and i represents the i-th dimension in the vector.
9. A method for cleaning HPLC data in a complex environment according to claim 1, characterized in that: Based on the real electrical data collected in the sliding window, the electrical data is input into the improved Informer model after training to predict the electrical data. Whether the real electrical data value is abnormal is judged according to whether it conforms to the distribution of the predicted value in the sliding window. Specifically, it includes: Collect the HPLC data x of the area at time t t As monitoring data, the monitoring data is preprocessed to obtain standard vector data, and the standard vector data is input into the trained improved Informer model to obtain L y The length of the prediction dataset p t , detect whether the data is abnormal based on whether the real area electrical data value conforms to the distribution of the prediction data set pt within its sliding window; Select the input monitoring data x t Centered, front-to-back length L y , calculate the mean μ of the predicted values within the window t and standard deviation σ t ; Set the weight coefficient k value for the monitoring data x t , if |x is satisfied t -μ t |>kσ t The condition indicates that the monitoring data is an abnormal point, otherwise it is judged as a non-abnormal point.
10. A complex environment-based HPLC data cleaning system for a station area, used to implement the complex environment-based HPLC data cleaning method for a station area according to any one of claims 1 to 9, characterized in that: include: Data collection module, data processing module, model building module, model training module, data prediction module and abnormality judgment module; The data acquisition module is used to collect electrical data from the high-speed power line carrier HPLC in the substation area to form a data set; The data processing module is used to preprocess and divide the data set to obtain the training data set; The model building module improves the Informer model based on the self-attention mechanism to obtain an improved Informer model; The model training module is used to combine the training data set, construct the loss function and use the optimization algorithm to train the improved Informer model; The data prediction module uses the real electrical data in the sliding window and inputs it into the trained and improved Informer model to predict the electrical data. The abnormality judgment module is used to judge whether the real electrical data is abnormal according to whether the real electrical data value conforms to the distribution of the predicted value in its sliding window.
11. A terminal comprising a processor and a storage medium; characterized in that: The storage medium is used to store instructions; The processor is configured to operate according to the instructions to execute the steps of the method according to any one of claims 1-9.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.
Citation Information
Cited By
Broadband electric energy quality data intelligent cleaning method and system fusing double-domain characteristics
CN121188358A
Wide-band power quality data intelligent cleaning method and system fusing double-domain features
CN121188358B