Power system time sequence data generation method and system

Through the power system timing data generation method based on the Transformer model, the problem that the prior art is difficult to capture multi-scale dependency features is solved, and the timing data generation with high reliability and high accuracy is achieved, which meets the complex data needs of the power system.

CN119740028AActive Publication Date: 2025-04-01STATE GRID HUNAN ELECTRIC POWER COMPANY LIMITED +2
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411794032.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-09
Publication Date
2025-04-01
Estimated Expiration
2044-12-09

AI Technical Summary

Technical Problem

The prior art is difficult to fully capture complex multi-scale dependency features, resulting in low accuracy and reliability of the timing data of the power system and cannot meet the timing data generation requirements of today's power systems.

Method used

The time sequence data generation method of the power system based on the Transformer model is adopted. By obtaining historical time sequence data, preprocessing data, building a Transformer model, training a model and generating primary time sequence data, the timing data that conforms to statistical characteristics and physical laws is finally obtained through filtering and correction.

Benefits of technology

It realizes high reliability and high accuracy generation of time sequence data of the power system, which can better meet the data needs of the safe and stable operation of the power system and the development plan.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119740028A_ABST
    Figure CN119740028A_ABST
Patent Text Reader

Abstract

The invention discloses a power system time sequence data generation method. The method comprises the steps of obtaining historical time sequence data information of a power system and preprocessing the historical time sequence data information to obtain a training data set; constructing a power system time sequence data generation primary model based on a Transform model, and training to obtain a power system time sequence data generation model; and generating primary power system time sequence data by adopting the power system time sequence data generation model, filtering, outputting the power system time sequence data conforming to the statistical characteristics and the physical rules, and completing the generation of the time sequence data of the target power system. The invention also discloses a system for realizing the time sequence data generation method of the power system. According to the method, the historical time series data is acquired, analyzed and processed, the data generation model constructed based on the Transform model is trained, and the finally generated data is corrected, so that the time series data of the power system is generated, the reliability is higher, and the accuracy is better.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of electrical automation, and in particular relates to a method and system for generating time series data of an electric power system. Background Art

[0002] With the development of economy and technology and the improvement of people's living standards, electricity has become an indispensable secondary energy source in people's production and life, bringing endless convenience to people's production and life. Therefore, ensuring the stable and reliable supply of electricity has become one of the most important tasks of the power system.

[0003] At present, the scale of power systems is getting larger and larger, and the generation of power system time series data is becoming more and more important to the power system. Reliable and accurate generation of power system time series data can provide data guarantee for the safe and stable operation of the power system and the formulation of development plans.

[0004] At present, traditional solutions for generating time series data of power systems generally adopt solutions based on linear models or simple nonlinear models. Although such solutions are simple and feasible, they are difficult to fully capture complex multi-scale dependency features, resulting in low accuracy and reliability of the generated data. Existing solutions of this type can no longer meet the requirements for generating time series data of today's power systems. Summary of the invention

[0005] One of the purposes of the present invention is to provide a method for generating time series data of an electric power system with high reliability and good accuracy.

[0006] A second objective of the present invention is to provide a system for implementing the method for generating time series data of a power system.

[0007] The method for generating time series data of a power system provided by the present invention comprises the following steps:

[0008] S1. Obtain historical time series data information of the power system;

[0009] S2. Preprocess the data information obtained in step S1 to obtain a training data set;

[0010] S3. Based on the Transformer model, a primary model for generating time series data of the power system is constructed;

[0011] S4. Using the training data set obtained in step S2, the primary model for generating power system time series data constructed in step S3 is trained to obtain a power system time series data generation model;

[0012] S5. Using the power system time series data generation model obtained in step S4 to generate primary power system time series data;

[0013] S6. Filter the data generated in step S5, output the time series data of the power system that conforms to the statistical characteristics and physical laws, and complete the generation of the time series data of the target power system.

[0014] The preprocessing described in step S2 specifically includes the following steps:

[0015] The historical time series data obtained in step S1 is expressed as where y t represents the output data of the power system sampled at the tth time step; T represents the total number of time steps;

[0016] For missing data, the following formula is used for interpolation:

[0017] f(x)=a i +b i (xx i )+c i (xx i ) 2 +d i (xx i ) 3

