Power grid time sequence data feature extraction model training method and device

By using contrastive learning and mask prediction methods to perform self-supervised pre-training on power grid time series data, the problem of noise neglect in existing time series analysis methods is solved, thereby improving the model's generalization ability and prediction accuracy.

CN116028785BActive Publication Date: 2025-11-21GLOBAL ENERGY INTERCONNECTION RES INST CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211705050.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-28
Publication Date
2025-11-21
Estimated Expiration
2042-12-28

AI Technical Summary

Technical Problem

Existing time series analysis methods do not specifically address noise in time series data, leading to overfitting of the model to the training data, which affects the model's generalization ability and hinders the improvement of time series model performance.

Method used

Self-supervised pre-training of power grid time series data is performed using contrastive learning and mask prediction methods. Modeling is carried out using discriminative features and contextual information. The original data is obtained by mask enhancement processing to obtain the first enhanced time series data. The original power grid time series data is then subjected to numerical transformation to obtain the second enhanced time series data. Finally, the original power grid time series data is subjected to mask prediction to obtain the mask-enhanced time series data.

Benefits of technology

It improves the generalization ability of the pre-trained time series feature extraction network and enhances the training speed and prediction accuracy of various downstream power grid time series tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116028785B_ABST
    Figure CN116028785B_ABST
Patent Text Reader

Abstract

Embodiments of the present application relate to a kind of power grid time series data feature extraction model training method and device, comprising: obtaining original power grid time series data, and the original power grid time series data is carried out mask enhancement processing, obtain first enhanced time series data;Original power grid time series data is carried out numerical transformation operation, obtain second enhanced time series data;Based on the first enhanced time series data and second enhanced time series data, initial model is carried out contrastive learning training, obtain contrastive loss;Through initial model, the first enhanced time series data is carried out mask prediction, obtain reconstruction loss;Based on the contrastive loss and the reconstruction loss, the training parameter of initial model is optimized, obtain power grid time series data feature extraction model.Therefore, using contrastive learning and mask prediction two kinds of ways simultaneously to time series data are self-supervised pre-training, modeling is considered from the distinguishability feature and context information, to improve the generalization ability of pre-training time series feature extraction network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of data processing, and in particular to a training method and apparatus for a power grid time series data feature extraction model. Background Technology

[0002] In recent years, time series data analysis has played a vital role in many fields, including financial markets, demand forecasting, and climate modeling. In power grid scenarios, the abundance of sensor devices generates massive amounts of online monitoring time series data. Time series analysis techniques, such as time series prediction and anomaly detection, can effectively detect abnormal states in power grid scenarios, thereby improving the intelligence level of fault diagnosis, preventing major faults in advance, and strongly supporting the construction of new power systems.

[0003] However, existing time series analysis methods do not specifically address noise in time series data, leading to overfitting of the model to the training data, which affects the model's generalization ability and thus hinders the improvement of time series model performance. Summary of the Invention

[0004] In view of this, in order to solve the above-mentioned technical problems or some of the technical problems, the present invention provides a training method and apparatus for a power grid time series data feature extraction model.

[0005] In a first aspect, embodiments of the present invention provide a training method for a power grid time-series data feature extraction model, comprising:

[0006] The original power grid time series data is acquired, and the original power grid time series data is subjected to mask enhancement processing to obtain the first enhanced time series data;

[0007] The original power grid time series data is subjected to numerical transformation to obtain the second enhanced time series data;

[0008] The initial model is trained by contrastive learning based on the first and second enhanced time series data to obtain the contrastive loss.

[0009] The reconstruction loss is obtained by performing mask prediction on the first enhanced temporal data using the initial model;

[0010] The training parameters of the initial model are optimized based on the contrast loss and the reconstruction loss to obtain a power grid time series data feature extraction model.

[0011] In one possible implementation, the method further includes:

[0012] Determine a fixed proportion of time step indices and determine the starting index position;

[0013] Based on a fixed proportion of time step index and the starting index position, the time step index of fixed length is expanded to obtain multiple time series data segments.

[0014] The original power grid time series data corresponding to the multiple time series data segments are zeroed to obtain the first enhanced time series data after mask enhancement processing.

[0015] In one possible implementation, the method further includes:

[0016] The original power grid time-series data is scaled.

[0017] The original power grid time series data after scaling is shifted.

[0018] The original power grid time series data after translation processing is jittered to obtain the second enhanced time series data after numerical transformation.

[0019] In one possible implementation, the method further includes:

[0020] Extract the first query feature corresponding to the first enhanced time series data, and extract the second query feature corresponding to the second enhanced time series data;

[0021] First query mapping features are extracted based on the first query features, and second query mapping features are extracted based on the second query features;

[0022] A first query prediction feature is extracted based on the first query mapping feature, and a second query prediction feature is extracted based on the second query mapping feature;

[0023] Extract the first key feature corresponding to the first enhanced time series data, and extract the second key feature corresponding to the second enhanced time series data;

[0024] First key mapping features are extracted based on the first key features, and second key mapping features are extracted based on the second key features.

[0025] In one possible implementation, the method further includes:

[0026] Calculate the first contrastive loss based on the first query prediction features and the second key mapping features;

[0027] The second contrastive loss is calculated based on the second query prediction feature and the first key mapping feature.

