Micro-grid control method, micro-grid control system and electronic equipment
By combining transfer learning and federated learning frameworks in a microgrid system and using a supplementary control model to correct deviations in the physical model, the problems of insufficient control accuracy and scalability in the microgrid system are solved, and efficient and accurate microgrid control is achieved.
Patent Information
- Application Number
- CN202410558731.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-07
- Publication Date
- 2025-11-07
AI Technical Summary
The increase in the number of distributed energy sources in microgrid systems leads to increased system uncertainty and nonlinear complexity, making accurate prediction and control difficult. Existing transfer learning methods suffer from poor interpretability, insufficient generalization ability, and insufficient flexibility and scalability.
By combining the frameworks of transfer learning and federated learning, and supplementing the traditional physical model with a control model, the deviations are corrected using a global transfer model and a supplementary control model, thereby achieving accurate modeling and control of the microgrid system and reducing design and deployment costs.
It improves the accuracy and interpretability of microgrid control, enhances the flexibility, scalability, and stability of the microgrid control system, and reduces design and deployment costs.
Smart Images

Figure CN120909110A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of terminals, and in particular to a microgrid control method, a microgrid control system and an electronic device. BACKGROUND
[0002] With the technological progress of renewable energy such as solar and wind energy, the demand for intelligent management and optimized utilization of distributed energy is increasing. As an important part of the energy system, microgrid can realize efficient management of energy through intelligent control and optimization algorithm. With the increase of the number of distributed energy in the microgrid, the uncertainty, nonlinearity and complexity of the microgrid system also greatly increase, which makes it difficult for the microgrid system to accurately predict and control the future situation.
[0003] In order to better realize the control of the microgrid system, the central computer or the cloud can obtain the control model for each microgrid system through the method of transfer learning, but the above-mentioned method of transfer learning still has the problems of poor interpretability, insufficient generalization ability and insufficient flexible expansion when applied to microgrid control. SUMMARY
[0004] The present application provides a microgrid control method, a microgrid control system and an electronic device. On the basis of traditional physical model control, the framework and mechanism of transfer learning are combined, so that the supplementary control model obtained by transfer learning can supplement and correct the deviation of the physical model in the microgrid control process, thereby solving the problem of insufficient accuracy of the control model and realizing accurate and efficient modeling and regulation. In addition, the microgrid control method provided by the present application also adopts a microgrid control framework based on transfer learning and federated learning, thereby realizing flexible modeling for off-site multi-type microgrid control, reducing the design requirements and deployment cost of the microgrid control system, and improving the flexible expansion of the microgrid control method.
[0005] In a first aspect, this application provides a microgrid control method applied to a microgrid control system. The microgrid control system includes a central modeling device, N local modeling devices, N end controllers, and N microgrids. The central modeling device and the local modeling devices are connected via communication. The N local modeling devices include a first local modeling device. The N end controllers include a first end controller. The N microgrids include a first microgrid. The first local modeling device is connected to the first end controller, and the first end controller is connected to the first microgrid. The microgrid includes one or more local controllers for distributed energy sources. N is a positive integer. The method includes: the first local modeling device training a global transfer model using a first sample set to obtain a first supplementary control model; the parameters of the first x layers of the neural network in the global transfer model and the first supplementary control model are the same, while the parameters of the subsequent layers of the neural network are different. The parameters of the neural network include weights and biases. The first sample set includes multiple first training samples, each including first data and corresponding second data. The first data describes the actual state data of the first microgrid at time t, or the actual state data of the first microgrid at time t and the control signal received at time t-1. The second data indicates a first deviation Δx. t First deviation Δx t The deviation between the actual state data of the first microgrid at time t and the first expected state data at time t calculated based on the linear model of the first microgrid; the first local modeling device deploys the first supplementary control model to the first end controller; the first end controller acquires the actual state data x of the first microgrid at time n. n Or the actual state data x at time n n and the control signal u at time n-1 n-1 The first deviation Δx at time n is calculated by inputting the first supplementary control model. n The first-end controller utilizes Δx n The linear model determines the control signal u at time n. n and using u n The first microgrid is controlled, and the actual state data x of the first microgrid at time n+1 is obtained. n+1 The second expected state data x of the first microgrid at time n+1 n+1 The deviation between the two values is less than the first threshold, and the second predicted state data x n+1 'To utilize Δx n The data was adjusted based on the first expected state data.
[0006] In the method provided by the first aspect, the first local modeling device (i.e., the cloud agent) can train the global transfer model obtained from the central modeling device (i.e., the device where the model integration module is located) based on the historical data or simulation data (i.e., the first sample set) collected by the data collection module to obtain a first supplementary control model (e.g., a supplementary control model for the microgrid system 1) for the first microgrid, and deploy the first supplementary control model to the corresponding first end controller, i.e., deploy the supplementary control model to the corresponding online controller. The online controller deployed with the above online controller can then obtain the system data at time n, including the actual state data x n at time n, or the actual state data x n at time n and the control signal u n-1 at time n-1, as the input of the supplementary control model, and output the first deviation. The first deviation can be used to compensate for the deviation of the physical model (i.e., the linear model) in the control process. Thus, the online controller can generate the control signal at time n using the first deviation and the physical model previously deployed in the online controller, and control the microgrid system connected thereto using the control signal at time n.
[0007] Compared with the existing method of obtaining a control model for each microgrid system based on data driving only, the method of obtaining a supplementary control model by data driving and using the supplementary control model to calculate a supplementary deviation (i.e., the first deviation) for compensating the control of the physical model can improve the accuracy and interpretability of the microgrid control while ensuring the stability of the microgrid control.
[0008] In combination with the first aspect, in some embodiments, before the first local modeling device trains the global transfer model to obtain the first supplementary control model using the first sample set, the method further comprises:
[0009] The first local modeling device obtains the global transfer model from the central modeling device, the input of the global transfer model is the actual state data of the microgrid at time t, or the actual state data of the microgrid at time t and the control signal received by the microgrid at time t-1, the output of the global transfer model is the second deviation, the second deviation is the deviation between the actual state data of the microgrid at time t and the first expected state data of the microgrid at time t calculated based on the linear model of the microgrid, and the linear model of the microgrid is used to describe the linear relationship between the actual state data of the microgrid at time t, the control signal at time t and the first predicted state data of the first microgrid at time t+1.
[0010] In the method provided in the above embodiment, in the process of performing the transfer learning, the first local modeling device (for example, the cloud agent 1) can obtain the global transfer model used for subsequent transfer learning from the central modeling device (the device where the model integration module is located). The subsequent training of the global transfer model is performed on the multi-layer neural network after the x layers of the global transfer model, so that the input and output of the global transfer model and the supplementary control model are the same, and the parameters (including weights and biases) of the neural network of the first x layers of the two models are completely the same, so that when the global transfer model is used to obtain the supplementary control model corresponding to the microgrid system, the supplementary control model corresponding to the microgrid system can be obtained by using fewer training samples (that is, the first training sample), and the modeling efficiency is improved.
[0011] In combination with the first aspect, in some embodiments, the global transfer model is initially trained based on a second sample set, and the second sample set includes a plurality of second training samples from the N microgrids, and each second training sample includes third data and fourth data corresponding to the third data, the third data is used to describe actual state data of the microgrid at time t or actual state data of the microgrid at time t and a control signal received at time t-1, and the fourth data is used to indicate a second deviation at time t.
[0012] In the method provided in the above embodiment, the global transfer model initially deployed in the model integration module can be pre-trained by using global data provided by each microgrid system in the microgrid control system, so that it is ensured that the global transfer model can be used to reflect the transferable knowledge or features in the global microgrid system, and the modeling efficiency of the supplementary control model can be improved when the global transfer model is used for transfer learning.
[0013] In combination with the first aspect, in some embodiments, the method further includes: receiving, by the central modeling device, the first parameters sent by the first local modeling device, and the first parameters include the parameters of the multi-layer neural network after the x layers of the first supplementary control model; and updating, by the central modeling device, the global transfer model by using the first parameters, so that the similarity between the updated global transfer model and the parameters of the multi-layer neural network after the x layers of the first supplementary control model is higher than that before the updating.
[0014] In the method provided in the above embodiment, the global transfer model in the central modeling device can also be obtained through federated learning, that is, the central modeling device can integrate the supplementary control models (that is, the first supplementary control models) for the microgrid systems trained in each cloud agent to obtain the global transfer model.
[0015] In combination with the first aspect, in some embodiments, the first sample set includes one or more of the following: a first sample set obtained by the first local modeling device from the first end controller, and a first sample set obtained by simulating the microgrid.
[0016] By implementing the method provided by the above embodiment, the cloud agent (i.e., the first modeling device) can directly obtain system data (i.e., the first sample set) of the corresponding microgrid system (i.e., the first microgrid) from the online controller (i.e., the first end controller), and the data actually obtained from the microgrid system can fully reflect the dynamic characteristics of the microgrid system. In addition, the cloud agent can also obtain simulation data of the microgrid system from the simulation software, so that when the communication between the cloud agent and the online controller is temporarily disconnected or the microgrid system is newly added to the microgrid control system, sufficient data can be obtained to perform subsequent training of the supplementary control model.
[0017] In combination with the first aspect, in some embodiments, the first local modeling device trains the global transfer model by using the first sample set to obtain the first supplementary control model, and specifically includes: the first local modeling device trains the global transfer model by using the first sample set until the third deviation is less than the second threshold, and the third deviation is the deviation between the predicted deviation obtained by inputting the first data into the global transfer model to obtain the global transfer model output and the first deviation in the first sample set.
[0018] By implementing the method provided by the above embodiment, the cloud agent trains the multi-layer neural network (i.e., the adaptive adjustment layer) after the x layer of the global transfer model by using the system data (i.e., the first sample set, including historical data and simulation data) collected by the data collection module until the model is accurate, to obtain the supplementary control model of the corresponding microgrid. The standard of the above model accuracy is that the deviation between the predicted deviation of the model and the actual deviation is less than the second threshold, so as to ensure that the supplementary control model deployed to the online controller can generate accurate supplementary deviation for compensating the deviation in the physical model control process, thereby improving the accuracy of the microgrid control system.
[0019] In combination with the first aspect, in some embodiments, the first end controller obtains the actual state data x n of the first microgrid at the n time point, or the actual state data x n at the n time point and the control signal u n-1 at the n-1 time point, and inputs the first supplementary control model to calculate the first deviation Δx n at the n time point, and the method further includes: the first end controller receives the first enabling signal sent by the first local modeling device.
[0020] The supplementary control model (i.e., the first supplementary control model) deployed to the online controller according to the method provided by the above embodiment is not necessarily effective, and the online controller activates the supplementary control model only when the online controller receives a valid enabling signal (i.e., the first enabling signal) sent by the model evaluation module of the cloud agent, for example, the enabling signal is set to True or 1, and the online controller adds the deviation that needs to be compensated calculated by the supplementary control model to the control model for the corresponding microgrid system (i.e., the first microgrid).
[0021] In combination with the first aspect, in some embodiments, the condition of the first enabling signal received by the first end controller includes that a difference between a predicted first deviation obtained by inputting the first data into the first supplementary control model and a first deviation in the first sample set is less than a third threshold.
[0022] The online controller receives the valid enabling signal on the premise that the supplementary control model deployed in the online controller is relatively accurate. The accuracy of the above supplementary control model can be judged by the model evaluation module of the cloud agent according to whether the difference between the predicted state deviation and the actual state deviation is less than a third threshold. The microgrid control system uses the enabling signal sent by the model evaluation module of the cloud agent, and can use the supplementary control model to compensate for the deviation caused by the control based on the physical model when the supplementary control model is accurate, thereby improving the accuracy of the microgrid control. In addition, when the supplementary control model is inaccurate or the communication connection between the cloud agent and the online controller is disconnected for a long time, the online controller receives an invalid enabling signal or does not receive the enabling signal, so that the above supplementary control model does not compensate for the deviation caused by the control of the physical model, that is, only the physical model is used to control the microgrid system, thereby ensuring the stability and certain accuracy of the microgrid control.
[0023] In combination with the first aspect, in some embodiments, the first local modeling device is integrated in the central modeling device.
[0024] According to the method provided by the above embodiment, one or more cloud agents (i.e., the first local modeling device) can be integrated in the device (i.e., the central modeling device) where the model integration module is located, thereby reducing the communication delay in the microgrid control process and the dependence on external network connection, and further improving the stability and reliability of the system.
[0025] In a second aspect, the application provides a microgrid control method applied to a central modeling device in a microgrid control system, the microgrid control system further comprising N local modeling devices, N end controllers and N microgrids, wherein the central modeling device and the local modeling devices are communicatively connected, the N local modeling devices comprise a first local modeling device, the N end controllers comprise a first end controller, the N microgrids comprise a first microgrid, the first local modeling device and the first end controller are communicatively connected, the first end controller and the first microgrid are communicatively connected, each microgrid comprises one or more local controllers of distributed energy resources, and N is a positive integer; the method comprises: sending a global transfer model to the first local modeling device, the input of the global transfer model being actual state data of the microgrid at time t or the actual state data of the microgrid at time t and a control signal received at time t-1, and the output of the global transfer model being a second deviation between the actual state data of the microgrid at time t and first expected state data of the microgrid at time t calculated based on a linear model of the microgrid, the linear model of the microgrid being used to describe a linear relationship between the actual state data of the microgrid at time t, the control signal at time t and first predicted state data of the first microgrid at time t+1; wherein the global transfer model is used by the first local modeling device to train a first supplementary control model; the parameters of the first x layers of neural networks in the global transfer model and the first supplementary control model are the same, the parameters of the multiple layers of neural networks after the x layers are different, and the parameters of the neural networks include weights and biases; the first supplementary control model is deployed by the first local modeling device to the first end controller, and the first supplementary control model is used to obtain actual state data x n of the first microgrid at time n by the first end controller n as input, or with the actual state data x n-1 at time n and the control signal u n at time n-1 as input, to calculate first deviation Δx n at time n; Δx n is used by the first end controller to determine the control signal u n at time n together with the linear model, u n+1 is used to control the first microgrid, and the deviation between actual state data x n+1 of the first microgrid at time n+1 and second expected state data x n+1 ’ of the first microgrid at time n+1 is less than a first threshold value, and the second predicted state data x n ’ is obtained by adjusting the first expected state data with Δx
[0026] In the method, the central modeling device (i.e., a device where the model integration module is located) can send a global transfer model to the first local modeling device (i.e., a cloud agent), and the global transfer model is used by the cloud agent to train a supplementary control model of a microgrid system (i.e., a first microgrid) corresponding to the cloud agent, and the supplementary control model is deployed to an online controller (i.e., a first end controller) to generate a control signal for controlling the first microgrid. The method of using transfer learning to establish the supplementary control model improves the modeling efficiency in the microgrid control process.
[0027] In combination with the second aspect, in some embodiments, the global transfer model is initially trained based on a second sample set, and the second sample set includes a plurality of second training samples from the N microgrids, and each second training sample includes third data and fourth data corresponding to the third data, the third data is used to describe actual state data of the microgrid at time t or actual state data of the microgrid at time t and a control signal received at time t-1, and the fourth data is used to indicate a second deviation at time t.
[0028] In combination with the second aspect, in some embodiments, the method further includes receiving first parameters sent by the first local modeling device, the first parameters including parameters of the multi-layer neural network after the x layers of the first supplementary control model; and updating the global transfer model by using the first parameters, and the global transfer model after the updating has a higher similarity with the parameters of the multi-layer neural network after the x layers of the first supplementary control model than the global transfer model before the updating.
[0029] In the third aspect, the present application provides a microgrid control method applied to a first local modeling device in a microgrid control system, the microgrid control system including a central modeling device, N local modeling devices, N end controllers, and N microgrids, wherein the central modeling device and the local modeling devices are in communication connection, the first local modeling device belongs to the N local modeling devices, the N end controllers include a first end controller, the N microgrids include a first microgrid, the first local modeling device and the first end controller are in communication connection, the first end controller and the first microgrid are in communication connection, each microgrid includes one or more local controllers of distributed energy sources, and N is a positive integer; the method includes training a global transfer model to obtain a first supplementary control model by using a first sample set; the parameters of the neural network in the first x layers of the global transfer model and the first supplementary control model are the same, and the parameters of the multi-layer neural network after the x layers are different; the parameters of the neural network include weights and biases; the first sample set includes a plurality of first training samples, and each first training sample includes first data and second data corresponding to the first data, the first data is used to describe actual state data of the first microgrid at time t or actual state data of the first microgrid at time t and a control signal received at time t-1, and the second data is used to indicate a first deviation Δx t , the first deviation Δxt The deviation between the actual state data of the first microgrid at time t and the first expected state data at time t calculated based on the linear model of the first microgrid is defined; a first supplementary control model is deployed to the first terminal controller; the first supplementary control model is used to obtain the actual state data x of the first microgrid at time n from the first terminal controller. n As input, or as the actual state data x at time n. n and the control signal u at time n-1 n-1 As input, the first deviation Δx at time n is calculated. n ;Δx n The control signal u at time n is used by the first-end controller and the linear model to determine the control signal u. n u n Used to control the first microgrid, the actual state data x of the first microgrid at time n+1. n+1 The second expected state data x of the first microgrid at time n+1 n+1 The deviation between the two values is less than the first threshold, and the second predicted state data x n+1 'To utilize Δx n The data was adjusted based on the first expected state data.
[0030] Implementing the method provided in the third aspect, the first local modeling device can use the system data of the first microgrid (i.e., the first sample set) to train the global transfer model to obtain the first supplementary control model (i.e., the supplementary control model) of the first microgrid, and then deploy the supplementary control model to the online controller. Subsequently, the supplementary control model is used by the online controller to calculate the supplementary deviation (i.e., the first deviation) used to compensate for the physical model control, thereby improving the accuracy and interpretability of microgrid control while ensuring the stability of microgrid control.
[0031] In conjunction with the third aspect, in some embodiments, before training the global transfer model using the first sample set to obtain the first supplementary control model, the method further includes: obtaining the global transfer model from the central modeling device, wherein the input of the global transfer model is the actual state data of the microgrid at time t, or the actual state data of the microgrid at time t and the control signal received at time t-1, and the output of the global transfer model is the second deviation, which is the deviation between the actual state data of the microgrid at time t and the first expected state data of the microgrid at time t calculated based on the linear model of the microgrid, wherein the linear model of the microgrid is used to describe the linear relationship between the actual state data of the microgrid at time t, the control signal at time t, and the first predicted state data of the first microgrid at time t+1.
[0032] In some embodiments, the global migration model is initially trained based on a second sample set, the second sample set comprising a plurality of second training samples from the N microgrids, the second training samples comprising third data and fourth data corresponding to the third data, the third data being used to describe actual state data of the microgrid at time t, or actual state data of the microgrid at time t and a control signal received at time t-1, the fourth data being used to indicate the second deviation at time t.
[0033] In some embodiments, the method further comprises: sending, to the central modeling device, first parameters, the first parameters comprising parameters of the multi-layer neural network after the x layer of the first supplementary control model; the first parameters being used by the central modeling device to update the global migration model, the updated global migration model having a higher similarity with the parameters of the multi-layer neural network after the x layer of the first supplementary control model than the global migration model before the update.
[0034] In some embodiments, the first sample set comprises one or more of: a first sample set obtained by the first local modeling device from the first end controller, a first sample set obtained by simulating the microgrid.
[0035] In some embodiments, the first supplementary control model is obtained by training the global migration model using the first sample set, specifically comprising: training the global migration model using the first sample set until the third deviation is less than a second threshold, the third deviation being a deviation between a predicted deviation obtained by inputting the first data into the global migration model to obtain the global migration model output and the first deviation in the first sample set.
[0036] In some embodiments, after deploying the first supplementary control model to the first end controller, the method further comprises: sending a first enabling signal to the first end controller.
[0037] In some embodiments, the condition for sending the first enabling signal to the first end controller comprises: a difference between a predicted first deviation obtained by inputting the first data into the first supplementary control model by the first end controller and the first deviation in the first sample set being less than a third threshold.
[0038] In some embodiments, the first local modeling device is integrated in the central modeling device.
[0039] Fourthly, this application provides a microgrid control method applied to a first end controller in a microgrid control system. The microgrid control system includes a central modeling device, N local modeling devices, N end controllers, and N microgrids. The central modeling device and the local modeling devices are connected by communication. The N local modeling devices include a first local modeling device. The first end controller belongs to the N end controllers. The N microgrids include a first microgrid. The first local modeling device and the first end controller are connected by communication. The first end controller and the first microgrid are connected by communication. The microgrid includes one or more local controllers for distributed energy resources. N is a positive integer. The method includes: receiving a first... The first supplementary control model is deployed by the local modeling equipment. This first supplementary control model is obtained by training a global transfer model using a first sample set. The parameters of the first x layers of the neural network in the global transfer model and the first supplementary control model are the same, while the parameters of the subsequent layers are different. The parameters of the neural networks include weights and biases. The first sample set includes multiple first training samples, which include first data and corresponding second data. The first data describes the actual state data of the first microgrid at time t, or the actual state data of the first microgrid at time t and the control signal received at time t-1. The second data indicates the first deviation Δx. t First deviation Δx t The deviation between the actual state data of the first microgrid at time t and the first expected state data at time t calculated based on the linear model of the first microgrid; obtain the actual state data x of the first microgrid at time n. n Or the actual state data x at time n n and the control signal u at time n-1 n-1 The first deviation Δx at time n is calculated by inputting the first supplementary control model. n ; Using Δx n The linear model determines the control signal u at time n. n and using u n The first microgrid is controlled, and the actual state data x of the first microgrid at time n+1 is obtained. n+1 The second expected state data x of the first microgrid at time n+1 n+1 The deviation between the two values is less than the first threshold, and the second predicted state data x n+1 'To utilize Δx n The data was adjusted based on the first expected state data.
[0040] In the method provided by the fourth aspect, after receiving the supplementary control model deployed by the first local modeling device (i.e., the cloud agent), the online controller (i.e., the first end controller) can obtain the state data of the first microgrid at time n, or the state data at time n and the control signal received at time n-1, and input the obtained data into the supplementary control model as the input of the supplementary control model, and output the obtained supplementary deviation (i.e., the first deviation) for compensating the control of the physical model, so as to improve the accuracy and interpretability of the microgrid control while ensuring the stability of the microgrid control.
[0041] In combination with the fourth aspect, in some embodiments, the actual state data x n of the first microgrid at time n is obtained, or the actual state data x n at time n and the control signal u n-1 at time n-1 are obtained, and the first deviation Δx n at time n is calculated by inputting the first supplementary control model.
[0042] In combination with the fourth aspect, in some embodiments, the condition of the received first enabling signal includes that the difference between the predicted first deviation obtained by inputting the first data into the first supplementary control model and the first deviation in the first sample set is less than a third threshold.
[0043] It can be understood that the method applied to the central modeling device provided by the second aspect, the method applied to the first local modeling device provided by the third aspect, and the method applied to the first end controller provided by the fourth aspect correspond to the system method provided by the first aspect, and thus the beneficial effects achieved thereby can refer to the beneficial effects of the first aspect, which will not be described herein again.
[0044] In the fifth aspect, the present application provides a microgrid control system, which includes a central modeling device, N local modeling devices, N end controllers, and N microgrids, wherein the central modeling device and the local modeling devices are in communication connection, the N local modeling devices include a first local modeling device, the N end controllers include a first end controller, the N microgrids include a first microgrid, the first local modeling device and the first end controller are in communication connection, the first end controller and the first microgrid are in communication connection, each microgrid includes one or more local controllers of distributed energy sources, and N is a positive integer; the central modeling device performs the method described in the second aspect and any possible implementation manner of the second aspect; the first local modeling device performs the method described in the third aspect and any possible implementation manner of the third aspect; and the first end controller performs the method described in the fourth aspect and any possible implementation manner of the fourth aspect.
[0045] In a sixth aspect, the present application provides an electronic device, comprising one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, and the one or more memories are configured to store computer program codes, the computer program codes comprising computer instructions, which, when executed by the one or more processors, cause the execution of the method according to the second aspect and any possible implementation manner of the second aspect, the method according to the third aspect and any possible implementation manner of the third aspect, or the method according to the fourth aspect and any possible implementation manner of the fourth aspect.
[0046] In a seventh aspect, the present application provides a computer readable storage medium, comprising computer executable programs, which, when executed on an electronic device, cause the electronic device to execute the method according to the second aspect and any possible implementation manner of the second aspect, the method according to the third aspect and any possible implementation manner of the third aspect, or the method according to the fourth aspect and any possible implementation manner of the fourth aspect.
[0047] In an eighth aspect, the present application provides a computer program product, comprising computer programs, which, when executed by a processor, implement the method according to the second aspect and any possible implementation manner of the second aspect, the method according to the third aspect and any possible implementation manner of the third aspect, or the method according to the fourth aspect and any possible implementation manner of the fourth aspect.
[0048] It can be understood that the microgrid control system provided in the fifth aspect, the electronic device provided in the sixth aspect, the computer storage medium provided in the seventh aspect, and the computer program product provided in the eighth aspect are all used to execute the method provided in the present application. Therefore, the beneficial effects achieved thereby can refer to the beneficial effects in the corresponding method, which will not be described here again. BRIEF DESCRIPTION OF DRAWINGS
[0049] Figure 1 is a system architecture schematic diagram of a microgrid control based on federated learning and transfer learning provided by an embodiment of the present application;
[0050] Figure 2 is a flowchart of cloud agent transfer learning provided by an embodiment of the present application;
[0051] Figure 3 is a structural schematic diagram of a supplementary control model provided by an embodiment of the present application;
[0052] Figure 4 is a structural schematic diagram of an electronic device 100 provided by an embodiment of the present application. DETAILED DESCRIPTION
[0053] The terminology used in the embodiments of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the present application.
[0054] A microgrid system is a distributed energy system, which is composed of one or more distributed energy resources (DERs), energy storage devices, and load devices, forming a relatively independent power network. The above-mentioned distributed energy resources include, but are not limited to, renewable energy such as solar energy and wind energy. The power network can realize power generation, transmission, storage, and consumption in a small range, and can be interconnected with a traditional power grid system or disconnected to form an independently operated power system. The operation and control of the above-mentioned microgrid system rely on a microgrid control system, which can include one or more control devices, through real-time detection, management, and optimization of energy generation, consumption, and storage, so as to realize efficient use, reliable supply, and economy of energy.
[0055] However, with the increase in the number of DERs in the microgrid, the uncertainty, nonlinearity, and complexity of the microgrid system also greatly increase, making it difficult for the microgrid system to accurately predict and control future situations. Among them, the nonlinearity of the microgrid system refers to the characteristics that the dynamic characteristics, energy transmission, and control response of the microgrid system during operation cannot be directly described by linear equations or linear models. Although the operation and control of the traditional power grid has accumulated a lot of experience, due to the great difference between the microgrid and the traditional power grid, the methods and experiences of the operation and control of the traditional power grid are difficult to apply to the microgrid. In addition, different microgrids differ greatly from each other due to their different compositions, further reducing the efficiency of the design and deployment of the microgrid control system.
[0056] In microgrid control, the traditional data-driven microgrid control method refers to directly building a model for control decision-making using a large amount of data. For example, the microgrid control system can use machine learning to analyze and learn a large amount of historical data, find rules and patterns, and achieve control and optimization of the microgrid system. It can be understood that the traditional data-driven microgrid control method is isolated, and the isolated microgrid control model is trained based on a specific task or data set, and there is no correlation between the control models before and after the change of the microgrid. Therefore, when the dynamic characteristics of the microgrid system change, a large amount of data needs to be used to retrain the model, resulting in low training efficiency and insufficient generalization ability of the model. The above-mentioned generalization ability refers to the ability of the model to correctly predict or classify when facing new, unseen data. It can be understood that a model with good generalization ability means that it can make accurate inferences and predictions for different but similar data, thereby achieving accurate control of the microgrid system.
[0057] In view of the above problems of the traditional data-driven microgrid control method, the embodiments of the present application provide a microgrid control method, which realizes microgrid control based on a method of transfer learning.
[0058] The transfer learning refers to fine-tuning a pre-trained model in a task, so that the fine-tuned model can be applied to different related tasks. The pre-training refers to an initial training method on a large-scale data set, which aims to provide a good pre-training model for subsequent tasks, also known as a global transfer model. The fine-tuning refers to adjusting the parameters (such as weights and biases) of the global transfer model so that the adjusted model can adapt to new tasks or new data sets.
[0059] When the transfer learning is applied to the field of microgrid control, the central computer / cloud can make the global transfer model obtain general microgrid feature extraction ability through pre-training, then the central computer / cloud can collect state data provided by each microgrid under its control, fine-tune the pre-trained global transfer model to obtain a control model of the corresponding microgrid according to the state data, and then deploy the fine-tuned control model to the controller of the corresponding microgrid. The controller of the corresponding microgrid can calculate the corresponding control signal by using the control model and realize the control of the microgrid by using the control signal, thereby improving the efficiency of learning and deploying the control model and the generalization ability of the control model. It can be understood that, by using the method of transfer learning, the microgrid system can use the knowledge in the previously trained global transfer model to train a new control model, thereby improving the training efficiency of the control model. The knowledge includes but is not limited to the following aspects: model structure, model parameter setting, effective feature representation method, etc. And because of the pre-training step in the transfer learning, the method can also cope with the problem of small amount of data when the dynamic characteristics of the microgrid change.
[0060] Although the method of transfer learning can be applied to the field of microgrid control, the existing transfer learning methods still have the following problems when applied:
[0061] 1. Poor interpretability and insufficient generalization ability: The existing transfer learning method is usually based on a black-box machine learning, that is, learning data features by a large amount of data without considering the physical characteristics of the actual power system, so the method lacks interpretability, thereby leading to insufficient generalization ability, and the control effect on new situations in the microgrid system may not be as expected.
[0062] 2. Insufficient flexibility: The existing transfer learning method usually collects all the data of the microgrid managed by the microgrid control system (i.e., global data) to the central computer / cloud to perform the above transfer learning, and then deploys the trained control model to the corresponding microgrid controller. Due to the diversity and variability of the microgrid, when the microgrid system changes, the central computer / cloud needs to collect global data to train a global transfer model, and then fine-tune to obtain a new model for each microgrid, which reduces the control efficiency and privacy of the microgrid control system when the microgrid system changes, thereby limiting the flexible expansion of the microgrid system under the microgrid control system.
[0063] The microgrid control method provided by the embodiments of the present application further combines the framework and mechanism of transfer learning on the basis of traditional physical model-based control, so that the supplementary control model obtained by transfer learning can supplement and correct the deviation of the physical model in the microgrid control process, thereby solving the problem of insufficient accuracy of the control model and realizing accurate and efficient modeling and regulation. In addition, the microgrid control method provided by the embodiments of the present application also adopts a microgrid control framework based on transfer learning and federated learning, thereby realizing flexible modeling for off-site multi-type microgrid control, reducing the design requirements and deployment cost of the microgrid control system, and improving the flexible expansion of the microgrid control method.
[0064] In the embodiments of the present application, the federated learning is used to indicate that the global transfer model is integrated by a plurality of supplementary control models trained by a plurality of model training devices (such as cloud agents), rather than being retrained by a large amount of historical data of each microgrid.
[0065] Specifically, the microgrid control method can be divided into two stages of modeling deployment and control. In the modeling deployment stage, the modeling device in the microgrid control system can train a supplementary control model adapted to the existing physical model of each microgrid by using the global transfer model and the related data of the microgrid system, and deploy it to the online controller, while the global transfer model in the central computer / cloud can be updated and iterated by using the trained supplementary control model. In the control stage, the supplementary control model can be activated, and the activated supplementary control model can correct the deviation of the traditional physical model in the microgrid control process, thereby calculating the control signal at this moment and controlling the microgrid system by using the control signal, thereby realizing stable operation and optimal control of the microgrid system.
[0066] Next, the microgrid control method provided by the embodiments of the present application will be described in detail from the modeling deployment stage.
[0067] Figure 1 is a system architecture schematic diagram of microgrid control based on federated learning and transfer learning provided by an embodiment of the present application.
[0068] As shown in Figure 1 , the microgrid control system adopts a hierarchical structure, and from bottom to top are N microgrid systems (which can also be referred to as microgrids), N online controllers and a central cloud, where N is a positive integer. The microgrid system can include one or more local controllers of DERs. The local controller of the DER can be used for primary control, i.e., real-time detection, control and protection of the DER locally to maintain the frequency and voltage of the DER within a reasonable range and ensure stable operation of the DER, thereby providing support for stable operation of the entire microgrid system.
[0069] The online controller can be used for secondary control, i.e., a control device used for monitoring, controlling and managing the microgrid control process in an actual microgrid control scenario, responsible for stable control at the microgrid system level. It can be understood that the primary control is a differential control, so that there is still a steady-state voltage deviation after primary control; and due to the influence of line impedance, it is difficult for the local controller of the DER to achieve accurate power distribution in primary control. Therefore, the secondary control refers to that the online controller can be used to compensate for the voltage and frequency deviation caused by the primary control and restore the synchronization of voltage and frequency, and can also be used to assume the function of seamless access or exit of the DER to the power grid. Optionally, the online controller can be carried on an online control device, such as a programmable logic controller (PLC) or an industrial computer. Optionally, the online controller can be outside the microgrid system as shown in Figure 1 . In some embodiments, the online controller can also be located inside the microgrid system, and the embodiments of the present application do not specially limit the location of the online controller. The online controller is also referred to as an end controller.
[0070] The central cloud can be used for tertiary control, responsible for managing the optimal operation of the microgrid, including economic scheduling, such as output planning of DERs within the entire microgrid, load forecasting, and the like, thereby globally optimizing the operation of the multi-microgrid system. The central cloud can include a model integration module and one or more cloud agents. The model integration module is used to collect supplementary control models of various microgrids and perform federated learning to obtain a unified global transfer model. The cloud agent can include a model learning module, a data collection module, and a model evaluation module. The data collection module can be used to collect and store historical data from online controllers or simulation data generated by simulation software. The model learning module can be used to train the global transfer model based on the data collected and stored by the data collection module, including historical data and simulation data, to obtain a supplementary control model for a specific microgrid system. The model evaluation module is used to evaluate the feasibility of the supplementary control model in the online controller, so as to realize the selective addition of the supplementary control model to the final microgrid control model for control. In addition, the central cloud can also have the function of parallel computing, so that when there are multiple cloud agents in the central cloud, the central cloud can support the parallel processing of data of multiple cloud agents, thereby improving the overall computing performance and processing efficiency of the system.
[0071] It can be understood that the multiple cloud agents described above can also be deployed on independent servers, and the device where the cloud agent is located can also be referred to as a local modeling device. The central cloud can also be replaced by a central computer containing the model integration module, and the device where the model integration module is located can also be referred to as a central modeling device. The end controller in the N end controllers can be referred to as a first end controller, and the control model deployed to the first end controller in the method is also referred to as a first supplementary model. The device where the cloud agent connected to the first end controller is located can also be referred to as a first local modeling device, and the microgrid connected to the first end controller can also be referred to as a first microgrid. The first local modeling device belongs to the N local modeling devices, and the first microgrid belongs to the N microgrids. For convenience of description, the cloud agent structure shown in the following Figure 1 will be taken as an example to illustrate the scheme.
[0072] The method of the embodiments of the present application can be applied to the secondary control and tertiary control of the microgrid control system. In the above control, the modeling and deployment stage can also be divided into two sub-stages: the first sub-stage is cloud-based federated transfer pre-learning, and the second sub-stage is cloud agent transfer learning.
[0073] First, the first sub-stage: cloud-based federated transfer pre-learning. In this stage, the model integration module in the central cloud can use the federated learning method to aggregate the distributed learning models to obtain a global transfer model.
[0074] like Figure 1 As shown, the structure of the microgrid control system mainly involved in this stage includes a model integration module in the central cloud and multiple cloud agents (e.g., cloud agent 1 and cloud agent 2). Specifically, when the model integration module first needs to deploy the global transfer model to each cloud agent, the global transfer model can be an initialized model. In some embodiments, the parameters in the initialized model can be set by developers based on experience. In some embodiments, the parameters in the initialized model can be obtained through pre-training. For example, the model integration module can use the system data of each microgrid system in the current microgrid control system to pre-train the initialized global transfer model. The system data includes the state data of the microgrid system at time t and the state deviation at time t, or the state data at time t, the control signal received by the microgrid system at time t-1, and the state deviation at time t. The system data of each microgrid system used to train the initialized global transfer model can also be called the second sample set. In this context, the state data of a microgrid system at time t, or the state data of the microgrid at time t and the control signal received by the microgrid system at time t-1, can be referred to as the third data. The output of the global transfer model, i.e., the state deviation at time t, is also referred to as the second deviation or the fourth data corresponding to the third data. Optionally, the pre-training can be configured to train a fixed number of rounds using the system data to obtain an initialized global transfer model. Optionally, the pre-training can be configured to be completed when the global transfer model converges, i.e., when the loss function of the global transfer model reaches its minimum value. This loss function can be referred to the loss function of the control model supplemented below, and will not be repeated here. The electronic device used for pre-training the global transfer model is not limited to the model integration module; it can also be other electronic devices with training model computing power. This application embodiment does not impose special restrictions on the electronic device used for pre-training the global transfer model or the specific pre-training process.
[0075] In addition, the aforementioned model integration module is used to perform the cloud-based federated migration pre-learning. Specifically, the global migration model deployed by the model integration module to each cloud agent is obtained by integrating the supplementary control models learned by the model learning modules in each cloud agent. After completing the training of the supplementary control models, each participant (e.g., the cloud agents corresponding to each microgrid system) can upload the trained supplementary control models to the model integration module in the central cloud. It is understood that uploading these supplementary control models only uploads the model parameters and does not include the historical or simulation data used to train the supplementary control models. How these supplementary control models are specifically trained will be explained in detail in the subsequent second sub-phase scheme introduction, and will not be elaborated here.
[0076] For example, Figure 1The cloud agent 1 and the cloud agent 2 in the cloud center respectively perform training of the supplementary control model, and obtain parameters of the supplementary control model. The parameters can be represented as a set of parameter data, including weights and biases between neurons in the model. The above parameter data is also referred to as parameters of the neural network. When the model learning module in the cloud agent 1 completes the training of the supplementary control model of the microgrid system 1, the cloud agent 1 can send the above parameter data (i.e., the parameter data of the control model corresponding to the microgrid system 1) to the model integration module. The parameters of the neural network sent by the first local modeling device can be referred to as first parameters. The above first parameters can include parameters of the multi-layer neural network after the x layer of the first supplementary control model, or can include parameters of the neural network of each layer in the model. After receiving the above parameter data, the model integration module can store the parameter data of the supplementary control model corresponding to the microgrid system 1. Similarly, the model integration module can obtain the parameter data of the supplementary control model corresponding to the microgrid system 2 through the above process. Subsequently, the model integration module can integrate and optimize the parameter data of each supplementary control model received by using a federated averaging algorithm to generate a global migration model. Specifically, the model integration module can update the parameters of the global migration model by performing weighted averaging on the parameter data of each supplementary control model. It can be understood that, since the supplementary control model is obtained by adjusting the global migration model, the global migration model and the supplementary control model have the same model structure, and therefore the global migration model can be updated in the above federated learning manner. Moreover, since the parameters of each supplementary control model are trained and iteratively updated in the model learning module of the cloud agent, the global migration model obtained by using the parameter data of each supplementary control model through the federated learning algorithm (for example, the weighted averaging manner in the above example) can also be considered to gradually converge to a better solution in the above iterative updating process, that is, the global migration model has learned the common features (i.e., the transferable knowledge) between the data of different microgrid systems, and these common features can help the global migration model to better generalize or migrate to a new microgrid system to form a supplementary control model corresponding to the microgrid system. Compared with the global migration model before updating, the global migration model after updating has higher similarity with the parameters of the multi-layer neural network after the x layer of the supplementary control model. Without limitation to the federated averaging algorithm, other algorithms capable of integrating and optimizing the parameter data of each supplementary control model can also be used in the model integration module, and the application embodiments do not specially limit the algorithm used in the integration and optimization process.
[0077] In some embodiments, the model integration module can perform the cloud federated transfer pre-training described above after detecting that the model learning module in each cloud agent trains a corresponding supplementary control model (i.e., after the supplementary control model trained by the model learning module in the cloud agent changes). In some embodiments, the model integration module can also collect the supplementary control model trained by the model learning module in each cloud agent at a certain frequency. The present embodiments do not make special restrictions on when the model integration module performs the cloud federated transfer pre-training described above.
[0078] So far, the model integration module can obtain a global transfer model by integrating the supplementary control models trained by each cloud agent, so that it is not necessary to collect the historical data or simulation data of each microgrid system again, and retrain a global transfer model based on the historical data or simulation data, thereby improving the modeling efficiency. Moreover, the cloud federated transfer pre-training can be used to quickly deploy the global transfer model when the microgrid system managed by the microgrid control system changes, for example, when a new microgrid system is added, without interference between the microgrid systems, thereby improving the flexible expansion of the microgrid control system.
[0079] After the model integration module obtains the updated global transfer model, it enters a second sub-phase: cloud agent transfer learning. In this phase, the model integration module can deploy the global transfer model to the model learning module of each cloud agent. Each cloud agent corresponds to a single microgrid system, and the cloud agent can adjust the global transfer model to obtain a supplementary control model for the corresponding microgrid system, and then deploy the supplementary control model to the online controller corresponding to the microgrid system.
[0080] Figure 2 is a flowchart of a cloud agent transfer learning provided by the present embodiments.
[0081] S101, the data collection module can collect data of the microgrid system and send the collected data to the model learning module.
[0082] The data collected by the aforementioned data collection module is the system data of the microgrid system, which may include the actual state data at time t (i.e., actual state data), the state data deviation at time t, and the control signal at time t-1. The aforementioned state data deviation refers to the deviation between the actual state data of the microgrid system at time t and the expected state data at time t calculated using the physical model. The expected state data at time t calculated using the physical model is also called the first expected state data at time t. The system data of the microgrid system is also called the first sample set. The actual state data at time t, or the actual state data of the first microgrid at time t and the control signal received at time t-1, is also called the first data; the aforementioned state data deviation at time t is also called the first deviation Δx at time t. t Δx t This can also be referred to as the second data corresponding to the first data. The above physical model is also called a linear model. The state data of the microgrid system can include output power, voltage, frequency, current, and other data provided by the common connection point of the microgrid system and one or more nodes within the microgrid. The above nodes can include the local control of each DER within the microgrid.
[0083] Specifically, the data collection module can acquire data from the microgrid system it controls from the online controller. For example... Figure 1 As shown, for example, the online controller 1 can collect the status data output by the microgrid system 1. The online controller can obtain the status data of the microgrid system from the aforementioned nodes and common connection points, and can also obtain it from the data acquisition modules (e.g., various sensors) within the microgrid system. This embodiment does not impose any special restrictions on the source of the microgrid system's status data. After the online controller 1 obtains the status data of the microgrid system 1, the data collection module of the cloud agent 1 can obtain the system data of the microgrid system 1 from the online controller 1.
[0084] In some embodiments, the data collection module of the cloud agent 1 can obtain several data samples of the microgrid system 1 from the online controller 1, wherein the data sample at time k can include the actual state data at time k, the control signal output by the online controller 1 at time k-1. Subsequently, the data collection module can calculate the expected state data at time k based on the physical model according to the state data at time k-1, and then calculate the state data deviation at time k in combination with the actual measured state data at time k, to further constitute the corresponding system data of the microgrid system 1. The above-mentioned system data actually obtained from the microgrid system 1 is also referred to as historical data. It can be understood that, since the expected state data at time k is calculated by the data collection module, in this embodiment, the data collection module needs to be pre-embedded with a physical model for controlling the microgrid system 1. In some embodiments, the data collection module of the cloud agent 1 can directly obtain the corresponding system data of the microgrid system 1 from the online controller 1, i.e., directly obtain the actual state data at time k, the state data deviation at time k and the control signal at time k-1. In this embodiment, the state data deviation at time k is calculated by the online controller 1 according to the actual state data at time k and the expected state data at time k, and the expected state data at time k is calculated by the online controller 1 based on the physical model according to the state data at time k-1. It can be understood that, in the above two implementation manners, the system data (also referred to as historical data) finally collected by the data collection module is the same, but the calculation of the state data deviation in the process can be performed by the data collection module or by the online controller 1, and the embodiments of the present application do not make special limitations thereon.
[0085] As to how the data collection module obtains the historical data from the online controller, optionally, the online controller can set the frequency of sending the system data to the above-mentioned data collection module. For example, the system data of the current microgrid system is sent to the data collection module every 1 millisecond. Optionally, the above-mentioned data collection module can obtain the system data of the current microgrid system through communication with the online controller. For example, the data collection module can send a request for collecting data to the online controller, and the online controller can send the system data of the corresponding microgrid system to the data collection module after receiving the request. The embodiments of the present application do not make special limitations on the manner in which the data collection module obtains the system data of the current microgrid system from the online controller.
[0086] Since the system data collected by the data collection module is used for training the supplementary control model subsequently, and the supplementary control model obtained by training can be used for federated learning in the first sub-stage to update the global migration model, in some embodiments, the data collection module can be configured to collect data of the same dimension, which means that the data collection module acquires system data of the microgrid system from nodes of the same number. For example, the data collection module can collect data only from the most important one or more (e.g., 5) nodes or public connection points in the microgrid system, ensuring the consistency of the system data provided by different microgrid systems in terms of dimension, and thus enabling the supplementary control model obtained by training to be used for subsequent federated learning. In the above example, the data collection module can specifically acquire the data from which nodes when the microgrid is controlled based on the physical model. The nodes from which the data is collected can be determined by actually detecting the data of each node when the microgrid is controlled based on the physical model, and thus determining which nodes are more important; or can be specified by the developer based on experience. The embodiments of the present application do not make special limitations on how the data source nodes of the system data of the microgrid system are specifically determined.
[0087] It can be understood that the data collection module in the cloud agent needs to meet certain conditions to acquire the system data of the microgrid system from the online controller, i.e., the cloud agent and the online controller can communicate with each other. In other words, if the communication between the online controller and the cloud agent is disconnected, the data collection module cannot complete the collection of the actual data of the microgrid system. Therefore, in addition to acquiring the actual system data from the microgrid system, the data collection module can also acquire simulation data from the simulation software to replace the actual system data acquired from the microgrid system. The data format and content of the simulation data are the same as those of the actual acquired historical data, and only the specific data of the system data is different.
[0088] Specifically, the central cloud can include simulation software capable of simulating the operation state of the microgrid system. The central cloud can establish a simulation model of the microgrid system in the simulation software. The simulation model can include one or more DERs, local controllers of the DERs, and other devices in the microgrid system, and online controllers for secondary control, etc. By setting the parameters of the microgrid system and inputting the operating conditions, the simulation software can use simulation algorithms to simulate the operation of the microgrid system under different operating conditions, for example, it can simulate the operation of the microgrid system under sunny or cloudy days (especially for photovoltaic power generation equipment in the DER). Thus, the microgrid operation results similar to the actual microgrid system are obtained. The above-mentioned microgrid operation results can include state data output by the microgrid system. The above-mentioned setting parameters can include setting the parameters of each component in the microgrid system, including the rated power of each device in each DER, for example, the rated power setting of the wind turbine. These parameters can be obtained by actual measurement or set according to the specifications of the equipment. The above-mentioned input operating conditions can include external conditions when the microgrid system is operating. As an example, the microgrid system includes a wind turbine, and the input conditions at this time should include the environmental wind speed. It can be understood that since the simulation data is obtained by first establishing a simulation model of the microgrid system in the simulation software, the simulation software needs to obtain certain data of the microgrid system to be modeled as the basis for modeling. These data include the parameters and characteristics of the components of the microgrid system. The embodiments of the present application do not make special restrictions on the way the simulation software obtains the data required for establishing the simulation model.
[0089] It can be understood that in addition to obtaining sufficient data for subsequent model learning when the communication between the online controller and the cloud agent is disconnected, using simulation data also enables a new microgrid system to access the control system without having a large amount of actual data. The simulation data can be used to learn and obtain a supplementary control model, thereby improving the efficiency of microgrid system control.
[0090] S102, the model integration module can deploy the global migration model to the model learning module.
[0091] The global migration model is provided by the first sub-stage (i.e., cloud-based federated migration pre-learning), or the global migration model is an initialized control model. The above-mentioned deployment refers to sending the control algorithm, equation or logic corresponding to the model to the corresponding module or device.
[0092] In some embodiments, the model integration module can immediately deploy the updated global migration model downward after the global migration model is updated. In some embodiments, the model integration module can deploy the global migration model downward at a certain frequency. The embodiments of the present application do not make special restrictions on when the model integration module deploys the global migration model downward.
[0093] S103, the model learning module can train the supplementary control model of the microgrid system based on the global transfer model and the historical data or simulation data of the microgrid system.
[0094] When the model learning module in the cloud agent receives the historical data or simulation data sent by the data collection module, and at this time the model learning module receives the global transfer model deployed by the model integration module, the model learning module can train the supplementary control model.
[0095] Figure 3 is a structural diagram of a supplementary control model provided by an embodiment of the present application, which is Figure 1 an expansion of the dashed box part in the online controller.
[0096] As Figure 3 shown, the structure of the supplementary control model can include a transferable knowledge extraction layer and an adaptive adjustment layer, and each of the two layers is composed of multiple layers of nonlinear perceptrons. It can be understood that since the supplementary control model of each microgrid system can be adjusted by the model learning module according to the global transfer model, the model structure of the supplementary control model trained in each model learning module is the same as the model structure of the model deployed in the online controller and the model structure of the global transfer model. It can be understood that for the supplementary control models of different microgrid systems, the transferable knowledge extraction layer in the above structure can be determined through the training of the first sub-stage (i.e. the structure of the transferable knowledge extraction layer is the same for the supplementary control models of different microgrid systems), and the model learning module can adjust the parameters of the adaptive adjustment layer for each microgrid system by training the historical data or simulation data of each microgrid system.
[0097] The process of training the supplementary control model by the model learning module using the global transfer model and the historical data / simulation data can be divided into two steps. First, the model learning module in the cloud agent can input the actual state data x k at time k or the actual state data x k at time k and the control signal u k-1 at time k-1 to the transferable knowledge extraction layer of the global transfer model issued by the model integration module, and output the first feature data at time k. The first feature data at time k can be combined with the deviation of the state data at time k in the system data to form a training sample in the first feature data set. Second, the model learning module can train the adaptive adjustment layer in the global transfer model using multiple training samples in the first feature data set. The transferable knowledge extraction layer and the trained adaptive adjustment layer can constitute the supplementary control model of the corresponding microgrid system. For example, the actual state data x k, or the actual state data x k at the k-1 time point k-1 is input into the transferable knowledge extraction layer, and the first feature data at the k time point is output. Subsequently, the first feature data at the k time point is input into the adaptive adjustment layer, and the predicted state deviation Δx k ′ at the k time point is output. The Δx k ′ is also referred to as the third deviation. The Δx k ′ can be used to compensate for the deviation caused by the physical model-based control of the microgrid system. It can be understood that, due to the model accuracy, random interference received by the microgrid system, and the like, there can still be a deviation between the predicted state deviation Δx k ′ and the actual state data deviation Δx k at the k time point. Therefore, although the Δx k ′ can be used to compensate for the deviation caused by the physical model-based control of the microgrid system, the compensation does not guarantee that the result expected by the control model is exactly the same as the actual operation result of the microgrid system.
[0098] Specifically, the model learning module can introduce a loss function to measure the accuracy of the model during the above-mentioned supplementary control model training process. The loss function can be calculated according to the predicted state deviation Δx k ′ that needs to be compensated and the actual state data deviation Δx k at the time point in the historical data or simulation data. For example, the loss function can be the absolute value of the difference between Δx k ′ and Δx k . Without limitation, the specific formula of the loss function is not specially limited in the present application, but the loss function can be used to represent the degree of deviation between Δx k ′ and Δx k . The model learning module can adjust the parameters in the adaptive adjustment layer according to the value of the loss function, for example, adjust the settings of the weights and biases in the adaptive adjustment layer. Optionally, the model learning module can use the stochastic gradient descent method to adjust the parameters in the adaptive adjustment layer. Without limitation to the stochastic gradient descent method, other algorithms that can be used to adjust the parameters in the adaptive adjustment layer can also be used in the method provided in the embodiments of the present application, for example, the adaptive moment estimation (ADAM) algorithm, and the algorithm for adjusting the parameters in the adaptive adjustment layer is not specially limited in the embodiments of the present application.
[0099] In some embodiments, the model learning module can consider that the adaptive adjustment layer has been trained when the value of the loss function is less than a second threshold. The specific value of the second threshold can be set by the developer empirically. In other embodiments, the model learning module can consider that the adaptive adjustment layer has been trained when the loss function converges, i.e., the deviation between the state deviation Δx k predicted by the supplementary control model and the actual state data deviation Δx k is the smallest. In both implementations, the supplementary control model finally obtained for the corresponding microgrid system can include the transferable knowledge extraction layer and the trained adaptive adjustment layer. Compared with the method provided in the above embodiment, the supplementary control model obtained by the method provided in this embodiment has higher accuracy, thereby resulting in better control effect when the microgrid control is finally performed in cooperation with the physical model.
[0100] Figure 3 The structure of the supplementary control model also includes a part of an output signal switch for activating the supplementary control model, the details of which will be described later, which will not be expanded here.
[0101] S104, the model learning module can deploy the trained supplementary control model to the online controller.
[0102] In some embodiments, the model learning module can deploy the supplementary control model to the online controller immediately after the training of the supplementary control model is completed, i.e., after the training of the new supplementary control model is completed, the new supplementary control model is used to replace the original supplementary control model.
[0103] In some embodiments, the trained supplementary control model can be stored in the model learning module first, and then the model learning module deploys the newly trained supplementary control model to the online controller when the accuracy of the supplementary control model previously deployed to the online controller is insufficient. The insufficient accuracy of the supplementary control model refers to the insufficient compensation ability of the supplementary model for the physical model, i.e., the expected state deviation Δx k calculated based on the supplementary control model and the actual state data deviation Δx kthe deviation of the home is still greater than the third threshold. Optionally, the accuracy of the supplementary control model can be measured by using the same loss function as in the training. The third threshold can be set by the developer empirically. The judgment of whether the accuracy of the supplementary control model is insufficient can be performed by the model evaluation module in the cloud agent. When the accuracy of the supplementary control model is sufficient, the model evaluation module can send an effective enable signal (for example, the enable signal is set to True or the enable signal is set to 1) to the online controller to enable the supplementary control model, that is, to ensure that the supplementary control model is effective. The effective enable signal is also referred to as the first enable signal. Specifically, the enable signal is an output signal switch sent to the supplementary control model, which will be described in detail in the subsequent control stage. It can be understood that since the supplementary control model must be in an effective state before the model evaluation module can judge whether its accuracy is sufficient, the enable signal can be set to an effective state by default when the model learning module deploys the supplementary control model to the online controller. For example, during the process of deploying the supplementary control model to the online controller, the model learning module can first send a notification information to the model evaluation module, which indicates that the model evaluation module sets the enable signal to an effective state.
[0104] At this point, the modeling and deployment stage has been completed, and the control stage is entered. After the supplementary control model is deployed to the online controller, the online controller can generate the control signal at this moment according to the physical model and the supplementary control model thereon.
[0105] It can be understood that the supplementary control model is not necessarily effective during the process of generating the control signal by the online controller. Whether the supplementary control model is effective depends on the enable signal output by the model evaluation module. Specifically, the sufficient and necessary condition for the effectiveness of the supplementary control model is to receive the effective enable signal sent by the model evaluation module, for example, the enable signal is set to True or the enable signal is set to 1. In other words, when the model evaluation module sends an invalid enable signal (for example, the enable signal is set to False or the enable signal is set to 0) to the supplementary control model, or the communication connection between the cloud agent and the online controller is disconnected, causing the supplementary control model to fail to receive the enable signal within the last first time range, the supplementary control model is invalid, and the supplementary control model exits the microgrid control loop.
[0106] Specifically, as Figure 3As shown, the model structure of the supplementary control model can also include an output signal switch. This output signal switch can be added by the online controller after the adaptive adjustment layer of the supplementary control model issued by the model learning module. The model evaluation module can send the enable signal to the output signal switch. For example, the output signal switch can be an AND gate hardware structure. If the enable signal is set to True or 1 at this time, the output of the original supplementary control model and the enable signal are ANDed through the output signal switch, and the expected state deviation Δx to be compensated is output as usual. k If the enable signal is set to False or 0 at this time, regardless of the output of the original supplementary control model, the output state deviation after the enable signal is ANDed with the above-mentioned output signal switch is 0. Therefore, the invalid state of the above-mentioned supplementary control model can include the supplementary control model outputting 0 after the output signal switch (i.e., a state that does not actually provide compensation for deviation). Not limited to the hardware structure of the AND gate, the above-mentioned output signal switch can also be implemented using software program code. This application embodiment does not impose special restrictions on the specific structure of the output signal switch that allows the supplementary control model to be non-necessarily effective when combined with the enable signal.
[0107] When the supplementary control model is effective, the online controller can generate corresponding control signals based on the physical model and the supplementary control model. For example, the supplementary control model δ can be expressed as:
[0108] δ=g(x j ,y j-1 |j=k,k-1,…)
[0109] Here, the function g is used to represent the state data x at time j. j The control signal u at time j-1 j-1 The supplementary deviation Δx required at time j j The mapping relationship between ' and '. The supplementary deviation Δx mentioned above. j ′ is the deviation value that the supplementary control model predicts needs to compensate for based on the current state data, i.e. Figure 1 The supplementary control model output shown is the supplementary deviation to the microgrid's physical model-based control module. Here, j is a variable that can take values such as k; the following explanation will use j=k as an example. This supplementary deviation can be understood as an increase that corrects or adjusts the state data x at time k+1. k+1 The constant. At this point, the actual control model used in the online controller is the sum of the physical model and the supplementary control model, and its expression can be:
[0110] x k+1 ′=Ax k +Buk +δ
[0111] wherein x k+1 ′ can be used to represent the state data of the microgrid system at k+1 time, which is predicted according to the above formula. x k can be used to represent the actual state data of the microgrid system at k time; u k can be used to represent the control signal output by the online controller at k time, A can be used to represent the state transition matrix of the microgrid system, and B can be used to represent the control matrix. As can be seen from the expression of the above control model, the expression can be divided into two parts, the first part is Ax k +Bu k , which can be the expression of the physical model set in advance in the online controller, and the second part is the supplementary control model δ. The expression of the above physical model can be obtained by machine learning or other methods, or can be set by the developer based on experience, and the embodiments of the present application do not make special limitations on the acquisition method of the expression of the physical model in the online controller. According to the expression of the above control model, the control signal u k at k time can be calculated.
[0112] In some embodiments, the microgrid system has a clear target for the state data at k+1 time (i.e., x k+1 ′ is known), then the online controller can obtain the state data x k at k time, and directly calculate the corresponding control signal u k+1 according to the known x k , δ and the expression of the above control model. k .
[0113] In some embodiments, if the microgrid system does not have a clear target for the state data at k+1 time, the online controller can use an optimization control method to achieve system stability and performance optimization. The above optimization control can be realized by using a linear quadratic regulator (LQR) or a model predictive control (MPC) method. Specifically, the online controller can introduce a cost function J control to measure the performance of the microgrid system, and by minimizing the following cost function J control , the required optimization control can be achieved with the minimum cost. Wherein, the smaller the value of the above cost function, the better the performance of the system. For example, the above cost function can be used to pursue the optimal control of power. In addition, the cost function can also be designed as an index related to the control target to be optimized, including but not limited to system response time, energy consumption, stability, etc. It can be understood that the cost function is highly related to the control target, which can be set in the controller by the developer in advance.
[0114] The following example, using the MPC method for controllers, further illustrates how an online controller determines the final output control signal through a cost function and a control model (including a physical model and a supplementary control model).
[0115] Without constraints, for example, assuming the current time is time 0 (i.e., k = 0), the cost function can be composed of the weighted sum of squares of the state vector and the control signal vector, as shown in the following formula:
[0116]
[0117] Where Q and R are both weighted matrices, with Q representing the weighting of the state data x. k The importance of different states is denoted by R, which represents the importance of the cost of the control input. The state data and control signals mentioned above can be represented in vector form. Continuing the example above, minimizing the cost function is now equivalent to finding:
[0118] minJ control (x k ,u k )
[0119] Understandably, for the purpose of optimal control, the cost function involves observed variables at future times (i.e., times after time 0). Therefore, the dynamic characteristics of the microgrid system need to be considered when solving for the minimum cost function. In this case, the online controller can use the control model (including the physical model and supplementary control model) as a constraint in the process of minimizing the cost function, thereby achieving effective optimization and adjustment of the system state. Based on this constraint, when J... control =minJ control (x k ,u k When ), its corresponding u k To control the optimal control signal for the microgrid system. In other words, the cost function J control (x k ,u k This is manifested in the use of control signal u k When control is implemented, the actual control effect at the next moment (i.e., the state data of the microgrid system) x k+1 The relationship between x and the expected control effect at the next moment calculated using the model k+1 The deviation is ''. Finding the minimum value of the above cost function is equivalent to finding the minimum value of the above deviation, which is the case where the control model most closely approximates the actual system state.
[0120] In some embodiments, the microgrid system imposes certain constraints on state variables and control signals. For example, when the microgrid system is in grid-connected operation mode, the online controller can receive control signals from the main grid, which impose certain constraints on the state variables of the nodes in the microgrid system. As another example, if the upstream controller (e.g., the central controller) sends a control signal to the online controller, requiring the microgrid system to output 100W of power, then the online controller, in further controlling each DER in the microgrid, needs to ensure that the generated control signals conform to the system's state constraints, so that the microgrid system can provide 100W of power after control.
[0121] At this point, the new cost function J control-new It can be composed of the weighted sum of squares of the error vector and the control signal vector. Therefore, when the system state exceeds the constraints, the cost function value increases, thereby driving the controller to avoid exceeding the constraints as much as possible. For example, its formula is as follows:
[0122]
[0123] delta_x k =x real,k -x ref,k
[0124] Among them, delta_x k The reference value x for the state data ref,k and the actual value x of the state data real,k (i.e. x) k The deviation between the observed and unobserved variables can be calculated by the online controller based on the constraints of the state variables to obtain the reference value z of the observed variable. ref,k Q is used here to represent delta_x k The degree of importance given to different states. R is used to represent the weight matrix of the control signal.
[0125] Continuing the example above, when the microgrid system as a whole needs to provide 100W of power, this power can be provided collectively by all DERs in the microgrid. If DER1 in the microgrid system is a control node, then the upper limit of the power provided by DER1 is 100W. In this case, if the online controller wants to control DER1, it can collect the status data x of the microgrid system. real,k Understandably, the aforementioned state data can also be represented as a vector, containing the state data of DER1 and other control nodes. The online controller can then use the formula delta_x... k =x real,k -x ref,k delta_x was calculated k, and then uses the cost function J contro-new to calculate the u k output to the microgrid system. It can be understood that the control signal is also a vector, which contains the control signal of the DER1 when the cost function J contro-new takes the minimum value. The control signals of other control nodes are obtained in the same way, and will not be described here.
[0126] When storing the cost function, preferably, the online controller can only store the cost function when the state variable is constrained. It can be understood that J control can be regarded as a variant of J control-new when z ref,k is zero.
[0127] In some embodiments, in the above control process, the control of the online controller on the microgrid system is not limited to a single variable. It can be understood that the developer can set different Q matrices according to the control needs of the system, so as to appropriately balance the importance between each state variable in the cost function. Thus, the controller can realize control for different state variables, so that the microgrid system as a whole tends to the optimal state under the controlled variable.
[0128] Correspondingly, when the controller uses the LQR method, the setting of the cost function can be different from the above MPC method. Generally, the value of the cost function can be calculated by integration, and the remaining process can refer to the related description of the MPC method above, and will not be described here. The embodiments of the present application do not make special restrictions on the method used by the controller to minimize the cost function.
[0129] Subsequently, the online controller can send the calculated u k to the controller (such as the local controller of the DER) in the microgrid system, so that the controller (such as the local controller of the DER) in the microgrid system can apply the u k to realize optimal control.
[0130] The above optimal control is realized by minimizing the cost function J control . In some embodiments, the online controller can also not find the minimum value of the cost function J control and then find the corresponding control signal, but use the control signal corresponding to when the cost function J control is less than the first threshold value to control. It can be understood that in these embodiments, when the cost function J control is less than the first threshold value, the online controller can consider that the control model has sufficiently reflected the state change of the system, and can use the control signal corresponding to when the cost function J control is less than the first threshold value to control.
[0131] When the supplementary control model is invalid, the online controller can generate the corresponding control signal based on the physical model only. In the above example, at this time, the control model in the online controller is the physical model set in advance, which is expressed as follows:
[0132] x k+1 ′ = Ax k + Bu k
[0133] The same as the process of determining the control signal when the supplementary control model is valid, when the supplementary control model is invalid, if the microgrid system needs to achieve optimal control, the online controller can also use the above cost function to calculate the control signal corresponding to the minimum value of the cost function or the control signal corresponding to the cost function less than the first threshold value u k . At this time, the online controller can take the physical model as a constraint condition in the above solving process, and the specific process can refer to the related description when the supplementary control model is valid, which will not be described here. In some embodiments, if the microgrid system has a clear target for the state data at time k+1 (i.e., x k+1 ′ is known), the online controller can obtain the state data x k at time k, and directly calculate the corresponding control signal u k+1 according to the known x k , x k and the expression of the control model.
[0134] Not limited to the above expression δ = g(x j , u j-1 | j = k, k-1, …), the above supplementary control model can also be obtained only by x j , that is, δ = g(x j | j = k, k-1, …). At this time, correspondingly, the data collected by the data collection module in the above step S101 and the related steps in the step S103 of modeling the supplementary control model and the control phase do not require u k-1 . The remaining process can refer to the related description in the foregoing, which will not be described here.
[0135] In the above description, k is used to represent a certain time, which is used in combination with k-1 or k+1 to explain the adjacent relationship between the times, and does not mean that k in the control process and k in the modeling process are the same value. It can be understood that k in the control phase can also be represented by n, then the state data of the microgrid system at time n is x n , the control signal of the microgrid system at time n determined by using the above state data and the control model is u n , and u n is used to control the microgrid system, then the actual state data of the microgrid system at time n+1 is x n+1At the n+1 moment, the state data at the n moment and the final control model predicted state data (also referred to as second predicted state data) are x n+1 ’. n+1 The deviation between x n+1 ’ should also be less than the first threshold value.
[0136] It can be understood that, since the physical model is established based on in-depth understanding of the physical principles and structure of the microgrid system, and the supplementary control model is obtained based on a data-driven method, in the above control model, the part of the physical model can provide basic guarantee for system stability, and the part of the supplementary control model can guarantee the accuracy of control, so that the overall control model improves the accuracy of control under the premise of guaranteeing the stability of the system. Therefore, using the physical model combined with the supplementary control model to control the microgrid system can have continuous and consistent stability and dynamic characteristics in the case that the microgrid system is subjected to random large disturbances or the online controller is interrupted in communication with the cloud agent. The above stability can be measured by the stability margin of the microgrid system.
[0137] In the actual control process, the motion state equation of the microgrid system 1 can be expressed as:
[0138]
[0139] Where t is used to represent the current moment t, and ξ is used to represent the input of the random variable received by the microgrid system at the current moment. It can be understood that the ξ received by the microgrid system at the t moment will have an impact on the state data at the t+1 moment. Therefore, it can be understood that the control signal u t When the above microgrid system is controlled, the deviation between the actually measured system state at the next moment and the system state at the next moment predicted according to the physical model is composed of two parts: one part is the deviation caused by the insufficient accuracy of the physical model, and the method provided in the embodiment of the present application can compensate for this part of the deviation, thereby improving the accuracy of the control model in the online controller; the other part is the deviation caused by the influence of the above random variable ξ on the microgrid system. Since this part of the deviation is affected by the external environment actually existing in the microgrid and the internal structure of the microgrid, it is difficult to capture the law, therefore, the method provided in the embodiment of the present application and the original control modeling method are both difficult to compensate for the deviation caused by the above random variable ξ. If the above random variable ξ is the deviation caused by the internal structure of the microgrid, such as high-frequency noise caused by the microgrid structure, the online controller can filter out the high-frequency noise by adding a filtering software module or a hardware module, thereby weakening the influence of the above random variable (high-frequency noise in this example) on the output of the microgrid system.
[0140] Figure 4Fig. 1 is a structural schematic diagram of an electronic device 100 provided by an embodiment of the present application. The electronic device 100 can be the central computer / cloud or the online control device (such as PLC and industrial computer, etc. carrying the online controller) described above.
[0141] As shown in Fig. 1, the electronic device 100 includes a processor 211, a memory 212, a communication module 213, a power switch 214, a display screen 215, a sensor module 216 and the like. The components in the electronic device are connected through a bus and communicate based on the bus. Figure 4
[0142] The processor 211 can include one or more processing units, for example: the processor 211 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor and / or a neural network processing unit (NPU) and the like. Different processing units can be independent devices or integrated in one or more processors. The controller can generate operation control signals according to instruction operation codes and timing signals to complete the control of fetching and executing instructions.
[0143] The memory 212 is coupled with the processor 211 and is used to store various software programs and / or groups of instructions. The memory 212 can be used to store computer executable program codes including instructions. The processor 211 executes various functional applications and data processing of the electronic device by running the instructions stored in the memory 212. The memory can also be provided in the processor 211 to store instructions and data.
[0144] The memory 212 can include one or more random access memories (RAMs) and one or more non-volatile memories (NVMs). The random access memory can be directly readable and writable by the processor 211. The random access memory can be used to store executable programs (e.g., machine instructions) of an operating system or other programs that are currently running, and can also be used to store data of users and application programs, etc. The non-volatile memory can also store executable programs and store data of users and application programs, etc. The executable programs and user data stored in the non-volatile memory can be loaded in advance into the random access memory for direct reading and writing by the processor 211.
[0145] Executable program codes and data for implementing the microgrid control method provided by the embodiments of the present application can be stored in the non-volatile memory. In the process of implementing the above microgrid control method, the electronic device can load the executable program codes and data of the non-volatile memory into the random access memory to achieve fast and accurate and adaptive, uninterrupted autonomous co-modeling, thereby improving the efficiency of microgrid control operation.
[0146] The communication function of the electronic device 100 can be implemented through wireless communication processing module 213A, mobile communication processing module 213B, wired communication processing module 213C, etc. in the communication module 213.
[0147] The wireless communication processing module 213A can provide wireless communication solutions including WLAN, such as Wi-Fi, Bluetooth communication, ZigBee communication, NFC communication, infrared communication, UWB communication, etc. In the embodiments of the present application, the online control device can transmit the state information of each device in each microgrid to the data collection module of the cloud agent through the wireless communication module, so as to model the microgrid with a supplementary control model. The online controller can also obtain system data of each microgrid through the wireless communication module, including actual state data, or actual state data and state deviation.
[0148] The mobile communication processing module 213B can include 2G, 3G, 4G, 5G, etc. communication technology, and can realize remote communication of the device, and thus can realize remote monitoring and control of the device. In the embodiments of the present application, the cloud agent and the model integration module can be deployed in the cloud, and the mobile communication processing module 213B in the electronic device can be used to remotely monitor and control subordinate devices (such as online controllers, local controllers of DERs, etc.). For example, the cloud agent can download the trained supplementary control model to the online controller through the mobile communication processing module 213B.
[0149] The wired communication processing module 213C is configured to realize wired communication between the electronic device and various devices in the microgrid system. The wired communication processing module 213C can integrate an Ethernet interface, a serial interface, or other wired communication interfaces, thereby providing stable and high-speed data transmission and connection. In the embodiments of the present application, the online controller obtains system data of each microgrid from the microgrid system and sends control signals to the microgrid system, which can be realized through the above-mentioned wired communication interface. The communication between the model integration module in the central cloud and the cloud agent can also be realized through the above-mentioned wired communication interface.
[0150] The power switch 214 can be used to control the power supply of the electronic device, thereby providing power for the processor 211, the memory 212, the communication module 213, the display screen 215, the sensor module 216, and the like.
[0151] The display screen 215 can be used for display. The display screen 215 includes a display panel. A touch sensor can be provided in the display screen 215. The touch sensor is configured to detect a touch operation acting on or near the touch sensor. The touch sensor can transmit the detected touch operation to the application processor to determine the touch event type. In turn, the electronic device can provide visual output related to the touch operation through the display screen 215. The electronic device can realize the display function through the GPU, the display screen 215, the touch sensor, and the application processor, and the like. In the embodiments of the present application, in the process of microgrid control, the electronic device 100 can display the user interaction interface corresponding to the microgrid control by using the display function provided by the GPU, the display screen 215, the touch sensor, and the application processor, and the like, so as to provide the operation of inputting the physical model for control in advance and human intervention (such as setting the state data of the microgrid system at the next time) in the control process.
[0152] The sensor module 216 can include a current sensor, a voltage sensor, a temperature sensor, an illumination sensor, and the like. In the embodiments of the present application, the electronic device 100 can detect and perceive various state parameters inside or outside the microgrid system through one or more of the above-mentioned sensors. For example, the central computer / cloud can obtain the current value and the voltage value of a node through the voltage sensor and the current sensor, and then the sensor module 216 can transmit the above-mentioned data to the processor 211 to calculate the real-time power information of the node, thereby being used for subsequent microgrid control.
[0153] It can be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device can include more or fewer components than the illustration, or combine certain components, or split certain components, or different component arrangements. The components can be realized by hardware, software, or a combination of software and hardware.
[0154] Those skilled in the art should be aware that, in the above one or more examples, the functions described in the embodiments of the present application can be implemented in hardware, software, firmware or any combination thereof. When implemented in software, the functions can be stored in a computer readable medium or transmitted as one or more instructions or code on a computer readable medium. The computer readable medium includes computer storage medium and communication medium, and the communication medium includes any medium that facilitates transfer of a computer program from one place to another. The storage medium can be any available medium that can be accessed by a general purpose or special purpose computer. The embodiments of the present application also provide a computer program product including a computer program, which can implement the steps of the above various method embodiments when the computer program is run on a processor.
[0155] The above detailed description of the embodiments of the present application has further detailed the purposes, technical solutions and beneficial effects of the embodiments of the present application. It should be understood that the above is only a specific implementation of the embodiments of the present application, and is not used to limit the protection scope of the embodiments of the present application. Any modification, equivalent replacement, improvement, etc. made on the basis of the technical solutions of the embodiments of the present application should be included in the protection scope of the embodiments of the present application.
Claims
1. A microgrid control method, characterized by, The method is applied to a microgrid control system, the microgrid control system comprising a central modeling device, N local modeling devices, N end controllers and N microgrids, wherein the central modeling device is in communication connection with the local modeling devices, the N local modeling devices comprise a first local modeling device, the N end controllers comprise a first end controller, the N microgrids comprise a first microgrid, the first local modeling device is in communication connection with the first end controller, the first end controller is in communication connection with the first microgrid, the microgrid comprises one or more local controllers of distributed energy sources, and N is a positive integer; the method comprises: The first local modeling device trains a global transfer model by using a first sample set to obtain a first supplementary control model; the global transfer model and the first supplementary control model have the same parameters of the first x layers of neural networks, and different parameters of the multiple layers of neural networks after the x layers; the parameters of the neural networks comprise weights and biases; The first sample set includes a plurality of first training samples, the first training sample including first data and second data corresponding to the first data, the first data being used to describe actual state data of the first microgrid at time t or actual state data of the first microgrid at time t and a control signal received at time t-1, and the second data being used to indicate a first deviation Δx t , the first deviation Δx t being a deviation between the actual state data of the first microgrid at time t and first expected state data of the first microgrid at time t calculated based on a linear model of the first microgrid. The first local modeling device deploys the first supplementary control model to the first end controller; The first end controller acquires actual state data x of the first microgrid at time n n , or actual state data x at time n n and control signal u at time n-1 n-1 , and inputs the first supplementary control model to obtain first deviation Δx at time n n ; the first end controller determines a control signal u n at time n using Δx n and the linear model, and controls the first microgrid using u n such that a deviation between actual state data x n+1 of the first microgrid at time n+1 and second predicted state data x n+1 ’ of the first microgrid at time n+1 is less than a first threshold, the second predicted state data x n+1 ’ being adjusted from the first predicted state data using Δx n .
2. The method of claim 1, wherein, Before the first local modeling device trains the global transfer model by using the first sample set to obtain the first supplementary control model, the method further comprises: The first local modeling device obtains the global transfer model from the central modeling device, the input of the global transfer model is actual state data of the microgrid at time t or the actual state data of the microgrid at time t and a control signal received at time t-1, and the output of the global transfer model is a second deviation, the second deviation is a deviation between the actual state data of the microgrid at time t and first expected state data of the microgrid at time t calculated based on a linear model of the microgrid, the linear model of the microgrid is used to describe a linear relationship between the actual state data of the microgrid at time t, a control signal at time t and first predicted state data of the first microgrid at time t+1.
3. The method of claim 2, wherein, Initially, the global transfer model is trained based on a second sample set, the second sample set comprises multiple second training samples from the N microgrids, the second training samples comprise third data and fourth data corresponding to the third data, the third data is used to describe actual state data of the microgrid at time t or the actual state data of the microgrid at time t and a control signal received at time t-1, and the fourth data is used to indicate the second deviation at time t.
4. The method according to any one of claims 2-3, characterized in that, The method further comprises: The central modeling device receives first parameters sent by the first local modeling device, the first parameters comprising parameters of the multiple layers of neural networks after the x layers of the first supplementary control model; The central modeling device updates the global transfer model by using the first parameters, and the global transfer model after the update has a higher similarity to the parameters of the multiple layers of neural networks after the x layers of the first supplementary control model than the global transfer model before the update.
5. The method according to any one of claims 1 to 4, characterized in that, The first sample set comprises one or more of the following: a first sample set obtained by the first local modeling device from the first end controller, and a first sample set obtained by simulating the microgrid.
6. The method according to any one of claims 1 to 5, characterized in that, The first local modeling device trains the global migration model using the first sample set to obtain a first supplementary control model, specifically comprising: The first local modeling device trains the global migration model using the first sample set until the third deviation is less than the second threshold, wherein the third deviation is the difference between the predicted deviation obtained by inputting the first data into the global migration model and the first deviation in the first sample set.
7. The method according to any one of claims 1 to 6, characterized in that, The first end controller acquires actual state data x of the first microgrid at time n n , or actual state data x at time n n and control signal u at time n-1 n-1 , and inputs the first supplementary control model to calculate first deviation Δx at time n n Before the above, the method further comprises: The first end controller receives the first enabling signal sent by the first local modeling device.
8. The method of claim 7, wherein, The conditions of the first enabling signal received by the first end controller include: The difference between the predicted first deviation obtained by inputting the first data into the first supplementary control model and the first deviation in the first sample set is less than the third threshold.
9. The method according to any one of claims 1 to 8, characterized in that, The first local modeling device is integrated in the central modeling device.
10. A microgrid control method, characterized by, The method is applied to a central modeling device in a microgrid control system, wherein the microgrid control system further comprises N local modeling devices, N end controllers and N microgrids, the central modeling device and the local modeling devices are communicatively connected, the N local modeling devices comprise a first local modeling device, the N end controllers comprise a first end controller, the N microgrids comprise a first microgrid, the first local modeling device and the first end controller are communicatively connected, the first end controller and the first microgrid are communicatively connected, the microgrid comprises one or more local controllers of distributed energy sources, N is a positive integer; the method comprises: sending a global migration model to the first local modeling device, wherein the input of the global migration model is actual state data of the microgrid at time t, or actual state data of the microgrid at time t and a control signal received at time t-1, the output of the global migration model is a second deviation, the second deviation is the deviation between the actual state data of the microgrid at time t and first expected state data of the microgrid at time t calculated based on a linear model of the microgrid, and the linear model of the microgrid is used to describe the linear relationship between the actual state data of the microgrid at time t, the control signal at time t and the first predicted state data of the first microgrid at time t+1; The global transfer model is used by the first local modeling device to train a first supplementary control model. The parameters of the first x layers of the neural network in both the global transfer model and the first supplementary control model are the same, while the parameters of the subsequent layers are different. The parameters of the neural networks include weights and biases. The first supplementary control model is deployed by the first local modeling device to the first end controller. The first supplementary control model is used with the actual state data x of the first microgrid at time n obtained by the first end controller. n As input, or as the actual state data x at time n. n and the control signal u at time n-1 n-1 As input, the first deviation Δx at time n is calculated. n ;Δx n The control signal u at time n is used by the first terminal controller and the linear model to determine the control signal u. n u n Used to control the first microgrid, so that the actual state data x of the first microgrid at time n+1 is... n+1 The second expected state data x of the first microgrid at time n+1 n+1 The deviation between the two values is less than the first threshold, and the second predicted state data x n+1 'To utilize Δx n The data is obtained by adjusting the first expected state data.
11. The method of claim 10, wherein, initially, the global migration model is trained based on a second sample set, the second sample set comprises a plurality of second training samples from the N microgrids, the second training sample comprises third data and fourth data corresponding to the third data, the third data is used to describe the actual state data of the microgrid at time t, or the actual state data of the microgrid at time t and the control signal received at time t-1, and the fourth data is used to indicate the second deviation at time t.
12. The method according to claim 10 or 11, characterized in that, The method further comprises: receive a first parameter sent by the first local modeling device, the first parameter comprising parameters of a multi-layer neural network after the x layers of the first supplementary control model; update the global transfer model using the first parameter, the updated global transfer model having a higher similarity with the parameters of the multi-layer neural network after the x layers of the first supplementary control model than the global transfer model before the update.
13. A microgrid control method, characterized by, The method is applied to a first local modeling device in a microgrid control system, the microgrid control system comprising a central modeling device, N local modeling devices, N end controllers and N microgrids, wherein the central modeling device is communicatively connected with the local modeling devices, the first local modeling device belongs to the N local modeling devices, the N end controllers comprise a first end controller, the N microgrids comprise a first microgrid, the first local modeling device is communicatively connected with the first end controller, the first end controller is communicatively connected with the first microgrid, the microgrid comprises one or more local controllers of distributed energy sources, and N is a positive integer; the method comprises: training a global transfer model using a first sample set to obtain a first supplementary control model, wherein the global transfer model and the first supplementary control model have the same parameters of a neural network of x layers, and different parameters of a multi-layer neural network after the x layers, the parameters of the neural network comprising weights and biases; The first sample set includes a plurality of first training samples, the first training sample including first data and second data corresponding to the first data, the first data being used to describe actual state data of the first microgrid at time t or actual state data of the first microgrid at time t and a control signal received at time t-1, and the second data being used to indicate a first deviation Δx t , the first deviation Δx t being a deviation between the actual state data of the first microgrid at time t and first expected state data of the first microgrid at time t calculated based on a linear model of the first microgrid. deploying the first supplementary control model to the first end controller; the first supplementary control model is used by the first end controller to obtain the actual state data x of the first microgrid at time n n As input, either the actual state data x at time n n and the control signal u at time n-1 n-1 As input, the first deviation Δx at time n is calculated n ; Δx n is used by the first end controller to determine the control signal u at time n with the linear model n , u n is used to control the first microgrid so that the deviation between the actual state data x of the first microgrid at time n+1 n+1 and the second expected state data x n+1 ' of the first microgrid at time n+1 is less than a first threshold value, the second expected state data x n+1 ' being obtained by adjusting the first expected state data with Δx n .
14. The method of claim 13, wherein, Before training the global transfer model using the first sample set to obtain the first supplementary control model, the method further comprises: obtaining a global transfer model from the central modeling device, wherein the input of the global transfer model is actual state data of the microgrid at time t, or the actual state data of the microgrid at time t and a control signal received at time t-1, and the output of the global transfer model is a second deviation, the second deviation being a deviation between the actual state data of the microgrid at time t and first expected state data of the microgrid at time t calculated based on a linear model of the microgrid, the linear model of the microgrid being used to describe a linear relationship between the actual state data of the microgrid at time t, a control signal at time t and first predicted state data of the first microgrid at time t+1.
15. The method of claim 14, wherein, The global transfer model is initially trained based on a second sample set, the second sample set comprising a plurality of second training samples from the N microgrids, the second training samples comprising third data and fourth data corresponding to the third data, the third data being used to describe actual state data of the microgrid at time t, or the actual state data of the microgrid at time t and a control signal received at time t-1, and the fourth data being used to indicate the second deviation at time t.
16. The method according to any one of claims 14-15, characterized by, The method further comprises: sending a first parameter to the central modeling device, the first parameter comprising parameters of a multi-layer neural network after the x layers of the first supplementary control model; The first parameter is used by the central modeling device to update the global migration model, and the updated global migration model has a higher similarity with the parameters of the multi-layer neural network after the x layer of the first supplementary control model than the global migration model before the update.
17. The method according to any one of claims 13-16, characterized in that, The first sample set includes one or more of the following: a first sample set obtained by the first local modeling device from the first end controller, and a first sample set obtained by simulating the microgrid.
18. The method according to any one of claims 13-17, characterized by, The first supplementary control model is obtained by training the global migration model using the first sample set, specifically including: The global migration model is trained using the first sample set until the third deviation is less than the second threshold, and the third deviation is the deviation between the predicted deviation obtained by inputting the first data into the global migration model and the first deviation in the first sample set.
19. The method according to any one of claims 13-18, characterized in that, After deploying the first supplementary control model to the first end controller, the method further includes: sending a first enable signal to the first end controller.
20. The method of claim 19, wherein, The condition for sending the first enable signal to the first end controller includes: The difference between the predicted first deviation obtained by inputting the first data into the first supplementary control model and the first deviation in the first sample set is less than a third threshold.
21. The method according to any one of claims 13-20, characterized in that, The first local modeling device is integrated in the central modeling device.
22. A microgrid control method, characterized by, The method is applied to a first end controller in a microgrid control system, the microgrid control system including a central modeling device, N local modeling devices, N end controllers, and N microgrids, wherein the central modeling device and the local modeling devices are communicatively connected, the N local modeling devices include a first local modeling device, the first end controller belongs to the N end controllers, the N microgrids include a first microgrid, the first local modeling device and the first end controller are communicatively connected, the first end controller and the first microgrid are communicatively connected, the microgrid includes one or more local controllers of distributed energy sources, and N is a positive integer; the method includes: receive a first supplementary control model deployed by the first local modeling device; the first supplementary control model is obtained by training a global migration model using a first sample set by the first local modeling device; parameters of a first x layers of neural networks in the global migration model and the first supplementary control model are the same, parameters of layers of neural networks after the x layers are different, the parameters of the neural networks include weights and biases; the first sample set includes a plurality of first training samples, the first training samples include first data and second data corresponding to the first data, the first data is used to describe actual state data of the first microgrid at time t, or actual state data of the first microgrid at time t and a control signal received at time t-1, the second data is used to indicate a first deviation Δx t , the first deviation Δx t is a deviation between actual state data of the first microgrid at time t and first expected state data of time t calculated based on a linear model of the first microgrid. acquiring actual state data x of the first microgrid at time n n , or actual state data x at time n n and control signal u at time n-1 n-1 , and inputting the first supplementary control model to calculate first deviation Δx at time n n ; determining a control signal u n at time n using the linear model and the Δx n and controlling the first microgrid using u n such that a deviation between actual state data x n+1 of the first microgrid at time n+1 and second predicted state data x n+1 ’ of the first microgrid at time n+1 is less than a first threshold value, the second predicted state data x n+1 ’ being adjusted from the first predicted state data using Δx n .
23. The method of claim 22, wherein, the actual state data x of the first microgrid at the n time point n , or the actual state data x at the n time point n and the control signal u at the n-1 time point n-1 , and input the first supplementary control model to calculate the first deviation Δx at the n time point n Before the above, the method further comprises: receiving a first enable signal sent by the first local modeling device.
24. The method of claim 23, wherein, The condition for receiving the first enable signal includes: The difference between the predicted first deviation obtained by inputting the first data into the first supplementary control model and the first deviation in the first sample set is less than a third threshold.
25. A microgrid control system, comprising: The system comprises a central modeling device, N local modeling devices, N end controllers and N microgrids, wherein the central modeling device is communicatively connected with the local modeling devices, the N local modeling devices comprise a first local modeling device, the N end controllers comprise a first end controller, the N microgrids comprise a first microgrid, the first local modeling device is communicatively connected with the first end controller, the first end controller is communicatively connected with the first microgrid, the microgrid comprises a local controller of one or more distributed energy sources, and N is a positive integer; the central modeling device is the electronic device of any one of claims 10-12, the first local modeling device is the electronic device of any one of claims 13-21, and the first end controller is the electronic device of any one of claims 22-24.
26. An electronic device, comprising: The electronic device comprises one or more processors and one or more memories; wherein the one or more memories are coupled with the one or more processors, and the one or more memories are configured to store computer program codes, the computer program codes comprising computer instructions which, when executed by the one or more processors, cause the execution of the method of any one of claims 10-12, 13-21 or 22-24.
27. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program, when running on an electronic device, causes the execution of the method of any one of claims 10-12, 13-21 or 22-24.
28. A computer program product comprising a computer program, characterised in that, The computer program, when executed by a processor, implements the method of any one of claims 10-12, 13-21 or 22-24.