Power market abnormal data reconstruction method, system, equipment and medium

Through the abnormal data reconstruction model fused by convolutional neural network and attention mechanism, the problems of insufficient detection accuracy of abnormal data in the power market and limited generalization capabilities are solved, efficient abnormal data repair and cross-market adaptation are achieved, and the stability of market data is ensured.

CN119961845AActive Publication Date: 2025-05-09LUCULENT SMART TECHNOLOGIES CO LTD

Patent Information

Application Number
CN202510436587.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-09
Publication Date
2025-05-09
Estimated Expiration
2045-04-09

AI Technical Summary

Technical Problem

The existing abnormal data reconstruction technology in the power market has problems such as insufficient abnormal detection accuracy, low consistency of reconstruction data, limited generalization capabilities of model, and the difficulty of migrating and reconstructing models in different market environments.

Method used

Convolutional neural network is used to extract the power market data characteristics, calculate the attention weight of the characteristics based on the attention mechanism, and build an abnormal data reconstruction model in conjunction. Migrate the trained model to the target power market and optimize the model's adaptability in different market environments through feature migration, parameter migration and instance migration.

Benefits of technology

It improves the accuracy of abnormal data detection and repair, enhances the reliability and market consistency of data repair, improves the cross-market adaptability of the model and real-time abnormal repair capabilities, and ensures the stability of market data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119961845A_ABST
    Figure CN119961845A_ABST
Patent Text Reader

Abstract

The invention discloses a power market abnormal data reconstruction method, system and device and a medium, and relates to the technical field of power market abnormal data reconstruction, and the method comprises the steps: extracting power market data features through employing a convolutional neural network; calculating attention weights of the features based on an attention mechanism, and fusing the convolutional neural network and the attention mechanism to construct an abnormal data reconstruction model; and migrating the trained abnormal data reconstruction model to the target electricity market. According to the method, efficient feature extraction of the power market data is realized, accurate identification of abnormal data is ensured, the identification degree of the abnormal data is improved, the subsequent data reconstruction process is optimized, the repaired abnormal data better conforms to the market operation law, the influence of the abnormal data on market analysis and decision is reduced, and the market quality is improved. According to the method, efficient migration of the abnormal data reconstruction model is achieved, the universality and the real-time abnormity repairing capacity of the model are improved, the stability of market data is ensured, and the reliability of data repairing is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of abnormal data reconstruction in an electricity market, and in particular to an abnormal data reconstruction method, system, equipment and medium in an electricity market. Background Art

[0002] With the development of the global energy Internet, the power market has gradually evolved from centralized dispatching to intelligent and autonomous trading. Real-time data analysis and intelligent prediction have become the key to optimizing power grid dispatching and improving market stability. Power market data has the characteristics of high dimension, nonlinearity, and strong time series volatility. The generation of abnormal data may affect market settlement, power grid security and transaction fairness. At present, statistical analysis, time series modeling and machine learning methods have been applied to the processing of abnormal data in the power market, but due to the limitations of data complexity and model capabilities, it is difficult to accurately detect and repair abnormal data. In recent years, deep learning technologies, such as convolutional neural networks (CNN) and recurrent neural networks (RNN), have shown advantages in time series data analysis. However, existing technologies still have deficiencies in abnormal data reconstruction accuracy, cross-market adaptability and data consistency. More efficient abnormal data reconstruction methods are urgently needed to ensure the quality and stability of power market data.

[0003] Existing methods for processing abnormal data in the electricity market mainly rely on statistical analysis, time series modeling and traditional machine learning techniques, but there are still many limitations. Statistical methods (such as sliding average and outlier removal) have limited ability to detect complex time series anomalies and are difficult to capture short-term mutations and periodic anomalies. Time series modeling (such as ARIMA and GRU) relies on the assumption of stationarity and is difficult to cope with the non-stationary and multi-scale characteristics of power market data. Anomaly detection methods based on machine learning (such as SVM and decision trees) are limited by feature extraction capabilities and are difficult to fully utilize the spatiotemporal characteristics of data, resulting in insufficient anomaly recognition capabilities and low reconstruction accuracy. Although deep learning technology has improved anomaly detection capabilities, it still faces problems such as low reconstruction quality and insufficient generalization capabilities. Existing methods usually only focus on anomaly detection and lack a precise repair mechanism for abnormal data, which makes the repaired data lack market consistency. Deep learning models rely on a large amount of labeled data, and the cost of acquiring abnormal data samples is high, which limits the generalization ability of the model. At the same time, existing methods have poor adaptability under different market conditions and lack cross-market migration capabilities, resulting in limited application of models in different power market environments. Therefore, there is an urgent need for an abnormal data reconstruction method that combines convolutional neural networks with attention mechanisms to improve the accuracy of abnormal data detection and repair, and optimize the adaptability of the model in different market environments through transfer learning. Summary of the invention

[0004] In view of the above-mentioned problems, the present invention is proposed.

[0005] Therefore, the technical problem solved by the present invention is: the existing abnormal data reconstruction technology in the power market has the problems of insufficient anomaly detection accuracy, low consistency of reconstructed data, limited model generalization ability, and how to effectively migrate the reconstruction model in different market environments.

[0006] To solve the above technical problems, the present invention provides the following technical solutions: a method for reconstructing abnormal data in an electricity market, comprising extracting data features of an electricity market using a convolutional neural network; calculating the attention weight of the features based on an attention mechanism, fusing the convolutional neural network and the attention mechanism to construct an abnormal data reconstruction model; migrating the trained abnormal data reconstruction model to a target electricity market; calculating the attention weight of the features comprises calculating the abnormal data weight, constructing query, key and value vectors, and optimizing the feature correlation; using exponential normalization to optimize the attention allocation, and introducing an abnormal data weight factor to dynamically adjust the weight; constructing an abnormal data reconstruction model comprises constructing an input layer, a convolutional feature extraction layer, an attention mechanism layer, and a reconstruction output layer of the abnormal data reconstruction model; fusing CNN to extract features, optimizing the representation of abnormal points through the attention mechanism, and adjusting parameters through error optimization and back propagation; migration comprises feature migration, parameter migration, and instance migration, freezing the CNN feature layer, and only fine-tuning the attention mechanism layer and the output layer.