[0028] In one possible implementation, the method further includes:

[0029] Extract the coding features of the first enhanced time-series data;

[0030] Based on the encoded features, the first enhanced temporal data is predicted by the reconstruction decoder to obtain predicted data;

[0031] The reconstruction loss is determined based on the original data corresponding to the predicted data and the first enhanced time-series data.

[0032] In one possible implementation, the method further includes:

[0033] The training parameters of the initial model are optimized using a first formula, which is: L = L con +αL rec ;

[0034] Among them, L con To compare the losses, L rec To reconstruct the loss, α is the weight that balances the two losses.

[0035] Secondly, embodiments of the present invention provide a method for extracting features from power grid time-series data, including:

[0036] Obtain the original time-series data of the power grid for which feature extraction is to be performed;

[0037] The original power grid time series data is input into the power grid time series data feature extraction model to obtain the power grid time series data features of the power grid.

[0038] Thirdly, embodiments of the present invention provide a training apparatus for a power grid time-series data feature extraction model, comprising:

[0039] The data processing module is used to acquire raw power grid time series data and perform mask enhancement processing on the raw power grid time series data to obtain first enhanced time series data.

[0040] The data processing module is also used to perform numerical transformation operations on the original power grid time series data to obtain the second enhanced time series data;

[0041] The training module is used to perform comparative learning training on the initial model based on the first and second augmented time series data to obtain the comparative loss;

[0042] The training module is also used to perform mask prediction on the first enhanced temporal data using the initial model to obtain the reconstruction loss;

[0043] An optimization module is used to optimize the training parameters of the initial model based on the contrast loss and the reconstruction loss to obtain a power grid time series data feature extraction model.

[0044] In one possible implementation, the data processing module is further configured to determine a fixed proportion of time step indexes and determine a starting index position; based on the fixed proportion of time step indexes and the starting index position, extend the time step indexes of a fixed length to obtain multiple time series data segments; and perform a zeroing operation on the original power grid time series data corresponding to the multiple time series data segments to obtain the first enhanced time series data after mask enhancement processing.

[0045] In one possible implementation, the data processing module is further configured to perform scaling processing on the original power grid time series data; perform translation processing on the scaled original power grid time series data; and perform jitter processing on the translated original power grid time series data to obtain the second enhanced time series data after numerical transformation operation.

[0046] In one possible implementation, the training module is further configured to: extract a first query feature corresponding to the first enhanced time-series data; extract a second query feature corresponding to the second enhanced time-series data; extract a first query mapping feature based on the first query feature; extract a second query mapping feature based on the second query feature; extract a first query prediction feature based on the first query mapping feature; extract a second query prediction feature based on the second query mapping feature; extract a first key feature corresponding to the first enhanced time-series data; extract a second key feature corresponding to the second enhanced time-series data; extract a first key mapping feature based on the first key feature; and extract a second key mapping feature based on the second key feature.

[0047] In one possible implementation, the training module is further configured to calculate a first contrastive loss based on the first query prediction feature and the second key mapping feature; and to calculate a second contrastive loss based on the second query prediction feature and the first key mapping feature.

[0048] In one possible implementation, the training module is further configured to extract the encoding features of the first augmented time-series data; predict the first augmented time-series data using a reconstruction decoder based on the encoding features to obtain predicted data; and determine the reconstruction loss based on the predicted data and the original data corresponding to the first augmented time-series data.

[0049] In one possible implementation, the optimization module is specifically used to optimize the training parameters of the initial model using a first formula, wherein the first formula is: L = L con +αL rec Among them, L con To compare the losses, L rec To reconstruct the loss, α is the weight that balances the two losses.

[0050] Fourthly, embodiments of the present invention provide a power grid time-series data feature extraction device, comprising:

[0051] The acquisition module is used to acquire the original time-series data of the power grid to be feature extracted;

[0052] The extraction module is used to input the original power grid time series data into the power grid time series data feature extraction model to obtain the power grid time series data features of the power grid;

[0053] The power grid time-series data feature extraction model is trained using the method described in the first aspect.

[0054] Fifthly, embodiments of the present invention provide a computer device, including: a processor and a memory, wherein the processor is configured to execute a training program for a power grid time-series data feature extraction model stored in the memory, so as to implement the power grid time-series data feature extraction model training method described in the first aspect and the power grid time-series data feature extraction method described in the second aspect.

[0055] In a sixth aspect, embodiments of the present invention provide a storage medium, comprising: the storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the training method for the power grid time series data feature extraction model described in the first aspect and the power grid time series data feature extraction method described in the second aspect.

[0056] The training scheme for the power grid time-series data feature extraction model provided in this invention involves acquiring original power grid time-series data and performing mask enhancement processing on the original power grid time-series data to obtain first enhanced time-series data; performing numerical transformation operations on the original power grid time-series data to obtain second enhanced time-series data; performing comparative learning training on an initial model based on the first and second enhanced time-series data to obtain a comparative loss; performing mask prediction on the first enhanced time-series data using the initial model to obtain a reconstruction loss; and optimizing the training parameters of the initial model based on the comparative loss and the reconstruction loss to obtain the power grid time-series data feature extraction model. Compared to existing time-series analysis methods that do not specifically address noise in time-series data, causing the model to overfit the training data and affecting the model's generalization ability, this scheme utilizes both comparative learning and mask prediction methods to simultaneously perform self-supervised pre-training on the time-series data, taking into account both discriminative features and contextual information modeling, thereby improving the generalization ability of the pre-trained time-series feature extraction network.

