Simulation method, simulation device, and storage medium
By building a model library and system configuration files, and using the simulation platform to automatically call up device models and parameters, the problem of cumbersome and time-consuming microgrid simulation process is solved, enabling rapid construction and efficient simulation, and improving simulation efficiency and data transmission reliability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CONTEMPORARY AMPEREX TECHNOLOGY CO LTD
- Filing Date
- 2025-01-13
- Publication Date
- 2026-07-14
AI Technical Summary
Microgrids require manual modification of equipment models and operating parameters on simulation platforms for different application scenarios, resulting in a cumbersome, time-consuming, and inefficient simulation process.
By building a model library and system configuration files, the simulation platform can automatically call device models and parameters, quickly build a simulation platform based on scene information, and automatically generate simulation scenes, thus achieving automatic simulation and data transmission.
It improves the efficiency of microgrid simulation, reduces the time required for manual modifications, enables rapid construction and flexible adjustment of the simulation platform, and enhances data transmission efficiency and reliability.
Smart Images

Figure CN122389274A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of microgrid simulation technology, and in particular to a simulation method, simulation equipment, and storage medium. Background Technology
[0002] Microgrids offer advantages such as enhanced grid resilience, optimized energy allocation, and improved energy efficiency, leading to their widespread adoption across various fields. However, in practical applications, microgrids need to adapt to diverse energy demands and environmental conditions. This means there are numerous application scenarios for microgrids, each with different operating parameters and equipment models. When applying microgrids to new scenarios, testers must manually modify the equipment models or operating parameters of the simulation platform, resulting in a cumbersome, time-consuming, and inefficient simulation process. Summary of the Invention
[0003] The main technical problem addressed by this application is to provide a simulation method, simulation equipment, and storage medium that can quickly generate simulation scenarios and simulate these scenarios to obtain first simulation data, thereby improving efficiency and flexibility.
[0004] In a first aspect, this application provides a microgrid simulation method, comprising: constructing and obtaining multiple microgrid device models and device model parameters corresponding to the device models; importing the device models into a model library; adding the device model parameters to a system configuration file of a simulation platform; obtaining first scenario information of the microgrid; constructing a simulation platform of the microgrid on the simulation platform based on the model library, the system configuration file, and the first scenario information; obtaining second scenario information of the device under test; generating a simulation scenario on the microgrid simulation platform based on the second scenario information; and simulating the simulation scenario to obtain first simulation data.
[0005] In the technical solution of this application embodiment, by constructing the microgrid simulation platform on the simulation platform based on the model library, the system configuration file, and the first scenario information, the microgrid simulation platform can be quickly constructed, improving simulation efficiency. By generating simulation scenarios on the microgrid simulation platform based on the second scenario information, simulation scenarios are automatically generated, eliminating the need for test personnel to manually modify the microgrid simulation platform, reducing time consumption, and improving simulation efficiency.
[0006] In some embodiments, constructing the microgrid simulation platform on the simulation platform based on the model library, the system configuration file, and the first scenario information includes: calling the corresponding device model from the model library through the simulation platform based on the first scenario information, and importing the corresponding device model parameters through the system configuration file and the first scenario information; and connecting the corresponding device model through the simulation platform based on the first scenario information to construct the microgrid simulation platform.
[0007] In the technical solution of this application embodiment, the simulation platform calls the corresponding device model from the model library based on the first scene information, thereby realizing model calling; the simulation platform connects the corresponding device model based on the first scene information, thereby realizing line connection of the called device model; modular design is achieved through model calling and line connection, enabling the rapid addition of device models and adjustment of device model parameters, improving flexibility; and a simulation platform for microgrids can be quickly built, improving simulation efficiency.
[0008] In some embodiments, the step of calling the corresponding device model from the model library based on the first scene information through the simulation platform, and importing the corresponding device model parameters through the system configuration file and the first scene information, includes: storing the first scene information in the system configuration file, wherein the first scene information includes device information; calling the corresponding device model from the model library based on the device information through the simulation platform; and importing the corresponding device model parameters from the system configuration file based on the device information through the simulation platform.
[0009] In the technical solution of this application embodiment, by storing the first scene information in the system configuration file, the device information can be easily called through the system configuration file, and then the corresponding device model can be called, thereby improving simulation efficiency; by importing the corresponding device model parameters from the system configuration file based on the device information through the simulation platform, the device model parameters can be quickly adjusted, improving flexibility and simulation efficiency.
[0010] In some embodiments, the first scene information includes connection information, and the step of connecting the corresponding device model through the simulation platform based on the first scene information includes: obtaining connection information corresponding to the corresponding device model through the simulation platform; and connecting the corresponding device model through the simulation platform based on the corresponding connection information.
[0011] In the technical solution of this application embodiment, the simulation platform connects the corresponding device models based on the corresponding connection information, which can realize automatic connection, reduce manual connection by testers, and improve simulation efficiency.
[0012] In some embodiments, the first scenario information includes test parameter information, and the simulation method further includes: obtaining the test parameter information through the simulation platform; performing simulation on the microgrid simulation platform based on the test parameter information to obtain second simulation data; transmitting the second simulation data to a server through the GRPC communication protocol so that the server can perform calculations on the second simulation data; and storing the second simulation data in a time-series database.
[0013] In the technical solution of this application embodiment, second simulation data is obtained by simulating the microgrid simulation platform based on the test parameter information. This enables automatic simulation of the connected device model according to the test parameter information, achieving automatic simulation and improving simulation efficiency. Transmitting the second simulation data to the server via the GPRC communication protocol reduces transmission latency, increases data throughput, and improves data transmission efficiency and reliability. Storing the second simulation data in a time-series database facilitates the generation of corresponding curves from the second simulation data.
[0014] In some embodiments, constructing and obtaining multiple microgrid device models and device model parameters corresponding to the device models includes: obtaining the formula of the microgrid; constructing the device model by means of a first preset code function; setting parameter information corresponding to the device model by means of a second preset code function, wherein the parameter information includes device model parameters; extracting the device model parameters from the parameter information; adding the device model parameters to the system configuration file; and encapsulating and storing the device model in the model library.
[0015] In the technical solution of this application embodiment, the device model is obtained by constructing the formula through a first preset code function, and the device model is encapsulated and stored in the model library, which enables the construction of the model library for easy subsequent calling; the parameter information corresponding to the device model is set through a second preset code function, and the parameter information includes device model parameters; the device model parameters are extracted from the parameter information and added to the system configuration file, which makes it easy to adjust the device model parameters, improves flexibility, and improves simulation efficiency.
[0016] In some embodiments, the simulation method further includes: obtaining the device type of the device model, and adding the device type and the corresponding device model parameters to the system configuration file.
[0017] In the technical solution of this application embodiment, by obtaining the device type of the device model and adding the device type and the corresponding device model parameters to the system configuration file, the corresponding device model can be called by the device type, which is convenient for calling; the device model parameters can be adjusted through the system configuration file without manual operation, which improves flexibility and simulation efficiency.
[0018] In some embodiments, after the step of setting the parameter information corresponding to the device model through the second preset code function, the simulation method further includes: connecting the corresponding device model according to the formula through the third preset code function.
[0019] In the technical solution of this application embodiment, the corresponding device models are connected through a third preset code function, which enables automatic connection of multiple device models.
[0020] In some embodiments, the simulation method further includes: installing a preset code script; importing a preset code interface into the preset code script, the preset code interface including a first preset code function, a second preset code function, and a third preset code function; and receiving the formula and the parameter information through the preset code interface.
[0021] In the technical solution of this application embodiment, by importing a preset code interface into a preset code script, formula and parameter information can be received through the preset code interface, and a model library can be built through the preset code script, thereby improving efficiency.
[0022] Secondly, this application provides a simulation device, comprising: a modeling module, used to construct and obtain multiple microgrid device models and device model parameters corresponding to the device models, import the device models into a model library, and add the device model parameters to a system configuration file of the simulation platform; a simulation module, used to acquire first scenario information of the microgrid, and construct a simulation platform of the microgrid on the simulation platform based on the model library, the system configuration file, and the first scenario information; the simulation module is further used to acquire second scenario information of the device under test, generate a simulation scenario on the microgrid simulation platform based on the second scenario information, and simulate the simulation scenario to obtain first simulation data.
[0023] Thirdly, this application provides a non-volatile computer-readable storage medium having program instructions stored thereon, which, when executed by a processor, implement the simulation method described in any of the above embodiments.
[0024] It is understood that the beneficial effects of the second and third aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here.
[0025] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description
[0026] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0027] Figure 1 A flowchart illustrating an embodiment of the simulation method provided in this application.
[0028] Figure 2 for Figure 1 A flowchart of an embodiment of step S102.
[0029] Figure 3 for Figure 2 A schematic diagram of the framework of one embodiment of the simulation platform.
[0030] Figure 4 for Figure 2 A flowchart of an embodiment of step S201.
[0031] Figure 5 for Figure 2 A flowchart of an embodiment of step S202.
[0032] Figure 6 for Figure 2 A flowchart of an embodiment of step S203.
[0033] Figure 7 for Figure 1 A flowchart of an embodiment of step S101.
[0034] Figure 8 A flowchart illustrating another embodiment of the simulation method provided in this application.
[0035] Figure 9 A schematic diagram of a framework for an embodiment of the simulation device provided in this application.
[0036] Figure 10 This is a schematic diagram of the structure of a non-volatile computer-readable storage medium in some embodiments of this application. Detailed Implementation
[0037] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0038] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.
[0039] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.
[0040] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0041] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.
[0042] In the description of the embodiments of this application, the term "multiple" refers to two or more (including two), similarly, "multiple sets" refers to two or more (including two sets), and "multiple pieces" refers to two or more (including two pieces).
[0043] In the description of the embodiments of this application, unless otherwise expressly specified and limited, the technical terms such as "installation," "connection," "joining," and "fixing" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. For those skilled in the art, the specific meaning of the above terms in the embodiments of this application can be understood according to the specific circumstances.
[0044] Microgrids offer advantages such as enhanced grid resilience, optimized energy allocation, and improved energy efficiency, leading to their widespread application across various fields. A microgrid (MG) is a local power grid system with self-control, protection, and management capabilities, capable of operating either connected to the main grid or independently. Microgrids typically include various power sources, such as solar, wind, and diesel generators, as well as energy storage systems (e.g., batteries). Microgrid simulation platforms control the operating states of various power sources based on specific application scenarios. The operating state of a microgrid not only reflects its energy supply and consumption but also indicates its degree of dependence on the external power grid under specific conditions.
[0045] However, microgrids need to adapt to different energy demands and environmental conditions in practical applications. This means there are numerous application scenarios for microgrids, each with different operating parameters and equipment models. When applying a microgrid to a new scenario, testers need to manually modify the equipment models or operating parameters of the simulation platform, making the simulation process cumbersome, time-consuming, and inefficient.
[0046] Based on the above considerations, this application provides a simulation method, simulation device, and storage medium. The microgrid simulation method includes: constructing and obtaining multiple microgrid device models and corresponding device model parameters; importing the device models into a model library; adding the device model parameters to the system configuration file of the simulation platform; obtaining first scenario information of the microgrid; constructing a microgrid simulation platform on the simulation platform based on the model library, system configuration file, and first scenario information; obtaining second scenario information of the device under test; generating a simulation scenario on the microgrid simulation platform based on the second scenario information; and simulating the simulation scenario to obtain first simulation data. This method enables rapid construction of a microgrid simulation platform, improving simulation efficiency. By generating a simulation scenario on the microgrid simulation platform based on the second scenario information, automatic generation of simulation scenarios is achieved, eliminating the need for manual modification of the microgrid simulation platform by test personnel, reducing time consumption, and improving simulation efficiency.
[0047] Please refer to some embodiments of this application. Figure 1 , Figure 1This is a flowchart illustrating an embodiment of the simulation method provided in this application. The simulation method is applied to a simulation platform, which may include, but is not limited to, a microgrid management system; the simulation method includes the following steps.
[0048] S101: Construct and obtain multiple microgrid equipment models and corresponding equipment model parameters, import the equipment models into the model library, and add the equipment model parameters to the system configuration file of the simulation platform.
[0049] Microgrids include, but are not limited to, at least one of power supply equipment, loads, and energy storage systems. Power supply equipment includes, but is not limited to, photovoltaic power systems, wind turbine power systems, or diesel generator systems; loads include, but are not limited to, variable or fixed loads; and energy storage systems include, but are not limited to, energy storage devices, such as energy storage batteries.
[0050] Multiple microgrid device models and corresponding device model parameters are constructed and obtained. The device models are imported into a model library, and the device model parameters are added to the system configuration file of the simulation platform. For example, a standard model library is obtained by coded modeling of the microgrid. The model library includes multiple device models, each corresponding to a device in the microgrid. For example, if the microgrid includes photovoltaic cells (also known as solar cells), a corresponding device model and corresponding device model parameters are constructed; if the microgrid includes wind turbines, a corresponding device model and corresponding device model parameters are constructed; if the microgrid includes energy storage devices, a corresponding device model and corresponding device model parameters are constructed.
[0051] S102: Obtain the first scenario information of the microgrid, and build the microgrid simulation platform on the simulation platform based on the model library, system configuration file and the first scenario information.
[0052] Microgrids have a large number of application scenarios. The application scenarios of microgrids are determined by obtaining the first scenario information of microgrids. The first scenario information includes, but is not limited to, the application scenario information of microgrids.
[0053] The first scenario information of the microgrid is obtained, and a simulation platform for the microgrid is built on the simulation platform based on the model library, system configuration file, and the first scenario information. For example, a simulation platform for the microgrid is built based on the model library, system configuration file, and the first scenario information.
[0054] S103: Obtain the second scene information of the device under test, generate a simulation scene on the microgrid simulation platform based on the second scene information, and simulate the simulation scene to obtain the first simulation data.
[0055] Obtain the second scene information of the device under test (DUT). For example, the tester inputs the second scene information of the DUT onto a simulation device. The second scene information differs from the first scene information.
[0056] A simulation scenario is generated on the microgrid simulation platform based on the second scenario information, and the simulation scenario is simulated to obtain the first simulation data. The microgrid simulation platform is constructed through step S102, and the simulation scenario is automatically generated on the microgrid simulation platform using the second scenario information.
[0057] This application constructs a microgrid simulation platform based on a model library, system configuration files, and first scenario information, enabling rapid construction and improving simulation efficiency. Furthermore, by generating simulation scenarios on the microgrid simulation platform based on second scenario information, it achieves automatic scenario generation, eliminating the need for manual modifications by test personnel, thus reducing time consumption and further enhancing simulation efficiency.
[0058] Please refer to some embodiments of this application. Figure 2 and Figure 3 , Figure 2 for Figure 1 A flowchart illustrating an embodiment of step S102; Figure 3 for Figure 2 A schematic diagram of the framework of an embodiment of the simulation platform. Step S102 of this embodiment includes the following steps:
[0059] S201: The simulation platform calls the corresponding device model from the model library based on the first scene information, and imports the corresponding device model parameters through the system configuration file and the first scene information.
[0060] Specifically, the simulation platform retrieves the corresponding device model from the model library based on the first scene information. For example, the simulation platform automatically matches the device model corresponding to the first scene information from the model library and places the corresponding device model into the simulation model corresponding to the first scene information.
[0061] The simulation platform imports the corresponding device model parameters based on the system configuration file and the first scenario information. In other words, the simulation platform automatically matches the device model parameters corresponding to the first scenario information from the system configuration file.
[0062] S202: Connect the corresponding device models based on the first scenario information through the simulation platform to build a simulation platform for the microgrid.
[0063] The simulation platform connects the corresponding device models based on the first scenario information, that is, it connects the corresponding device models in step S201 with lines based on the first scenario information to build a simulation platform for the microgrid.
[0064] S203: Based on the first scenario information, the simulation platform of the microgrid is used to simulate and obtain the second simulation data.
[0065] The simulation platform simulates the microgrid based on the first scenario information to obtain the second simulation data.
[0066] In some embodiments, the simulation platform includes a device model calling module 10, a system connection module 20, and a simulation module 30. The model calling module 10 is used to call the corresponding device model from the model library based on the first scenario information, and import the corresponding device model parameters through the system configuration file and the first scenario information. The system connection module 20 is used to obtain the corresponding device model from the device model calling module 10, and connect the corresponding device model based on the first scenario information to construct the microgrid simulation platform. The simulation module 30 is used to obtain the microgrid simulation platform from the system connection module 20, and simulate the microgrid simulation platform based on the first scenario information to obtain second simulation data.
[0067] This application enables model invocation by calling the corresponding device model from the model library based on the first scenario information through the simulation platform, such as the model invocation module 10; it enables line connection of the called device model by connecting the corresponding device model based on the first scenario information through the simulation platform, such as the system connection module 20; it achieves modular design through model invocation and line connection, enabling the rapid addition of device models and adjustment of device model parameters, thus improving flexibility; it enables the rapid construction of a microgrid simulation platform, thus improving simulation efficiency.
[0068] Please refer to some embodiments of this application. Figure 4 , Figure 4 for Figure 2 A flowchart illustrating an embodiment of step S201. Step S201 in this embodiment includes the following steps:
[0069] S301: Store the first scene information in the system configuration file. The first scene information includes device information.
[0070] The first scenario information includes equipment information, which refers to the information of the microgrid's equipment. Specifically, the equipment information includes, but is not limited to, equipment types.
[0071] In some embodiments, the microgrid includes energy storage devices, the device information of which can be Lithium Battery devices, where Lithium Battery devices are the device type of energy storage devices; the microgrid includes photovoltaic devices, the device information of which can be Photovoltaic devices, where Photovoltaic devices are the device type of photovoltaic devices; the microgrid includes loads, the device information of which can be ElectricLoad devices, where ElectricLoad devices are the device type of loads; and the microgrid includes a power grid, the device information of which can be PowerGrid devices, where PowerGrid devices are the device type of power grids.
[0072] The first scene information is stored in the system configuration file. In one embodiment, the simulation platform further includes a system configuration file (Configures file), in which the simulation platform stores the first scene information.
[0073] S302: The simulation platform calls the corresponding device model from the model library based on the device information.
[0074] The simulation platform obtains device information through the system configuration file and calls the corresponding device model from the model library based on the device information. For example, if the device information is ElectricLoad, the simulation platform will call the load model from the model library.
[0075] S303: Import the corresponding device model parameters from the system configuration file based on the device information through the simulation platform.
[0076] When the simulation platform obtains device information through the system configuration file, it imports the corresponding device model parameters from the system configuration file based on the device information.
[0077] This application improves simulation efficiency by storing the first scene information in a system configuration file, which facilitates the retrieval of device information and the corresponding device model. Furthermore, the simulation platform can quickly adjust the device model parameters by importing them from the system configuration file based on the device information, thereby enhancing flexibility and simulation efficiency.
[0078] Please refer to some embodiments of this application. Figure 5 , Figure 5 for Figure 2 A flowchart illustrating an embodiment of step S202. Step S202 in this embodiment includes the following steps:
[0079] S401: Obtain the connection information corresponding to the corresponding device model through the simulation platform.
[0080] The first scenario information also includes connection information, that is, the first scenario information includes device information and connection information, and the connection information refers to the connection relationship between the devices under test.
[0081] After calling the corresponding device model from the model library based on the device information, the simulation platform obtains the connection information corresponding to the corresponding device model.
[0082] S402: Connect the corresponding device models through the simulation platform based on the corresponding connection information.
[0083] Based on the corresponding connection information, the simulation platform connects the corresponding device models, enabling automatic connection to other device models related to the device model. For example, if the device under test is an energy storage device, and the connection information for the energy storage device is connection to the power grid, then the simulation platform will automatically connect the device model of the energy storage device and the device model of the power grid based on the connection information.
[0084] This application uses a simulation platform to connect corresponding device models based on the corresponding connection information, which can achieve automatic connection, reduce manual connection by testers, and improve simulation efficiency.
[0085] Please refer to some embodiments of this application. Figure 3 and Figure 6 , Figure 6 for Figure 2 A flowchart illustrating an embodiment of step S203. Step S203 in this embodiment includes the following steps:
[0086] S501: Obtain test parameter information through the simulation platform, and simulate the microgrid simulation platform based on the test parameter information to obtain the second simulation data.
[0087] The first scenario information also includes test parameter information, namely, device information, connection information, and test parameter information. Specifically, the simulation platform obtains the test parameter information from the system configuration file and performs simulations on the microgrid based on this information to obtain the second simulation data.
[0088] Test parameter information includes, but is not limited to, at least one of the following: running time and running parameters. For example, the simulation module 30 of the simulation platform simulates the microgrid simulation platform based on the running time to obtain the second simulation data, thereby realizing automatic simulation.
[0089] S502: The second simulation data is transmitted to the server via the GRPC (High-Performance Remote Procedure Call Protocol) communication protocol so that the server can perform calculations on the second simulation data.
[0090] The microgrid simulation platform connects to the server via the GRPC communication protocol to transmit the second simulation data to the server.
[0091] In some embodiments, the simulation platform further includes a communication module 40, through which the simulation module 30 connects to the server. The communication protocol of the communication module 40 includes, but is not limited to, the gRPC communication protocol. In other embodiments, the communication protocol of the communication module 40 can be the HTTP / HTTPS communication protocol.
[0092] Optionally, the server includes an EMS (Energy Management System), a technology platform for monitoring and controlling the energy use of equipment or systems. It is primarily used to optimize the energy efficiency and performance of buildings, factories, or power grids. The EMS provides functions such as real-time data analysis, energy consumption monitoring, equipment performance evaluation, and predictive maintenance. For example, simulation module 30 transmits the second simulation data to the server via communication module 40. The server's EMS solves the second simulation data to obtain the current optimal control result and feeds the control result back to the simulation platform.
[0093] S503: Store the second simulation data in the time series database.
[0094] In some embodiments, the simulation platform further includes an export data module 50, which stores the second simulation data into a time-series database, whereby the time-series database is a database that stores data sequentially in chronological order. For example, the export data module 50 stores the second simulation data into the time-series database via a web application, enabling the web application to generate a running curve based on the second simulation data, thereby displaying the simulation results.
[0095] This application obtains second simulation data by simulating a microgrid simulation platform based on test parameter information. It can automatically simulate the connected device models according to the test parameter information, achieving automated simulation and improving simulation efficiency. By transmitting the second simulation data to the server via the gRPC communication protocol, it can reduce transmission latency, increase data throughput, and improve data transmission efficiency and reliability. By storing the second simulation data in a time-series database, it is convenient to generate corresponding curves from the second simulation data.
[0096] In some embodiments, the simulation platform further includes a saving module 60, which is used to automatically save the microgrid simulation platform for subsequent comparative testing with other simulation scenarios.
[0097] Please refer to some embodiments of this application. Figure 7 , Figure 7 for Figure 1 A flowchart illustrating an embodiment of step S101. Step S101 in this embodiment includes the following steps:
[0098] S601: Obtain the formula for the microgrid, and construct the device model by using the first preset code function.
[0099] The simulation platform obtains the formulas for the microgrid. For example, if the microgrid includes energy storage devices, the formula for the microgrid is the same as the formula for the energy storage devices. The formula for the energy storage devices is:
[0100]
[0101] Where SOC(t) is the charge state of the energy storage device at t, SOC(t+1) is the charge state of the energy storage device at t+1, and E BT For the capacity of energy storage devices, The charging power for energy storage devices, This refers to the discharge power of the energy storage device. The charging efficiency of energy storage devices. E represents the discharge efficiency of energy storage devices. r (t) represents the remaining power of the energy storage device, and δ represents the self-discharge rate of the energy storage device.
[0102] The device model of the energy storage device is obtained by constructing the energy storage formula through the first preset code function; for example, the device model of the energy storage device is obtained by constructing the energy storage formula through the engine.add_block function.
[0103] For example, a microgrid includes photovoltaic cells. The output power of a photovoltaic cell is related to light intensity and temperature. The formula for the output power of a photovoltaic cell is:
[0104]
[0105] Among them, P PV P represents the output power of the photovoltaic cell. STC G represents the rated output power of a photovoltaic cell under standard conditions. C and G STC These represent the actual light intensity and the standard light intensity, respectively; k is the power temperature coefficient; T c T is the operating temperature of the photovoltaic panel. STC Standard temperature; T a The ambient temperature.
[0106] The photovoltaic cell device model is obtained by constructing the formula for the output power of the photovoltaic cell through the first preset code function; for example, the photovoltaic cell device model is obtained by constructing the formula for the output power of the photovoltaic cell through the engine.add_block function.
[0107] For example, a microgrid includes wind turbines, and the formula for the actual power of the wind turbines is:
[0108]
[0109] Among them, P r and P WT These represent the rated power and actual power of the fan, respectively; a and b are the fitting parameters of the fan power curve determined based on parameters provided by the fan manufacturer, satisfying the following formula:
[0110]
[0111] Where, v and v r These are the actual wind speed and the rated wind speed, respectively; v ci and v co These are the cut-in wind speed and the cut-out wind speed, respectively.
[0112] The equipment model of the wind turbine is obtained by constructing the formula for the actual power of the wind turbine through the first preset code function; for example, the equipment model of the wind turbine is obtained by constructing the formula for the actual power of the wind turbine through the engine.add_block function.
[0113] S602: Set the parameter information corresponding to the device model through the second preset code function. The parameter information includes the device model parameters.
[0114] The simulation platform sets the parameter information corresponding to the device model through a second preset code function. The parameter information includes the device model parameters. For example, the simulation platform sets the parameter information corresponding to the device model through the engine.set_param function, which includes the device model parameters.
[0115] In some embodiments, the microgrid includes energy storage devices. The simulation platform sets parameter information for the energy storage devices through the engine.set_param function, including but not limited to rated power, rated capacity, charge and discharge efficiency, upper charge and discharge limit, or lower charge and discharge limit.
[0116] S603: Extract device model parameters from parameter information and add the device model parameters to the system configuration file.
[0117] The simulation platform extracts equipment model parameters from the parameter information and adds them to the system configuration file. These equipment model parameters refer to the variable parameters in the parameter information.
[0118] In some embodiments, the microgrid includes energy storage devices, and the simulation platform extracts device model parameters from parameter information, including but not limited to rated power, rated capacity, charge and discharge efficiency, upper charge and discharge limit, or lower charge and discharge limit.
[0119] In some embodiments, the microgrid includes photovoltaic cells, and the simulation platform extracts equipment model parameters from parameter information, including but not limited to rated power, actual light intensity, or ambient temperature.
[0120] In some embodiments, the microgrid includes wind turbines, and the simulation platform extracts equipment model parameters from parameter information, including but not limited to rated power, actual wind speed, cut-in wind speed, or cut-out wind speed.
[0121] S604: Encapsulate and store the device model in the model library.
[0122] The simulation platform encapsulates and stores the equipment models in the model library, that is, imports multiple equipment models into the model library.
[0123] This application constructs a device model from the formula using a first preset code function, encapsulates the device model, and stores it in a model library, enabling the construction of a model library for easy subsequent use. A second preset code function sets the parameter information corresponding to the device model, including device model parameters. The device model parameters are extracted from the parameter information and added to the system configuration file. The system configuration file facilitates the adjustment of the device model parameters, improving flexibility and simulation efficiency.
[0124] According to some embodiments of this application, the simulation method further includes: obtaining the device type of the device model and adding the device type and corresponding device model parameters to the system configuration file. Specifically, the simulation platform obtains the device type of the device model and adds the device type and corresponding device model parameters to the system configuration file.
[0125] This application obtains the device type of the device model and adds the device type and corresponding device model parameters to the system configuration file. This allows the corresponding device model to be called by device type, which is convenient. The device model parameters can be adjusted through the system configuration file without manual operation, which improves flexibility and simulation efficiency.
[0126] According to some embodiments of this application, after step S602, the simulation method further includes: connecting the corresponding device models according to a formula using a third preset code function. Specifically, the simulation platform connects the corresponding device models according to the formula using the `engine.add_line` function.
[0127] This application connects the corresponding device models through a third preset code function, enabling automatic connection of multiple device models.
[0128] According to some embodiments of this application, please refer to Figure 8 , Figure 8A schematic flowchart of another embodiment of the simulation method provided in this application. Before step S101, the simulation method further includes:
[0129] S701: Install preset code scripts.
[0130] The simulation platform installs pre-defined code scripts, including but not limited to Python scripts. Before installing these scripts, the matlab.engine package is installed using Python code. matlab.engine is an interface that allows other programming environments, such as Python, to call MATLAB functions and execute scripts.
[0131] S702: Import a preset code interface into the preset code script. The preset code interface includes a first preset code function, a second preset code function, and a third preset code function.
[0132] The simulation platform imports a pre-defined code interface into the pre-defined code script. This pre-defined code interface includes a first pre-defined code function, a second pre-defined code function, and a third pre-defined code function. For example, the simulation platform imports the matlab.engine module into a Python script to implement the import of this pre-defined code interface.
[0133] S703: Receives formula and parameter information through a preset code interface.
[0134] The simulation platform receives formula and parameter information through a pre-defined code interface, such as through the matlab.engine module.
[0135] This application improves efficiency by importing a preset code interface into a preset code script, which allows the user to receive formula and parameter information and build a model library.
[0136] In one specific embodiment, the microgrid of this embodiment is applied in the scenario of a small-scale microgrid with source-grid-load-storage. Source-grid-load-storage refers to power sources, grids, loads, and energy storage devices. That is, the equipment of the microgrid includes power sources, grids, loads, and energy storage devices. Power sources, loads, and energy storage devices are connected to the grid through a PCC point (Point of Common Coupling).
[0137] The power source can be a photovoltaic device, and the configuration information of the photovoltaic device within a day is shown in Table 1 below.
[0138] The maximum load power is 10kW, the grid frequency is 50Hz, the grid line voltage is 380V, and the simulation running time is 24h.
[0139] The configuration information of the energy storage equipment is shown in Table 2 below.
[0140] Table 1 Configuration Information of Photovoltaic Equipment
[0141] time Rated power Actual light intensity Ambient temperature 0:15:00 5kW 0 24.4045 0:30:00 5kW 0 24.323 0:45:00 5kW 0 23.951 … … … … 11:15:00 5kW 1036.05 28.4065 11:30:00 5kW 1057.4 29.222 11:45:00 5kW 1073.7 29.376 12:00:00 5kW 1086.8 28.975 12:15:00 5kW 1089.6 28.884 … … … … 23:30:00 5kW 0 24.85 23:45:00 5kW 0 24.906
[0142] Table 2 Configuration information of energy storage devices
[0143]
[0144] Therefore, a microgrid includes photovoltaic equipment, a power grid, loads, and energy storage equipment. The first scenario information includes the configuration information of the photovoltaic equipment, the configuration information of the energy storage equipment, the maximum power of the load, the grid frequency, the grid line voltage, and the simulation running time.
[0145] The testers input the configuration information of the photovoltaic (PV) equipment, energy storage equipment, maximum load power, grid frequency, grid line voltage, and simulation runtime into the simulation platform. The simulation platform can store these configuration information in a system configuration file. Specifically, the energy storage equipment type is Lithium Battery, the PV equipment type is Photovoltaic, the grid equipment type is PowerGrid, and the load equipment type is ElectricLoad. Based on the configuration information of the PV equipment, energy storage equipment, maximum load power, grid frequency, grid line voltage, and simulation runtime, the simulation platform constructs a microgrid simulation platform (MG) on the simulation platform.
[0146] The simulation platform performs simulations using the simulation method described in the above embodiments. The simulation platform acquires the device type and imports the corresponding device model parameters from the system configuration file based on the device type. For example, the device type of the photovoltaic device is Photovoltaic device. Based on the Photovoltaic device, the corresponding device model parameters are imported from the system configuration file, including power, illuminance, and ambient temperature.
[0147] The simulation platform acquires equipment information for photovoltaic (PV) devices, the power grid, loads, and energy storage devices. The equipment information for PV devices includes their type, the power grid type, the load type, and the energy storage type. Based on this information, the platform retrieves the corresponding device models from the model library. For example, the platform calls the device models for PV devices, the power grid, the load, and the energy storage devices, automatically importing the relevant parameters to build a microgrid simulation platform (MG) on the platform.
[0148] The simulation platform acquires connection information corresponding to photovoltaic equipment, the power grid, loads, and energy storage devices, and connects the equipment models of the photovoltaic equipment, the power grid, the loads, and the energy storage devices. For example, based on the connection information, the simulation platform connects the output terminals of the photovoltaic equipment model, the load model, and the energy storage device model to the power grid's equipment model, achieving automatic connection.
[0149] The simulation platform simulates the simulation scene MG based on the test parameter information to obtain the second simulation data. For example, the simulation platform simulates the simulation scene MG based on the simulation running time of 24 hours to obtain the second simulation data.
[0150] The simulation platform transmits the second simulation data to the server's EMS via the GRPC communication protocol. For example, the second simulation data includes, but is not limited to, the current simulation running time, photovoltaic power, energy storage power, energy storage system SOC (State of Charge), load power, and grid power, as shown in Table 3 below. The photovoltaic equipment and the grid are the power supply side, while the energy storage equipment and the load are the power consumption side.
[0151] The server's EMS receives the second simulation data and performs optimization solutions for the energy storage device during the next time step (e.g., economic optimization or balancing power supply and power consumption), obtaining the simulation operation control results for the next time step. For example, based on the second simulation data, the server's EMS obtains the simulation operation control result for the next time step as reducing the charging power of the energy storage device and supplying the electricity generated by the photovoltaic device to the grid, as shown in Table 4 below.
[0152] Table 3 Second Simulation Data
[0153]
[0154] Table 4. Control results during simulation at the next time step.
[0155]
[0156] The server's EMS feeds back the simulation runtime control results of the next moment to the simulation platform through the GRPC communication protocol, so that the simulation platform can control the corresponding device model based on the simulation runtime control results of the next moment until the simulation ends.
[0157] Simultaneously, the simulation platform stores the second simulation data in the sequential database on the web interface. After the simulation runs, it generates simulation curves based on the data in the sequential database on the web interface to demonstrate the simulation results.
[0158] After the simulation runs, the simulation platform automatically saves the microgrid simulation platform MG, which is convenient for subsequent comparison and testing with other simulation scenarios.
[0159] This application provides a simulation device 1, such as... Figure 9 As shown, Figure 9 This is a schematic diagram of a framework for an embodiment of a simulation device provided in this application. The simulation device 1 includes a modeling module 100 and a simulation module 200. The simulation device 1 is used to install the simulation platform of the above embodiment.
[0160] The modeling module 100 is used to construct and obtain multiple microgrid equipment models and equipment model parameters corresponding to the equipment models, import the equipment models into the model library, and add the equipment model parameters to the system configuration file of the simulation platform.
[0161] The simulation module 200 is used to acquire the first scenario information of the microgrid, and to build a simulation platform for the microgrid on the simulation platform based on the model library, system configuration file, and the first scenario information. The simulation module 200 is also used to acquire the second scenario information of the device under test, to generate a simulation scenario on the microgrid simulation platform based on the second scenario information, and to simulate the simulation scenario to obtain the first simulation data.
[0162] Please refer to Figure 10 , Figure 10 This is a schematic diagram of the structure of a non-volatile computer-readable storage medium in some embodiments of this application. The non-volatile computer-readable storage medium 4 stores program instructions 41, which, when executed by a processor, implement the steps of any of the above simulation methods.
[0163] In some embodiments, the functions or modules of the apparatus provided in this application can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0164] The description of the various embodiments above tends to emphasize the differences between the various embodiments. The similarities or similarities between them can be referred to, and for the sake of brevity, they will not be repeated here.
[0165] In the several embodiments provided in this application, it should be understood that the disclosed methods and apparatus can be implemented in other ways. For example, the apparatus implementations described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms.
[0166] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0167] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0168] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and not to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. These modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application, and they should all be covered within the scope of the claims and specification of this application. In particular, as long as there is no structural conflict, the various technical features mentioned in the embodiments can be combined in any way. This application is not limited to the specific embodiments disclosed herein, but includes all technical solutions falling within the scope of the claims.
Claims
1. A simulation method for a microgrid, characterized in that, include: Multiple microgrid equipment models and corresponding equipment model parameters are constructed and obtained. The equipment models are imported into the model library, and the equipment model parameters are added to the system configuration file of the simulation platform. Obtain the first scenario information of the microgrid, and construct the simulation platform of the microgrid on the simulation platform based on the model library, the system configuration file and the first scenario information; The second scenario information of the device under test is obtained, and a simulation scenario is generated on the simulation platform of the microgrid based on the second scenario information. The simulation scenario is then simulated to obtain the first simulation data.
2. The simulation method according to claim 1, characterized in that, The simulation platform for building the microgrid on the simulation platform based on the model library, the system configuration file, and the first scenario information includes: The simulation platform calls the corresponding device model from the model library based on the first scene information, and imports the corresponding device model parameters through the system configuration file and the first scene information. The simulation platform connects the corresponding device models based on the first scenario information to construct the simulation platform for the microgrid.
3. The simulation method according to claim 2, characterized in that, The step of calling the corresponding device model from the model library based on the first scene information through the simulation platform, and importing the corresponding device model parameters through the system configuration file and the first scene information, includes: The first scene information is stored in the system configuration file, and the first scene information includes device information; The simulation platform retrieves the corresponding device model from the model library based on the device information. The simulation platform imports the corresponding device model parameters from the system configuration file based on the device information.
4. The simulation method according to claim 2 or 3, characterized in that, The first scene information includes connection information, and the step of connecting the corresponding device model through the simulation platform based on the first scene information includes: The connection information corresponding to the corresponding device model is obtained through the simulation platform; The simulation platform connects the corresponding device models based on the corresponding connection information.
5. The simulation method according to any one of claims 2-4, characterized in that, The first scenario information includes test parameter information, and the simulation method further includes: The test parameter information is obtained through the simulation platform, and the simulation platform of the microgrid is simulated based on the test parameter information to obtain the second simulation data; The second simulation data is transmitted to the server via the GRPC communication protocol, so that the server can perform calculations on the second simulation data; The second simulation data is stored in a time series database.
6. The simulation method according to any one of claims 1-5, characterized in that, The construction and acquisition of multiple microgrid device models and corresponding device model parameters include: The formula for the microgrid is obtained, and the device model is constructed by the formula through a first preset code function; The parameter information corresponding to the device model is set through a second preset code function, and the parameter information includes device model parameters; Extract the device model parameters from the parameter information and add the device model parameters to the system configuration file; The device model is encapsulated and stored in the model library.
7. The simulation method according to claim 6, characterized in that, The simulation method further includes: Obtain the device type of the device model, and add the device type and the corresponding device model parameters to the system configuration file.
8. The simulation method according to claim 6 or 7, characterized in that, After the step of setting the parameter information corresponding to the device model through the second preset code function, the simulation method further includes: The corresponding device models are connected according to the formula using the third preset code function.
9. The simulation method according to any one of claims 6-8, characterized in that, The simulation method further includes: Install the preset code script; Import a preset code interface into the preset code script. The preset code interface includes a first preset code function, a second preset code function, and a third preset code function. The formula and parameter information are received through the preset code interface.
10. A simulation device, characterized in that, include: The modeling module is used to construct and obtain multiple microgrid equipment models and equipment model parameters corresponding to the equipment models, import the equipment models into the model library, and add the equipment model parameters to the system configuration file of the simulation platform. The simulation module is used to acquire the first scenario information of the microgrid and construct the simulation platform of the microgrid on the simulation platform based on the model library, the system configuration file and the first scenario information. The simulation module is also used to acquire second scene information of the device under test, generate a simulation scene on the simulation platform of the microgrid based on the second scene information, and simulate the simulation scene to obtain first simulation data.
11. A non-volatile computer-readable storage medium storing program instructions thereon, characterized in that, When the program instructions are executed by the processor, they implement the simulation method according to any one of claims 1 to 9.