[0007] As a preferred solution of the method for reconstructing abnormal data in the power market described in the present invention, the method of extracting the features of the power market data includes collecting time series data of the power market and normalizing the data, and extracting multi-level features in the power market data through a convolutional neural network and multiple convolutional layers and pooling layers.

[0008] As a preferred solution of the method for reconstructing abnormal data in the power market described in the present invention, the convolutional neural network includes: in the first convolution layer, a convolution kernel of a set size is used to perform a sliding window calculation on the input power market time series data, the size of the sliding window is set to a fixed value, the convolution kernel slides on the time dimension according to a set step size, local pattern matching is performed on each time step, and the time series characteristics of the power market data are extracted. Within the sliding window, a linear transformation is performed on the data according to the set parameter weights, and a nonlinear activation function is applied to obtain time series feature information.

[0009] In the pooling layer, based on the time series features extracted by the first convolutional layer, the convolutional power market data is subjected to dimensionality reduction processing by using maximum pooling or average pooling. In the maximum pooling mode, the maximum value of the abnormal data point is selected within the set time window. In the weighted average pooling mode, the weighted mean within the set window is calculated, and higher weights are assigned to abnormal points.

[0010] In the subsequent convolutional layers, based on the temporal features extracted by the first convolutional layer, long-term dependencies are calculated and high-level temporal features are extracted. In the feature extraction process, an adaptive anomaly detection mechanism is introduced to automatically adjust the convolution kernel parameters by monitoring the distribution changes of data features.

[0011] As a preferred solution of the method for reconstructing abnormal power market data described in the present invention, the attention weight of the calculated features includes introducing an attention mechanism, constructing a query vector, a key vector and a value vector based on the features of the abnormal power market data, and extracting key correlation information between different time points and variables of the power market data.

[0012] The query vector, key vector and value vector are obtained by linear transformation of the power market time series data, and the parameter transformation adopts a trainable weight matrix.

[0013] The matching score is calculated by performing a dot product operation on the query vector and the key vector, and the correlation between different time steps is evaluated.

[0014] A correlation score matrix based on anomaly weights is constructed, combined with feature data extracted by convolutional neural networks, to calculate the correlation between time steps and assign higher weights to anomalies in the power market data.

[0015] The exponential normalization method is used to normalize the correlation at different time points, perform exponential transformation on the matching scores in the matrix, sum all the values ​​in the same row, and perform normalization on the matrix rows to optimize the attention allocation method.

[0016] In the process of attention calculation, an abnormal data weight factor is introduced to dynamically adjust the weight of abnormal data points. According to the feature distribution in the attention calculation stage, the calculation method of the attention mechanism is optimized in the feature extraction stage.

[0017] The attention weighted result is calculated based on the normalized attention weight. The normalized value is used as the weight, and element-by-element multiplication is performed with the value vector. The product results are summed in the time dimension to form a new set of weighted feature vectors.

[0018] As a preferred solution of the abnormal data reconstruction method of the power market described in the present invention, the abnormal data reconstruction model includes an input layer, a convolutional feature extraction layer, an attention mechanism layer and a reconstruction output layer.

[0019] The input layer receives preprocessed electricity market time series data, including historical electricity market transaction data, power load data, power grid operation data and market quotation data, and performs normalization to eliminate the dimensional differences between different data sources.

[0020] The convolutional feature extraction layer extracts the multi-level time series features of the power market data through multiple convolutional layers and pooling layers. The convolutional layer extracts local data patterns based on the set sliding window, and the pooling layer reduces the data dimension and removes redundant information.

[0021] The attention mechanism layer calculates the weights of abnormal features of the power market data, introduces the self-attention mechanism to perform weighted calculations on the features of different time steps, constructs the query vector, key vector and value vector, and obtains the correlation between time series by calculating the matching degree between the query vector and the key vector, thus giving higher weights to the key abnormal features of the power market.

[0022] Reconstruct the output layer, including reconstructing abnormal data based on weighted features calculated by the attention mechanism, generating normal data through time series prediction methods, calculating the deviation between predicted data and actual data using error optimization methods, and adjusting the parameters of the abnormal data reconstruction model based on the back propagation algorithm to minimize the prediction error.

[0023] As a preferred solution of the abnormal data reconstruction method for the power market described in the present invention, the migration includes feature migration, applying the trained abnormal data reconstruction model in the target market, performing parameter freezing operation on the specific layer weights of the pre-trained model, maintaining the general feature extraction capability, and only allowing the parameters of the attention mechanism layer and the output layer to be updated on the target market data.

[0024] Parameter migration: Migrate the model parameters trained in the source market to the target market and perform fine-tuning on the target market data.

[0025] Instance migration selects part of the source market data and mixes it with the target market data according to a preset ratio, and performs training on the mixed data set of the target market data and the source market data.

[0026] The reconstructed model after migration is evaluated in the target power market. The model error is calculated by comparing the actual data with the reconstructed data. Based on the evaluation results, the model is optimized and the model parameters and structure are adjusted.

[0027] The optimized reconstruction model is deployed in actual applications to obtain power market data in real time, perform online abnormal data reconstruction, and update and optimize the model in a timely manner by continuously monitoring the reconstruction results and market data.

[0028] As a preferred solution of the method for reconstructing abnormal data in the power market described in the present invention, the fine-tuning on the target market data includes setting a learning rate and using the target market data for small batch training; calculating the loss function value of the target market data and adjusting the parameters of the attention mechanism layer and the output layer through back propagation; monitoring error changes during training and adjusting the training strategy to prevent the model from overfitting or falling into a local optimum.