[0057] The power grid time-series data feature extraction scheme provided in this invention obtains the original power grid time-series data of the power grid to be feature extracted; the original power grid time-series data is input into the power grid time-series data feature extraction model to obtain the power grid time-series data features of the power grid. This scheme, by extracting power grid time-series data features using a model trained to address noise in the time-series data while considering discriminative features and contextual information, can improve the generalization ability of the trained time-series feature extraction network and enhance the training speed and prediction accuracy for various downstream power grid time-series tasks. Attached Figure Description

[0058] Figure 1 A flowchart illustrating a training method for a power grid time-series data feature extraction model provided in an embodiment of the present invention;

[0059] Figure 2 A flowchart illustrating another training method for a power grid time-series data feature extraction model provided in an embodiment of the present invention;

[0060] Figure 3 A power grid time-series data feature extraction model architecture diagram provided in an embodiment of the present invention;

[0061] Figure 4 An encoder model architecture diagram provided for an embodiment of the present invention;

[0062] Figure 5 This is a diagram illustrating the architecture of a mask prediction model provided in an embodiment of the present invention.

[0063] Figure 6 A schematic diagram of the structure of a training device for a power grid time series data feature extraction model provided in an embodiment of the present invention;

[0064] Figure 7 This is a schematic diagram of the structure of a power grid time-series data feature extraction device provided in an embodiment of the present invention;

[0065] Figure 8 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Detailed Implementation

[0066] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0067] To facilitate understanding of the embodiments of the present invention, further explanations and descriptions will be provided below with reference to the accompanying drawings and specific embodiments. These embodiments do not constitute a limitation on the embodiments of the present invention.

[0068] Figure 1 This is a flowchart illustrating a training method for a power grid time-series data feature extraction model provided in an embodiment of the present invention, as shown below. Figure 1 As shown, the method specifically includes:

[0069] S11. Obtain the original power grid time series data and perform mask enhancement processing on the original power grid time series data to obtain the first enhanced time series data.

[0070] This invention provides a training method for a power grid time series data feature extraction model based on joint modeling of contrastive learning and mask prediction. First, the original power grid time series data is acquired, and then mask enhancement processing is performed on it. Specifically, this includes: randomly selecting a fixed proportion of time step indices from the input original power grid time series data, with no overlap between indices; then, starting from each index, continuously expanding the time step indices to a fixed length to form a time series data segment; finally, setting all values ​​at the obtained index positions to zero to obtain the first enhanced time series data.

[0071] For example, given 100 original power grid time series data points, we determine to perform masking enhancement on 80 of them. Starting from the first data point, we index every 5 data points as a time step until we have selected 80 data points to obtain a time series data segment. Finally, we set the data values ​​at the obtained index positions to zero, thus masking the real data and obtaining the first enhanced time series data.

[0072] S12. Perform a numerical transformation operation on the original power grid time series data to obtain the second enhanced time series data.

[0073] The numerical transformation first scales the original power grid time series data by randomly sampling a single value ∈ ~N(0,0.5). Then, the scaled data is translated using randomly sampled single values ​​∈ ~N(0,0.5). Finally, through random sampling of n values ​​ε i ~N(0,0.5) jitters the data at each time step after translation. n is the length of the time series data, resulting in the second enhanced time series data after the numerical transformation operation.

[0074] S13. Based on the first enhanced time series data and the second enhanced time series data, the initial model is trained by comparative learning to obtain the comparative loss.

[0075] The contrastive learning training phase includes two branches: the query branch and the key branch, and five core modules: the query encoder, the query mapping head, the query prediction head, the key encoder, and the key mapping head. The model architecture is as follows: Figure 3 As shown.

[0076] For the query branch: First, the masked time series data is the first enhanced time series data, and the numerically transformed time series data is the second enhanced time series data. The first and second enhanced data are used to extract the first and second query features through the query encoder. Then, the first and second query features are used to extract the first and second query mapping features through the query mapping head. Finally, the first and second query mapping features are used to extract the first and second query prediction features through the query prediction head.

[0077] For the key branch: First, the first and second enhanced time series data are processed by the key encoder to extract the first and second key features; then, the first and second key features are processed by the key mapping head to extract the first and second key mapping features; finally, the contrastive loss is calculated between the first query prediction feature and the second key mapping feature, and the contrastive loss is calculated between the second query prediction feature and the first key mapping feature.

[0078] S14. Perform mask prediction on the first enhanced time series data using the initial model to obtain the reconstruction loss.

[0079] The mask prediction stage comprises two core modules: a query encoder and a reconstruction decoder. The query encoder is shared with the contrastive learning stage, while the reconstruction decoder is a transformer encoding module. The mask prediction model architecture diagram is shown below. Figure 5 As shown, firstly, the first enhanced temporal data is used to extract coded features through a query encoder; then, the coded features are used to predict the temporal values ​​of the mask region through a reconstruction decoder; finally, the reconstruction loss of the predicted mask values ​​and the real temporal data is calculated and used for parameter optimization of the mask prediction-related modules.

