Power load analysis method based on NLP large model of power system

By constructing a long and short-term memory model LSTM based on NLP large model, combining feature selection and attention mechanism, the problem that the sliding window algorithm cannot meet the intelligent and adaptive analysis is solved, and the intelligent and adaptive analysis of power load data is realized, providing more accurate power load change evaluation and analysis.

CN119721803APending Publication Date: 2025-03-28CHINA SOUTHERN POWER GRID COMPANY

Patent Information

Application Number
CN202411646369.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

In the prior art, when the sliding window algorithm processes power load data, the fixed algorithm logic and parameter settings cannot meet the needs of intelligent and adaptive analysis, and cannot effectively adapt to the missing and changes of data.

Method used

By obtaining the total load data of the user's electricity consumption, setting the time series step length, and combining the characteristics of voltage, current, and power data, feature selection and construction of a long and short-term memory model LSTM. The NLP technology attention mechanism is introduced so that the model can focus on key information in the input sequence and realize intelligent power load analysis.

Benefits of technology

The intelligent and adaptive analysis of power load data is realized, which can capture long-term dependencies, improve the performance of the model in processing power load changes sequence data, and provide more accurate power load changes evaluation and analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119721803A_ABST
    Figure CN119721803A_ABST
Patent Text Reader

Abstract

The invention discloses a power load analysis method based on a power system NLP large model, and the method comprises the steps: obtaining the power load data of a user, setting the time sequence step length of the power load of the user, carrying out the feature selection according to the operation data of current, voltage and power, extracting the peak value, valley value and average value features of the data, and carrying out the analysis of the power load. The method comprises the following steps: constructing a feature vector according to feature value features, constructing an LSTM model by using user power utilization total load data and the feature vector, processing time sequence numerical value features, further improving the performance of the model in combination with an NLP technology attention mechanism, and evaluating the output user total power utilization load change of the model by analyzing a voltage fluctuation ratio, a current average value and a power change trend. After the accuracy of the model is confirmed, the total power utilization load data of the user is input into the model, power load analysis is achieved, and intelligence and adaptivity of power load analysis can be effectively achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power system load analysis, and in particular to a power load analysis method based on a power system NLP large model. Background Art

[0002] As the electricity demand of the power system increases, a large amount of electricity resources are consumed. As the core link of electricity consumption, the change of power load has a great impact on the stability and operation efficiency of the power system. Therefore, power load analysis is of great significance to ensure the stability of power supply.

[0003] The Chinese patent publication number: CN113765096B discloses a method, device, computer equipment and storage medium for analyzing power load. The invention aims to use a sliding time window algorithm to identify the total power load data, obtain the starting points and ending points of each change of the total power load data, and then determine the segmented load change data corresponding to each time period. The segmented load change data is compared with a preset load threshold. If the load change exceeds the threshold, a prompt message is issued, which solves the problem of manually analyzing the power load data to understand the user's power consumption after obtaining the power load data. The core solution includes obtaining the total power load data of the user in a preset time period; the total power load data is obtained. The electric load data includes at least one of voltage data, current data, and power data; the total electric load data is identified and extracted to determine the segmented load change data in the total electric load data corresponding to each time period; the working state of at least one electrical appliance corresponding to each segmented load change data is determined; and a reasonable electric consumption strategy is formulated for the user based on the working state of at least one electrical appliance corresponding to each segmented load change data. This can formulate a reasonable electric consumption strategy for the user and improve work efficiency, but the sliding window algorithm works using fixed algorithm logic and parameter settings, and needs to adjust the window and position to adapt to the lack of data, and cannot meet the market demand for intelligent and adaptive analysis of electric loads.

[0004] The present invention proposes a solution to the above shortcomings: obtaining the total electricity load data of users, setting the time series step of the total electricity load of users, and performing feature selection according to the characteristics of voltage, current and power data, constructing a long short-term memory model LSTM, processing the numerical features of the time series, and combining the attention mechanism of NLP technology to further improve the performance of the model, by analyzing the voltage fluctuation rate, current average value and power change trend, evaluating the output of the model The user's total electricity load change, after confirming the accuracy of the model, the user's total electricity load data is input into the model to realize power load analysis. Summary of the invention