[0018] Where f(x) is the interpolated data; x i is the horizontal coordinate value of the known data point; x is the horizontal coordinate value of the interpolated data; a i is the first interpolation coefficient; b i is the second interpolation coefficient; c i is the third interpolation coefficient; d i is the fourth interpolation coefficient;

[0019] Perform outlier data detection: If the data y t satisfy Then determine the data y t is abnormal data; among them, is the mean of the time series data, α is the set threshold and its value is k times the standard deviation σ of the time series data, and k is the set coefficient;

[0020] Correction of abnormal point data: for abnormal point data y t , use the following formula to correct it:

[0021]

[0022] In the formula is the corrected data; t-1 is the data value of the previous data of the abnormal point data; y t+1 The data value of the data following the abnormal point data;

[0023] Through the above preprocessing, we finally get the preprocessed time series data

[0024] The step S3 described in the example of constructing a primary model for generating power system time series data based on the Transformer model specifically includes the following steps:

[0025] The constructed power system time series data generates a primary model, and the processing process includes the following steps:

[0026] Based on the Transformer model, build the Transformer basic network;

[0027] The time series data obtained in step S2 Input into the Transformer basic network to obtain a multi-scale feature vector

[0028] The obtained multi-scale feature vector Perform frequency decomposition to obtain the subsequence after frequency decomposition in, is the data component of the tth time step at frequency k;

[0029] Subsequence after frequency decomposition Input into the Transformer basic network to obtain the generated time series data prediction value under frequency band k

[0030] According to the predicted values ​​of the time series data in each frequency band, the generated time series data is obtained for Wherein, K is the total number of frequency bands.

[0031] The Transformer model is based on the Transformer basic network, which specifically includes the following steps:

[0032] The input data of the Transformer basic network is represented as yy t is the input data of the tth time step, and T is the total number of time steps;

[0033] Processing of the Embedding Layer: Input Data After processing by the embedding layer, the input feature sequence is obtained xx t is the feature vector of the tth time step in the feature space;

[0034] Processing of self-attention mechanism: In the self-attention mechanism, the query matrix Q, key matrix K and value matrix V of the input feature sequence are expressed as

[0035] Q=W q XX

[0036] K=W k XX

[0037] V=W v XX

[0038] Where W q is the weight matrix of the query matrix; W k is the key matrix weight matrix; W v is the weight matrix of the value matrix; XX is the input feature matrix, and XX={xx1,xx2,...,xx T};

[0039] In the process of self-attention mechanism processing, the sparse representation of the attention weight matrix A is set:

[0040] When j∈S(i), when When A ij =0; where A ij is the attention score between the i-th query and the j-th key; Q i is the query matrix; S(i) is the i The key dependency point set of K j or K j' is the key matrix; j' is the index variable of the candidate key; d is the scaling factor of the feature dimension;

[0041] In the process of self-attention mechanism processing, the following steps are used to dynamically adjust the attention window: by calculating the similarity score between the query and all keys, the keys that exceed the set threshold are selected as the range of attention calculation. Specifically, the model first calculates the relevance score between the query and each key through dot product or other similarity measurement methods, and sets a fixed threshold. When the relevance score of a key is greater than the threshold, it is included in the window range for subsequent attention weight calculation. This scheme can dynamically adjust the window according to the actual content of the input data, ensuring that the range of attention is accurate and has high computational efficiency;

[0042] Output of the self-attention mechanism: The output feature matrix O of the self-attention mechanism is O=AV;

[0043] Processing of the fully connected layer: The output feature matrix O output by the self-attention mechanism is mapped back to the time series output space through the fully connected layer to obtain the output of the Transformer basic network.

[0044] The multi-scale feature vector obtained by Perform frequency decomposition to obtain the subsequence after frequency decomposition The specific steps include:

[0045] The obtained multi-scale feature vector The frequency decomposition is performed using the following formula:

[0046]

[0047] In the formula is the data component of the tth time step at frequency k; ψ k is the selected basis function; N is the number of basis functions.

[0048] The training described in step S4 specifically includes the following steps:

[0049] The following formula is used as the loss function of the kth frequency band:

[0050]

[0051] Where L (k) is the loss function value of the kth frequency band; is the predicted value of the time series data under the generated frequency band k; is the actual time series data value under frequency band k;