[0080] S15. Based on the contrast loss and the reconstruction loss, the training parameters of the initial model are optimized to obtain the power grid time series data feature extraction model.

[0081] The contrastive learning training and mask prediction stages correspond to contrastive loss and reconstruction loss, respectively, and both losses simultaneously optimize the entire model end-to-end. The overall loss function is calculated as shown in Equation 1:

[0082] L = L con +αL rec Formula 1

[0083] Among them, L con To compare the losses, L rec To reconstruct the loss, α is the weight that balances the two losses.

[0084] The training parameters of the initial model are optimized based on the loss function calculation results. For example, if the loss function calculation results do not reach the expected value, the model training parameters are adjusted until the loss function calculation results reach the expected value, indicating that the model training is complete and the power grid time series data feature extraction model is obtained.

[0085] The training method for the power grid time series data feature extraction model provided in this embodiment of the invention integrates comparative learning and mask prediction for time series data. By leveraging the complementarity of discriminative feature learning and contextual modeling, it achieves pre-training of the power grid time series data model, extracts general features with strong generalization ability, and greatly improves the training speed and prediction accuracy of various downstream power grid time series tasks, including time series prediction, time series classification, and anomaly detection.

[0086] The training method for a power grid time-series data feature extraction model provided in this invention involves acquiring original power grid time-series data and performing mask enhancement processing on the original power grid time-series data to obtain first enhanced time-series data; performing numerical transformation operations on the original power grid time-series data to obtain second enhanced time-series data; performing comparative learning training on an initial model based on the first and second enhanced time-series data to obtain a comparative loss; performing mask prediction on the first enhanced time-series data using the initial model to obtain a reconstruction loss; and optimizing the training parameters of the initial model based on the comparative loss and the reconstruction loss to obtain a power grid time-series data feature extraction model. Compared to existing time-series analysis methods that do not specifically address noise in time-series data, causing the model to overfit the training data and affecting the model's generalization ability, this method utilizes both comparative learning and mask prediction to simultaneously perform self-supervised pre-training on the time-series data, taking into account both discriminative features and contextual information modeling, thereby improving the generalization ability of the pre-trained time-series feature extraction network.

[0087] Figure 2 A flowchart illustrating another training method for a power grid time-series data feature extraction model provided in this embodiment of the invention is shown below. Figure 2 As shown, the method specifically includes:

[0088] S21. Determine the time step index with a fixed ratio and determine the starting index position.

[0089] S22. Based on the fixed proportion of the time step index and the starting index position, expand the fixed length of the time step index to obtain multiple time series data segments.

[0090] S23. The original power grid time series data corresponding to the multiple time series data segments are zeroed to obtain the first enhanced time series data after mask enhancement processing.

[0091] The following provides a unified explanation of S21 to S23:

[0092] First, the original power grid time series data is acquired, and then the original power grid time series data is subjected to masking enhancement processing. Specifically, this includes: randomly selecting a fixed proportion of time step indices from the input original power grid time series data, with no overlap between the indices; then, starting from each index, continuously expanding the time step indices of a fixed length to form a time series data segment; finally, setting all the values ​​at the obtained index positions to zero to obtain the first enhanced time series data.

[0093] For example, given 100 original power grid time series data points, 60 of them are selected for masking enhancement. Starting from the first data point, every 3 data points are used as a time step index until 60 data points are selected to obtain a time series data segment. Finally, the data values ​​at the obtained index positions are set to zero, thus masking the real data and obtaining the first enhanced time series data.

[0094] S24. Perform scaling processing on the original power grid time series data.

[0095] S25. Perform translation processing on the original power grid time series data after scaling.

[0096] S26. The original power grid time series data after translation processing is subjected to jitter processing to obtain the second enhanced time series data after numerical transformation operation.

[0097] The following provides a unified explanation of S24 to S26:

[0098] The numerical transformation first scales the original power grid time series data by randomly sampling a single value ε ~ N(0, 0.5). Then, the scaled data is translated using a randomly sampled single value ε ~ N(0, 0.5). Finally, through random sampling of n values ​​∈ i ~N(0,0.5) jitters the data at each time step after translation. n is the length of the time series data, resulting in the second enhanced time series data after the numerical transformation operation.

[0099] S27. Extract the first query feature corresponding to the first enhanced time series data, and extract the second query feature corresponding to the second enhanced time series data.

[0100] S28. Extract a first query mapping feature based on the first query feature, and extract a second query mapping feature based on the second query feature.

[0101] S29. Extract a first query prediction feature based on the first query mapping feature, and extract a second query prediction feature based on the second query mapping feature.

[0102] S210. Extract the first key feature corresponding to the first enhanced time series data, and extract the second key feature corresponding to the second enhanced time series data.

[0103] S211. Extract a first key mapping feature based on the first key feature, and extract a second key mapping feature based on the second key feature.

[0104] The following provides a unified explanation of S27 to S211:

[0105] The contrastive learning training phase includes two branches: the query branch and the key branch, and five core modules: the query encoder, the query mapping head, the query prediction head, the key encoder, and the key mapping head. The model architecture is as follows: Figure 3 As shown.