[0005] In order to solve the above-mentioned technical problems, the present invention provides a power load analysis method based on a large NLP model of a power system.

[0006] The technical solution of the present invention is implemented as follows: a power load analysis method based on a large NLP model of a power system, comprising:

[0007] S1. Obtain the total power load data of users, including the operating data of current, voltage and power, and set the time series step of the power load of users;

[0008] S2. Perform feature selection based on the operating data characteristics of voltage, current, and power, including extracting data peak, valley, and average features;

[0009] S3, construct the long short-term memory model LSTM to process the numerical features of time series;

[0010] S4. Introduce the attention mechanism of NLP technology to make the long short-term memory model LSTM focus on the key information in the input sequence;

[0011] S5. Input the voltage, current and power data into the long short-term memory model LSTM to analyze the voltage fluctuation rate, current average value and power change trend, and evaluate the total power load change of users output by the model;

[0012] S6. Input the total user load data into the long short-term memory model LSTM to obtain power load analysis at different time points, including periodicity, stability, and trend characteristics.

[0013] Furthermore, the time series step of the total power load of users is set in step S1: the operating data of voltage, current and power are obtained according to the monitoring equipment of the power system, including smart meters and sensors, and the data results are cleaned to process missing values ​​and outliers. The missing values ​​are processed by filling them with the average value, and the outliers are processed by calculating the Z-score to remove the outliers. The voltage, current and power operating data are normalized, and the maximum and minimum value normalization is used to convert the characteristic data values ​​into between 0 and 1. The total power load data of users is sampled at a frequency of once an hour according to the time series step, and each sequence contains the voltage, current and power values ​​at all time points in that hour.

[0014] Furthermore, the feature selection in step S2 includes extracting the peak value, valley value, and average value features of each sequence data. The feature of extracting the data peak value is that when a data point is greater than its two adjacent data points, it is identified as a peak value. The peak values ​​of the extracted voltage, current, and power are V peak ,I peak , P peak ;

[0015] The feature of extracting the valley value of each sequence data is that when a data point is smaller than its two adjacent data points, it is identified as a valley value. The valley values ​​of voltage, current, and power are extracted as V valley ,I valley , P valley ;

[0016] The feature of extracting the average value of each sequence data is to calculate the average value of the entire sequence, and extract the average values ​​of voltage, current, and power respectively.

[0017] The extracted features are constructed into a feature vector, expressed as:

[0018]

[0019] Furthermore, the specific steps of constructing the long short-term memory model LSTM in step S3 and processing the numerical features of the time series are as follows:

[0020] S301, initialization vector, determine the network structure including memory cells, forget gate, input gate, output gate and cell state. The core of the LSTM model is the memory cell. Input the preprocessed feature vector F into the input layer of the LSTM model. At time t, the input value x of the network at the current time t , the output value h of LSTM at the previous moment t-1 , and the cell state c at the previous moment t-1 ; The output layer outputs two values, including the output value h of the LSTM at the current moment t , the current cell state c t , use three control switches to control the long-term state c. The first switch is responsible for controlling the continuation of the long-term state c. The second switch is responsible for controlling the input of the immediate state into the long-term state c. The third switch is responsible for controlling whether to use the long-term state c as the current output. Set the hidden layer to a two-layer network structure, train the LSTM network layer by layer, and input the output of each neuron in the hidden layer of the previous LSTM network into the neuron corresponding to the hidden state of the next layer for calculation. After all calculations, use the Sigmoid function as the activation function to activate the LSTM model;

[0021] S302, train the LSTM model, split the time series data into a training set and a validation set, use the training set to train the long short-term memory model LSTM, and use the validation set to test the accuracy of the model. Use the back propagation training algorithm to train the LSTM model, set hyperparameters, including setting the training rounds to 100, the learning rate to 0.001, the batch size to 8, and select the Adam optimizer. The loss function selects binary cross entropy, and calculates f by forward calculating the output value of each neuron. t 、it 、c t , o t 、h t The values ​​of the five vectors are used to reversely calculate the error term value of each neuron. The back propagation of the error term includes two directions: starting from the current moment t, one is to propagate back along time and calculate the error term at each moment, and the other is to propagate the error term to the upper layer and calculate the gradient of each weight according to the corresponding error term;