[0029] Another object of the present invention is to provide an abnormal data reconstruction system for the power market, which can construct an abnormal data reconstruction model by integrating the convolutional neural network and the attention mechanism by calculating the attention weight of the features based on the attention mechanism, thereby solving the problems of the current abnormal data detection technology in the power market, such as insufficient accuracy in abnormal point recognition, unreasonable abnormal data repair, and limited time series correlation modeling capabilities.

[0030] As a preferred solution of the power market abnormal data reconstruction system described in the present invention, it includes: a feature extraction module, a weight calculation module, and a migration optimization module; the feature extraction module includes a data preprocessing module and a multi-level feature extraction module, the data preprocessing module is used to collect power market time series data and normalize the data, the multi-level feature extraction module is used to extract multi-level features in the data through a convolutional neural network, through the operation of multiple convolutional layers and pooling layers; the weight calculation module includes an associated weight calculation module and an abnormal data reconstruction model building module, the associated weight calculation module is used to construct a query vector, a key vector and a value vector through an attention mechanism, establish the correlation between different time steps, and combine The abnormal data weight factor dynamically adjusts the attention allocation method and optimizes the weighting process of the abnormal data. The abnormal data reconstruction model construction module is used to generate the final feature representation based on the weighted result of the attention mechanism, and a complete abnormal data reconstruction model is constructed by combining convolutional feature extraction, attention allocation and reconstruction output; the migration optimization module includes a model migration module and a fine-tuning optimization module. The model migration module is used to migrate the trained abnormal data reconstruction model to the target power market through feature migration, parameter migration and instance migration. The fine-tuning optimization module is used for small batch training on the target market data set, and is dynamically adjusted based on the loss function value. The back propagation algorithm is used to optimize the model parameters to prevent overfitting or local optimality.

[0031] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of a method for reconstructing abnormal data in an electricity market.

[0032] A computer-readable storage medium stores a computer program, which implements the steps of a method for reconstructing abnormal data in a power market when executed by a processor.

[0033] Beneficial effects of the present invention: The abnormal data reconstruction method for the power market provided by the present invention utilizes a convolutional neural network to extract the features of the power market data, thereby realizing efficient feature extraction of the power market data and ensuring accurate identification of abnormal data. The attention weight of the features is calculated based on the attention mechanism, and the convolutional neural network and the attention mechanism are integrated to construct an abnormal data reconstruction model, so that the repaired abnormal data is more in line with the market operation rules, and the impact of abnormal data on market analysis and decision-making is reduced. The trained abnormal data reconstruction model is migrated to the target power market, and efficient migration of the abnormal data reconstruction model is realized. The model can adapt to different market environments, improve the versatility and real-time abnormal repair capability of the model, ensure the stability of market data, and improve the reliability of data repair. The present invention achieves better results in terms of abnormal data detection accuracy, data repair rationality, and cross-market adaptability. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0035] Figure 1 This is an overall flow chart of the method for reconstructing abnormal data in the power market provided by the first embodiment of the present invention. DETAILED DESCRIPTION

[0036] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.

[0037] Example 1, reference Figure 1 , is an embodiment of the present invention, and provides a method for reconstructing abnormal data in a power market, comprising:

[0038] S1: Extracting features of electricity market data using convolutional neural networks.

[0039] Furthermore, the characteristics of the electricity market data are extracted, including collecting the electricity market time series data and normalizing the data. Through the convolutional neural network, multiple convolutional layers and pooling layers are used to extract multi-level characteristics in the electricity market data.

[0040] It should be noted that the convolutional neural network includes, in the first convolution layer, using a convolution kernel of a set size to perform sliding window calculation on the input electricity market time series data, the size of the sliding window is set to a fixed value, the convolution kernel slides on the time dimension according to the set step size, performs local pattern matching on each time step, extracts the time series characteristics of the electricity market data, and within the sliding window, performs linear transformation on the data according to the set parameter weights, and applies nonlinear activation function processing to obtain time series feature information.

[0041] It should also be noted that a preferred solution for extracting the time series characteristics of the power market data specifically includes calculating the Feature extraction results at time , expressed as: ; in, is the relative time step covered by the current convolution operation in the time dimension, is the window size of the convolution operation, indicating the length of the convolution kernel, is the convolution kernel weight, which represents the trainable parameters in the convolutional neural network and is used to learn the patterns of electricity market data. Represents the time step Electricity market data from the United Nations.

[0042] In the pooling layer, based on the time series features extracted by the first convolutional layer, the convolutional power market data is subjected to dimensionality reduction processing by using maximum pooling or average pooling. In the maximum pooling mode, the maximum value of the abnormal data point is selected within the set time window. In the weighted average pooling mode, the weighted mean within the set window is calculated, and higher weights are assigned to abnormal points.

[0043] In the subsequent convolutional layers, based on the temporal features extracted by the first convolutional layer, long-term dependencies are calculated and high-level temporal features are extracted. In the feature extraction process, an adaptive anomaly detection mechanism is introduced to automatically adjust the convolution kernel parameters by monitoring the distribution changes of data features.

[0044] It should also be noted that, in the maximum pooling mode, a preferred solution for selecting the maximum value of abnormal data points within a set time window specifically includes calculating The maximum pooled feature value at the moment , expressed as: ; in, is the maximum pooling operation, For electricity market data in time window arrive The subset within is the pooling window size.

[0045] It should also be noted that, in the weighted average pooling mode, a preferred solution for calculating the weighted mean within the set window range specifically includes calculating the first The weighted pooling feature value at the moment , expressed as: ; in, is the window size of the weighted pooling operation, indicating the length of the pooling window, The relative time steps covered by the current pooling operation in the time dimension.