[0106] For the query branch: First, the masked time series data is the first enhanced time series data, and the numerically transformed time series data is the second enhanced time series data. The first enhanced time series data can be used to extract the first query feature through the query encoder, and the second enhanced time series data can be used to extract the second query feature through the query encoder. Then, the first query feature is used to extract the first query mapping feature through the query mapping head, and the second query feature is used to extract the second query mapping feature through the query mapping head. Finally, the first query mapping feature is used to extract the first query prediction feature through the query prediction head, and the second query mapping feature is used to extract the second query prediction feature through the query prediction head.

[0107] For the critical branch: First, the first critical feature is extracted from the first augmented time series data through the critical encoder, and the second critical feature is extracted from the second augmented time series data through the critical encoder; then, the first critical feature is used to extract the first critical mapping feature through the critical mapping head, and the second critical feature is used to extract the second critical mapping feature through the critical mapping head.

[0108] S212. Calculate the first contrast loss based on the first query prediction feature and the second key mapping feature.

[0109] S213. Calculate the second contrast loss based on the second query prediction features and the first key mapping features.

[0110] The first contrast loss and the second contrast loss are calculated using Formula 2, which is as follows:

[0111]

[0112] Among them, z i To query predictive features, As the key mapping feature, z j K represents other data in the same batch of training data, where K is the number of data in the same batch of training data.

[0113] By comparing the loss-optimized query encoder and query map head, the parameters of the key encoder and key map head are updated using an exponential moving average.

[0114] It should be noted that the query encoder and the key encoder use the same network structure, which consists of two transformer encoding modules. For the temporal values ​​at each time step, linear mapping encoding and positional encoding are used as inputs to the subsequent multi-head attention layer and feedforward layer to achieve feature encoding of the temporal data. The specific encoder model architecture is as follows: Figure 4 As shown, the query mapping head and key mapping head use the same network structure, containing three neural network layers. Each layer consists of a fully connected layer, a layer normalization function, and a non-linear activation function; the fully connected layer in the middle layer has a dimension of 1024, and the fully connected layer in the output layer has a dimension of 256. The query prediction head has the same network structure as the mapping head, the only difference being that it only has two neural network layers.

[0115] S214. Extract the coding features of the first enhanced time-series data.

[0116] S215. Based on the encoding features, the first enhanced time-series data is predicted by the reconstruction decoder to obtain the predicted data.

[0117] S216. Determine the reconstruction loss based on the original data corresponding to the predicted data and the first enhanced time series data.

[0118] The following provides a unified explanation of S214 to S216:

[0119] First, the first enhanced temporal data is used to extract encoded features through a query encoder. Then, the encoded features are used to predict the temporal values ​​of the masked region through a reconstruction decoder. Finally, the reconstruction loss between the predicted mask values ​​and the actual temporal data is calculated and used for parameter optimization of the mask prediction-related modules. The formula for calculating the reconstruction loss is shown in Formula 3:

[0120] L rec =MSE(pred[masked_index],target[masked_index]) Formula 3

[0121] Where MSE is the mean squared error loss, pred and target are the reconstructed value and the target value, respectively, and masked_index is the time step index of the masking.

[0122] Furthermore, the entire model can be optimized end-to-end based on the contrastive loss and reconstruction loss corresponding to the contrastive learning and mask prediction stages, respectively. Figure 1 Formula 1 in the corresponding embodiment calculates the loss function value. The training parameters of the initial model are optimized based on the loss function calculation result. For example, if the loss function calculation result does not reach the expected value, the model training parameters are adjusted until the loss function calculation result reaches the expected value, indicating that the model training is complete and a power grid time series data feature extraction model is obtained.

[0123] The training method for a power grid time-series data feature extraction model provided in this invention involves acquiring original power grid time-series data and performing mask enhancement processing on the original power grid time-series data to obtain first enhanced time-series data; performing numerical transformation operations on the original power grid time-series data to obtain second enhanced time-series data; performing comparative learning training on an initial model based on the first and second enhanced time-series data to obtain a comparative loss; performing mask prediction on the first enhanced time-series data using the initial model to obtain a reconstruction loss; and optimizing the training parameters of the initial model based on the comparative loss and the reconstruction loss to obtain a power grid time-series data feature extraction model. This method utilizes both comparative learning and mask prediction to simultaneously perform self-supervised pre-training on time-series data, taking into account both discriminative features and contextual information modeling, thereby improving the generalization ability of the pre-trained time-series feature extraction network. Through a self-supervised learning paradigm of joint modeling, the pre-trained feature extraction network can be used for fine-tuning of various downstream time-series tasks, greatly improving the training speed and prediction accuracy of various downstream tasks.

[0124] Figure 6 A schematic diagram of the structure of a training device for a power grid time-series data feature extraction model provided in an embodiment of the present invention, specifically including:

[0125] The data processing module 601 is used to acquire raw power grid time-series data and perform masking enhancement processing on the raw power grid time-series data to obtain first enhanced time-series data. For detailed explanations, please refer to the relevant descriptions in the above method embodiments; they will not be repeated here.

[0126] The data processing module 601 is further configured to perform numerical transformation operations on the original power grid time-series data to obtain second enhanced time-series data. For detailed explanations, please refer to the relevant descriptions in the above method embodiments; they will not be repeated here.

