Method and system for predicting electrical characteristics of equipment
By adding an expanded input vector of a specific function to the input of an ordinary differential neural network, and combining mean square error and frequency domain loss function, the problem of neural networks being difficult to learn periodic functions is solved, which significantly improves the accuracy of equipment electrical characteristics prediction.
Patent Information
- Application Number
- CN202411814558.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-05-16
AI Technical Summary
When using neural networks to learn electrical characteristics, it is difficult to effectively learn periodic functions and their derivatives, resulting in poor parameter update effect, which in turn affects the prediction effect.
By adding the expanded input vectors corresponding to specific functions to the input of ordinary differential neural networks, and using mean square error loss function and frequency domain loss function at the same time, the neural network's learning of specific functions is strengthened and the dynamic characteristics of the power system are captured.
It effectively improves the prediction effect of ordinary differential neural networks on the electrical characteristics of equipment and improves the ability to capture the dynamic characteristics of the power system.
Smart Images

Figure CN120011733A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power system control, and in particular to a method and system for predicting electrical characteristics of equipment. Background Art
[0002] At present, my country is building a new power system with a high proportion of renewable energy and a high proportion of power electronic devices. However, the grid connection of a large number of renewable energy sources makes the dynamic characteristics of the power system more complex, which has a negative impact on the dynamic stability of the power system. In order to improve the simulation and analysis capabilities of the new power system, it has become an urgent need to establish a dynamic model of the power system components based on a large amount of measurement data in the new power system.
[0003] The existing technology uses neural networks to build dynamic models of electrical equipment and learn the electrical characteristics of electrical equipment through neural networks. Multilayer Perceptron (MLP) has attracted widespread attention because of its simplicity and wide application. MLP learns the complex nonlinear relationship between input data by mapping input data to multiple hidden layers and using the method of alternating linear layers and activation functions. Finally, the output layer projects the information in the high-dimensional hidden space into the output result.
[0004] However, despite the remarkable success of MLP in many fields, it still faces challenges in learning certain types of functions. For example, periodic functions, such as trigonometric functions, often correspond to the same data values at different times, but their derivatives are opposite. When trained using the back-propagation algorithm, these opposite derivatives will cancel each other out during the gradient update process, resulting in poor parameter updates, making it difficult for MLP to effectively learn these special functions.
[0005] In addition, the mean square error (MSE) loss function is widely used in existing neural network training, which aims to minimize the square error between the predicted value and the true value. The MSE loss function performs well on data points near the stable operating point and can effectively learn the characteristics of the stable state. However, for data containing dynamic parts, the learning effect of the MSE loss function is often poor.
[0006] Therefore, it is necessary to solve the problem that the existing technology cannot effectively learn special functions when using neural networks to learn electrical characteristics, and ultimately the learning effect is poor. Summary of the invention
[0007] The purpose of this section is to summarize some aspects of embodiments of the present invention and briefly introduce some preferred embodiments. Some simplifications or omissions may be made in this section and the specification abstract and the invention title of this application to avoid blurring the purpose of this section, the specification abstract and the invention title, and such simplifications or omissions cannot be used to limit the scope of the present invention.
[0008] In view of the above existing problems, the present invention is proposed.
[0009] Therefore, the present invention provides a method and system for predicting electrical characteristics of a device, which can solve the problems mentioned in the background technology.
[0010] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0011] In a first aspect, the present invention provides a method for predicting electrical characteristics of a device, comprising:
[0012] Obtaining an observed input vector of an electrical device in a target power system at a first moment;
[0013] A first neural network is preset to predict a state variable at a second moment based on an observed input vector at a first moment and a corresponding expanded input vector;
[0014] The electrical characteristics of the device are predicted according to the state variables at the second moment.
[0015] As a preferred solution of the device electrical characteristics prediction method of the present invention, the expanded input vector includes:
[0016] determining one or more preset specific functions;
[0017] Taking the state variable at the first moment as input, solving the preset specific function to obtain one or more solution vectors;
[0018] One or more solution vectors are combined to obtain the expanded input vector.
[0019] As a preferred solution of the device electrical characteristics prediction method described in the present invention, the preset specific function includes one or more combinations of sine function, cosine function, non-sinusoidal periodic function and high-order harmonics.
[0020] As a preferred solution of the device electrical characteristics prediction method described in the present invention, the observed input vector includes state variables, injected current, node voltage and external input variables.
[0021] As a preferred solution of the device electrical characteristics prediction method of the present invention, the first neural network includes:
[0022] The first neural network is obtained by training and optimizing through a target loss function, wherein the target loss function includes a mean square error loss function and a frequency domain loss function; the state variable at the second moment is the predicted electrical characteristics of the device.
[0023] As a preferred solution of the device electrical characteristic prediction method of the present invention, wherein: the preset first neural network predicts the state variable at the second moment according to the observed input vector at the first moment and its corresponding expanded input vector, including:
[0024] Concatenating the observed input vector and the expanded input vector to obtain a target input vector;
[0025] Inputting the target input vector into a pre-trained first neural network to obtain a derivative function of the state vector at a first moment;
[0026] The state vector at the first moment and its corresponding derivative function are numerically integrated to obtain the state variable at the second moment.
[0027] As a preferred solution of the device electrical characteristics prediction method described in the present invention, the first neural network also includes a multi-layer perceptron, and the number of hidden layers and neurons in the multi-layer perceptron are set according to different scenarios.
[0028] In a second aspect, the present invention provides a device electrical characteristics prediction system, comprising:
[0029] A data acquisition module, used to obtain an observed input vector of an electrical device in a target power system at a first moment;
[0030] A neural network building module is used to preset a first neural network and predict a state variable at a second moment based on an observed input vector at a first moment and its corresponding expanded input vector;
[0031] A prediction module is used to predict the electrical characteristics of the device according to the state variables at the second moment.
[0032] In a third aspect, the present invention provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above-mentioned method when executing the computer program.
[0033] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the method described above when executed by a processor.
[0034] Compared with the prior art, the present invention has the following beneficial effects: the present invention proposes a method and system for predicting the electrical characteristics of equipment, which obtains the observed input vector of the electrical equipment in the target power system at the first moment; presets a first neural network, and predicts the state variable at the second moment based on the observed input vector at the first moment and its corresponding extended input vector; and predicts the electrical characteristics of the equipment based on the state variable at the second moment. This method can effectively enhance the learning of the neural network on the specific function and capture the dynamic characteristics of the power system by adding the extended input vector corresponding to the specific function to the input of the ordinary differential neural network, and simultaneously applying the mean square error loss function and the frequency domain loss function, thereby improving the prediction effect of the ordinary differential neural network on the electrical characteristics of the equipment. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. Among them:
[0036] Figure 1 It is a flow chart of a method and system for predicting electrical characteristics of a device provided by an embodiment of the present invention.
[0037] Figure 2 It is a schematic diagram of the framework of the ordinary differential neural network provided by the prior art.
[0038] Figure 3 It is a schematic diagram of training optimization of an ordinary differential neural network provided by an embodiment of the present invention.
[0039] Figure 4 This is a diagram of the neural network learning effect using a mixed loss function provided in an embodiment of the present invention.
[0040] Figure 5 This is a graph of the neural network learning effect using the mean square error loss function provided by the existing technology.
[0041] Figure 6 It is a diagram of the learning effect of a neural network using an expanded input vector provided by an embodiment of the present invention.
[0042] Figure 7 This is a graph of the learning effect of a neural network without using an expanded input vector provided by the prior art.
[0043] Figure 8 It is a schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0044] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.
[0045] Example 1
[0046] Reference Figure 1-Figure 8 , which is the first embodiment of the present invention, provides a method and system for predicting electrical characteristics of a device, including:
[0047] It should be noted that the existing technology uses neural networks to build dynamic models of electrical equipment and learn the electrical characteristics of electrical equipment through neural networks. MLP has received widespread attention because of its simplicity and wide application. MLP learns the complex nonlinear relationship between input data by mapping input data to multiple hidden layers and using the method of alternating linear layers and activation functions. Finally, the output layer projects the information in the high-dimensional hidden space into the output result.
[0048] However, despite the remarkable success of MLP in many fields, it still faces challenges in learning certain types of functions. For example, periodic functions, such as trigonometric functions, often correspond to the same data values at different times, but their derivatives are opposite. When trained using the back-propagation algorithm, these opposite derivatives will cancel each other out during the gradient update process, resulting in poor parameter updates, making it difficult for MLP to effectively learn these special functions.
[0049] In addition, the mean square error (MSE) loss function is widely used in existing neural network training, which aims to minimize the square error between the predicted value and the true value. The MSE loss function performs well on data points near the stable operating point and can effectively learn the characteristics of the stable state. However, for data containing dynamic parts, the learning effect of the MSE loss function is often poor.
[0050] This application provides a method that can effectively solve the above-mentioned problems. Next, we will describe in detail how to implement the device electrical characteristics prediction method in combination with multiple embodiments.
[0051] Figure 1 A schematic diagram of a device electrical characteristic prediction method and system is shown, including:
[0052] S101, obtaining an observed input vector of an electrical device in a target power system at a first moment;
[0053] In an optional embodiment, before predicting the state variables of electrical equipment in the power system at future times, it is necessary to collect state information of the electrical equipment at the current time and before the current time from the power system, where the state information includes but is not limited to state variables, injected current, node voltage, and external input variables.
[0054] In an optional embodiment, the state variables refer to key physical quantities that can describe the dynamic behavior of the system, including but not limited to the angle, frequency, speed, etc. of the generator. For a specific power network, the state variables may also include the voltage phase angle and voltage amplitude at both ends of the line and transformer.
[0055] In an optional embodiment, the injected current refers to the current flowing into or out of the system node, which can be used to represent the current consumed by the load or generated by the power source (such as a generator).
[0056] In an optional embodiment, the node voltage is the voltage level of each node in the power system, and these voltage values are very important for evaluating the stability of the system and determining whether there is an overvoltage or undervoltage situation.
[0057] In an optional embodiment, external input variables refer to influencing factors from outside the system, including but not limited to weather conditions (temperature, wind speed, etc.), changes in market demand, fault events, etc., which may affect the operating status of the power system.
[0058] In the embodiment of the present application, the observed input vector includes state variables, injected current, node voltage and external input variables. The specific selection depends on the actual needs of the technicians and is not limited here.
[0059] It should be noted that the various state information of the above-mentioned electrical equipment can be collected in real time using various sensors and measuring devices (such as current transformers, voltage transformers, digital meters, etc.), which are not specifically limited here. After the various state information of the above-mentioned electronic equipment is collected, it is spliced to obtain the observation input vector.
[0060] In an optional embodiment, the first moment may be any moment, for example, the current moment or a moment in the past. In order to ensure the real-time nature of the solution, the present application selects the current moment as the first moment. Relevant technicians may define the actual first moment according to actual needs.
[0061] It should be noted that obtaining the observed input vector of the electrical equipment in the target power system at the first moment can provide accurate initial conditions for subsequent predictions. In this way, it can be ensured that the prediction model has sufficient information when the prediction starts, thereby improving the accuracy and reliability of the prediction. In addition, this acquisition method can also help the model capture the instantaneous state of the power system at a specific moment, which is crucial for understanding the dynamic behavior of the system and predicting future states. In practical applications, the acquisition process of this observation input vector needs to consider the real-time and accuracy of the data to ensure the effectiveness of the prediction results.
[0062] S102, presetting a first neural network to predict a state variable at a second moment based on an observed input vector at a first moment and its corresponding expanded input vector;
[0063] In an optional embodiment, the second moment is a subsequent moment of the first moment, and there is a time period between the second moment and the first moment. If the first moment is a past moment, the second moment can be the current moment or a future moment. If the first moment is the current moment, the second moment can only be a future moment.
[0064] In the embodiment of the present application, the first moment is the current moment, so the second moment is a moment in the future.
[0065] In an embodiment of the present application, expanding the input vector includes:
[0066] determining one or more preset specific functions;
[0067] Taking the state variable at the first moment as input, solving the preset specific function to obtain one or more solution vectors;
[0068] One or more solution vectors are combined to obtain an expanded input vector.
[0069] In an embodiment of the present application, the preset specific function includes one or more combinations of a sine function, a cosine function, a non-sinusoidal periodic function, and a high-order harmonic.
[0070] In an optional embodiment, after obtaining the observed input vector of the electrical equipment in the power system at the current moment, it is also necessary to obtain an expanded input vector. Specifically, it is necessary to first determine a preset specific function, such as a trigonometric function, and then calculate the preset specific function value corresponding to the state variable in the observed input vector, that is, substitute the state variable into the preset specific function for solving to obtain the corresponding solution vector. Finally, the solution vectors obtained by solving are spliced and combined to obtain the expanded input vector.
[0071] When merging the solution vectors, they may be combined in a weighted manner according to the importance of different preset specific functions (or different solution vectors), which is not specifically limited here.
[0072] In an optional embodiment, the state variable is the angular velocity ω t , taking the trigonometric function as an example, the sine function and cosine function can be added to the input function of the neural network, and the angular velocity can be observed from the actual data. The neural network combines the sine function value and cosine function value corresponding to the angular velocity to obtain AC data of different amplitudes and phases, and obtains the expanded input vector (sinω t ,cosω t ).
[0073] In the embodiment of the present application, the preset specific function in the embodiment may be other specific functions in addition to the sine function and the cosine function, such as non-sinusoidal periodic function and high-order harmonics. In other words, the preset specific function may be determined according to actual conditions, and the preset specific function may be a combination of one or more of the sine function, the cosine function, the non-sinusoidal periodic function and the high-order harmonics, which are not specifically limited here.
[0074] Thus, the model input of the ordinary differential neural network can be further obtained. Specifically, the observed input vector and the expanded input vector are concatenated to obtain the target input vector, and then the target input vector is input into the pre-trained ordinary differential neural network to obtain the derivative function of the state vector at the current moment. Finally, the state vector at the current moment and its corresponding derivative function are numerically integrated to obtain the state variable at the future moment.
[0075] In the embodiment of the present application, a first neural network is preset, and according to the observed input vector at the first moment and its corresponding expanded input vector, the state variable at the second moment is predicted, including:
[0076] Concatenate the observed input vector and the expanded input vector to obtain the target input vector;
[0077] Input the target input vector into a pre-trained first neural network to obtain a derivative function of the state vector at a first moment;
[0078] The state vector at the first moment and its corresponding derivative function are numerically integrated to obtain the state variable at the second moment.
[0079] The first neural network also includes a multi-layer perceptron, and the number of hidden layers and neurons in the multi-layer perceptron are set according to different scenarios.
[0080] In an optional embodiment, numerical integration is an approximate method used to estimate the solution of the differential equation, including but not limited to the Euler method and the Runge-Kutta method.
[0081] In an optional embodiment, the state variable is still the angular velocity ω t , taking the preset specific function as a trigonometric function as an example, the function corresponding to the ordinary differential neural network can be expressed as the following formula (1).
[0082]
[0083] In formula (1), represents the derivative function of the state variable at the current moment, f NN represents an ordinary differential neural network, x(t) represents the state variable at the current moment, and θ represents the model parameters of the ordinary differential neural network.
[0084] In an embodiment of the present application, one or more preset specific functions are determined, and the state variables at the current moment are used as input to solve the preset specific functions to obtain one or more solution vectors, and then one or more solution vectors are combined to obtain an extended input vector, and then based on the pre-trained ordinary differential neural network, the observed input vector at the current moment and its corresponding extended input vector are used to predict the state variables at future moments. This method can effectively enhance the learning of the neural network on the specific function and capture the dynamic characteristics of the power system by adding the extended input vector corresponding to the specific function to the input of the ordinary differential neural network, and simultaneously applying the mean square error loss function and the frequency domain loss function, thereby improving the prediction effect of the ordinary differential neural network on the electrical characteristics of the equipment.
[0085] In an optional embodiment, the extended input vector refers to a vector consisting of some special functions added to the input of the ordinary differential neural network in addition to the observed input vector. The extended input vector is to enhance the learning effect of the ordinary differential neural network on a specific functional relationship (such as trigonometric function), which can be further calculated based on the state variables in the observed input vector.
[0086] In an optional embodiment, when actually predicting the electrical characteristics of the device, the obtained observed input vector and the expanded input vector are used together as the input of a pre-trained ordinary differential neural network to obtain the derivative function corresponding to the state variable in the observed input vector. Then, based on the state variables in the observed input vector and their corresponding derivative functions, the state variables at future moments are further predicted.
[0087] In an optional embodiment, the state variable at the future time represents the electrical characteristics of the electrical equipment in the power system, such as the angle, frequency, and voltage of the generator.
[0088] In an optional embodiment, the first neural network can be constructed based on a deep learning framework, such as a convolutional neural network (CNN), a recurrent neural network (RNN), or a long short-term memory network (LSTM), etc. These neural networks can process sequence data and can capture complex patterns of dynamic changes in the power system.
[0089] In an optional embodiment, the first neural network can also be a neural network based on a fully connected layer. Since the dynamic changes of the power system may involve multiple time scales, the first neural network can be designed as a deep network with multiple hidden layers to enhance its modeling ability for complex dynamic patterns.
[0090] In an optional embodiment, the first neural network can also be a simple ordinary differential neural network (CDNN), which has a simple structure, is easy to implement, and can effectively model the dynamic changes of the power system. By learning the state variables of the target power system and their changing laws, the CDNN can output the partial derivatives of the corresponding state variables, providing data support for further learning and optimization of the linear model.
[0091] In an embodiment of the present application, the first neural network is designed using an ordinary differential neural network. An ordinary differential neural network is a machine learning model that combines traditional neural networks and ordinary differential equations. It can use neural networks to define the dynamics of ordinary differential equations and predict the evolution of power systems. Compared with traditional deep neural networks, ordinary differential neural networks require fewer states to be stored and require less memory space during training. Ordinary differential neural networks can adaptively evaluate strategies based on inputs, and can clearly balance numerical accuracy with speed, and can dynamically adjust the required computing resources based on actual application scenarios. For some systems, ordinary differential equations are more suitable for describing the system's dynamic equations than other equations.
[0092] In an embodiment of the present application, the first neural network includes:
[0093] The first neural network is obtained by training and optimization through the target loss function, which includes the mean square error loss function and the frequency domain loss function; the state variable at the second moment is the predicted electrical characteristics of the device.
[0094] In an optional embodiment, a target loss function is used when training and optimizing an ordinary differential neural network. The target loss function consists of two parts, one is a mean square error loss function, and the other is a frequency domain loss function.
[0095] Specifically, the objective loss function can be expressed by the following equations (2)-(4).
[0096] L(x true ,xpred )=αL t (x true ,x pred )+βL f (x true ,x pred ) (2).
[0097] L t (x true ,x pred )=MSE(x true ,x pred ) (3).
[0098] L f (x true ,x pred )=MSE(DFT(x true ),DFT(x pred )) (4).
[0099] In formulas (2)-(4), L(x true ,x pred ) represents the target loss function, x true represents the measured value, x pred represents the predicted value, L t represents the mean square error loss function, L f represents the frequency domain loss function, α and β represent the weight coefficients of the mean square error loss function and the frequency domain loss function, respectively, which are used to adjust the proportion of the two loss functions in different scenarios. true ) represents the discrete Fourier transform of the measured value, DFT(x pred ) represents the discrete Fourier transform of the predicted value.
[0100] It should be noted that according to the target loss function, when training and optimizing the ordinary differential neural network, the measured values and predicted values corresponding to a part of the samples are only applicable to the mean square error loss function; the measured values and predicted values of a part of the samples are applicable to the frequency domain loss function, that is, the discrete Fourier transform is first performed, and then the mean square error loss is calculated for the transformed result as the loss of the model in the frequency domain. In this way, not only the frequency domain part (corresponding to the dynamic data of the power system) is added to the loss function, but also the learning effect of the time domain part (corresponding to the steady-state data of the power system) is ensured.
[0101] Then, the ordinary differential neural network is trained and optimized based on the target loss function to obtain a trained ordinary differential neural network. Thus, the trained ordinary differential neural network is used to predict the electrical characteristics of electrical equipment in the power system.
[0102] In an embodiment of the present application, by simultaneously applying the mean square error loss function and the frequency domain loss function to train and optimize the ordinary differential neural network, the dynamic characteristics of the power system can be effectively captured, thereby improving the prediction effect of the ordinary differential neural network on the electrical characteristics of the equipment.
[0103] In the embodiment of the present application, the ordinary differential neural network (i.e., the first neural network) is pre-trained, and in particular, the mean square error loss function and the frequency domain loss function are used when training and optimizing the ordinary differential neural network. The mean square error loss function is used to measure the difference between the predicted value and the true value, and the frequency domain loss function is used to ensure that the response of the ordinary differential network at different frequencies is consistent with the actual system, so as to capture the unique dynamic characteristics of the power system, such as oscillation mode, etc.
[0104] It should be noted that by obtaining the observed input vector of the electrical equipment in the power system at the current moment; wherein the observed input vector includes state variables, injected current, node voltage and external input variables; and based on the pre-trained ordinary differential neural network, according to the observed input vector at the current moment and its corresponding extended input vector, the state variables at the future moment are predicted; wherein the ordinary differential neural network is trained and optimized through the target loss function, and the target loss function includes the mean square error loss function and the frequency domain loss function; the state variables at the future moment are the predicted electrical characteristics of the equipment. This method can effectively strengthen the learning of the neural network on the specific function and capture the dynamic characteristics of the power system by adding the extended input vector corresponding to the specific function to the input of the ordinary differential neural network, and applying the mean square error loss function and the frequency domain loss function at the same time, thereby improving the prediction effect of the ordinary differential neural network on the electrical characteristics of the equipment.
[0105] S103, predicting electrical characteristics of the device according to the state variables at the second moment.
[0106] In an embodiment of the present application, the electrical characteristics of the device are predicted based on the state variables at the second moment, and first the time range of the prediction needs to be determined. The time range of the prediction can be set according to actual needs. For example, it can be a short-term prediction of a few seconds to a few minutes, or a medium-term prediction of a few hours to a few days. After determining the prediction time range, the observed input vector at the current moment is input into the trained ordinary differential neural network, and the network will dynamically predict the state variables at future moments based on the input data. The predicted state variables reflect the electrical characteristics of the power system within the prediction time range, including the changing trends of key parameters such as voltage, current, and power. In this way, the operating status of the power system can be monitored and predicted in real time, thereby providing strong support for the stable operation and fault prevention of the power system.
[0107] In an optional embodiment, when training the first neural network, it is first necessary to generate a data set for training, including a training set and a test set. The data structures of the training set and the test set are the same, and the systems used for generating them are also the same, but they have different initial settings.
[0108] Taking the training set as an example, in the training set used in this embodiment, each sample in the training set includes information related to electrical characteristics, such as t, x, z, z_jump, and event_t. Among them, t represents the time series; x is the state variable described above, and z is the external input variable described above; z_jump represents the moment when the system jumps, and event_t represents the time when the jump occurs. When the time recorded by event_t is calculated, the input of the network will switch from z to z_jump. When it is specifically input into the network, after specifying the training rounds, the model will extract the specified N samples from the training set in each round of training, and divide them into several batches according to the batch_size samples contained in each batch, and use batches for training.
[0109] Figure 2 FIG. 1 shows a schematic diagram of the framework of an ordinary differential neural network provided by the prior art. Figure 2 As shown, starting from the initial value, the neural network receives the current value of x(t) and z(t) and calculates the current value. Then, according to x(t) and The value of x(t+Δt) can be obtained by numerical integration. When calculating the next moment, the calculated x(t+Δt) and z(t+Δt) are used as inputs, and the x values corresponding to different times can be obtained by cyclic calculation. In different scenarios, the settings of the neural network module used are different, and different numbers of hidden layers and neurons can be set. After calculating the x value corresponding to the entire time series, the loss function is calculated, and back propagation and parameter update are performed.
[0110] Among them, x(t) represents the state variable at the current moment, z(t) represents the external input variable at the current moment, represents the derivative function of the state variable at the current moment, and x(t+Δt) represents the predicted state variable at the future moment.
[0111] The present invention is directed to Figure 2 The ordinary differentiable neural network framework in has been improved. Specifically, Figure 3 A schematic diagram of training optimization of an ordinary differential neural network provided by an embodiment of the present invention is shown.
[0112] according to Figure 3 It can be seen that compared with the prior art, the present invention improves the input and loss function of the ordinary differential neural network, and other modules are Figure 2 Specifically, on the one hand, some preset specific functions are added to the input of the ordinary differential neural network to enhance the learning effect of the neural network on these functional relationships; on the other hand, the loss function design is to introduce the frequency domain loss function, which can be specifically referred to in the above formulas (2)-(4). Through the improved design of the present invention, the prediction effect of the ordinary differential neural network on the electrical characteristics of the device can be effectively improved.
[0113] Regarding the learning effect of ordinary differentiable neural networks, Figure 4 The figure shows the effect of neural network learning using a mixed loss function provided by an embodiment of the present invention. Figure 5 The figure shows the effect of neural network learning using mean square error loss function provided by the prior art, wherein the mixed loss function is the target loss function in the present invention.
[0114] By comparing Figure 4 and Figure 5 It can be clearly observed that the learning effect of the model in the dynamic part has been greatly improved, and the method of introducing the frequency domain can indeed improve the dynamic characteristics of the power system under given circumstances.
[0115] at the same time, Figure 6 FIG. 4 shows a graph showing the learning effect of a neural network using an expanded input vector provided by an embodiment of the present invention. Figure 7 The figure shows the effect of neural network learning without using the expanded input vector provided by the prior art. Among them, the mixed loss function is the target loss function in the present invention.
[0116] By comparing Figure 6 and Figure 7 It can be seen that although there is still a large deviation, the results of the network output are basically consistent with the trend of the actual value, which shows that the ordinary differential neural network has learned certain communication information and verifies the role of expanding the network input in improving the network learning effect.
[0117] This embodiment also provides a device electrical characteristics prediction system, which is characterized by comprising:
[0118] A data acquisition module, used to obtain an observed input vector of an electrical device in a target power system at a first moment;
[0119] A neural network building module is used to preset a first neural network and predict a state variable at a second moment based on an observed input vector at a first moment and its corresponding expanded input vector;
[0120] The prediction module is used to predict the electrical characteristics of the device according to the state variables at the second moment.
[0121] The above-mentioned unit modules may be embedded in or independent of a processor in a computer device in the form of hardware, or may be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to the above-mentioned modules.
[0122] Figure 8 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 8 As shown, the electronic device may include: a processor 910, a communication interface 920, a memory 930 and a communication bus 940, wherein the processor 910, the communication interface 920 and the memory 930 communicate with each other through the communication bus 940. The processor 910 may call the logic instructions in the memory 930 to execute the device electrical characteristic prediction method based on the ordinary differential neural network, the method comprising: obtaining the observed input vector of the electrical equipment in the target power system at the first moment; presetting the first neural network, predicting the state variable at the second moment according to the observed input vector at the first moment and its corresponding extended input vector; predicting the device electrical characteristics according to the state variable at the second moment.
[0123] In addition, the logic instructions in the above-mentioned memory 930 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0124] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the device electrical characteristics prediction method based on the ordinary differential neural network provided by the above methods. The method includes: obtaining the observed input vector of the electrical equipment in the target power system at the first moment; presetting a first neural network, predicting the state variable at the second moment based on the observed input vector at the first moment and its corresponding expanded input vector; and predicting the device electrical characteristics based on the state variable at the second moment.
[0125] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the device electrical characteristics prediction method based on an ordinary differential neural network provided by the above-mentioned methods, the method comprising: obtaining an observed input vector of an electrical device in a target power system at a first moment; presetting a first neural network, predicting a state variable at a second moment based on the observed input vector at the first moment and its corresponding expanded input vector; and predicting the device electrical characteristics based on the state variables at the second moment.
[0126] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.
[0127] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.
[0128] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for predicting electrical characteristics of a device, characterized in that: include: Obtaining an observed input vector of an electrical device in a target power system at a first moment; A first neural network is preset to predict a state variable at a second moment based on an observed input vector at a first moment and a corresponding expanded input vector; The electrical characteristics of the device are predicted according to the state variables at the second moment.
2. The device electrical characteristics prediction method according to claim 1, characterized in that: The expanded input vector includes: determining one or more preset specific functions; Taking the state variable at the first moment as input, solving the preset specific function to obtain one or more solution vectors; One or more solution vectors are combined to obtain the expanded input vector.
3. The device electrical characteristics prediction method according to claim 2, characterized in that: The preset specific function includes one or more combinations of a sine function, a cosine function, a non-sinusoidal periodic function and a high-order harmonic.
4. The device electrical characteristics prediction method according to claim 3, characterized in that: The observation input vector includes state variables, injected currents, node voltages, and external input variables.
5. The device electrical characteristics prediction method according to claim 4, characterized in that: The first neural network comprises: The first neural network is obtained by training and optimizing through a target loss function, wherein the target loss function includes a mean square error loss function and a frequency domain loss function; the state variable at the second moment is the predicted electrical characteristics of the device.
6. The device electrical characteristics prediction method according to claim 5, characterized in that: The preset first neural network predicts the state variable at the second moment according to the observed input vector at the first moment and the corresponding expanded input vector, including: Concatenating the observed input vector and the expanded input vector to obtain a target input vector; Inputting the target input vector into a pre-trained first neural network to obtain a derivative function of the state vector at a first moment; The state vector at the first moment and its corresponding derivative function are numerically integrated to obtain the state variable at the second moment.
7. The device electrical characteristics prediction method according to claim 6, characterized in that: The first neural network also includes a multi-layer perceptron, and the number of hidden layers and the number of neurons in the multi-layer perceptron are set according to different scenarios.
8. A device electrical characteristics prediction system, characterized in that: include: A data acquisition module, used to obtain an observed input vector of an electrical device in a target power system at a first moment; A neural network building module is used to preset a first neural network and predict a state variable at a second moment based on an observed input vector at a first moment and its corresponding expanded input vector; A prediction module is used to predict the electrical characteristics of the device according to the state variables at the second moment.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.