[0022] S303, calculate the loss, use the validation set to test the accuracy of the model, adjust the hyperparameters, use the Adam optimizer to update the weights, and the loss function calculation formula is:

[0023]

[0024] Among them, L is the loss value, N is the number of samples, and y i is the true value of the i-th sample, is the value of the i-th sample predicted by the model;

[0025] During the model training process, the loss function calculates the model prediction value through forward propagation, and the predicted value and the actual value are brought into the loss function through loss calculation to calculate the loss value. Backward propagation calculates the gradient of the loss function relative to the model parameters through the chain rule to guide the parameter update. Through the maximum iteration optimization algorithm, the weights are updated, the model parameters are adjusted, and the loss value is reduced, thereby improving the accuracy of the model.

[0026] Furthermore, the NLP technology attention mechanism is introduced in the S4 step, so that the long short-term memory model LSTM focuses on the key information in the input sequence. On the basis of the constructed LSTM model, combined with the NLP technology attention mechanism, an attention layer is introduced to dynamically allocate attention weights. The attention layer receives the output of the NLP model as input, and globally average pools the input feature layer, and performs two full connections on the one-dimensional vector of the global average pooling. The first full connection has a smaller number of neurons, and the second full connection has the same number of neurons as the input feature layer. After completing the two connections, the Sigmoi d feature is taken and the value is fixed to between 0 and 1 as the weight of each channel of the input feature layer. The weight is multiplied by the input layer feature value to calculate the weight of each time step, which further improves the performance of the long short-term memory model LSTM in processing the load change sequence data of electrical equipment.

[0027] Furthermore, the total power load change of users output by the evaluation model in step S5 is input into the long short-term memory model LSTM according to the total power load data of users over a period of time, and the voltage fluctuation rate, the current average value, and the power change are predicted. The voltage fluctuation rate is equal to the maximum voltage minus the minimum voltage divided by the average voltage. The current average value over a period of time is calculated as the overall average level of the current. By analyzing the power value of each time point when the power data in the power system changes over time, the power change trend is analyzed, and the new characteristic value is input into the model to generate a power load curve, which is compared with the standard load curve. If the matching result is consistent with the standard load curve, the original load curve is maintained and the model is applied to the power load analysis. If it does not match the standard load curve, return to step S3 to step S4 for retraining.

[0028] Furthermore, in the step S6, the total user load data is input into the long short-term memory model LSTM to obtain power load analysis at different time points. In different time periods, the collected total user power load data is input into the trained long short-term memory model LSTM. The model controls the flow and preservation of information through the forget gate, input gate and output gate, and can capture the long-term dependency of sequence data. According to the total user power load data, the time series features are extracted. According to the extracted time series features, the power load curve of a specific time period is drawn. According to the power load curve, the periodic changes, stability and trend of power load changes in different time periods of the power load are analyzed, and the short- and medium-term load curve of the time period after a period of time is drawn.

[0029] Beneficial Effects

[0030] The present invention aims at the fact that the sliding window algorithm in the prior art works with fixed algorithm logic and parameter settings, and needs to adjust the window and position to adapt to the lack of data, which cannot meet the market demand for intelligent and adaptive analysis. The present invention sets the time series step of the user's power load, and constructs a feature vector through feature selection according to the operating characteristics of the voltage, current and power data. The long short-term memory model LSTM is constructed by using the user's power load data and feature vectors. The weight affecting the power load is intelligently updated according to the input data. The performance of the model in processing data is further improved by combining the attention mechanism of NLP technology. The trained model is applied to the divided time periods. The LSTM model can capture long-term dependencies and retain the advantages of distant context information when processing sequence data. The power load curve of a specific time period is drawn, and power load analysis is realized according to the power load curve. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 It is a structural block diagram of a power load analysis method based on a power system NLP large model in an embodiment of the present invention;