[0127] Training module 602 is used to perform comparative learning training on the initial model based on the first and second enhanced time-series data to obtain the comparative loss. For detailed explanations, please refer to the relevant descriptions in the above method embodiments; they will not be repeated here.

[0128] The training module 602 is further configured to perform mask prediction on the first enhanced temporal data using the initial model to obtain the reconstruction loss. For detailed explanations, please refer to the relevant descriptions in the above method embodiments; they will not be repeated here.

[0129] The optimization module 603 is used to optimize the training parameters of the initial model based on the contrast loss and the reconstruction loss to obtain a power grid time series data feature extraction model. For detailed explanations, please refer to the relevant descriptions in the above method embodiments; they will not be repeated here.

[0130] The training device for the power grid time series data feature extraction model provided in this embodiment can be as follows: Figure 6 The training device for the power grid time-series data feature extraction model shown can perform, for example... Figure 1-2 All steps of the training method for the feature extraction model of China Power Grid time series data are described, thereby achieving... Figure 1-2 For details on the technical effectiveness of the training method for the power grid time-series data feature extraction model shown, please refer to [link / reference needed]. Figure 1-2 The relevant descriptions are presented concisely and will not be elaborated upon here.

[0131] This invention also provides a method for extracting features from power grid time series data. By using a trained power grid time series data feature extraction model to extract the features of power grid time series data, the generalization ability of the trained time series feature extraction network can be improved, and the training speed and prediction accuracy of various downstream power grid time series tasks can be greatly improved, including time series prediction, time series classification, anomaly detection, etc.

[0132] Figure 7 A schematic diagram of a power grid time-series data feature extraction device provided in an embodiment of the present invention is shown, specifically including:

[0133] The acquisition module 701 is used to acquire the original power grid time series data of the power grid to be feature extracted;

[0134] The extraction module 702 is used to input the original power grid time series data into the power grid time series data feature extraction model to obtain the power grid time series data features of the power grid.

[0135] The power grid time-series data feature extraction device provided in this embodiment can be as follows: Figure 7 The power grid time series data feature extraction device shown can execute all the steps of the power grid time series data feature extraction method, thereby achieving the technical effect of the power grid time series data feature extraction method. For the sake of simplicity, it will not be elaborated here.

[0136] Figure 8 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Figure 8The computer device 800 shown includes at least one processor 801, a memory 802, at least one network interface 804, and other user interfaces 803. The various components in the computer device 800 are coupled together via a bus system 805. It is understood that the bus system 805 is used to implement communication between these components. In addition to a data bus, the bus system 805 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 8 The general labeled all buses as Bus System 805.

[0137] The user interface 803 may include a display, keyboard, or clicking device (e.g., mouse, trackball, touchpad, or touchscreen).

[0138] It is understood that the memory 802 in the embodiments of the present invention can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 802 described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0139] In some implementations, memory 802 stores elements, executable units or data structures, or subsets thereof, or extended sets thereof: operating system 8021 and application programs 8022.

[0140] The operating system 8021 includes various system programs, such as the framework layer, core library layer, and driver layer, used to implement various basic business functions and handle hardware-based tasks. The application program 8022 includes various applications, such as a media player and a browser, used to implement various application functions. The program implementing the method of this embodiment can be included in the application program 8022.

[0141] In this embodiment of the invention, by calling the program or instructions stored in the memory 802, specifically the program or instructions stored in the application program 8022, the processor 801 executes the method steps provided in each method embodiment, including, for example:

[0142] The process involves acquiring raw power grid time-series data and performing masking enhancement on the raw power grid time-series data to obtain first enhanced time-series data; performing numerical transformation on the raw power grid time-series data to obtain second enhanced time-series data; training an initial model based on the first and second enhanced time-series data through comparative learning to obtain a comparative loss; performing masking prediction on the first enhanced time-series data using the initial model to obtain a reconstruction loss; and optimizing the training parameters of the initial model based on the comparative loss and the reconstruction loss to obtain a power grid time-series data feature extraction model.

[0143] In one possible implementation, a fixed proportion of time step indexes is determined and a starting index position is determined; based on the fixed proportion of time step indexes and the starting index position, a fixed length of time step indexes is extended to obtain multiple time series data segments; the original power grid time series data corresponding to the multiple time series data segments are zeroed to obtain the first enhanced time series data after mask enhancement processing.

[0144] In one possible implementation, the original power grid time series data is scaled; the scaled original power grid time series data is translated; and the translated original power grid time series data is jittered to obtain the second enhanced time series data after numerical transformation.

[0145] In one possible implementation, a first query feature corresponding to the first enhanced time-series data and a second query feature corresponding to the second enhanced time-series data are extracted; a first query mapping feature is extracted based on the first query feature and a second query mapping feature is extracted based on the second query feature; a first query prediction feature is extracted based on the first query mapping feature and a second query prediction feature is extracted based on the second query mapping feature; a first key feature corresponding to the first enhanced time-series data and a second key feature corresponding to the second enhanced time-series data are extracted; a first key mapping feature is extracted based on the first key feature and a second key mapping feature is extracted based on the second key feature.

[0146] In one possible implementation, a first contrast loss is calculated based on the first query prediction feature and the second key mapping feature; a second contrast loss is calculated based on the second query prediction feature and the first key mapping feature.