[0052] The following formula is used as the total loss function:

[0053]

[0054] Where L is the total loss function value;

[0055] During training, the model is trained by minimizing the total loss function.

[0056] Step S6 of filtering the data generated in step S5 and outputting the power system time series data that conforms to the statistical characteristics and physical laws specifically includes the following steps:

[0057] The overall distribution difference between the generated data and the real data is calculated using the following formula:

[0058]

[0059] Where ES is the energy fraction; is the predicted value at another time step t';

[0060] The consistency between the generated data and the real data is calculated using the following formula:

[0061]

[0062] Where CRPS is the continuous ranking probability score; is the cumulative distribution function of the generated data; I(z≥y t ) is the indicator function, which represents the real data distribution; z is the distribution evaluation variable;

[0063] The load balancing error of the generated data is calculated using the following formula:

[0064]

[0065] Where ε t is the load balance error; D t is the load demand at time t; L t is the system loss;

[0066] The fluctuation range of the generated data is calculated using the following formula:

[0067]

[0068] In the formula is the fluctuation range of the generated data;

[0069] Using Fourier transform, the main periodic component P of the generated data is extracted k ;

[0070] According to the generated data, the physical laws are corrected: if ε t If it is greater than the set threshold, the generated data will be corrected until ε t is less than the set threshold to ensure that the generated data meets the load balance; if If the value is greater than the set threshold, the generated data will be corrected until is less than the set threshold to ensure that the generated data fluctuation is within the set range; if P k If the set threshold is exceeded, the main periodic component of the generated data is adjusted to ensure that the fluctuation amplitude and periodic characteristics of the generated data meet the set requirements;

[0071] Finally, the power system time series data that conforms to statistical characteristics and physical laws is output.

[0072] The present invention also provides a system for realizing the method for generating time series data of the power system, comprising a data acquisition module, a data processing module, a model construction module, a model training module, a preliminary generation module and a data generation module; the data acquisition module, the data processing module, the model construction module, the model training module, the preliminary generation module and the data generation module are connected in series in sequence; the data acquisition module is used to acquire the historical time series data information of the power system, and upload the data information to the data processing module; the data processing module is used to pre-process the acquired data information according to the received data information, obtain the training data set, and upload the data information to the model construction module; the model construction module is used to construct, based on the Transformer model, the received data information The primary model of the power system time series data generation is generated, and the data information is uploaded to the model training module; the model training module is used to train the primary model of the power system time series data generation constructed in step S3 according to the received data information and the obtained training data set, obtain the power system time series data generation model, and upload the data information to the preliminary generation module; the preliminary generation module is used to generate primary power system time series data according to the received data information and the obtained power system time series data generation model, and upload the data information to the data generation module; the data generation module is used to filter the generated data according to the received data information, output the power system time series data that conforms to the statistical characteristics and physical laws, and complete the generation of the time series data of the target power system.

[0073] The method and system for generating time series data for a power system provided by the present invention, through the acquisition, analysis and processing of historical time series data, the training of a data generation model constructed based on a Transformer model, and the correction of the final generated data, not only realizes the generation of time series data for a power system, but also has higher reliability and better accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0074] Figure 1 The figure is a schematic diagram of the method flow of the present invention.

[0075] Figure 2 Schematic diagram of the functional modules of the system of the present invention. DETAILED DESCRIPTION

[0076] like Figure 1 The method flow chart of the method of the present invention is shown as follows: The method for generating time series data of a power system provided by the present invention comprises the following steps:

[0077] S1. Obtain historical time series data information of the power system;

[0078] S2. Preprocess the data information obtained in step S1 to obtain a training data set; specifically, the steps include:

[0079] The historical time series data obtained in step S1 is expressed as where y t represents the output data of the power system sampled at the tth time step; T represents the total number of time steps;

[0080] For missing data, the following formula is used for interpolation:

[0081] f(x)=a i +b i (xx i )+c i (xx i ) 2 +d i (xx i ) 3