[0046] It should also be noted that by using convolutional neural networks (CNNs) to extract features from power market data, the model's ability to capture market fluctuations and abnormal data is improved. First, market transactions, power loads, power grid operations and other data are collected and normalized to eliminate dimensional differences between different data sources. By setting the size of the convolution kernel and sliding window, the data slides in the time dimension according to the step size, and local pattern matching is performed on each time step to extract short-term periodic features and abnormal features. In the pooling layer, maximum pooling or weighted average pooling is used to reduce the data dimension. Maximum pooling highlights abnormal peaks, and weighted pooling highlights abnormal peaks. The influence of outliers is enhanced through exponential normalization. In the subsequent convolutional layers, long-term dependencies are further extracted to improve the ability to identify market trends and abnormal patterns. The adaptive anomaly detection mechanism monitors changes in data distribution and dynamically adjusts convolution kernel parameters to optimize the extraction of outliers. Through multi-level feature extraction of convolutional neural networks, the model can capture market dynamics at different time scales, ensuring that abnormal data is not smoothed or ignored, and providing high-quality input data for subsequent reconstruction of the model, which not only improves the accuracy and computational efficiency of feature extraction, but also improves the robustness and sensitivity of the model to abnormal data.

[0047] S2: Calculate the attention weight of the feature based on the attention mechanism, and integrate the convolutional neural network and the attention mechanism to build an abnormal data reconstruction model.

[0048] Furthermore, the attention weights of the features are calculated, including introducing an attention mechanism, constructing a query vector, a key vector, and a value vector based on the features of the power market abnormal data, and extracting key correlation information between different time points and variables of the power market data.

[0049] The query vector, key vector and value vector are obtained by linear transformation of the power market time series data, and the parameter transformation adopts a trainable weight matrix.

[0050] The matching score is calculated by performing a dot product operation on the query vector and the key vector, and the correlation between different time steps is evaluated.

[0051] A correlation score matrix based on anomaly weights is constructed, combined with feature data extracted by convolutional neural networks, to calculate the correlation between time steps and assign higher weights to anomalies in the power market data.

[0052] The exponential normalization method is used to normalize the correlation at different time points, perform exponential transformation on the matching scores in the matrix, sum all the values ​​in the same row, and perform normalization on the matrix rows to optimize the attention allocation method.

[0053] In the process of attention calculation, an abnormal data weight factor is introduced to dynamically adjust the weight of abnormal data points. According to the feature distribution in the attention calculation stage, the calculation method of the attention mechanism is optimized in the feature extraction stage.

[0054] The attention weighted result is calculated based on the normalized attention weight. The normalized value is used as the weight, and element-by-element multiplication is performed with the value vector. The product results are summed in the time dimension to form a new set of weighted feature vectors.

[0055] It should be noted that the abnormal data reconstruction model includes an input layer, a convolutional feature extraction layer, an attention mechanism layer, and a reconstruction output layer.

[0056] The input layer receives preprocessed electricity market time series data, including historical electricity market transaction data, power load data, power grid operation data and market quotation data, and performs normalization to eliminate the dimensional differences between different data sources.

[0057] The convolutional feature extraction layer extracts the multi-level time series features of the power market data through multiple convolutional layers and pooling layers. The convolutional layer extracts local data patterns based on the set sliding window, and the pooling layer reduces the data dimension and removes redundant information.

[0058] The attention mechanism layer calculates the weights of abnormal features of the power market data, introduces the self-attention mechanism to perform weighted calculations on the features of different time steps, constructs the query vector, key vector and value vector, and obtains the correlation between time series by calculating the matching degree between the query vector and the key vector, thus giving higher weights to the key abnormal features of the power market.

[0059] Reconstruct the output layer, including reconstructing abnormal data based on weighted features calculated by the attention mechanism, generating normal data through time series prediction methods, calculating the deviation between predicted data and actual data using error optimization methods, and adjusting the parameters of the abnormal data reconstruction model based on the back propagation algorithm to minimize the prediction error.

[0060] It should also be noted that a preferred solution for normalization calculation specifically includes calculating the weights in weighted pooling by an exponential normalization method, which is expressed as: ; in, For the The pooling weights for time steps, represents the exponential transformation result of each time step within the pooling window, Represents the time step index within the pooling window.

[0061] It should also be noted that a preferred solution for dynamically adjusting the weight of abnormal data points specifically includes calculating the attention score , expressed as: ; in, represents the current time step, represents the target time step being focused on, is the query vector, is the transpose of the key vector, is the dimension of the key vector, is the abnormal data adjustment factor, is the abnormal data weight factor.

[0062] It should also be noted that a preferred solution for forming a new set of weighted feature vectors specifically includes calculating normalized attention weights and calculating final weighted features.

[0063] Calculate the normalized attention weight, expressed as: ; in, is the current time step For the target time step being focused The normalized attention weights of is the exponentially transformed attention score, is a normalization term that ensures the attention scores are non-negative and gives higher weights to larger relevance values.

[0064] Calculate the final weighted features , expressed as: ; in, is a weighted feature vector set used for data reconstruction, is the attention allocation matrix, is a value vector used for the final feature representation.

[0065] It should also be noted that a preferred solution for calculating the deviation between the predicted data and the actual data using the error optimization method specifically includes calculating the loss function value , expressed as: ; in, is the loss function value, which measures the deviation between the predicted data and the real data and is used to optimize the model parameters so that the repaired abnormal data is closer to the real market data. Abnormal data weight factor, Represents electricity market data under real market conditions, including electricity prices, loads, and transaction volume data. represents the repair data generated by the abnormal data reconstruction model, is the square error, which is used to measure the error between the reconstructed data and the true data.

[0066] It should also be noted that a preferred solution for adjusting the parameters of the abnormal data reconstruction model based on the back propagation algorithm to minimize the prediction error includes constructing a model parameter matrix, which is expressed as: ; in, Indicates The model parameter matrix after rounds of training, Indicates The model parameter matrix during round training, Represents the learning rate, which controls the step size of each parameter update. Represents the loss function For model parameters The gradient of the current model parameters The impact on the overall loss, thereby determining the direction of parameter optimization.