[0147] In one possible implementation, the coding features of the first enhanced time-series data are extracted; based on the coding features, the first enhanced time-series data is predicted by a reconstruction decoder to obtain predicted data; and the reconstruction loss is determined based on the predicted data and the original data corresponding to the first enhanced time-series data.

[0148] In one possible implementation, the training parameters of the initial model are optimized using a first formula, which is: L = L con +αL rec Among them, L con To compare the losses, L rec To reconstruct the loss, α is the weight that balances the two losses.

[0149] The methods disclosed in the above embodiments of the present invention can be applied to or implemented by processor 801. Processor 801 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 801 or by instructions in the form of software. The processor 801 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of the present invention can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software units in the decoding processor. The software units may be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 802. Processor 801 reads the information in memory 802 and, in conjunction with its hardware, completes the steps of the above method.

[0150] It is understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described herein, or combinations thereof.

[0151] For software implementation, the techniques described herein can be implemented by units that perform the functions described herein. The software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.

[0152] The computer device provided in this embodiment may be as follows: Figure 8 The computer device shown can perform, for example Figure 1-2 All steps of the training method for the feature extraction model of China Power Grid time series data are described, thereby achieving... Figure 1-2 For details on the technical effectiveness of the training method for the power grid time-series data feature extraction model shown, please refer to [link / reference needed]. Figure 1-2 The relevant descriptions are presented concisely and will not be elaborated upon here.

[0153] This invention also provides a storage medium (computer-readable storage medium). This storage medium stores one or more programs. The storage medium may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, hard disk, or solid-state drive; the memory may also include combinations of the above types of memory.

[0154] When one or more programs in the storage medium can be executed by one or more processors, the training method of the power grid time series data feature extraction model executed on the computer device side can be implemented.

[0155] The processor is used to execute a training program for a power grid time-series data feature extraction model stored in memory, to implement the following steps of a training method for a power grid time-series data feature extraction model executed on the computer device side:

[0156] The process involves acquiring raw power grid time-series data and performing masking enhancement on the raw power grid time-series data to obtain first enhanced time-series data; performing numerical transformation on the raw power grid time-series data to obtain second enhanced time-series data; training an initial model based on the first and second enhanced time-series data through comparative learning to obtain a comparative loss; performing masking prediction on the first enhanced time-series data using the initial model to obtain a reconstruction loss; and optimizing the training parameters of the initial model based on the comparative loss and the reconstruction loss to obtain a power grid time-series data feature extraction model.

[0157] In one possible implementation, a fixed proportion of time step indexes is determined and a starting index position is determined; based on the fixed proportion of time step indexes and the starting index position, a fixed length of time step indexes is extended to obtain multiple time series data segments; the original power grid time series data corresponding to the multiple time series data segments are zeroed to obtain the first enhanced time series data after mask enhancement processing.

[0158] In one possible implementation, the original power grid time series data is scaled; the scaled original power grid time series data is translated; and the translated original power grid time series data is jittered to obtain the second enhanced time series data after numerical transformation.

[0159] In one possible implementation, a first query feature corresponding to the first enhanced time-series data and a second query feature corresponding to the second enhanced time-series data are extracted; a first query mapping feature is extracted based on the first query feature and a second query mapping feature is extracted based on the second query feature; a first query prediction feature is extracted based on the first query mapping feature and a second query prediction feature is extracted based on the second query mapping feature; a first key feature corresponding to the first enhanced time-series data and a second key feature corresponding to the second enhanced time-series data are extracted; a first key mapping feature is extracted based on the first key feature and a second key mapping feature is extracted based on the second key feature.

[0160] In one possible implementation, a first contrast loss is calculated based on the first query prediction feature and the second key mapping feature; a second contrast loss is calculated based on the second query prediction feature and the first key mapping feature.

[0161] In one possible implementation, the coding features of the first enhanced time-series data are extracted; based on the coding features, the first enhanced time-series data is predicted by a reconstruction decoder to obtain predicted data; and the reconstruction loss is determined based on the predicted data and the original data corresponding to the first enhanced time-series data.

[0162] In one possible implementation, the training parameters of the initial model are optimized using a first formula, which is: L = L con +αL rec Among them, L con To compare the losses, L rec To reconstruct the loss, α is the weight that balances the two losses.

[0163] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0164] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented in hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0165] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A training method for a power grid time-series data feature extraction model, characterized in that, include: The original power grid time series data is acquired, and the original power grid time series data is subjected to mask enhancement processing to obtain the first enhanced time series data; The original power grid time series data is subjected to numerical transformation to obtain the second enhanced time series data; The initial model is trained by contrastive learning based on the first and second enhanced time series data to obtain the contrastive loss. The reconstruction loss is obtained by performing mask prediction on the first enhanced temporal data using the initial model; The training parameters of the initial model are optimized based on the contrast loss and the reconstruction loss to obtain a power grid time series data feature extraction model. The step of performing comparative learning training on the initial model based on the first and second enhanced time-series data to obtain the comparative loss includes: Extract the first query feature corresponding to the first enhanced time series data, and extract the second query feature corresponding to the second enhanced time series data; First query mapping features are extracted based on the first query features, and second query mapping features are extracted based on the second query features; A first query prediction feature is extracted based on the first query mapping feature, and a second query prediction feature is extracted based on the second query mapping feature; Extract the first key feature corresponding to the first enhanced time series data, and extract the second key feature corresponding to the second enhanced time series data; A first key mapping feature is extracted based on the first key feature, and a second key mapping feature is extracted based on the second key feature; Calculate the first contrastive loss based on the first query prediction features and the second key mapping features; Calculate the second contrastive loss based on the second query prediction features and the first key mapping features; The first contrast loss and the second contrast loss are calculated using the following formulas: Among them, z i To query predictive features, As the key mapping feature, z j K represents other data in the same batch of training data, where K is the number of data in the same batch of training data.