[0082] Where f(x) is the interpolated data; x i is the horizontal coordinate value of the known data point; x is the horizontal coordinate value of the interpolated data; a i is the first interpolation coefficient; b i is the second interpolation coefficient; c i is the third interpolation coefficient; d i is the fourth interpolation coefficient; the first to fourth interpolation coefficients are calculated through known adjacent data points and smoothness conditions to ensure smooth connection between interpolation segments, so that the time series data maintains continuity and consistency locally;

[0083] Perform outlier data detection: If the data y t satisfy Then determine the data y t is abnormal data; among them, is the mean of the time series data, α is the set threshold and its value is k times the standard deviation σ of the time series data, and k is the set coefficient;

[0084] Correction of abnormal point data: for abnormal point data y t , use the following formula to correct it:

[0085]

[0086] In the formula is the corrected data; t-1 is the data value of the previous data of the abnormal point data; y t+1 is the data value of the data after the abnormal point data; through this correction scheme, the reasonable volatility of the data is maintained, and the interference of abnormal data on the overall trend is avoided, thereby improving the accuracy and consistency of the data;

[0087] Through the above preprocessing, we finally get the preprocessed time series data

[0088] S3. Based on the Transformer model, a primary model for generating power system time series data is constructed; specifically, the following steps are included:

[0089] The constructed power system time series data generates a primary model, and the processing process includes the following steps:

[0090] Based on the Transformer model, build the Transformer basic network; specifically include the following steps:

[0091] The input data of the Transformer basic network is represented as yy t is the input data of the tth time step, and T is the total number of time steps;

[0092] Processing of the Embedding Layer: Input Data After processing by the embedding layer, the input feature sequence is obtained xx t is the feature vector of the tth time step in the feature space;

[0093] Processing of self-attention mechanism: In the self-attention mechanism, the query matrix Q, key matrix K and value matrix V of the input feature sequence are expressed as

[0094] Q=W q XX

[0095] K=W k XX

[0096] V=W v XX

[0097] Where W q is the weight matrix of the query matrix; W k is the key matrix weight matrix; W v is the weight matrix of the value matrix; XX is the input feature matrix, and XX={xx1,xx2,...,xx T}; W q , W k and W v A feature space for mapping input features to queries, keys, and values;

[0098] In the process of self-attention mechanism, in order to avoid wasting computing resources in the case of long-term dependence, only the key time steps that have a greater impact on the output are focused on; therefore, the sparse representation of the attention weight matrix A is set:

[0099] When j∈S(i), when When A ij =0; where A ij is the attention score between the i-th query and the j-th key; Q i is the query matrix; S(i) is the i The key dependency point set of K j or K j' is the key matrix; j' is the index variable of the candidate key; d is the scaling factor of the feature dimension; the above sparse scheme automatically screens important time steps and only retains the positions that have a greater impact on the current time step, thereby achieving effective modeling of long-term dependencies;

[0100] In the process of self-attention mechanism processing, the following steps are adopted to dynamically adjust the attention window: by calculating the similarity score between the query and all keys, the keys exceeding the set threshold are selected as the range of attention calculation; specifically, the model first calculates the relevance score between the query and each key through dot product or other similarity measurement methods, and sets a fixed threshold. When the relevance score of a key is greater than the threshold, it is included in the window range for subsequent attention weight calculation; this scheme can dynamically adjust the window according to the actual content of the input data to ensure that the range of attention is accurate and has high computational efficiency; this scheme of dynamically adjusting the attention window makes the attention window more focused on the local time step when the short-term changes are drastic; and when the long-term changes are stable, the window range is automatically expanded to cover longer time dependencies, ensuring that the model can flexibly switch between short-term fluctuations and long-term trends;

[0101] Output of the self-attention mechanism: The output feature matrix O of the self-attention mechanism is O=AV;

[0102] Processing of the fully connected layer: The output feature matrix O output by the self-attention mechanism is mapped back to the time series output space through the fully connected layer to obtain the output of the Transformer basic network;

[0103] Through the sparse attention mechanism and dynamic window adjustment strategy, the constructed Transformer basic network can not only effectively capture the multi-scale characteristics of power system data, but also significantly improve the computational efficiency in the modeling of long-term dependencies;

[0104] The time series data obtained in step S2 Input into the Transformer basic network to obtain a multi-scale feature vector

