Waveform generation model training method and system based on line working condition parameters
Through the self-attention generation adversarial network model training method based on line working conditions parameters, the iterative lag problem of the power system fault location algorithm is solved, efficient generation of high-reality waveform data is achieved, and the generalization ability and development efficiency of the algorithm are improved.
Patent Information
- Application Number
- CN202510414498.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-03
- Publication Date
- 2025-07-18
AI Technical Summary
The existing power system fault location algorithm relies on real waveform data acquisition, resulting in the algorithm iteration lag, high cost and insufficient generalization capabilities. Especially when the online operating conditions parameter changes or new faults occur, a large amount of data needs to be collected repeatedly.
By obtaining the simulated line working conditions parameters and historical line working conditions parameters, converting them into feature vectors, and using self-attention to generate an adversarial network model for training, a two-stage training strategy is adopted, first learning physical laws through the simulation data, and then using real data to correct errors to generate high-reality waveform data.
It solves the problem of insufficient real data samples, avoids the tedious process of repeatedly collecting real data, significantly improves the efficiency of algorithm development, and enhances the generation ability of the model under any working conditions.
Smart Images

Figure CN120338036A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of power system fault diagnosis, and relates to a waveform generation model training method and system based on line condition parameters. Background Art
[0002] In the field of power system fault location, the existing technology mainly relies on the real power frequency / traveling wave waveform data collected by distributed fault location devices, and develops waveform classification models based on machine learning algorithms such as support vector machines (SVM) and long short-term memory networks (LSTM). The training and iteration of such models require a large amount of real recorded wave data support. Especially in scenarios such as different voltage levels and fault types (such as lightning strikes, icing, tree faults), new data needs to be continuously supplemented to maintain the algorithm accuracy.
[0003] The limitations of the existing technology are mainly reflected in the strong dependence on real waveform data and its derived problems: real data can only reflect the occurred fault scenarios. When line condition parameters (such as voltage level, topological structure) change or new types of faults (such as high-impedance grounding) appear, a large amount of data needs to be re-collected to meet the algorithm training requirements, resulting in a long algorithm update cycle and high costs. In addition, the classification model fails due to scarce data for some rare faults. Moreover, the acquisition of real data is limited by physical conditions (such as devices cannot be installed in extreme environments), making it difficult to cover all potential fault scenarios, further restricting the generalization ability of the algorithm. Summary of the Invention
[0004] In view of the deficiencies of the existing technology, the present application provides a waveform generation model training method and system based on line condition parameters, which solves the problem of algorithm iteration lag caused by the traditional fault location algorithm's dependence on real waveform data acquisition.
[0005] To achieve the above object, in the first aspect, the present invention provides a waveform generation model training method based on line condition parameters, including:
[0006] Obtain each preset simulation line condition parameter and the corresponding simulation waveform data, as well as historical line condition parameters and the corresponding historical waveform data;
[0007] Convert each of the simulation line condition parameters into a corresponding simulation feature vector, and convert each of the historical line condition parameters into a corresponding historical feature vector;
[0008] Train a preset original self-attention generative adversarial network model according to the simulation feature vector and the corresponding simulation waveform data to obtain a first self-attention generative adversarial network model; wherein, the generator of the original self-attention generative adversarial network model includes at least one self-attention layer;
[0009] Train the first self-attention generative adversarial network model according to the historical feature vectors and the corresponding historical waveform data to obtain a waveform generation model.
[0010] Compared with the prior art, the embodiments of the present application have the following beneficial effects: By obtaining simulation and real data to cover diverse fault scenarios (such as lightning strikes, icing, tree faults, etc.), the problem of insufficient real data samples is solved; The line condition parameters are uniformly encoded into high-dimensional feature vectors to avoid difficulties in model training caused by inconsistent input forms; A two-stage training strategy is adopted. First, learn physical laws through simulation data, and then use historical real data to correct errors, enabling the model to generate highly realistic waveform data based on any condition parameters, avoiding the cumbersome process of repeatedly collecting a large amount of real data in new fault scenarios, and significantly improving the algorithm development efficiency.
[0011] In some embodiments of the first aspect of the present application, the conversion of each of the simulation line condition parameters into a corresponding simulation feature vector includes:
[0012] Convert each of the simulation line condition parameters into a corresponding simulation feature vector according to a preset multi-layer perceptron neural network model;
[0013] Among them, the multi-layer perceptron neural network model includes a preprocessing layer, a hidden layer, and an output layer; The preprocessing layer is used to process the scalar parameters and matrix parameters in the simulation line condition parameters respectively to obtain scalar features and matrix features, and fuse the scalar features and matrix features to obtain a first feature; The hidden layer is used to perform a high-order non-linear transformation process on the first feature to obtain a second feature, and the output layer is used to perform a linear compression mapping on the second feature to obtain a simulation feature vector.
[0014] Compared with the prior art, the above embodiments have the following beneficial effects: By using a branch network to process scalar parameters (such as voltage levels) and matrix parameters (such as impedance matrices) respectively, the spatial symmetry characteristics of the matrix are retained; Concatenating scalar and matrix features to form a comprehensive representation solves the problem of incomplete condition representation caused by isolated parameter processing in traditional methods; Using the hidden layer for high-order non-linear transformation further accurately extracts the high-order correlation between parameters and waveforms, providing high-quality input for the subsequent generative adversarial network.
[0015] In some embodiments of the first aspect of the present application, the training of the preset original self-attention generative adversarial network model includes:
[0016] Train the original self-attention generative adversarial network model according to a preset adaptive learning rate adjustment algorithm; Among them, the adaptive learning rate adjustment algorithm is:
[0017] Where ηt Denote the current learning rate as η max and η min respectively represent the maximum and minimum values of the learning rate, and T cur Denote the current training epoch as T max Denote the total number of training epochs.
[0018] Compared with the prior art, the above embodiments have the following beneficial effects: By using the adaptive learning rate adjustment algorithm to dynamically adjust the learning rate, a larger learning rate is used at the beginning of training to accelerate convergence, and the learning rate is reduced in the later stage to refine and optimize the parameters, reducing the training time and avoiding local optima; By constraining the maximum / minimum learning rate, gradient explosion and update stagnation are prevented, ensuring the dynamic balance between the generator and the discriminator.
[0019] In some embodiments of the first aspect of the present application, training the preset original self-attention generative adversarial network model further includes:
[0020] Iteratively update the generator parameters and discriminator parameters according to the respective first discrimination results of the discriminator of the original self-attention generative adversarial network model until a preset number of iterations is reached;
[0021] Wherein, the first discrimination result is obtained by the discriminator comparing the first waveform data and the simulation waveform data; the first waveform data is obtained by the generator processing the simulation feature vector.
[0022] Compared with the prior art, the above embodiments have the following beneficial effects: By using the adversarial loss to force the generator to learn the features of the simulation waveform, improving the physical rationality of the waveform; The discriminator identifies defects by comparing the generated / simulated data, driving the generator to iteratively optimize. The two form an adversarial optimization mechanism to prevent the training imbalance caused by one-sided model overstrength, ensure the balanced improvement of the overall performance of the model, and enhance the deception ability of the generator and the discrimination ability of the discriminator.
[0023] In some embodiments of the first aspect of the present application, the first waveform data is obtained by the generator processing the simulation feature vector, including:
[0024] Perform convolution processing on the simulation feature vector according to the preset convolution layer in the generator to extract the corresponding local features;
[0025] Extract the global features in the local features according to the preset self-attention layer in the generator;
[0026] Fuse and map the global features and local features according to the preset fully connected layer in the generator, and output the corresponding first waveform data.
[0027] Compared with the prior art, the above embodiments have the following beneficial effects: The convolutional layer is used to extract local features of the waveform, and the self-attention layer captures global dependencies, enabling the energy decay of the generated waveform during the continuous phase to conform to physical laws; the fully connected layer fuses local and global features and outputs a waveform with both details and consistency, solving the problem of insufficient modeling of long-range dependencies in traditional generation models.
[0028] In some embodiments of the first aspect of the present application, iteratively updating the generator parameters and discriminator parameters according to each first discrimination result of the discriminator of the original self-attention generative adversarial network model includes:
[0029] Calculating a first loss of the generator according to a preset first generator loss function and each of the first discrimination results, and updating the generator parameters according to the first loss of the generator; wherein, the first generator loss function is:
[0030] L g =λ g L g +λ MSE L MSE ; where L g represents the adversarial loss that the first waveform data generated by the generator is recognized as simulation waveform data by the discriminator, L MSE represents the mean square error between the generated first waveform data and the simulation waveform data, and λ g and λ MSE represent balance coefficients;
[0031] Calculating a first loss of the discriminator according to a preset first discriminator loss function and each of the first discrimination results, and updating the discriminator parameters according to the first loss of the discriminator.
[0032] Compared with the prior art, the above embodiments have the following beneficial effects: Introducing a weighted combination of adversarial loss and mean square error, using the adversarial loss to force the generator to deceive the discriminator and enhancing the local fidelity of the waveform (such as the spike shape); constraining the global similarity between the generated waveform and the simulation data through the mean square error (such as the overall amplitude distribution), avoiding local overfitting or global distortion caused by a single loss function, and improving the physical rationality of the generated data.
[0033] In some embodiments of the first aspect of the present application, training the first self-attention generative adversarial network model includes:
[0034] Iteratively updating the generator parameters and discriminator parameters according to each second discrimination result of the discriminator of the first self-attention generative adversarial network model until the model converges;
[0035] Wherein, the second discrimination result is obtained by comparing the second waveform data and the historical waveform data according to the discriminator; the second waveform data is obtained by processing the historical feature vector according to the generator.
[0036] Compared with the prior art, the above embodiments have the following beneficial effects: Fine-tuning the generator with real data to reduce the morphological difference between the simulation and the real waveform; Identifying subtle defects (such as oscillation frequency deviation) through secondary training of the discriminator, and driving the generator to optimize, further improving the performance of the model.
[0037] In some embodiments of the first aspect of the present application, the second waveform data is obtained by processing the historical feature vector according to the generator, including:
[0038] Performing convolution processing on the historical feature vector according to the preset convolution layer in the generator to extract corresponding local features;
[0039] Extracting global features from the local features according to the preset self-attention layer in the generator;
[0040] Fusing and mapping the global features and local features according to the preset fully connected layer in the generator, and outputting corresponding second waveform data.
[0041] Compared with the prior art, the above embodiments have the following beneficial effects: Using the convolution layer to extract local features of the waveform, and the self-attention layer to capture global dependencies, so that the energy decay of the generated waveform in the continuous stage conforms to physical laws; The fully connected layer fuses local and global features, and outputs a waveform with both details and consistency, ensuring that the generated data can cover the diversity of historical working conditions and avoid overfitting problems.
[0042] In some embodiments of the first aspect of the present application, iteratively updating the generator parameters and discriminator parameters according to each second discrimination result of the discriminator of the first self-attention generative adversarial network model includes:
[0043] Calculating the second loss of the generator according to the preset second generator loss function and each of the second discrimination results, and updating the generator parameters according to the second loss of the generator; wherein, the second generator loss function is:
[0044] L g ′=λ g ′L g ′+λ MSE ′L MSE ′; where L g ′ represents the adversarial loss that the second waveform data generated by the generator is recognized as historical waveform data by the discriminator, L MSE′ represents the mean square error between the generated second waveform data and the historical waveform data, λ g ′ and L MSE ′ represents the balance coefficient;
[0045] According to the preset second discriminator loss function and each of the second discrimination results, calculate the second loss of the discriminator, and update the discriminator parameters according to the second loss of the discriminator.
[0046] Compared with the prior art, the above embodiments have the following beneficial effects: introducing a weighted combination of adversarial loss and mean square error, using the adversarial loss to force the generator to deceive the discriminator, enhancing the local fidelity of the waveform (such as the spike shape); constraining the global similarity between the generated waveform and the historical real data through the mean square error (such as the overall amplitude distribution), avoiding local overfitting or global distortion caused by a single loss function, and improving the physical rationality of the generated data.
[0047] In a second aspect, the present invention also provides a waveform generation model training system based on line condition parameters, including: a data acquisition module, a conversion module, a first training module, and a second training module;
[0048] Among them, the data acquisition module is used to acquire each preset simulation line condition parameter and the corresponding simulation waveform data, as well as the historical line condition parameter and the corresponding historical waveform data;
[0049] The conversion module is used to convert each of the simulation line condition parameters into a corresponding simulation feature vector, and convert each of the historical line condition parameters into a corresponding historical feature vector;
[0050] The first training module is used to train a preset original self-attention generative adversarial network model according to the simulation feature vector and the corresponding simulation waveform data to obtain a first self-attention generative adversarial network model; wherein, the generator of the original self-attention generative adversarial network model includes at least one self-attention layer;
[0051] The second training module is used to train the first self-attention generative adversarial network model according to the historical feature vector and the corresponding historical waveform data to obtain a waveform generation model.
[0052] Compared with the prior art, the above embodiments of the present application have the following beneficial effects: By obtaining simulation and real data to cover diverse fault scenarios (such as lightning strikes, icing, tree obstacles, etc.), the problem of insufficient real data samples is solved; the line condition parameters are uniformly encoded into high-dimensional feature vectors to avoid difficulties in model training caused by inconsistent input forms; a two-stage training strategy is adopted, first learning physical laws through simulation data, and then using historical real data to correct errors, enabling the model to generate highly realistic waveform data based on arbitrary condition parameters, avoiding the cumbersome process of repeatedly collecting a large amount of real data in new fault scenarios, and significantly improving the algorithm development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 : A schematic flow chart of a method for training a waveform generation model based on line condition parameters provided in some embodiments of the present invention.
[0054] Figure 2 : A schematic structural diagram of a system for training a waveform generation model based on line condition parameters provided in some embodiments of the present invention.
[0055] Figure 3 : A schematic structural diagram of a multi-layer perceptron neural network in a method for training a waveform generation model based on line condition parameters provided in some embodiments of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0056] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0057] Embodiment 1:
[0058] Please refer to Figure 1 , a method for training a waveform generation model based on line condition parameters provided in an embodiment of the present invention, including steps S1 to S4:
[0059] Step S1: Obtain each preset simulation line condition parameter and the corresponding simulation waveform data, as well as historical line condition parameters and the corresponding historical waveform data.
[0060] In specific implementation, the simulation line condition parameters can be randomly generated within a reasonable range according to historical or expert experience. The specific parameters include: line parameters, boundary conditions, fault information, and topology information. Among them, the line parameters include voltage level, line length, series impedance matrix per unit length of the line, and shunt admittance matrix parameters; the boundary conditions include equivalent short-circuit capacity, short-circuit current, and load magnitude parameters; the fault information includes fault type, fault phase, fault location, fault duration, and reclosing operation condition parameters; the topology information includes the number of line branches parameter. For example, the voltage level can be one of the cases such as 35 kV, 110 kV, 220 kV, and 500 kV, the line length can be a random value between 5 kilometers and 100 kilometers, and the fault type can be one of the cases such as single-phase ground fault and three-phase ground fault. For matrix data (i.e., series impedance matrix and shunt admittance matrix), it can be calculated by the frequency-variable parameter line model according to the above-mentioned randomly generated scalar data (the data other than the matrix data in the above line condition parameters is scalar data).
[0061] After obtaining the simulation line condition parameters, electromagnetic transient calculation software such as PSCAD / EMTDC can be used to build a transmission line simulation model, and an automation script can be built through methods such as the PSCAD Automation library to realize batch modification of model parameters, and finally corresponding simulation waveform data can be generated through electromagnetic transient simulation.
[0062] In this embodiment, by obtaining simulation data in step S1, diverse fault scenarios (such as lightning strikes, icing, tree faults, etc.) can be covered, and the problem of insufficient real data samples can be solved.
[0063] Step S2: Convert each of the simulation line condition parameters into corresponding simulation feature vectors, and convert each of the historical line condition parameters into corresponding historical feature vectors.
[0064] Preferably, the simulation feature vectors can be obtained through the following preferred implementation method, including step S21, which is specifically as follows:
[0065] S21: According to a preset multi-layer perceptron neural network model, convert each of the simulation line condition parameters into corresponding simulation feature vectors. Among them, the multi-layer perceptron neural network model includes a preprocessing layer, a hidden layer, and an output layer. The preprocessing layer is used to process the scalar parameters and matrix parameters in the simulation line condition parameters respectively, obtain scalar features and matrix features, and fuse the scalar features and matrix features to obtain a first feature. The hidden layer is used to perform high-order non-linear transformation processing on the first feature to obtain a second feature, and the output layer is used to perform linear compression mapping on the second feature to obtain simulation feature vectors.
[0066] In addition, in step S2, the historical feature vector can also be obtained in the manner of step S21 above. Just replace the input data of the multi-layer perceptron neural network model with the historical line condition parameters instead of the simulation route condition parameters.
[0067] For example, in specific implementation, as Figure 3 shown in the structural schematic diagram of the multi-layer perceptron neural network, the model structure of the multi-layer perceptron neural network model can be as follows: it includes 1 preprocessing layer, 1 input layer, 4 hidden layers, and 1 output layer, where:
[0068] The preprocessing layer adopts a parallel network architecture. Its branch 1 is responsible for processing scalar data in the line condition parameters, such as parameters like voltage level, line length, fault type, etc. It is composed of 1 input layer, 2 hidden layers, and 1 output layer. Among them, hidden layer 1 is a fully connected layer with 128 neurons, using the Dropout method for regularization and adopting the ReLu activation function; hidden layer 2 has 256 neurons, and other parameters are the same as those of hidden layer 1; the output layer is a fully connected layer with 100 neurons, adopting a linear activation function, and its output is a 100-dimensional feature vector. Branch 2 is responsible for processing matrix data, including the series impedance matrix and shunt admittance matrix per unit length of the line. The network structure of this branch is the same as that of branch 1. Its input is a vector formed by sequentially connecting the impedance matrix and the admittance matrix after tiling, and the output is also a 100-dimensional feature vector. Finally, in the preprocessing layer, the two 100-dimensional feature vectors output by the two branches are combined into a 200-dimensional feature vector, which serves as the input parameter of the input layer of the multi-layer perceptron neural network model.
[0069] The parameters of the hidden layers of the multi-layer perceptron neural network model are as follows: hidden layer 1 is a fully connected layer with 256 neurons, using the Dropout method for regularization and adopting the ReLu activation function; the structures of hidden layers 2 - 4 are similar to that of hidden layer 1, and their numbers of neurons are 512, 1024, and 2048 respectively; the output layer is a fully connected layer with 400 neurons, adopting a linear activation function; the final output parameter is a 400-dimensional high-dimensional feature vector (i.e., the simulation feature vector or the historical feature vector), and this feature vector can be used as the input parameter of the subsequent self-attention generative adversarial network.
[0070] In this preferred embodiment, scalar parameters (such as voltage level) and matrix parameters (such as impedance matrix) are processed separately through branch networks to retain the spatial symmetry characteristics of the matrix; the scalar and matrix features are spliced to form a comprehensive representation, solving the problem of incomplete condition representation caused by the isolated processing of parameters in traditional methods; high-order non-linear transformation is performed using the hidden layer to further accurately extract the high-order correlations between parameters and waveforms, providing high-quality input for the subsequent generative adversarial network.
[0071] Step S3: Train a preset original self-attention generative adversarial network model based on the simulation feature vectors and the corresponding simulation waveform data to obtain a first self-attention generative adversarial network model; wherein, the generator of the original self-attention generative adversarial network model includes at least one self-attention layer.
[0072] Preferably, the original self-attention generative adversarial network model in step S3 can be trained according to a preset adaptive learning rate adjustment algorithm; wherein, the adaptive learning rate adjustment algorithm is as follows:
[0073] where η t represents the current learning rate, η max and η min represent the maximum and minimum values of the learning rate respectively, T cur represents the current training epoch, and T max represents the total number of training epochs.
[0074] In this preferred embodiment, step S3 dynamically adjusts the learning rate through the adaptive learning rate adjustment algorithm, uses a larger learning rate at the beginning of training to accelerate convergence, and reduces the learning rate in the later stage to refine and optimize the parameters, reducing the training time and avoiding local optima; by constraining the maximum / minimum learning rate, it prevents gradient explosion and update stagnation, and ensures the dynamic balance between the generator and the discriminator.
[0075] Furthermore, the training of the preset original self-attention generative adversarial network model in step S3 can be implemented through the following preferred implementation manner, including step S31, specifically as follows:
[0076] S31: Iteratively update the generator parameters and discriminator parameters according to each first discrimination result of the discriminator of the original self-attention generative adversarial network model until a preset number of iterations is reached; wherein, the first discrimination result is obtained by comparing the first waveform data and the simulation waveform data according to the discriminator; the first waveform data is obtained by processing the simulation feature vectors by the generator.
[0077] In this preferred embodiment, step S31 forces the generator to learn the features of the simulation waveform through adversarial loss, improving the physical rationality of the waveform; the discriminator identifies defects by comparing the generated / simulated data, driving the generator to iteratively optimize. The two form an adversarial optimization mechanism to prevent training imbalance caused by one-sided model overstrength, ensure the balanced improvement of the overall model performance, and enhance the deception ability of the generator and the discrimination ability of the discriminator.
[0078] Furthermore, in step S31, the first waveform data can be obtained through the following preferred implementation manner, including steps S311 - S313, specifically as follows:
[0079] S311: Convolve the simulated feature vector according to the preset convolutional layer in the generator to extract corresponding local features.
[0080] S312: Extract the global features from the local features according to the preset self-attention layer in the generator.
[0081] S313: Integrate and map the global features and local features according to the preset fully connected layer in the generator, and output corresponding first waveform data.
[0082] In this preferred embodiment, steps S311 - S313 use a convolutional layer to extract local waveform features, and a self-attention layer to capture global dependencies, so that the energy decay of the generated waveform during the continuous stage conforms to physical laws; the fully connected layer integrates local and global features and outputs a waveform with both details and consistency, solving the problem of insufficient modeling of long-range dependencies in traditional generation models.
[0083] Further, in step S31, the iterative update of the generator parameters and discriminator parameters can be achieved through the following preferred implementation, including steps S314 - S315, specifically as follows:
[0084] S314: Calculate the first loss of the generator according to the preset first generator loss function and each of the first discrimination results, and update the generator parameters according to the first loss of the generator; where the first generator loss function is:
[0085] L g = λ g L g + λ MSE L MSE ; where L g represents the adversarial loss that the first waveform data generated by the generator is recognized as simulated waveform data by the discriminator, L MSE represents the mean square error between the generated first waveform data and the simulated waveform data, and λ g and λ MSE represent balance coefficients.
[0086] S315: Calculate the first loss of the discriminator according to the preset first discriminator loss function and each of the first discrimination results, and update the discriminator parameters according to the first loss of the discriminator.
[0087] In this preferred embodiment, steps S314 - S315 introduce a weighted combination of adversarial loss and mean squared error. The adversarial loss is used to force the generator to deceive the discriminator, enhancing the local fidelity of the waveform (such as the spike morphology). The mean squared error is used to constrain the global similarity between the generated waveform and the simulation data (such as the overall amplitude distribution), avoiding local overfitting or global distortion caused by a single loss function and improving the physical rationality of the generated data.
[0088] Step S4: Train the first self - attention generative adversarial network model according to the historical feature vectors and the corresponding historical waveform data to obtain a waveform generation model.
[0089] Preferably, training the first self - attention generative adversarial network model in step S4 can be implemented through the following preferred implementation, including step S41, specifically as follows:
[0090] S41: Iteratively update the generator parameters and discriminator parameters according to the respective second discrimination results of the discriminator of the first self - attention generative adversarial network model until the model converges; wherein, the second discrimination result is obtained by comparing the second waveform data and the historical waveform data according to the discriminator; the second waveform data is obtained by processing the historical feature vectors by the generator.
[0091] In this preferred embodiment, step S41 fine - tunes the generator using real data, reducing the morphological differences between the simulation and real waveforms. Through the secondary training of the discriminator to identify subtle defects (such as oscillation frequency deviation), the generator is driven to optimize, further improving the performance of the model.
[0092] Furthermore, in step S41, the second waveform data can be obtained through the following preferred implementation, including steps S411 - S413, specifically as follows:
[0093] S411: Perform convolutional processing on the historical feature vectors according to the preset convolutional layer in the generator to extract the corresponding local features.
[0094] S412: Extract the global features from the local features according to the preset self - attention layer in the generator.
[0095] S413: Fuse and map the global features and local features according to the preset fully - connected layer in the generator, and output the corresponding second waveform data.
[0096] In this preferred embodiment, steps S411 - S413 use a convolutional layer to extract local waveform features, and a self - attention layer to capture global dependencies, enabling the energy decay of the generated waveform during the continuous phase to conform to physical laws; the fully - connected layer fuses local and global features to output a waveform with both details and consistency, ensuring that the generated data can cover the diversity of historical working conditions and avoid overfitting problems.
[0097] Further, in step S41, the iterative update of the generator parameters and discriminator parameters includes steps S414 - S415, specifically:
[0098] S414: According to the preset second generator loss function and each of the second discrimination results, calculate the second loss of the generator, and update the generator parameters according to the second loss of the generator; where the second generator loss function is:
[0099] L g ′=λ g ′L g ′+λ MSE ′L MSE ′; where L g ′ represents the adversarial loss that the second waveform data generated by the generator is recognized as historical waveform data by the discriminator, L MSE ′ represents the mean square error between the generated second waveform data and the historical waveform data, λ g ′ and L MSE ′ represent balance coefficients.
[0100] S415: According to the preset second discriminator loss function and each of the second discrimination results, calculate the second loss of the discriminator, and update the discriminator parameters according to the second loss of the discriminator.
[0101] In this preferred embodiment, steps S414 - S415 introduce a weighted combination of adversarial loss and mean square error. The adversarial loss forces the generator to deceive the discriminator, enhancing the local fidelity of the waveform (such as the spike shape); the mean square error constrains the global similarity between the generated waveform and the historical real data (such as the overall amplitude distribution), avoiding local overfitting or global distortion caused by a single loss function, and improving the physical rationality of the generated data.
[0102] In addition, when training the first self - attention generative adversarial network model in step S4, an adaptive learning rate adjustment algorithm can also be introduced for training. The specific algorithm formula is the same as the adaptive learning rate adjustment algorithm described in step S3 above, and will not be elaborated here.
[0103] In a specific implementation, for example, the structures of the self - attention generative adversarial network models in steps S3 and S4 can be as follows:
[0104] Generator part: The network structure of the generator can be composed of 1 input layer, 3 convolutional layers, 1 self-attention layer, and 1 output layer; the input parameter of the input layer is the simulation feature vector (if it is in the training stage of step S4, it is replaced by the historical feature vector); the self-attention layer is used to capture global features; the output layer adopts a fully connected layer with a linear activation function, and outputs the generated waveform data.
[0105] Discriminator part: The network structure of the discriminator can be composed of 1 input layer, 3 convolutional layers, 1 self-attention layer, and 1 output layer; the input parameters of the input layer are the waveform generated by the generator and the simulation waveform data (if it is in the training stage of step S4, the simulation waveform data is replaced by the historical waveform data); the self-attention layer is used to capture global features; the output layer adopts a fully connected layer with a Sigmoid activation function, and its output is the discrimination result.
[0106] In summary, compared with the prior art, the above embodiments of the present application have the following beneficial effects: By obtaining simulation and real data to cover diverse fault scenarios (such as lightning strikes, icing, tree faults, etc.), the problem of insufficient real data samples is solved; the line condition parameters are uniformly encoded into high-dimensional feature vectors to avoid the difficulty of model training caused by inconsistent input forms; a two-stage training strategy is adopted, first learning physical laws through simulation data, and then using historical real data to correct errors, enabling the model to generate highly realistic waveform data based on arbitrary condition parameters, avoiding the cumbersome process of repeatedly collecting a large amount of real data in new fault scenarios, and significantly improving the algorithm development efficiency.
[0107] Embodiment 2:
[0108] Please refer to Figure 2 , based on the same inventive concept, an embodiment of the present invention discloses a waveform generation model training system based on line condition parameters, including: a data acquisition module M1, a conversion module M2, a first training module M3, and a second training module M4;
[0109] Among them, the data acquisition module M1 is used to acquire various preset simulation line condition parameters and corresponding simulation waveform data, as well as historical line condition parameters and corresponding historical waveform data.
[0110] The conversion module M2 is used to convert each of the simulation line condition parameters into a corresponding simulation feature vector, and convert each of the historical line condition parameters into a corresponding historical feature vector.
[0111] Further, the conversion module M2 includes: a simulation feature vector conversion unit;
[0112] Among them, the simulation feature vector conversion unit is used to convert each of the simulation line condition parameters into corresponding simulation feature vectors according to a preset multi-layer perceptron neural network model; among them, the multi-layer perceptron neural network model includes a preprocessing layer, a hidden layer, and an output layer; the preprocessing layer is used to process the scalar parameters and matrix parameters in the simulation line condition parameters respectively, obtain scalar features and matrix features, and fuse the scalar features and matrix features to obtain a first feature; the hidden layer is used to perform a high-order non-linear transformation process on the first feature to obtain a second feature, and the output layer is used to perform a linear compression mapping on the second feature to obtain a simulation feature vector.
[0113] In this preferred embodiment, the simulation feature vector conversion unit processes scalar parameters (such as voltage level) and matrix parameters (such as impedance matrix) through a branch network respectively, and retains the spatial symmetry characteristics of the matrix; splices the scalar and matrix features to form a comprehensive representation, solving the problem of incomplete condition representation caused by isolated parameter processing in traditional methods; uses the hidden layer for high-order non-linear transformation to further accurately extract the high-order correlation between parameters and waveforms, providing high-quality input for the subsequent generative adversarial network.
[0114] The first training module M3 is used to train a preset original self-attention generative adversarial network model according to the simulation feature vector and the corresponding simulation waveform data to obtain a first self-attention generative adversarial network model; among them, the generator of the original self-attention generative adversarial network model includes at least one self-attention layer.
[0115] Furthermore, the first training module M3 includes: an adaptive adjustment unit;
[0116] The adaptive adjustment unit is used to train the original self-attention generative adversarial network model according to a preset adaptive learning rate adjustment algorithm; among them, the adaptive learning rate adjustment algorithm is:
[0117] where η t represents the current learning rate, η max and η min represent the maximum and minimum values of the learning rate respectively, T cur represents the current training round, and T max represents the total number of training rounds.
[0118] In this preferred embodiment, the adaptive adjustment unit dynamically adjusts the learning rate through the adaptive learning rate adjustment algorithm, uses a larger learning rate at the beginning of training to accelerate convergence, reduces the learning rate in the later stage to refine and optimize parameters, reduces the training time and avoids local optima; prevents gradient explosion and update stagnation by constraining the maximum / minimum learning rate, and ensures the dynamic balance between the generator and the discriminator.
[0119] Furthermore, the first training module M3 further includes: a first training control unit;
[0120] Among them, the first training control unit is used to iteratively update the generator parameters and discriminator parameters according to each first discrimination result of the discriminator of the original self-attention generative adversarial network model until a preset number of iterations is reached; wherein, the first discrimination result is obtained by the discriminator comparing the first waveform data and the simulation waveform data; the first waveform data is obtained by the generator processing the simulation feature vector.
[0121] In this preferred embodiment, the first training control unit forces the generator to learn the characteristics of the simulation waveform through adversarial loss, improving the physical rationality of the waveform; the discriminator identifies defects by comparing the generated / simulated data, driving the generator to iteratively optimize. The two form an adversarial optimization mechanism to prevent training imbalance caused by one-sided model overstrength, ensure the balanced improvement of the overall model performance, and enhance the deception ability of the generator and the discrimination ability of the discriminator.
[0122] Furthermore, the first training control unit includes: a first local feature extraction subunit, a first global feature extraction subunit, and a first waveform generation subunit;
[0123] Among them, the first local feature extraction subunit is used to perform convolution processing on the simulation feature vector according to the preset convolutional layer in the generator to extract the corresponding local features;
[0124] The first global feature extraction subunit is used to extract the global features in the local features according to the preset self-attention layer in the generator;
[0125] The first waveform generation subunit is used to fuse and map the global features and local features according to the preset fully connected layer in the generator, and output the corresponding first waveform data.
[0126] In this preferred embodiment, the first training control unit uses the convolutional layer to extract the local features of the waveform, and the self-attention layer captures the global dependence relationship, so that the energy decay of the generated waveform in the continuous stage conforms to the physical law; the fully connected layer fuses the local and global features and outputs a waveform with both details and consistency, solving the problem of insufficient modeling of long-range dependencies by traditional generative models.
[0127] Furthermore, the first training control unit further includes: a first generator update subunit and a first discriminator update subunit;
[0128] Among them, the first update subunit of the generator is used to calculate the first loss of the generator according to a preset first generator loss function and each of the first discrimination results, and update the generator parameters according to the first loss of the generator; among them, the first generator loss function is:
[0129] L g =λ g L g +λ MSE L MSE ; where L g represents the adversarial loss that the first waveform data generated by the generator is recognized as simulation waveform data by the discriminator, and L MSE represents the mean square error between the generated first waveform data and the simulation waveform data, and λ g and λ MSE represent balance coefficients.
[0130] The first update subunit of the discriminator is used to calculate the first loss of the discriminator according to a preset first discriminator loss function and each of the first discrimination results, and update the discriminator parameters according to the first loss of the discriminator.
[0131] In this preferred embodiment, the first training control unit introduces a weighted combination of adversarial loss and mean square error, uses the adversarial loss to force the generator to deceive the discriminator, and enhances the local fidelity of the waveform (such as the spike shape); through the mean square error, the global similarity between the generated waveform and the simulation data (such as the overall amplitude distribution) is constrained, avoiding local overfitting or global distortion caused by a single loss function, and improving the physical rationality of the generated data.
[0132] The second training module M4 is used to train the first self-attention generative adversarial network model according to the historical feature vector and the corresponding historical waveform data to obtain a waveform generation model.
[0133] Furthermore, the second training module M4 includes a second training control unit;
[0134] Among them, the second training control unit is used to iteratively update the generator parameters and the discriminator parameters according to each second discrimination result of the discriminator of the first self-attention generative adversarial network model until the model converges; where the second discrimination result is obtained by the discriminator comparing the second waveform data and the historical waveform data; the second waveform data is obtained by the generator processing the historical feature vector.
[0135] In this preferred embodiment, the second training control unit fine-tunes the generator using real data to reduce the morphological difference between the simulation and the real waveform; through the secondary training of the discriminator to identify subtle defects (such as oscillation frequency deviation), the generator is driven to be optimized, further improving the performance of the model.
[0136] Furthermore, the second training control unit includes a second local feature extraction subunit, a second global feature extraction subunit, and a second waveform generation subunit;
[0137] Among them, the second local feature extraction subunit is used to perform convolution processing on the historical feature vector according to the preset convolutional layer in the generator to extract the corresponding local features;
[0138] The second global feature extraction subunit is used to extract the global features in the local features according to the preset self-attention layer in the generator;
[0139] The second waveform generation subunit is used to fuse and map the global features and local features according to the preset fully connected layer in the generator, and output the corresponding second waveform data.
[0140] In this preferred embodiment, the second training control unit uses the convolutional layer to extract the local features of the waveform, and the self-attention layer captures the global dependencies, so that the energy decay of the generated waveform in the continuous stage conforms to the physical law; the fully connected layer fuses the local and global features, and outputs a waveform with both details and consistency, ensuring that the generated data can cover the diversity of historical working conditions and avoid the overfitting problem.
[0141] Furthermore, the second training control unit further includes: a second generator update subunit and a second discriminator update subunit.
[0142] Among them, the second generator update subunit is used to calculate the second generator loss according to the preset second generator loss function and each of the second discriminant results, and update the generator parameters according to the second generator loss; where the second generator loss function is:
[0143] L g ′ =λ g ′ L g ′ +λ MSE ′ L MSE ′ ; where L g ′ represents the adversarial loss that the second waveform data generated by the generator is recognized as historical waveform data by the discriminator, L MSE ′Denotes the mean square error between the generated second waveform data and the historical waveform data, λ g ′ and L MSE ′ Denotes the balance coefficient.
[0144] The second discriminator update subunit is configured to calculate a second discriminator loss according to a preset second discriminator loss function and each of the second discrimination results, and update the discriminator parameters according to the second discriminator loss.
[0145] In this preferred embodiment, the second training control unit introduces a weighted combination of adversarial loss and mean square error, uses the adversarial loss to force the generator to deceive the discriminator, and enhances the local waveform fidelity (such as spike morphology); through the mean square error, the global similarity between the generated waveform and the historical real data (such as the overall amplitude distribution) is constrained, avoiding local overfitting or global distortion caused by a single loss function, and improving the physical rationality of the generated data.
[0146] In summary, compared with the prior art, the embodiments of the present application have the following beneficial effects: by obtaining simulation and real data to cover diverse fault scenarios (such as lightning strikes, icing, tree faults, etc.), the problem of insufficient real data samples is solved; the line condition parameters are uniformly encoded into high-dimensional feature vectors, avoiding difficulties in model training caused by inconsistent input forms; a two-stage training strategy is adopted, first learning physical laws through simulation data, and then using historical real data to correct errors, enabling the model to generate high-fidelity waveform data based on any condition parameters, avoiding the cumbersome process of repeatedly collecting a large amount of real data in new fault scenarios, and significantly improving the algorithm development efficiency.
[0147] For the specific working processes of the above-described modules, reference may be made to the corresponding processes in the foregoing method embodiments, which will not be elaborated herein. The division of the modules is only a logical function division, and there may be other division methods in actual implementation. For example, multiple modules may be combined or integrated into another system.
[0148] The above specific embodiments have further elaborated the object, technical solution and beneficial effects of the present invention. It should be understood that the above are only specific embodiments of the present invention and are not used to limit the protection scope of the present invention. It is particularly pointed out that for those skilled in the art, any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A waveform generation model training method based on line condition parameters, characterized in that Including: Obtain various preset simulation line condition parameters and corresponding simulation waveform data, as well as historical line condition parameters and corresponding historical waveform data; Convert each of the simulation line condition parameters into a corresponding simulation feature vector, and convert each of the historical line condition parameters into a corresponding historical feature vector; Train a preset original self-attention generative adversarial network model according to the simulation feature vector and the corresponding simulation waveform data to obtain a first self-attention generative adversarial network model; wherein, the generator of the original self-attention generative adversarial network model includes at least one self-attention layer; Train the first self-attention generative adversarial network model according to the historical feature vector and the corresponding historical waveform data to obtain a waveform generation model.
2. The waveform generation model training method based on line condition parameters according to claim 1, characterized in that The converting each of the simulation line condition parameters into a corresponding simulation feature vector includes: Convert each of the simulation line condition parameters into a corresponding simulation feature vector according to a preset multi-layer perceptron neural network model; Wherein, the multi-layer perceptron neural network model includes a preprocessing layer, a hidden layer and an output layer; the preprocessing layer is used to process the scalar parameters and matrix parameters in the simulation line condition parameters respectively to obtain scalar features and matrix features, and fuse the scalar features and matrix features to obtain a first feature; the hidden layer is used to perform a high-order non-linear transformation process on the first feature to obtain a second feature, and the output layer is used to perform a linear compression mapping on the second feature to obtain a simulation feature vector.
3. The waveform generation model training method based on line condition parameters according to claim 1, characterized in that The training of the preset original self-attention generative adversarial network model includes: Train the original self-attention generative adversarial network model according to a preset adaptive learning rate adjustment algorithm; wherein, the adaptive learning rate adjustment algorithm is: Among them, η t represents the current learning rate, η max and η min represent the maximum and minimum values of the learning rate respectively, T cur represents the current training epoch, T max represents the total number of training epochs.
4. The waveform generation model training method based on line condition parameters according to claim 3, characterized in that The training of the preset original self-attention generative adversarial network model further includes: Iteratively update the generator parameters and discriminator parameters according to each first discrimination result of the discriminator of the original self-attention generative adversarial network model until a preset number of iterations is reached; Wherein, the first discrimination result is obtained by the discriminator comparing the first waveform data and the simulation waveform data; the first waveform data is obtained by the generator processing the simulation feature vector.
5. The waveform generation model training method based on line condition parameters according to claim 4, characterized in that The first waveform data is obtained by the generator processing the simulation feature vector, including: Perform convolution processing on the simulation feature vector according to a preset convolution layer in the generator to extract corresponding local features; Extract global features in the local features according to a preset self-attention layer in the generator; Fuse and map the global features and local features according to a preset fully connected layer in the generator, and output corresponding first waveform data.
6. The waveform generation model training method based on line condition parameters according to claim 4, characterized in that The iteratively updating the generator parameters and discriminator parameters according to each first discrimination result of the discriminator of the original self-attention generative adversarial network model includes: Calculate a first generator loss according to a preset first generator loss function and each of the first discrimination results, and update the generator parameters according to the first generator loss; wherein, the first generator loss function is: L g = λ g L g + λ MSE L MSE ; where L g represents the adversarial loss that the discriminator recognizes the first waveform data generated by the generator as simulation waveform data, and L MSE represents the mean square error between the generated first waveform data and the simulation waveform data, and λ g and λ MSE represent the balance coefficients; Calculate the first discriminator loss according to the preset first discriminator loss function and each of the first discrimination results, and update the discriminator parameters according to the first discriminator loss.
7. The waveform generation model training method based on line condition parameters according to claim 1, wherein The training of the first self-attention generative adversarial network model includes: Iteratively update the generator parameters and the discriminator parameters according to each second discrimination result of the discriminator of the first self-attention generative adversarial network model until the model converges; Wherein, the second discrimination result is obtained by comparing the second waveform data and the historical waveform data according to the discriminator; the second waveform data is obtained by processing the historical feature vector by the generator.
8. The waveform generation model training method based on line condition parameters according to claim 7, characterized in that The second waveform data is obtained by processing the historical feature vector by the generator, including: Perform convolution processing on the historical feature vector according to the preset convolutional layer in the generator to extract corresponding local features; Extract the global features in the local features according to the preset self-attention layer in the generator; Fuse and map the global features and local features according to the preset fully connected layer in the generator, and output the corresponding second waveform data.
9. The waveform generation model training method based on line condition parameters according to claim 7, characterized in that The iteratively updating the generator parameters and the discriminator parameters according to each second discrimination result of the discriminator of the first self-attention generative adversarial network model includes: Calculate the second generator loss according to the preset second generator loss function and each of the second discrimination results, and update the generator parameters according to the second generator loss; wherein, the second generator loss function is: L g ′ = λ g ′ L g ′ + λ MSE ′ L MSE ′ ; where L g ′ represents the adversarial loss that the second waveform data generated by the generator is recognized as historical waveform data by the discriminator, L MSE ′ represents the mean square error between the generated second waveform data and the historical waveform data, λ g ′ and L MSE ′ represent the balance coefficient; Calculate the second discriminator loss according to the preset second discriminator loss function and each of the second discrimination results, and update the discriminator parameters according to the second discriminator loss.
10. A waveform generation model training system based on line condition parameters, characterized in that, Including: A data acquisition module, a conversion module, a first training module, and a second training module; Wherein, the data acquisition module is used to acquire each preset simulation line condition parameter and the corresponding simulation waveform data, as well as the historical line condition parameter and the corresponding historical waveform data; The conversion module is used to convert each of the simulation line condition parameters into corresponding simulation feature vectors, and convert each of the historical line condition parameters into corresponding historical feature vectors; The first training module is used to train a preset original self-attention generative adversarial network model according to the simulation feature vectors and the corresponding simulation waveform data to obtain a first self-attention generative adversarial network model; wherein, the generator of the original self-attention generative adversarial network model includes at least one self-attention layer; The second training module is used to train the first self-attention generative adversarial network model according to the historical feature vectors and the corresponding historical waveform data to obtain a waveform generation model.