[0032] Figure 2 A flowchart of a method for analyzing power load based on a large NLP model of a power system according to an embodiment of the present invention;

[0033] Figure 3 The present invention is a flowchart of the steps of constructing a long short-term memory model LSTM in a power load analysis method based on a power system NLP large model in an embodiment of the present invention. DETAILED DESCRIPTION

[0034] In order to make the objects and advantages of the present invention more clearly understood, the present invention is further described below in conjunction with embodiments; it should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0035] The preferred implementation methods of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these implementation methods are only used to explain the technical principles of the present invention and are not intended to limit the protection scope of the present invention.

[0036] It can be understood that the terms "first", "second", etc. used in the present application can be used in this article to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from another element.

[0037] When used herein, the singular forms "a", "an", and "said / the" may also include plural forms, unless the context clearly indicates otherwise. It should also be understood that the terms "include / comprise" or "have" and the like specify the presence of stated features, wholes, steps, operations, components, parts, or combinations thereof, but do not exclude the possibility of the presence or addition of one or more other features, wholes, steps, operations, components, parts, or combinations thereof. At the same time, the term "and / or" used in this specification includes any and all combinations of the relevant listed items.

[0038] See also Figure 1-Figure 3 As shown, a power load analysis method based on a power system NLP large model includes:

[0039] S1. Obtain the total power load data of users, including the operating data of current, voltage and power, and set the time series step of the power load of users;

[0040] S2. Perform feature selection based on the operating data characteristics of voltage, current, and power, including extracting data peak, valley, and average features;

[0041] S3, construct the long short-term memory model LSTM to process the numerical features of time series;

[0042] S4. Introduce the attention mechanism of NLP technology to make the long short-term memory model LSTM focus on the key information in the input sequence;

[0043] S5. Input the voltage, current and power data into the long short-term memory model LSTM to analyze the voltage fluctuation rate, current average value and power change trend, and evaluate the total power load change of users output by the model;

[0044] S6. Input the total user load data into the long short-term memory model LSTM to obtain power load analysis at different time points, including periodicity, stability, and trend characteristics.

[0045] like Figure 1-Figure 2 As shown, in the step S1, the total power load data of the user is obtained, including the operating data of current, voltage and power, and the time series step length of the user's power load is set;

[0046] Specifically, in step S1, the time series step of the total power load of the user is set: according to the monitoring equipment of the power system, including smart meters and sensors, the operating data of voltage, current and power are obtained, and the data results are cleaned to process missing values ​​and outliers. The missing values ​​are processed by filling them with the average value, and the outliers are processed by calculating the Z-score to remove the outliers. The Z-score calculation formula is:

[0047]

[0048] Among them, x represents the original data value, μ represents the mean value, and σ represents the standard deviation;

[0049] Define the value of |Z|>3 as an outlier, and the way to deal with outliers includes deleting or replacing outliers;

[0050] The voltage, current and power operation data are normalized, and the maximum and minimum value normalization is used to convert the characteristic data values ​​into between 0 and 1. The normalization calculation formula is:

[0051]

[0052] Among them, X' represents the converted value, X represents the original value, and X max Indicates the maximum value, X min Indicates the minimum value;

[0053] The user's total power load data is sampled once an hour according to the time series step size, and each sequence contains the voltage, current, and power values ​​at all time points within that hour.

[0054] like Figure 1-Figure 2As shown, in the step S2, feature selection is performed according to the operating data characteristics of voltage, current and power, including extracting data peak value, valley value and average value features;

[0055] Specifically, the feature selection described in step S2 includes extracting the peak value, valley value, and average value features of each sequence data. The feature of extracting the data peak value is that when a data point is greater than its two adjacent data points, it is identified as a peak value. The peak values ​​of the extracted voltage, current, and power are V, V, and V, respectively. peak ,I peak , P peak ;

[0056] The feature of extracting the valley value of each sequence data is that when a data point is smaller than its two adjacent data points, it is identified as a valley value. The valley values ​​of voltage, current, and power are extracted as V valley ,I valley , P valley ;