[0105] The obtained multi-scale feature vector Perform frequency decomposition to obtain the subsequence after frequency decomposition in, is the data component of the tth time step under frequency k; through frequency decomposition, multiple subsequences with different frequencies are obtained to model the short-term fluctuation and long-term trend characteristics of power system time series data respectively; specifically, the following steps are included:

[0106] The obtained multi-scale feature vector The frequency decomposition is performed using the following formula:

[0107]

[0108] In the formula is the data component of the tth time step at frequency k; ψ k is the selected basis function; N is the number of odd functions;

[0109] Subsequence after frequency decomposition Input into the Transformer basic network to obtain the generated time series data prediction value under frequency band k To learn the time-dependent features at each scale, the feature vectors of each frequency band pass through the model in turn to gradually improve the modeling accuracy of short-term fluctuations and long-term trends;

[0110] According to the predicted values ​​of the time series data in each frequency band, the generated time series data is obtained for Among them, K is the total number of frequency bands; by integrating the features of different frequency bands, the data finally generated contains both global trends and short-term fluctuation information, realizing the unified expression of multi-scale information;

[0111] S4. Using the training data set obtained in step S2, the primary model for generating power system time series data constructed in step S3 is trained to obtain a power system time series data generation model;

[0112] In specific implementation, the training process includes the following steps:

[0113] The following formula is used as the loss function of the kth frequency band:

[0114]

[0115] Where L (k) is the loss function value of the kth frequency band; is the predicted value of the time series data under the generated frequency band k; is the actual time series data value under frequency band k;

[0116] The following formula is used as the total loss function:

[0117]

[0118] Where L is the total loss function value;

[0119] During training, the model is trained by minimizing the total loss function;

[0120] S5. Using the power system time series data generation model obtained in step S4 to generate primary power system time series data;

[0121] S6. Filter the data generated in step S5, output the power system time series data that conforms to the statistical characteristics and physical laws, and complete the generation of the target power system time series data; specifically, the following steps are included:

[0122] The overall distribution difference between the generated data and the real data is calculated using the following formula:

[0123]

[0124] Where ES is the energy fraction; is the predicted value at another time step t';

[0125] The consistency between the generated data and the real data is calculated using the following formula:

[0126]

[0127] Where CRPS is the continuous ranking probability score; is the cumulative distribution function of the generated data; I(z≥y t ) is the indicator function, which represents the real data distribution; z is the distribution evaluation variable;

[0128] After completing the statistical characteristics evaluation, the physical mechanism of the power system is embedded to verify the physical consistency of the generated data to ensure that the data meets the core constraints of power system analysis;

[0129] The load balancing error of the generated data is calculated using the following formula:

[0130]

[0131] Where ε t is the load balance error; D t is the load demand at time t; L t is the system loss;

[0132] The fluctuation range of the generated data is calculated using the following formula:

[0133]

[0134] In the formula is the fluctuation range of the generated data;

[0135] Using Fourier transform, the main periodic component P of the generated data is extracted k ;

[0136] According to the generated data, the physical laws are corrected: if ε t If it is greater than the set threshold, the generated data will be corrected until ε t is less than the set threshold to ensure that the generated data meets the load balance; if If the value is greater than the set threshold, the generated data will be corrected until is less than the set threshold to ensure that the generated data fluctuation is within the set range; if P k If the set threshold is exceeded, the main periodic component of the generated data is adjusted to ensure that the fluctuation amplitude and periodic characteristics of the generated data meet the set requirements, including the target range and physical laws.

[0137] Finally, the power system time series data that conforms to statistical characteristics and physical laws is output.

[0138] like Figure 2 The functional module schematic diagram of the system of the present invention is shown as follows: the system disclosed in the present invention for realizing the method for generating time series data of the power system comprises a data acquisition module, a data processing module, a model construction module, a model training module, a preliminary generation module and a data generation module; the data acquisition module, the data processing module, the model construction module, the model training module, the preliminary generation module and the data generation module are connected in series in sequence; the data acquisition module is used to acquire the historical time series data information of the power system and upload the data information to the data processing module; the data processing module is used to pre-process the acquired data information according to the received data information to obtain a training data set and upload the data information to the model construction module; the model construction module is used to, based on the received data information, mer model, construct a primary model for power system time series data generation, and upload the data information to the model training module; the model training module is used to train the primary model for power system time series data generation constructed in step S3 according to the received data information and the obtained training data set, obtain the power system time series data generation model, and upload the data information to the preliminary generation module; the preliminary generation module is used to generate primary power system time series data according to the received data information and the obtained power system time series data generation model, and upload the data information to the data generation module; the data generation module is used to filter the generated data according to the received data information, output the power system time series data that conforms to the statistical characteristics and physical laws, and complete the generation of the target power system time series data.