[0067] It should also be noted that by integrating CNN and attention mechanism, a complete structure of local and global feature modeling is constructed to form stronger anomaly detection and data reconstruction capabilities. CNN is responsible for extracting the feature infrastructure, and the attention mechanism optimizes the feature correlation through dynamic weighting, which enhances the performance and adaptability of the model under complex market conditions and improves the anomaly detection and reconstruction effects. Based on the features extracted by the convolutional neural network, the query vector is constructed. , key vector Sum value vector , extract the correlation information between different time points through linear transformation; use dot product operation to calculate the attention score and measure the correlation between time steps; through exponential normalization, prevent the attention score from being too large or too small, resulting in unstable learning; introduce abnormal data weight factors, dynamically adjust the attention allocation according to the deviation of the data from the normal distribution, and ensure that the model gives priority to abnormal points; through attention weighting, increase the proportion of abnormal points in the feature representation, and form a new set of weighted feature vectors; the model improves the reconstruction effect of abnormal data by strengthening the expression ability of abnormal points. This step optimizes the attention distribution and highlights the criticality of abnormal data, so that the model can maintain the ability to efficiently capture and repair abnormal patterns in a complex market environment. The dynamic adjustment ability based on the attention mechanism ensures that the model can flexibly respond to different market conditions.

[0068] S3: Migrate the trained abnormal data reconstruction model to the target power market.

[0069] Furthermore, the migration,includes,feature migration, which applies the trained anomaly data to reconstruct the model in the target market,performs parameter freezing operation on the specific layer weights of the pre-trained model,maintains the general feature extraction capability, and only allows the parameters of the attention mechanism layer and the output layer to be updated on the target market data.

[0070] Parameter migration: Migrate the model parameters trained in the source market to the target market and perform fine-tuning on the target market data.

[0071] Instance migration selects part of the source market data and mixes it with the target market data according to a preset ratio, and performs training on the mixed data set of the target market data and the source market data.

[0072] Evaluate the reconstructed model after migration in the target power market, calculate the model error by comparing the actual data with the reconstructed data, optimize the model and adjust the model parameters and structure based on the evaluation results; deploy the optimized reconstructed model to actual applications, obtain power market data in real time, reconstruct abnormal data online, and update and optimize the model in a timely manner by continuously monitoring the reconstruction results and market data.

[0073] It should be noted that fine-tuning is performed on the target market data, including setting a smaller learning rate and using the target market data for small batch training; calculating the loss function value of the target market data and adjusting the parameters of the attention mechanism layer and the output layer through back propagation; monitoring error changes during training and adjusting the training strategy to prevent the model from overfitting or falling into local optimality.

[0074] It should also be noted that the trained abnormal data reconstruction model is migrated to the target power market. The adaptability and generalization ability of the model in different power markets are improved through transfer learning. The feature migration strategy is adopted to freeze the convolutional feature extraction layer trained in the source market, maintain the model's ability to extract basic market features, and only optimize the attention mechanism layer and output layer in the target market; parameter migration is performed to migrate the training parameters of the source market to the target market, and fine-tune the model through the target market data to ensure that the model can adapt to the new market environment; instance migration is adopted to mix part of the source market data with the target market data for training, so that the model has stronger adaptability in the new market environment; through online optimization, the model can be monitored and adjusted in real time when running in the target market to ensure repair accuracy and stability; the training time of the model in the new market is effectively reduced, the data demand and computing cost are reduced, while maintaining a high level of anomaly detection and repair capabilities; transfer learning enables the model to quickly adapt to different market environments, maintain efficient identification and repair of market abnormal data, and improve the cross-market versatility and stability of the model.

[0075] Embodiment 2 is an embodiment of the present invention, which provides a method for reconstructing abnormal data in the power market. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through economic benefit calculation and simulation experiments.

[0076] Firstly, the historical time series data of the power market in a certain region are selected, including power transaction data, power load data, power grid operation data and market quotation data, with a time span of 30 days and a data frequency of 15 minutes, totaling 2880 time steps. The collected data are preprocessed to eliminate outliers and missing values, and the data are mapped to the [0,1] interval by normalization method to eliminate the dimensional differences between different data sources. Firstly, a convolutional neural network (CNN) structure is established, and the convolution kernel size of the first convolution layer is set to 3 and the step size is 1. The sliding window method is used to perform convolution operation on the input power market data. The sliding window moves in the time dimension, and the short-term features and abnormal patterns are extracted by local pattern matching. In the convolution operation, linear transformation is performed on the data. The ReLU (rectified linear unit) activation function is combined to enhance the nonlinear expression ability; in the pooling layer, the maximum pooling and weighted average pooling methods are used to reduce the dimension of the convolutional data; in the maximum pooling mode, the maximum value in the window is taken; in the weighted average pooling mode, the data in the window is weighted according to the exponential normalization to enhance the weight of abnormal data in the feature representation; in the subsequent convolutional layers, based on the short-term features extracted by the first convolutional layer, the long-term dependencies are further extracted to enhance the model's ability to capture the long-term trends and cyclical fluctuations of the electricity market. Through the adaptive anomaly detection mechanism, the convolution kernel parameters are dynamically adjusted to adaptively optimize the feature extraction effect based on the distribution changes of market data; next, the attention mechanism is used to calculate the attention weight of the feature. First, the query vector, key vector and value vector are constructed, and the correlation between different time steps is established through linear transformation; the matching score is calculated by dot product, and the matching score is weighted in combination with the abnormal data weight factor; the exponential normalization method is used to normalize the attention scores of different time steps and optimize the attention distribution; based on the attention distribution, a weighted feature representation is generated to provide optimized input for abnormal data reconstruction; finally, the trained abnormal data reconstruction model is migrated to other power markets; the feature migration strategy is adopted to freeze the parameters of the convolutional feature extraction layer, and only the attention mechanism layer and the output layer are fine-tuned; by fine-tuning the parameters in the target market environment, it is ensured that the model can quickly adapt to the new market data distribution; combined with instance migration, part of the source market data is mixed with the target market data to further enhance the adaptability of the model; after the model is run in the target market, the model reconstruction effect is continuously monitored through the online optimization mechanism, and the model parameters are dynamically adjusted according to the feedback. Refer to Table 1 to record and analyze the experimental data.