[0057] The feature of extracting the average value of each sequence data is to calculate the average value of the entire sequence, and extract the average values ​​of voltage, current, and power respectively.

[0058] The extracted features are constructed into a feature vector, which can be expressed as:

[0059]

[0060] like Figure 1-Figure 3 As shown, in the step S3, a long short-term memory model LSTM is constructed to process the numerical features of the time series;

[0061] Specifically, in step S3, the long short-term memory model LSTM is constructed and the specific steps for processing the numerical features of the time series are as follows:

[0062] S301, initialization vector, determine the network structure including memory cells, forget gate, input gate, output gate and cell state. The core of the LSTM model is the memory cell. Input the preprocessed feature vector F into the input layer of the LSTM model. At time t, the input value x of the network at the current time t , the output value h of LSTM at the previous moment t-1 , and the cell state c at the previous moment t-1 ; The output layer outputs two values, including the output value h of the LSTM at the current moment t , the current cell state c t, use three control switches to control the long-term state c. The first switch is responsible for controlling the continuation of the long-term state c. The second switch is responsible for controlling the input of the immediate state into the long-term state c. The third switch is responsible for controlling whether to use the long-term state c as the current output. Set the hidden layer to a two-layer network structure, train the LSTM network layer by layer, and input the output of each neuron in the hidden layer of the previous LSTM network into the neuron corresponding to the hidden state of the next layer for calculation. After all calculations, use the Sigmoid function as the activation function to activate the LSTM model;

[0063] S302, train the LSTM model, split the time series data into a training set and a validation set, use the training set to train the long short-term memory model LSTM, and use the validation set to test the accuracy of the model. Use the back propagation training algorithm to train the LSTM model, set hyperparameters, including setting the training rounds to 100, the learning rate to 0.001, the batch size to 8, and select the Adam optimizer. The loss function selects binary cross entropy, and calculates f by forward calculating the output value of each neuron. t 、i t 、c t , o t 、h t The values ​​of the five vectors are used to reversely calculate the error term value of each neuron. The back propagation of the error term includes two directions: starting from the current moment t, one is to propagate back along time and calculate the error term at each moment, and the other is to propagate the error term to the upper layer and calculate the gradient of each weight according to the corresponding error term;

[0064] S303, calculate the loss, use the validation set to test the accuracy of the model, adjust the hyperparameters, use the Adam optimizer to update the weights, and the loss function calculation formula is:

[0065]

[0066] Among them, L is the loss value, N is the number of samples, and y i is the true value of the i-th sample, is the value of the i-th sample predicted by the model;

[0067] During the model training process, the loss function calculates the model prediction value through forward propagation, and the predicted value and the actual value are brought into the loss function through loss calculation to calculate the loss value. Backward propagation calculates the gradient of the loss function relative to the model parameters through the chain rule to guide the parameter update. Through the maximum iteration optimization algorithm, the weights are updated, the model parameters are adjusted, and the loss value is reduced, thereby improving the accuracy of the model.

[0068] In step S301, the gate control unit of LSTM at each sequence index position generally includes three types: forget gate, input gate and output gate. The input gate controls the fusion of input signals, the forget gate controls the forgetting of past memories, and the output gate controls the final output of information fused with memories. The unit state is an information fusion of the input signal and the past input signal.

[0069] The calculation formula of the input gate is:

[0070]

[0071] Among them, i t is the output of the input gate, σ is the sigmoid activation function, W xi , W hi , W hc is the weight of the input gate, is the candidate memory cell state output, b i , b c are the bias of the input gate and candidate memory unit, respectively, and h t-1 is the hidden state of the previous time step, x t is the input of the current time step, tanh represents the tangent activation function;

[0072] The calculation formula of the forget gate is:

[0073] f t =σ(x t W xf +h t-1 W hf +b f )

[0074] Among them, f t is the output of the forget gate, σ is the sigmoid activation function, W xf and W hf The weight of the forget gate, b f is the forget gate bias, h t-1 is the hidden state of the previous time step, x t is the input of the current time step;