Claims

1. A method for generating time series data of a power system, comprising the following steps: S1. Obtain historical time series data information of the power system; S2. Preprocess the data information obtained in step S1 to obtain a training data set; S3. Based on the Transformer model, a primary model for generating time series data of the power system is constructed; S4. Using the training data set obtained in step S2, the primary model for generating power system time series data constructed in step S3 is trained to obtain a power system time series data generation model; S5. Using the power system time series data generation model obtained in step S4 to generate primary power system time series data; S6. Filter the data generated in step S5, output the time series data of the power system that conforms to the statistical characteristics and physical laws, and complete the generation of the time series data of the target power system.

2. The method for generating time series data of a power system according to claim 1, characterized in that The preprocessing described in step S2 specifically includes the following steps: The historical time series data obtained in step S1 is expressed as where y t represents the output data of the power system sampled at the tth time step; T represents the total number of time steps; For missing data, the following formula is used for interpolation: f(x)=a i +b i (x-x i )+c i (x-x i ) 2 +d i (x-x i ) 3 Where f(x) is the interpolated data; x i is the horizontal coordinate value of the known data point; x is the horizontal coordinate value of the interpolated data; a i is the first interpolation coefficient; b i is the second interpolation coefficient; c i is the third interpolation coefficient; d i is the fourth interpolation coefficient; Perform outlier data detection: If the data y t satisfy Then determine the data y t is abnormal data; among them, is the mean of the time series data, α is the set threshold and its value is k times the standard deviation σ of the time series data, and k is the set coefficient; Correction of abnormal point data: for abnormal point data y t , use the following formula to correct it: In the formula is the corrected data; t-1 is the data value of the previous data of the abnormal point data; y t+1 The data value of the data following the abnormal point data; Through the above preprocessing, we finally get the preprocessed time series data 3. The method for generating time series data of a power system according to claim 2, characterized in that The step S3 described in the example of constructing a primary model for generating power system time series data based on the Transformer model specifically includes the following steps: The constructed power system time series data generates a primary model, and the processing process includes the following steps: Based on the Transformer model, build the Transformer basic network; The time series data obtained in step S2 Input into the Transformer basic network to obtain a multi-scale feature vector The obtained multi-scale feature vector Perform frequency decomposition to obtain the subsequence after frequency decomposition in, is the data component of the tth time step at frequency k; Subsequence after frequency decomposition Input into the Transformer basic network to obtain the generated time series data prediction value under frequency band k According to the predicted values ​​of the time series data in each frequency band, the generated time series data is obtained for Wherein, K is the total number of frequency bands.

4. The method for generating time series data of a power system according to claim 3, characterized in that The Transformer model is based on the Transformer basic network, which specifically includes the following steps: The input data of the Transformer basic network is represented as yy t is the input data of the tth time step, and T is the total number of time steps; Processing of the Embedding Layer: Input Data After processing by the embedding layer, the input feature sequence is obtained xx t is the feature vector of the tth time step in the feature space; Processing of self-attention mechanism: In the self-attention mechanism, the query matrix Q, key matrix K and value matrix V of the input feature sequence are expressed as Q=W q XX K=W k XX V=W v XX Where W q is the weight matrix of the query matrix; W k is the key matrix weight matrix; W v is the weight matrix of the value matrix; XX is the input feature matrix, and XX={xx1,xx2,...,xx T }; In the process of self-attention mechanism processing, the sparse representation of the attention weight matrix A is set: When j∈S(i), when When A ij =0; where A ij is the attention score between the i-th query and the j-th key; Q i is the query matrix; S(i) is the i The key dependency point set of K j or K j' is the key matrix; j' is the index variable of the candidate key; d is the scaling factor of the feature dimension; In the process of self-attention mechanism processing, the following steps are used to dynamically adjust the attention window: calculate the similarity score between the query and all keys, and filter out the keys whose similarity scores exceed the set threshold as the scope of attention calculation; Output of the self-attention mechanism: The output feature matrix O of the self-attention mechanism is O=AV; Processing of the fully connected layer: The output feature matrix O output by the self-attention mechanism is mapped back to the time series output space through the fully connected layer to obtain the output of the Transformer basic network.