2. The method according to claim 1, characterized in that, The process of acquiring raw power grid time-series data and performing masking enhancement processing on the raw power grid time-series data to obtain first enhanced time-series data includes: Determine a fixed proportion of time step indices and determine the starting index position; Based on a fixed proportion of time step index and the starting index position, the time step index of fixed length is expanded to obtain multiple time series data segments. The original power grid time series data corresponding to the multiple time series data segments are zeroed to obtain the first enhanced time series data after mask enhancement processing.

3. The method according to claim 1, characterized in that, The step of performing a numerical transformation operation on the original power grid time series data to obtain the second enhanced time series data includes: The original power grid time-series data is scaled. The original power grid time series data after scaling is shifted. The original power grid time series data after translation processing is jittered to obtain the second enhanced time series data after numerical transformation.

4. The method according to claim 1 or 2, characterized in that, The step of performing mask prediction on the first enhanced temporal data using an initial model to obtain the reconstruction loss includes: Extract the coding features of the first enhanced time-series data; Based on the encoded features, the first enhanced temporal data is predicted by the reconstruction decoder to obtain predicted data; The reconstruction loss is determined based on the original data corresponding to the predicted data and the first enhanced time-series data.

5. The method according to claim 1, characterized in that, The optimization of the training parameters of the initial model based on the contrast loss and the reconstruction loss to obtain the power grid time series data feature extraction model includes: The training parameters of the initial model are optimized using a first formula, which is: L = L con +αL rec ; Among them, L con To compare the losses, L rec To reconstruct the loss, α is the weight that balances the two losses.

6. A method for feature extraction from power grid time-series data, characterized in that, include: Obtain the original time-series data of the power grid for which feature extraction is to be performed; The original power grid time series data is input into the power grid time series data feature extraction model to obtain the power grid time series data features of the power grid; The power grid time-series data feature extraction model is trained using the method described in any one of claims 1-5.

7. A training device for a power grid time-series data feature extraction model, characterized in that, include: The data processing module is used to acquire raw power grid time series data and perform mask enhancement processing on the raw power grid time series data to obtain first enhanced time series data. The data processing module is also used to perform numerical transformation operations on the original power grid time series data to obtain the second enhanced time series data; The training module is used to perform comparative learning training on the initial model based on the first and second augmented time series data to obtain the comparative loss; The training module is also used to perform mask prediction on the first enhanced temporal data using the initial model to obtain the reconstruction loss; An optimization module is used to optimize the training parameters of the initial model based on the contrast loss and the reconstruction loss to obtain a power grid time series data feature extraction model. Specifically, the training module is used for: Extract the first query feature corresponding to the first enhanced time series data, and extract the second query feature corresponding to the second enhanced time series data; First query mapping features are extracted based on the first query features, and second query mapping features are extracted based on the second query features; A first query prediction feature is extracted based on the first query mapping feature, and a second query prediction feature is extracted based on the second query mapping feature; Extract the first key feature corresponding to the first enhanced time series data, and extract the second key feature corresponding to the second enhanced time series data; A first key mapping feature is extracted based on the first key feature, and a second key mapping feature is extracted based on the second key feature; Calculate the first contrastive loss based on the first query prediction features and the second key mapping features; Calculate the second contrastive loss based on the second query prediction features and the first key mapping features; The first contrast loss and the second contrast loss are calculated using the following formulas: Among them, z i To query predictive features, As the key mapping feature, z j K represents other data in the same batch of training data, where K is the number of data in the same batch of training data.

8. A device for extracting features from power grid time-series data, characterized in that, include: The acquisition module is used to acquire the original time-series data of the power grid to be feature extracted; The extraction module is used to input the original power grid time series data into the power grid time series data feature extraction model to obtain the power grid time series data features of the power grid; The power grid time-series data feature extraction model is trained using the method described in any one of claims 1-5.

9. A computer device, characterized in that, include: A processor and a memory, the processor being configured to execute a training program for a power grid time-series data feature extraction model stored in the memory, to implement the training method for the power grid time-series data feature extraction model according to any one of claims 1 to 5 and the power grid time-series data feature extraction method according to claim 6.

10. A storage medium, characterized in that, The storage medium stores one or more programs, which can be executed by one or more processors to implement the training method for the power grid time series data feature extraction model according to any one of claims 1 to 5 and the power grid time series data feature extraction method according to claim 6.

Citation Information

Patent Citations

  • Robot obstacle avoidance trajectory planning method based on imitation learning and robot

    CN111702754A

  • Instance segmentation model training method, device and system and storage medium

    CN113673505A