[0075] The calculation formula of the output gate is:

[0076]

[0077] Among them, t is the output of the output gate, σ is the sigmoid activation function, W xo and W ho is the weight of the output gate, b o is the bias of the output gate, h t-1 is the hidden state of the previous time step, ht is the current hidden state update output, x t is the input of the current time step, c t is the output of the memory signal, and tanh represents the tangent activation function;

[0078] The unit state calculation formula is:

[0079] g t =tanh(x t W xg +h t-1 W hg +b g )

[0080] Among them, g t is the output of the unit state, tanh represents the tangent activation function, W xg and W hg is the weight of the output gate, b g is the bias of the output gate, h t-1 is the hidden state of the previous time step, x t is the input of the current time step;

[0081] The calculation formula of the memory signal is:

[0082] c t =f t ×c t-1 +i t ×g t

[0083] Among them, c t is the output of the memory signal, f t is the output of the forget gate, c t-1 is the memory signal of the previous time step, i t is the output of the input gate, g t is the output of the cell state.

[0084] like Figure 1-Figure 3 As shown, the NLP technology attention mechanism is introduced in the S4 step, so that the long short-term memory model LSTM focuses on the key information in the input sequence;

[0085] Among them, the attention mechanism of NLP technology is an important technology in deep learning. The core idea is to let the model selectively focus on different parts of the input sequence and assign different weights to each part of the input sequence to highlight the information that is more critical to the task;

[0086] Specifically, in step S4, the NLP technology attention mechanism is introduced to make the long short-term memory model LSTM focus on the key information in the input sequence. On the basis of the constructed LSTM model, combined with the NLP technology attention mechanism, an attention layer is introduced to dynamically allocate attention weights. The attention layer receives the output of the NLP model as input, and globally average pools the input feature layer. The one-dimensional vector of the global average pool is fully connected twice. The first full connection has a smaller number of neurons, and the second full connection has the same number of neurons as the input feature layer. After completing the two connections, Sigmoi d is taken to fix the eigenvalue to between 0 and 1 as the weight of each channel of the input feature layer. The weight is multiplied by the input layer eigenvalue to calculate the weight of each time step, which further improves the performance of the long short-term memory model LSTM in processing the load change sequence data of electrical equipment.

[0087] like Figure 1-Figure 3 As shown, in the step S5, the voltage, current and power data are input into the long short-term memory model LSTM, and the voltage fluctuation rate, current average value and power change trend are analyzed to evaluate the change of the total power load of users output by the model;

[0088] Specifically, in step S5, the total power load change of users output by the evaluation model is input into the long short-term memory model LSTM according to the total power load data of users over a period of time, and the voltage fluctuation rate, the current average value, and the power change are predicted. The voltage fluctuation rate is equal to the maximum voltage minus the minimum voltage divided by the average voltage. The current average value for a period of time is calculated as the overall average level of the current. By analyzing the power value of each time point when the power data in the power system changes over time, the power change trend is analyzed, and the new characteristic value is input into the model to generate a power load curve, which is compared with the standard load curve. If the matching result is consistent with the standard load curve, the original load curve is kept and the model is applied to the power load analysis. If it does not match the standard load curve, return to step S3 to step S4 for retraining.

[0089] like Figure 1-Figure 3 As shown, in the step S6, the total user load data is input into the long short-term memory model LSTM to obtain the power load analysis at different time points, including periodicity, stability, and trend characteristics;

[0090] Specifically, in step S6, the total user load data is input into the long short-term memory model LSTM to obtain power load analysis at different time points. In different time periods, the collected total user power load data is input into the trained long short-term memory model LSTM. The model controls the flow and preservation of information through forget gates, input gates and output gates, and can capture the long-term dependencies of sequence data. According to the total user power load data, the time series features are extracted, and the weights and biases of each gate are automatically adjusted. According to the extracted time series features, the power load curve of a specific time period is drawn. According to the power load curve, the periodic changes, stability and trend of power load changes in different time periods are analyzed, and the short- and medium-term load curve of the time period after a period of time is drawn.