5. The method for generating time series data of a power system according to claim 4, characterized in that The multi-scale feature vector obtained by Perform frequency decomposition to obtain the subsequence after frequency decomposition The specific steps include: The obtained multi-scale feature vector The frequency decomposition is performed using the following formula: In the formula is the data component of the tth time step at frequency k; ψ k is the selected basis function; N is the number of basis functions.

6. The method for generating time series data of a power system according to claim 5, characterized in that The training described in step S4 specifically includes the following steps: The following formula is used as the loss function of the kth frequency band: Where L (k) is the loss function value of the kth frequency band; is the predicted value of the time series data under the generated frequency band k; is the actual time series data value under frequency band k; The following formula is used as the total loss function: Where L is the total loss function value; During training, the model is trained by minimizing the total loss function.

7. The method for generating time series data of a power system according to claim 6, characterized in that Step S6 of filtering the data generated in step S5 and outputting the power system time series data that conforms to the statistical characteristics and physical laws specifically includes the following steps: The overall distribution difference between the generated data and the real data is calculated using the following formula: Where ES is the energy fraction; is the predicted value at another time step t'; The consistency between the generated data and the real data is calculated using the following formula: Where CRPS is the continuous ranking probability score; is the cumulative distribution function of the generated data; I(z≥y t ) is the indicator function, which represents the real data distribution; z is the distribution evaluation variable; The load balancing error of the generated data is calculated using the following formula: Where ε t is the load balance error; D t is the load demand at time t; L t is the system loss; The fluctuation range of the generated data is calculated using the following formula: In the formula is the fluctuation range of the generated data; Using Fourier transform, the main periodic component P of the generated data is extracted k ; According to the generated data, the physical laws are corrected: if ε t If it is greater than the set threshold, the generated data will be corrected until ε t is less than the set threshold to ensure that the generated data meets the load balance; if If the value is greater than the set threshold, the generated data will be corrected until is less than the set threshold to ensure that the generated data fluctuation is within the set range; if P k If the set threshold is exceeded, the main periodic component of the generated data is adjusted to ensure that the fluctuation amplitude and periodic characteristics of the generated data meet the set requirements; Finally, the power system time series data that conforms to statistical characteristics and physical laws is output.

8. A system for implementing the method for generating time series data of a power system according to any one of claims 1 to 7, characterized in that It includes a data acquisition module, a data processing module, a model building module, a model training module, a preliminary generation module and a data generation module; the data acquisition module, the data processing module, the model building module, the model training module, the preliminary generation module and the data generation module are connected in series in sequence; the data acquisition module is used to obtain the historical time series data information of the power system and upload the data information to the data processing module; The data processing module is used to pre-process the acquired data information according to the received data information, obtain the training data set, and upload the data information to the model construction module; The model building module is used to build a primary model for power system time series data generation based on the Transformer model according to the received data information, and upload the data information to the model training module; The model training module is used to train the primary model for generating the power system time series data constructed in step S3 according to the received data information and the obtained training data set, obtain the power system time series data generation model, and upload the data information to the preliminary generation module; The preliminary generation module is used to generate primary power system time series data according to the received data information and adopt the obtained power system time series data generation model, and upload the data information to the data generation module; The data generation module is used to filter the generated data according to the received data information, output the power system time series data that conforms to the statistical characteristics and physical laws, and complete the generation of the target power system time series data.

Citation Information

Patent Citations

  • Water quality early warning method based on Informer model

    CN114385614A

  • Prediction method, system and equipment for mechanical drilling speed time sequence characteristics based on Transform model and medium

    CN116822580A

  • Environment variable prediction method and equipment for multi-temporal-spatial-scale attention mechanism

    CN117332227A

  • Current load decomposition method based on time sequence deep analysis

    CN118094139A

  • Power load prediction method based on multivariable time sequence information interaction

    CN118333232A