[0077] Table 1 Experimental data record table Time step Input power load (MW) Input electricity price (yuan / MWh) Convolution feature extraction value Max Pooling Value Weighted pooling value Reconstruction error (%) Attention weighted results 1 320 45 0.67 0.68 0.65 2.50% 0.66 2 315 47 0.7 0.72 0.69 2.00% 0.71 3 310 44 0.66 0.67 0.65 2.20% 0.67 4 322 48 0.73 0.74 0.72 1.80% 0.73 5 318 46 0.69 0.71 0.68 2.10% 0.7 6 325 49 0.74 0.75 0.73 1.50% 0.74

[0078] It can be seen from the experimental data that in terms of convolution feature extraction, after sliding window and convolution kernel operations, the short-term periodic features and abnormal features in the power market data are successfully extracted. For example, from the 1st to the 6th time step, the convolution feature extraction value is stable between 0.66 and 0.74, indicating that the model has a strong recognition ability for market data features at different time steps; in terms of pooling operation, the maximum pooling method can effectively highlight the extreme outliers in the market data; for example, in the second time step, the maximum pooling value is 0.72, which is higher than the convolution feature extraction value, indicating that the model has a good ability to detect abnormal points in power market price fluctuations. Higher sensitivity; the weighted pooling method enhances the influence of abnormal data through exponential normalization. For example, at the second time step, the weighted pooling value is 0.69, indicating that the model can highlight the contribution of abnormal points in feature expression; in the attention mechanism, the attention weighted result is basically consistent with the convolution feature extraction value and the pooling result, indicating that the model effectively retains the integrity of the features during the weighting process; for example, at the fourth time step, the attention weighted result is 0.73, which is close to the convolution feature extraction value and the pooling value, indicating that the model has strong stability and robustness in multi-level feature extraction; in addition, the reconstruction error is between 1.5% and 2 .5%, indicating that the model has high accuracy in abnormal data reconstruction; through model migration, the reconstructed model still maintains high performance in different market environments, which is manifested in low error rate and stable attention weighted results; for example, at the 6th time step, the reconstruction error of the model in the target market is 1.5%, indicating that through feature migration and parameter fine-tuning, the abnormal repair ability of the model in the target market environment has been effectively maintained; compared with the prior art, the present invention adopts a combination of convolutional neural network and attention mechanism to effectively improve the detection and repair capabilities of abnormal data in the power market. Traditional methods often ignore the cyclical and short-term fluctuation characteristics of the market in abnormal data identification, resulting in insufficient sensitivity of abnormal detection. The present invention improves the model's attention to abnormal points by introducing attention mechanism and adaptive anomaly detection mechanism, ensuring that abnormal data is not weakened or lost during the reconstruction process; at the same time, transfer learning improves the adaptability of the model in different market environments, reduces training cost and time, and improves the practicality and scalability of the model; in summary, the present invention effectively improves the accuracy, stability and adaptability of abnormal data reconstruction in the power market through convolutional neural network feature extraction, attention mechanism optimization and transfer learning, and has innovation and application value.

[0079] Embodiment 3 is an embodiment of the present invention, which provides an abnormal data reconstruction system for the power market, including a feature extraction module, a weight calculation module, and a migration optimization module.

[0080] The feature extraction module includes a data preprocessing module and a multi-level feature extraction module. The data preprocessing module is used to collect time series data of the electricity market and normalize the data. The multi-level feature extraction module is used to extract multi-level features in the data through a convolutional neural network, through the operation of multiple convolutional layers and pooling layers.

[0081] It should be noted that after receiving the time series data from the electricity market, the system performs preliminary processing by the feature extraction module. Specifically, the data preprocessing module is responsible for collecting historical market transaction data, power load data, power grid operation data and market quotation data, and normalizing the data from different data sources to eliminate the dimensional differences between different data and ensure the consistency of the data after input into the model; then, the normalized data is processed by the multi-level feature extraction module through the convolutional neural network (CNN). The convolution operation extracts short-term periodic features through the sliding window mechanism, and the pooling operation further reduces the dimension and enhances the feature expression through maximum pooling and weighted pooling, thereby extracting local patterns and abnormal features in the data.

[0082] The feature extraction module is responsible for providing basic feature input for the weight calculation module. In the initial stage of system operation, the data preprocessing module receives historical data of the power market (including power load, electricity price, transaction volume, power grid operation status, etc.), cleans the data, fills in missing values ​​and normalizes the data, eliminates the dimensional differences between different data sources, and ensures the consistency and integrity of data input; the input data after data preprocessing is transmitted to the multi-level feature extraction module, and the short-term periodic features and long-term trend features in the data are extracted through the convolutional neural network (CNN); in the convolution layer, the sliding window is combined with the convolution kernel to extract the dynamic features and anomalies of the power market through local pattern matching; the feature matrix generated by the convolution operation is further reduced in dimension through maximum pooling and weighted pooling in the pooling layer to enhance the expression ability of abnormal features, and weighted pooling is normalized by exponentials so that abnormal data points obtain higher weights in the feature representation; the feature matrix after extraction is directly transmitted to the weight calculation module. At this time, the feature matrix not only contains the overall dynamic features of the market, but also contains the feature representation after abnormal enhancement, thereby providing high-quality input for the calculation of the attention mechanism.