[0091] like Figure 1-Figure 3 As shown, the present invention solves the shortcomings of the sliding window algorithm in the prior art that the sliding window algorithm uses fixed algorithm logic and parameter settings to work, needs to adjust the window and position to adapt to the lack of data, and cannot meet the market demand for intelligent and adaptive analysis. The working method is as follows:

[0092] Obtain the total power load data of users, including the operating data of current, voltage and power, and set the time series step of the power load of users;

[0093] According to the characteristics of the operating data of voltage, current and power, feature selection is performed, including extracting the features of the peak value, valley value and average value of the data;

[0094] Construct a long short-term memory model LSTM to process the numerical features of time series;

[0095] Introducing the attention mechanism of NLP technology to enable the long short-term memory model LSTM to focus on the key information in the input sequence;

[0096] According to the voltage, current and power data, they are input into the long short-term memory model LSTM to analyze the voltage fluctuation rate, current average value and power change trend, and evaluate the total power load change of users output by the model;

[0097] The total user load data is input into the long short-term memory model LSTM to obtain power load analysis at different time points, including periodicity, stability, and trend characteristics.

[0098] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.

[0099] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and rules of the present invention shall be included in the protection scope of the present invention.

Claims

1. A power load analysis method based on a large NLP model of a power system, characterized by: S1. Obtain the total power load data of users, including the operating data of current, voltage and power, and set the time series step of the power load of users; S2. Perform feature selection based on the operating data characteristics of voltage, current, and power, including extracting data peak, valley, and average features; S3, construct the long short-term memory model LSTM to process the numerical features of time series; S4. Introduce the attention mechanism of NLP technology to make the long short-term memory model LSTM focus on the key information in the input sequence; S5. Input the voltage, current and power data into the long short-term memory model LSTM to analyze the voltage fluctuation rate, current average value and power change trend, and evaluate the total power load change of users output by the model; S6. Input the total user load data into the long short-term memory model LSTM to obtain power load analysis at different time points, including periodicity, stability, and trend characteristics.

2. The power load analysis method based on the power system NLP large model according to claim 1 is characterized by: The time series step of the total power load of users is set as follows: according to the monitoring equipment of the power system, including smart meters and sensors, the operating data of voltage, current and power are obtained, the data results are cleaned to process missing values ​​and outliers, the missing values ​​are processed by filling them with the average value, the outliers are processed by calculating the Z-score to remove the outliers, and the voltage, current and power operating data are normalized, the maximum and minimum value normalization is used to convert the characteristic data values ​​into between 0 and 1, and the total power load data of users is sampled at a frequency of once an hour according to the time series step, and each sequence contains the voltage, current and power values ​​at all time points in the hour.

3. The power load analysis method based on the power system NLP large model according to claim 1 is characterized by: The feature selection includes extracting the peak value, valley value and average value of each sequence data. The feature of extracting the peak value of the data is that when a data point is larger than its two adjacent data points, it is identified as a peak value. The peak values ​​of the extracted voltage, current and power are V peak ,I peak , P peak ; The feature of extracting the valley value of each sequence data is that when a data point is smaller than its two adjacent data points, it is identified as a valley value. The valley values ​​of voltage, current, and power are extracted as V valley ,I valley , P valley ; The feature of extracting the average value of each sequence data is to calculate the average value of the entire sequence, and extract the average values ​​of voltage, current, and power respectively. The extracted features are constructed into a feature vector, expressed as:

4. The power load analysis method based on the power system NLP large model according to claim 1 is characterized by: The specific steps of constructing the long short-term memory model LSTM and processing the numerical features of the time series are as follows: S301, initialization vector, determine the network structure including memory cells, forget gate, input gate, output gate and cell state. The core of the LSTM model is the memory cell. Input the preprocessed feature vector F into the input layer of the LSTM model. At time t, the input value x of the network at the current time t , the output value h of LSTM at the previous moment t-1 , and the cell state c at the previous moment t-1 ; The output layer outputs two values, including the output value h of the LSTM at the current moment t , the current cell state c t , use three control switches to control the long-term state c. The first switch is responsible for controlling the continuation of the long-term state c. The second switch is responsible for controlling the input of the immediate state into the long-term state c. The third switch is responsible for controlling whether to use the long-term state c as the current output. Set the hidden layer to a two-layer network structure, train the LSTM network layer by layer, and input the output of each neuron in the hidden layer of the previous LSTM network into the neuron corresponding to the hidden state of the next layer for calculation. After all calculations, use the Sigmoid function as the activation function to activate the LSTM model; S302, train the LSTM model, split the time series data into a training set and a validation set, use the training set to train the long short-term memory model LSTM, and use the validation set to test the accuracy of the model. Use the back propagation training algorithm to train the LSTM model, set hyperparameters, including setting the training rounds to 100, the learning rate to 0.001, the batch size to 8, and select the Adam optimizer. The loss function selects binary cross entropy, and calculates f by forward calculating the output value of each neuron. t 、i t 、c t , o t 、h t The values ​​of the five vectors are used to reversely calculate the error term value of each neuron. The back propagation of the error term includes two directions: starting from the current moment t, one is to propagate back along time and calculate the error term at each moment, and the other is to propagate the error term to the upper layer and calculate the gradient of each weight according to the corresponding error term; S303, calculate the loss, use the validation set to test the accuracy of the model, adjust the hyperparameters, use the Adam optimizer to update the weights, and the loss function calculation formula is: Among them, L is the loss value, N is the number of samples, and y i is the true value of the i-th sample, is the value of the i-th sample predicted by the model; During the model training process, the loss function calculates the model prediction value through forward propagation, and the predicted value and the actual value are brought into the loss function through loss calculation to calculate the loss value. Backward propagation calculates the gradient of the loss function relative to the model parameters through the chain rule to guide the parameter update. Through the maximum iteration optimization algorithm, the weights are updated, the model parameters are adjusted, and the loss value is reduced.

5. The power load analysis method based on the power system NLP large model according to claim 1 is characterized by: The NLP technology attention mechanism is introduced to make the long short-term memory model LSTM focus on the key information in the input sequence. On the basis of the constructed LSTM model, combined with the NLP technology attention mechanism, an attention layer is introduced to dynamically allocate attention weights. The attention layer receives the output of the NLP model as input, and globally average pools the input feature layer. The one-dimensional vector of the global average pool is fully connected twice. The first time, some neurons are fully connected, and the second time, the number of neurons is the same as that of the input feature layer. After completing the two connections, the Sigmoid feature is taken to fix the value between 0 and 1 as the weight of each channel of the input feature layer. The weight is multiplied by the input layer feature value to calculate the weight of each time step.

6. The power load analysis method based on the power system NLP large model according to claim 1 is characterized by: The evaluation model outputs the change in the total power load of users, and inputs the time series values ​​into the long short-term memory model LSTM according to the total power load data of users over a period of time, predicts the voltage fluctuation rate, the current average value, and the power change, the voltage fluctuation rate is equal to the maximum voltage minus the minimum voltage divided by the average voltage, and calculates the current average value for a period of time as the overall average level of the current. By analyzing the power value of each time point when the power data in the power system changes over time, the power change trend is analyzed, and the new characteristic value is input into the model to generate a power load curve, which is compared with the standard load curve. If the matching result is consistent with the standard load curve, the original load curve is maintained, and the model is applied to the power load analysis. If it does not match the standard load curve, it is retrained.

7. The power load analysis method based on the power system NLP large model according to claim 1 is characterized by: The total user load data is input into the long short-term memory model LSTM to obtain power load analysis at different time points. In different time periods, the collected total user power load data is input into the trained long short-term memory model LSTM. The model controls the flow and preservation of information through a forget gate, an input gate, and an output gate. According to the total user power load data, time series features are extracted, and according to the extracted time series features, a power load curve for a specific time period is drawn.

Citation Information

Patent Citations

  • Electricity load analysis method, device, computer equipment and storage medium

    CN113765096B

Cited By

  • Power grid alarm perception model training method and system based on information fusion

    CN119988986A