[0083] The weight calculation module includes an associated weight calculation module and an abnormal data reconstruction model construction module. The associated weight calculation module is used to construct query vectors, key vectors and value vectors through the attention mechanism, establish the correlation between different time steps, and dynamically adjust the attention allocation method in combination with the abnormal data weight factor to optimize the weighted process of abnormal data. The abnormal data reconstruction model construction module is used to generate the final feature representation based on the weighted results of the attention mechanism, and adopt a combination of convolutional feature extraction, attention allocation and reconstruction output to construct a complete abnormal data reconstruction model.

[0084] It should be noted that after the feature extraction is completed, the system transmits the generated feature vector to the weight calculation module. First, the association weight calculation module constructs the query vector, key vector and value vector through the attention mechanism to establish the correlation between different time steps; the matching score is calculated by dot product operation, and the matching score is weighted by the abnormal data weight factor to generate an association score matrix based on the abnormal data weight; then, the exponential normalization method is used to optimize the attention distribution to ensure that the model pays more attention to the contribution of abnormal points in the feature expression; the abnormal data reconstruction model construction module generates the final feature representation based on the weighted feature vector, and adopts a combination of convolutional feature extraction, attention allocation and reconstruction output to construct a complete abnormal data reconstruction model to ensure the model's ability to identify and repair abnormal points.

[0085] The weight calculation module provides the migration optimization module with feature representation after model training and optimization. In the weight calculation module, the final feature matrix after convolution operation and attention mechanism weighting is input into the reconstruction model. The trained reconstruction model contains the dynamic characteristics and abnormal patterns of the power market, and forms the ability to identify and repair abnormal points. The trained model is directly used as the input of the migration optimization module.

[0086] The migration optimization module includes a model migration module and a fine-tuning optimization module. The model migration module is used to migrate the trained abnormal data reconstruction model to the target power market through feature migration, parameter migration and instance migration. The fine-tuning optimization module is used for small-batch training on the target market data set, and dynamically adjusts based on the loss function value. The back-propagation algorithm is used to optimize the model parameters to prevent overfitting or local optimality.

[0087] It should be noted that after the model completes the initial training, the system enters the migration optimization module to achieve rapid adaptation of the model in different power market environments; first, the model migration module migrates the trained abnormal data reconstruction model to the new target market through feature migration, parameter migration and instance migration; to prevent the performance of the model from degrading in the new market environment, the system performs small batch training on the target market data set through the fine-tuning optimization module. According to the dynamic changes of the loss function value, the system automatically adjusts the model parameters through the back-propagation algorithm, optimizes the attention weight and reconstruction accuracy, and ensures that the model maintains stable anomaly detection and repair capabilities in the new market environment.

[0088] After the migration optimization module runs in the new market environment, the optimization results will further adjust the parameters of the feature extraction module. During the migration and fine-tuning process, the system will dynamically adjust the receptive field of the convolution kernel, the step size of the sliding window, and the pooling strategy according to the fluctuation pattern of the new market data to adapt to the dynamic changes of the new market; the system may adjust the maximum pooling and weighted pooling strategies according to the characteristics of the abnormal patterns in the target market to improve the accuracy of abnormal data identification; through this reverse adjustment, the system realizes a complete closed-loop optimization from feature extraction to weight calculation and then to model migration.

[0089] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0090] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.

[0091] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic devices), a portable computer disk case (magnetic devices), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0092] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logical function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc. It should be noted that the above embodiments are only used to illustrate the technical solution of the present invention and are not limited. Although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention, which should be included in the scope of the claims of the present invention.

Claims

1. A method for reconstructing abnormal data in the power market, characterized in that: include: Extracting features from electricity market data using convolutional neural networks; The attention weight of the feature is calculated based on the attention mechanism, and the convolutional neural network and the attention mechanism are integrated to build an abnormal data reconstruction model; Migrate the trained abnormal data reconstruction model to the target power market; Calculating the attention weight of features includes calculating the weight of abnormal data, constructing query, key and value vectors, and optimizing feature relevance; Exponential normalization is used to optimize attention allocation, and an abnormal data weight factor is introduced to dynamically adjust the weight; the abnormal data reconstruction model is constructed, including constructing an input layer, a convolutional feature extraction layer, an attention mechanism layer, and a reconstruction output layer; CNN is integrated to extract features, the attention mechanism optimizes the representation of abnormal points, and the parameters are adjusted through error optimization and back propagation; migrate Including feature migration, parameter migration, instance migration, freezing the CNN feature layer, and only fine-tuning the attention mechanism layer and output layer.

2. The method for reconstructing abnormal data in the power market according to claim 1, characterized in that: The extracting of electricity market data features includes: The power market time series data is collected and normalized, and the multi-level features in the power market data are extracted through the convolutional neural network through the operation of multiple convolutional layers and pooling layers.

3. The method for reconstructing abnormal data in the power market according to claim 2, characterized in that: The convolutional neural network includes: In the first convolution layer, a convolution kernel of a set size is used to perform sliding window calculation on the input power market time series data. The size of the sliding window is set to a fixed value. The convolution kernel slides on the time dimension according to the set step size, performs local pattern matching on each time step, and extracts the time series characteristics of the power market data. Within the sliding window, a linear transformation is performed on the data according to the set parameter weights, and a nonlinear activation function is applied to obtain time series feature information; In the pooling layer, based on the time series features extracted by the first convolutional layer, the convolutional power market data is subjected to dimensionality reduction processing by using the maximum pooling or average pooling method. In the maximum pooling mode, the maximum value of the abnormal data point within the set time window is selected. In the weighted average pooling mode, the weighted mean within the set window is calculated, and a higher weight is assigned to the abnormal point. In the subsequent convolutional layers, based on the temporal features extracted by the first convolutional layer, long-term dependencies are calculated and high-level temporal features are extracted. In the feature extraction process, an adaptive anomaly detection mechanism is introduced to automatically adjust the convolution kernel parameters by monitoring the distribution changes of data features.

4. The method for reconstructing abnormal data in the power market according to claim 1 or 3, characterized in that: The attention weight of the calculated feature, include, The attention mechanism is introduced to construct query vectors, key vectors and value vectors based on the characteristics of abnormal data in the power market, and to extract key correlation information between different time points and variables in the power market data; The query vector, key vector and value vector are obtained by linear transformation of the power market time series data, and the parameter transformation adopts a trainable weight matrix; Compute the matching score by performing a dot product operation on the query vector and the key vector and evaluate the correlation between different time steps; Construct a correlation score matrix based on anomaly weights, combine the feature data extracted by convolutional neural networks, calculate the correlation between time steps, and assign higher weights to anomalies in power market data; The exponential normalization method is used to normalize the correlation at different time points, perform exponential transformation on the matching scores in the matrix, sum all the values ​​in the same row, and perform normalization on the matrix rows to optimize the attention allocation method; Introducing an abnormal data weight factor in the attention calculation process, dynamically adjusting the weight of abnormal data points, and optimizing the calculation method of the attention mechanism in the feature extraction stage according to the feature distribution in the attention calculation stage; The attention weighted result is calculated based on the normalized attention weight. The normalized value is used as the weight, and element-by-element multiplication is performed with the value vector. The product results are summed in the time dimension to form a new set of weighted feature vectors.

5. The method for reconstructing abnormal data in the power market according to claim 4, characterized in that: The abnormal data reconstruction model includes: Input layer, convolutional feature extraction layer, attention mechanism layer, and reconstruction output layer; The input layer receives preprocessed power market time series data, including historical power market transaction data, power load data, power grid operation data and market quotation data, and performs normalization to eliminate the dimensional differences between different data sources; The convolutional feature extraction layer extracts multi-level time series features of the power market data through multiple convolutional layers and pooling layers. The convolutional layer extracts local data patterns based on a set sliding window, and the pooling layer reduces the data dimension and removes redundant information. The attention mechanism layer calculates the weights of abnormal features of power market data, introduces the self-attention mechanism to perform weighted calculations on features of different time steps, constructs query vectors, key vectors, and value vectors, and obtains the correlation between time series by calculating the matching degree between query vectors and key vectors, giving higher weights to key abnormal features of the power market. Reconstruct the output layer, including reconstructing abnormal data based on weighted features calculated by the attention mechanism, generating normal data through time series prediction methods, calculating the deviation between predicted data and actual data using error optimization methods, and adjusting the parameters of the abnormal data reconstruction model based on the back propagation algorithm to minimize the prediction error.

6. The method for reconstructing abnormal data in the power market according to any one of claims 1, 2 or 5, characterized in that: The migration includes: Feature transfer: Apply the trained abnormal data to reconstruct the model in the target market, perform parameter freezing on the weights of specific layers of the pre-trained model, maintain the general feature extraction capability, and only allow the parameters of the attention mechanism layer and the output layer to be updated on the target market data; Parameter migration: Migrate the model parameters trained in the source market to the target market and perform fine-tuning on the target market data; Instance migration: select part of the source market data and mix it with the target market data according to a preset ratio, and perform training on the mixed data set of the target market data and the source market data; Evaluate the reconstructed model after migration in the target power market, calculate the model error by comparing the actual data with the reconstructed data, and optimize the model and adjust the model parameters and structure based on the evaluation results; The optimized reconstruction model is deployed in actual applications to obtain power market data in real time, perform online abnormal data reconstruction, and update and optimize the model in a timely manner by continuously monitoring the reconstruction results and market data.

7. The method for reconstructing abnormal data in the power market according to claim 6, characterized in that: The said fine-tuning on the target market data includes, Set the learning rate and use the target market data for small batch training; Calculate the loss function value of the target market data and adjust the parameters of the attention mechanism layer and the output layer through back propagation; Monitor error changes during training and adjust training strategies to prevent the model from overfitting or falling into local optimality.

8. The power market abnormal data reconstruction system is characterized by: Including feature extraction module, weight calculation module, and migration optimization module; The feature extraction module includes a data preprocessing module and a multi-level feature extraction module. The data preprocessing module is used to collect the time series data of the power market and normalize the data. The multi-level feature extraction module is used to extract multi-level features in the data through a convolutional neural network and operations of multiple convolutional layers and pooling layers. The weight calculation module includes an associated weight calculation module and an abnormal data reconstruction model construction module. The associated weight calculation module is used to construct a query vector, a key vector and a value vector through an attention mechanism, establish correlations between different time steps, and dynamically adjust the attention allocation method in combination with the abnormal data weight factor to optimize the weighting process of the abnormal data. The abnormal data reconstruction model construction module is used to generate the final feature representation based on the weighted result of the attention mechanism, and adopt a combination of convolutional feature extraction, attention allocation and reconstruction output to construct a complete abnormal data reconstruction model. The migration optimization module includes a model migration module and a fine-tuning optimization module. The model migration module is used to migrate the trained abnormal data reconstruction model to the target power market through feature migration, parameter migration and instance migration. The fine-tuning optimization module is used for small-batch training on the target market data set, and dynamically adjusts based on the loss function value. The back-propagation algorithm is used to optimize the model parameters to prevent overfitting or local optimality.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method for reconstructing abnormal power market data according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for reconstructing abnormal data in a power market according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Semi-supervised anomaly detection method based on transfer learning

    CN113128613A

  • Federal learning-based power data anomaly detection method

    CN116451117A

  • Time sequence anomaly detection method based on association difference and TimeBlock encoder

    CN117743899A

  • Power system data anomaly detection method and system based on graph neural network

    CN118861956A

  • Robot alarm processing method and system based on target detection algorithm and cloud platform

    CN119418174A

Cited By

  • Well drilling risk prediction method and device

    CN121235446A