Energy storage equipment simulator generation method and device, electronic equipment and storage medium
By generating and configuring an energy storage simulator, the problem of difficulty and cost of building an energy storage system environment is solved, and the energy storage system is simulated and run on a computer device is realized, reducing the difficulty and cost of construction, and improving testing efficiency and accuracy.
Patent Information
- Application Number
- CN202510004136.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-02
- Publication Date
- 2025-05-02
AI Technical Summary
Due to the diverse number of equipment and complex working conditions of energy storage systems, it is difficult and costly to build an environment.
By obtaining the equipment configuration table, verifying data, generating an energy storage simulator, and configuring service interfaces and log services for it, it realizes the simulation of each energy storage device running the energy storage system on a computer device.
It greatly reduces the difficulty and cost of environmental construction, realizes reliable testing of energy storage systems, and improves testing efficiency and accuracy.
Smart Images

Figure CN119918272A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a method, device, electronic device and storage medium for generating an energy storage device simulator. Background Art
[0002] Energy storage system refers to a system that can store electrical energy and release it when needed. For example, in the field of new energy, a smart microgrid energy storage system is usually composed of a power management unit, an energy management system, a battery management system and a battery pack system, and involves a large number of devices. With the transformation of the global energy structure and the rapid development of renewable energy, energy storage technology plays an increasingly important role in modern energy systems.
[0003] In order to ensure the reliability of the energy storage system function and to ensure the safe and reliable operation of the energy storage point, the energy storage system is usually tested to verify its reliability. However, the number of devices involved in the energy storage system and the variety of working conditions require the construction of a large number of master and slave devices, which makes the construction of the energy storage equipment environment difficult and costly. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a method, device, electronic device and storage medium for generating an energy storage device simulator, which constructs a virtual energy storage device, all of which run on a computer device. The energy storage device environment can be set up by only plugging in a network cable, greatly reducing the difficulty and cost of environment construction.
[0005] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0006] In a first aspect, the present invention provides a method for generating an energy storage device simulator, the method comprising:
[0007] Obtaining a device configuration table; wherein the device configuration table includes device configuration information;
[0008] Verify the data in the device configuration table;
[0009] When the verification of the device configuration table is passed, an energy storage simulator is obtained according to the device configuration information of each device in the device configuration table; wherein the energy storage simulator includes at least one simulation device of the energy storage device, and the simulation device is used to simulate the operating function of the corresponding energy storage device;
[0010] According to the device configuration table, a service interface and a log service are configured for the energy storage simulator; wherein the service interface is used to provide communication and data services for the energy storage simulator, and the log service is used to record log information of each of the simulated devices.
[0011] Optionally, the step of obtaining an energy storage simulator according to each of the configuration information in the device configuration table includes:
[0012] Parsing the device configuration table to obtain at least one device configuration information;
[0013] Preprocessing the device configuration information to obtain a device information group;
[0014] For each of the device information groups, convert the device information group into a device dictionary, and store the device dictionary into a variable to obtain a simulated device of an energy storage device;
[0015] The collection of the simulation devices is used as an energy storage simulator.
[0016] Optionally, the step of converting the device information group into a device dictionary includes:
[0017] Calling a creation function for the device information group and using the device information group as a parameter of the creation function;
[0018] By means of the creation function, the information in the device information group is arranged in a preset order to obtain a tuple;
[0019] The creation function is used to perform list derivation processing on the tuple to obtain a device dictionary.
[0020] Optionally, the device configuration information includes device attribute information, communication protocol, network configuration information and device operation specifications;
[0021] The step of preprocessing the device configuration information to obtain a device information group includes:
[0022] For each of the device configurations, according to the communication protocol, retrieving the protocol information of the communication protocol;
[0023] The protocol information is combined with the remaining information of the device configuration information to obtain a device information group.
[0024] Optionally, the step of verifying the data in the device configuration table includes:
[0025] Verifying the header format of the device configuration table;
[0026] In case of an error in the header format, print the header error information;
[0027] When the table header format is verified to be correct, verify each data item in the device configuration table according to the preset verification rules for each data item;
[0028] In the case where at least one of the data items is erroneous, data error information is printed according to each of the erroneous data items.
[0029] Optionally, the step of verifying each data item in the device configuration table according to preset verification rules for each data item includes:
[0030] Using the first column in the device configuration table as a verification column;
[0031] Retrieving the validation rules of the validation column, and converting each data item of the validation column into a list to obtain a validation list; wherein the validation rules include the expected total number of data, the expected data type of each data item, the expected data range, and the validation function;
[0032] According to the expected total number of data, check the data missing status of the verification column;
[0033] For each of the data items in the verification list, checking the correctness of the data item according to the expected data type, the expected data range and the verification function of the data item;
[0034] Determine whether the verification column is the last column of the device configuration table;
[0035] If yes, then obtain the verification result;
[0036] If not, the next column after the verification column is used as the next verification column, and the step of returning to execute the verification rule of the verification column, and converting each data item of the verification column into a list to obtain the verification list.
[0037] Optionally, the step of configuring a service interface and a log service for the energy storage simulator according to the device configuration includes:
[0038] According to the device configuration table, obtain network configuration information of each energy storage device;
[0039] Configure an HTTP interface for the energy storage simulator, and configure a modbus interface for each of the simulated devices for the energy storage simulator according to each of the network configuration information;
[0040] Configure a log service function for the energy storage simulator.
[0041] In a second aspect, the present invention provides an energy storage device simulator generation device, including a configuration acquisition module, a data verification module, a simulator generation module, and a service configuration module;
[0042] The configuration acquisition module is used to acquire a device configuration table; wherein the device configuration table includes device configuration information;
[0043] The data verification module is used to verify the data in the device configuration table;
[0044] The simulator generation module is used to obtain an energy storage simulator according to each device configuration information in the device configuration table when the verification of the device configuration table passes; wherein the energy storage simulator includes at least one simulation device of the energy storage device, and the simulation device is used to simulate the operating function of the corresponding energy storage device;
[0045] The service configuration module is used to configure a service interface and a log service for the energy storage simulator according to the device configuration table; wherein the service interface is used to provide communication and data services for the energy storage simulator, and the log service is used to record log information of each of the simulated devices.
[0046] In a third aspect, the present invention provides an electronic device, comprising a processor and a memory, wherein the memory stores a computer program executable by the processor, and the processor can execute the computer program to implement the energy storage device simulator generation method as described in the first aspect.
[0047] In a fourth aspect, the present invention provides a storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method for generating an energy storage device simulator as described in the first aspect.
[0048] The embodiments of the present invention provide a method, apparatus, electronic device and storage medium for generating an energy storage device simulator. The method comprises: obtaining a device configuration table, the device configuration table comprising device configuration information; verifying the data in the device configuration table; if the verification of the device configuration table passes, obtaining an energy storage simulator according to the device configuration information of each device in the device configuration table, the energy storage simulator comprising at least one simulation device of the energy storage device, the simulation device being used to simulate the operating function of the corresponding energy storage device; configuring a service interface and a log service for the energy storage simulator according to the device configuration table, the service interface being used to provide communication and data services for the energy storage simulator, and the log service being used to record log information of each simulation device.
[0049] In this way, an energy storage simulator consisting of simulation devices of various energy storage devices is automatically constructed. The simulation device realizes the simulation of the energy storage device function. The configured log service records the log service of the simulation device operation. The configured service interface realizes the communication and data functions of the energy storage device. Therefore, the energy storage devices of the energy storage system can be simulated and operated on a computer device. Only one network cable is needed to build the test environment of the energy storage system, which greatly simplifies the difficulty and cost of environment construction.
[0050] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0052] Figure 1 A system architecture diagram of an energy storage device simulator generation system provided in an embodiment of the present invention is shown.
[0053] Figure 2 A module architecture diagram of an electronic device provided by an embodiment of the present invention is shown.
[0054] Figure 3 A schematic flow chart of a method for generating an energy storage device simulator provided in an embodiment of the present invention is shown.
[0055] Figure 4 Shows Figure 3 Schematic diagram of the process flow of some sub-steps of step 13.
[0056] Figure 5 Shows Figure 4 A flowchart of some sub-steps of step 135 in FIG.
[0057] Figure 6 Shows Figure 3 Schematic diagram of the process flow of some sub-steps of step 15.
[0058] Figure 7 Shows Figure 6 A flowchart of some sub-steps of step 155.
[0059] Figure 8 Shows Figure 3 Schematic diagram of the process of some sub-steps of step 17.
[0060] Fig. 9 A schematic structural diagram of an energy storage simulator provided in an embodiment of the present invention is shown.
[0061] Fig.10 A module architecture diagram of an energy storage device simulator generation device provided in an embodiment of the present invention is shown.
[0062] Explanation of the accompanying drawings: 10 - energy storage device simulator generation system; 110 - input device; 120 - computer device; 20 - electronic device; 210 - memory; 220 - processor; 230 - communication module; 30 - energy storage device simulator generation device; 310 - configuration acquisition module; 320 - data verification module; 330 - simulator generation module; 340 - service configuration module. DETAILED DESCRIPTION
[0063] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0064] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present invention.
[0065] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0066] The energy storage device simulator generation method provided in the embodiment of the present invention can be applied to Figure 1 In the energy storage device simulator generation system 10 shown, the energy storage device simulator generation system 10 includes an input device 110 and a computer device 120, wherein the input device 110 can be connected to the computer device 120 in a wired or wireless manner.
[0067] The input device 110 may be, but is not limited to, any device with input function, such as a keyboard, a mouse, a mobile phone, a touch screen, a microphone, a tablet computer, etc. The computer device 120 may be a personal computer, a notebook computer, an independent server or a server cluster, etc.
[0068] The tester can fill in the device configuration form through the input device 110 , and the input device 110 sends the completed device configuration form to the computer device 120 .
[0069] The computer device 120 is used to implement the energy storage device simulator generation method provided in an embodiment of the present invention, including: obtaining a device configuration table, the device configuration table including device configuration information; verifying the data in the device configuration table; if the device configuration table passes the verification, obtaining an energy storage simulator based on the device configuration information in the device configuration table, the energy storage simulator including at least one simulation device of the energy storage device, the simulation device being used to simulate the operating function of the corresponding energy storage device; configuring a service interface and a log service for the energy storage simulator according to the device configuration table, the service interface being used to provide communication and data services for the energy storage simulator, and the log service being used to record log information of each simulation device.
[0070] Please refer to Figure 2 , is a block diagram of an electronic device 20, which may be Figure 1 The computer device 120 in the energy storage device simulator generation system 10 is shown. The electronic device 20 includes a memory 210, a processor 220 and a communication module 230. The memory 210, the processor 220 and the communication module 230 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.
[0071] The memory 210 is used to store programs or data and can be, but not limited to, a random access memory, a read-only memory, a programmable read-only memory, an erasable read-only memory, an electrically erasable read-only memory, and the like.
[0072] The processor 220 is used to read / write data or programs stored in the memory 210 and execute corresponding functions. For example, Figure 1 In the energy storage device simulator generation system 10 shown, the processor 220 of the computer device 120 reads the computer program stored in the memory 210 to implement the energy storage device simulator generation method provided in the embodiment of the present invention.
[0073] The communication module 230 is used to establish a communication connection between the computer device 120 and other communication terminals through the network, and to send and receive data through the network. Figure 1 In the energy storage device simulator generation system 10 shown, the communication module 230 of the computer device 120 transmits and receives data with the input device 110 or other electronic devices 20 through the network.
[0074] It should be understood that Figure 2The structure shown is only a schematic diagram of the structure of the computer device 120. The computer device 120 may also include Figure 2 More or fewer components as shown, or with Figure 2 Different configurations are shown. Figure 2 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0075] In order to improve the problem of difficulty and high cost in building a test environment for energy storage systems in related technologies due to the large number of master and slave devices, refer to Figure 3 The embodiment of the present invention provides a method for generating an energy storage device simulator, comprising steps 11 to 17. Thus,: Figure 1 In the energy storage device simulator generation system 10 shown in FIG. Figure 2 The structure shown, when the processor 220 executes the computer program stored in the memory 210, implements steps 11 to 17 to implement the energy storage device simulator generation method.
[0076] Step 11, obtain the device configuration table.
[0077] Among them, the device configuration table includes device configuration information.
[0078] Step 13, verify the data in the device configuration table.
[0079] Step 15: When the verification of the device configuration table is passed, an energy storage simulator is obtained according to the configuration information of each device in the device configuration table.
[0080] The energy storage simulator includes at least one simulation device of an energy storage device, and the simulation device is used to simulate the operating function of the corresponding energy storage device.
[0081] Step 17: Configure the service interface and log service for the energy storage simulator according to the device configuration table.
[0082] Among them, the service interface is used to provide communication and data services for the energy storage simulator, and the log service is used to record the log information of each simulation device.
[0083] For example, in combination Figure 1 In the energy storage device simulator generation system 10 shown, after the tester determines the energy storage system that needs to be tested and verified, he fills in the device configuration information related to the energy storage system through the input device 110, and after filling in, the input device 110 sends the complete device configuration table to the computer device 120.
[0084] After receiving the device configuration table, the computer device 120 verifies the data in the device configuration table, and if the verification of the device configuration table passes, it constructs a simulation device corresponding to each energy storage device of the energy storage system according to the configuration information of each device in the device configuration table. The simulation device simulates the operating function of the physical energy storage device to obtain an energy storage simulator (i.e., a simulation system of the energy storage system).
[0085] Furthermore, in order to simulate the functions of real-time data query, parameter configuration, remote control, provision of fault codes and related information in the event of anomalies, integration with other systems (such as industrial control systems, SCADA systems or other third-party systems, etc.), and historical data record query of the energy storage system, the service interface and log service are configured for the energy storage simulator according to the device configuration table. The service interface is used to provide communication and data services for the energy storage simulator, and the log service is used to record the log information of each simulated device.
[0086] The methods for building a test environment for an energy storage system in the related art include: (1) using physical energy storage equipment to build the test environment; (2) manually building the test environment. These methods are difficult to build, inefficient, and costly.
[0087] Compared with the related art, in the above energy storage device simulator generation method, an energy storage simulator composed of simulation devices of various energy storage devices is automatically constructed, the simulation device realizes the simulation of the energy storage device function, the configured log service records the log service of the simulation device operation, and the configured service interface realizes the communication and data functions of the energy storage device. Therefore, the various energy storage devices of the energy storage system can be simulated and operated on a computer device, and the test environment of the energy storage system can be built by plugging in a network cable, which greatly simplifies the difficulty and cost of environment construction.
[0088] Among them, in order to make the constructed energy storage device simulator have the performance of reliable data reading, fast data transmission speed, high communication reliability and easy integration and expansion of the system, before filling in the equipment configuration table, any communication protocol with great performance advantages can be selected.
[0089] By way of example, the communication protocol may be a Modbus communication protocol.
[0090] The Modbus communication protocol is an open standard supported by many equipment manufacturers, so it is compatible with various types of equipment, including energy storage equipment, PLC, RTU, HMI, etc. Due to the universality of the Modbus communication protocol, most devices have built-in Modbus communication protocol, so when deploying energy storage systems, the equipment can be quickly integrated into the existing network. The Modbus communication protocol is relatively simple, easy to understand and implement. And its message structure is clear, so the development and use costs are low.
[0091] In addition, the Modbus communication protocol also supports a variety of transmission media, such as serial lines (RS-232, RS-485, etc.), Ethernet, and optical fiber, so that it can choose the appropriate transmission method according to the specific application scenario. And it does not require complex hardware or software support, and the implementation cost is low. In addition, the Modbus communication protocol contains error detection and verification mechanisms, which helps to ensure the accuracy of data and the reliability of transmission. The frame format of the Modbus communication protocol is public, and technicians can directly view and analyze communication data, which makes debugging and maintenance easier. The Modbus communication protocol has a clear standard definition, which reduces misunderstandings and errors caused by different protocols and improves the stability and predictability of the system. The Modbus communication protocol also supports a variety of function codes, which can meet different types of data reading and writing requirements and is suitable for a variety of application scenarios. Because the Modbus communication protocol is widely used, there is a large developer community and rich resources, which also provides convenience for solving problems and developing new functions.
[0092] At the same time, before filling in the equipment configuration table, you can also make reasonable network planning for the energy storage system.
[0093] Reasonable network planning can ensure that the various components in the energy storage system (such as battery packs, inverters, energy management systems, etc.) work together efficiently, thereby improving the operating efficiency of the entire system, better managing the storage and release of energy, achieving load balancing, extending battery life, and improving energy utilization. Effective network planning helps reduce unnecessary hardware investment and operating costs, such as reducing material costs and installation costs by optimizing cable layout. Reasonable network planning can reduce the risk of single point failures and improve the reliability and stability of the system through redundant design. Safety measures such as fire prevention, explosion prevention, and overload protection can be taken into account during the planning process to ensure the safe operation of the system. Good network planning leaves room for future system expansion, making it easier and more cost-effective to add new equipment or upgrade the system. By optimizing the network structure and communication protocol, the delay in data transmission can be reduced and the system's response speed to load changes can be improved. Reasonable network planning can support remote monitoring and control, making it easier for managers to understand the system status in real time and perform remote operations.
[0094] In addition, good network planning can make it easier for energy storage systems to adapt to different application scenarios and demand changes, such as grid peak shaving, backup power supply, demand response, etc. By optimizing equipment layout and energy flow, the impact on the environment can be reduced, such as reducing land occupation and electromagnetic interference. Energy storage network planning is a key step in achieving efficient, reliable and economical operation of energy storage systems. It helps to maximize the value of energy storage systems while reducing operating costs and risks.
[0095] After completing the network planning of the energy storage system and the selection of the communication protocol, the tester writes the device configuration information related to the energy storage system into the device configuration table through the input device 110 for transmission to the computer device 120 .
[0096] The energy storage system includes batteries, energy storage inverters, battery management subsystems, energy management subsystems, heat exchangers, etc. The equipment configuration information includes but is not limited to the communication protocol, equipment attribute information, network configuration information and equipment operation specifications for each energy storage device in the energy storage system. Equipment attribute information includes equipment name, equipment parameters (such as battery capacity, rated voltage, charge and discharge rate, energy density, energy storage efficiency, power density, discharge depth, state of charge and battery health status, efficiency, input voltage range, overload capacity and protection level of energy storage inverters, operating temperature and storage temperature of battery management subsystems, etc.). Network configuration information includes the IP address, port and physical address of the energy storage device. Equipment operation specifications include the calculation rules and configuration points of the energy storage device (i.e., the critical thresholds for judging various states of the device).
[0097] After the computer device 120 obtains the device configuration table, step 13 is executed to verify the data in the device configuration table. The verification method can be flexibly set. For example, a rule can be adopted to verify each data item, or different verification methods can be adopted for different data items in a classified verification manner. The above method is only an example, and its implementation method is not limited.
[0098] In order to accurately verify the accuracy of each data item and avoid missing erroneous data that may cause the energy storage simulator to be inconsistent with the actual energy storage system, the concept of targeted verification of each data item is introduced in the verification of the device configuration table in step 13. Figure 4 The verification process in step 13 includes steps 131 to 137.
[0099] Step 131, verifying the header format of the device configuration table.
[0100] Step 133: if the header format is incorrect, print the header error information.
[0101] Step 135, when the header format is verified to be correct, verify each data item in the device configuration table according to the preset verification rules for each data item.
[0102] The validation rules for each data item may be extracted from a predefined and stored data validation rule table. The data validation rule table records the predefined validation rules for each data item of each energy storage device, or the data validation rule table is defined as the validation rules for each data item in the device configuration table, and the implementation method is not limited.
[0103] Step 137: When at least one data item is wrong, print data error information according to each wrong data item.
[0104] During the data verification process, you can use Python's pandas library, Dask, Modin and other data analysis tools to process the device configuration table to read, process and analyze the data in the device configuration table. Load the device configuration table into the data frame (DataFrame) of the pandas library to perform related operations on the table data of the device configuration table.
[0105] In step 131, a data analysis tool is used to locate the header format of the device configuration table, and the column names of the header data frame (i.e., header format) of the device configuration table are extracted and converted into a list for comparison. For example, the header format of the device configuration table is compared with the predefined expected header format. If they are consistent, the header format is verified to be correct (i.e., correct). If they are inconsistent, the header format is wrong, and step 133 is executed to print out the header error information to inform the tester of the error cause in a timely manner.
[0106] If the header format is verified to be correct, step 135 is executed to verify the data items in the device configuration table. The method of verifying the data items can be flexibly set, for example, a traversal verification method can be adopted, or a parallel verification method can be adopted, and the implementation method is not limited.
[0107] In order to improve the accuracy of verification and avoid errors caused by verification disorder, the idea of traversing and verifying one by one in the order of columns in the device configuration table is introduced in the data item verification of step 135. Figure 5 The process of verifying each data item in the device configuration table in step 135 may include steps 1351 to 1357.
[0108] Step 1351, use the first column in the device configuration table as a verification column.
[0109] The first column here refers to the first column in the data item, not the sequence number column.
[0110] Step 1352, retrieve the validation rules of the validation column, and convert each data item of the validation column into a list to obtain a validation list.
[0111] The validation rules include the expected total number of data, the expected data type of each data item, the expected data range, and the validation function.
[0112] Step 1353, based on the expected total data, check the data missing status of the verification column.
[0113] For example, the total number of data in the verification column is compared with the expected total number of data to see if they are consistent. If they are inconsistent, it indicates that there is missing data.
[0114] Step 1354, for each data item in the verification list, check the correctness of the data item based on the expected data type, expected data range and verification function of the data item.
[0115] The data item check includes: confirming whether the data type of the data item is consistent with the expected data type, checking whether the data value of the data item is within the expected data range, and using the verification function to check whether the data item is accurate, so as to obtain the result of each verification. For example, if it is inconsistent with the expected data type, the print data type is incorrect, and if everything is in line with expectations, the print verification is passed.
[0116] Step 1355, determine whether the verification column is the last column of the device configuration table. If not, execute step 1356, and if so, execute step 1357.
[0117] Step 1356: Use the next column after the verification column as the next verification column. After step 1356, return to step 1352.
[0118] Step 1357, obtain the verification result.
[0119] Through the above steps 1351 to 1357, each data item is traversed in order to be checked one by one, which effectively avoids omissions in verification, improves the accuracy of verification, and ensures to a certain extent that the energy storage simulator generated subsequently will not have errors.
[0120] In step 137, after an erroneous data item is found, the verification may be stopped and the error cause of the erroneous data item may be printed to remind the tester to make corrections. Alternatively, after all data items are verified, the error causes of all erroneous data items may be printed together, so that the tester can make corrections and adjustments to all erroneous data at one time, avoiding repeated verification errors and improving the efficiency of energy storage simulator generation.
[0121] When the header format and each data are verified to be correct, execute step 15 to construct the energy storage simulator. The method of constructing the energy storage simulator can be flexibly selected. For example, the device configuration table can be input into a predefined simulation generation function, and the energy storage simulator can be automatically generated by the simulation generation function, or the energy storage simulator can be generated by processing according to preset rules. The above methods are all examples, and their implementation methods are not limited.
[0122] In order to enable the energy storage simulator to simulate the data reading and writing operations of each energy storage device and facilitate the subsequent addition or update of energy storage devices, the idea of grouping the information in the device configuration table by energy storage device and converting the device information group into a dictionary in list form is introduced in step 15. Figure 6 The process of obtaining the energy storage simulator in step 15 includes steps 151 to 157.
[0123] Step 151, parse the device configuration table to obtain at least one device configuration information.
[0124] For example, each data item in the device configuration table carries a device identifier, and data items with the same device identifier belong to information of the same energy storage device. When parsing the device configuration table, all data items with the same device identifier in the device configuration table are treated as a device configuration information, so as to be grouped by energy storage device, and each device configuration information corresponds to one energy storage device.
[0125] Step 153, pre-process the device configuration information to obtain a device information group.
[0126] Step 155 , for each device information group, convert the device information group into a device dictionary, and store the device dictionary into a variable to obtain a simulated device of an energy storage device.
[0127] Step 157, the collection of simulation devices is used as an energy storage simulator.
[0128] The variables of each device dictionary may be understood as a device dictionary list, and the device dictionary list may be as shown in Table 1.
[0129] Table 1
[0130]
[0131] Table 1 contains device dictionaries of three energy storage devices (i.e., energy storage devices with device identifiers ES001, ES002, and ES003, respectively). As can be seen from Table 1, more device dictionaries of energy storage devices can be added, and only the information related to the energy storage devices in the device dictionary is needed for updating, without modifying the code logic.
[0132] By classifying and grouping the device configuration table according to the energy storage device, and constructing each information of the classification group into a simulated device, the energy storage simulator corresponding to the energy storage system is a collection of simulated devices of each energy storage device under the energy storage system, and the simulated device is the device information in the form of dictionary columns in the variable. Therefore, when the information of a certain energy storage device is updated later, it is only necessary to update the device dictionary of the energy storage device in the variable, or when the information of a new energy storage device needs to be added, it is only necessary to add a new device dictionary without changing the code logic of other parts, which is convenient for adding or updating energy storage devices.
[0133] At the same time, since all device dictionaries are stored in variables, it is possible to simulate operations such as data reading and writing of each energy storage device.
[0134] The preprocessing in step 153 may be data verification or data cleaning operations such as deduplication and denoising, and the implementation method is not limited.
[0135] In order to enable the created simulated device to simulate the operation function and communication function of the physical energy storage device at the same time, the concept of retrieving the supplementary protocol information is introduced in step 153. The preprocessing process in step 153 includes: for each device configuration, according to the communication protocol, retrieving the protocol information of the communication protocol, combining the protocol information with the remaining information of the device configuration information, and obtaining the device information group.
[0136] Through the above method, more detailed protocol information is completed for each energy storage device, so that the simulation device can accurately simulate the actual communication function and operation function (including calculation, data reading, response to control instructions, etc.) of the energy storage device at the same time, thereby meeting the test requirements.
[0137] In order to improve the readability and maintainability of the energy storage simulator (ie, the device dictionary of each simulated device) code, the concept of separating data creation and processing is introduced in the process of converting the device information group into the device dictionary in step 155. Figure 7 , the process of converting the winning device information group into a device dictionary in step 155 includes steps 1551 to 1555.
[0138] Step 1551, call a creation function for the device information group, and use the device information group as a parameter of the creation function.
[0139] Step 1553, by creating a function, the information in the device information group is arranged in a preset order to obtain a tuple.
[0140] Step 1555, by creating a function, list-derived processing is performed on the tuple to obtain a device dictionary.
[0141] Among them, the creation function is a pre-deployed function, which realizes the function of converting the device information group into a tuple, and then converting each tuple in the tuple list into a device dictionary. In addition, for the same energy storage device, the device information group can be classified according to the data type or data function to create multiple device dictionaries. For example, the device operation rules including information such as calculation method, configuration point and operation rules are a dictionary a of device A, and the network device information is a dictionary b of device A, so as to facilitate subsequent rapid positioning and search.
[0142] In the above process, the device information groups are first arranged in a certain order to form a tuple, and then written into a tuple list. The tuple list contains multiple tuples, each of which represents an information set of an energy storage device. The information is arranged in a certain order to facilitate subsequent processing. Next, using list derivation, each tuple in the tuple list is efficiently and concisely converted into a device dictionary. The device dictionary stores the device attribute information, communication protocol, network configuration information, and device operation specifications of the corresponding energy storage device in the form of key-value pairs, which is convenient for subsequent reading and searching of data. Each device dictionary is stored in a variable, and the detailed information of each device can be displayed by traversing this list.
[0143] In this way, by storing tuples and device dictionaries converted from tuples into variables, data creation and processing are separated, that is, data is read by querying variables, and data creation is achieved by modifying the tuple list and then converting it into a device dictionary. The two are independent and complementary to each other, thereby greatly improving the readability and maintainability of the energy storage simulator (i.e., the device dictionary of each simulated device) code.
[0144] After the energy storage simulator is constructed in the above manner, in step 17, a common service interface may be created for the energy storage simulator, or multiple service interfaces may be created as required, and the implementation method is not limited.
[0145] Considering that the test process may involve controlling or reading data from multiple energy storage devices at the same time, in order to avoid access resource conflicts when using the energy storage simulator for subsequent test verification and improve test efficiency and accuracy, the idea of configuring a shared HTTP interface and log service, as well as creating a dedicated modbus interface for each simulation device, is introduced in step 17. Figure 8 The process of configuring the service interface and the log service in step 17 includes steps 171 to 175. Step 175 may also be executed in parallel with steps 171 to 175.
[0146] Step 171, obtaining network configuration information of each energy storage device according to the device configuration table.
[0147] Step 173, configure an HTTP interface for the energy storage simulator, and configure a modbus interface for each simulation device for the energy storage simulator based on each network configuration information.
[0148] For each modbus interface, its IP address and physical address are consistent with the corresponding analog device.
[0149] Step 175: configure a log service function for the energy storage simulator.
[0150] The HTTP interface design of the energy storage simulator follows the RESTful architecture to ensure easy understanding and expansion. The HTTP interface includes functions such as device status query, parameter configuration, and control operation. Among them, status query is implemented through GET request, which returns device status information; parameter configuration is updated using PUT request; control operation is sent through POST request.
[0151] To ensure security, the HTTP interface also implements authentication and access control, and uses OAuth 2.0 or JWT. The HTTP interface uses JSON data format and HTTPS encrypted communication. Error handling uses HTTP status code and detailed error information. The interface design considers current limiting and caching strategies to improve performance. Version control is implemented through URL or media type for easy management. Provide detailed API documentation for developers to use. The design takes into account scalability, compatibility and maintainability to meet future changes in demand.
[0152] For example, to display detailed information about the current state of the simulated energy storage device, this can be achieved through the Json code shown in Table 2 below through the HTTP interface.
[0153] Table 2
[0154]
[0155]
[0156] By way of example, in step 173 , the Modbus interface of each simulated device may be created using the pymodbus library, a Python library for the Modbus protocol that supports TCP, UDP, serial (RTU and ASCII), and TLS.
[0157] Among them, the pymodbus library can be used to create a TCP server with a Modbus interface using the code shown in Table 3.
[0158] Table 3
[0159]
[0160] Each modbus interface implements the relevant services of the corresponding analog device.
[0161] For example, the Modbus interface allows the monitoring center or the upper management system of the energy storage system to query the real-time data of the simulated equipment in the energy storage simulator (i.e., the simulator of the energy storage system) through the Modbus protocol, such as battery status, charge and discharge power, temperature, voltage, current, etc. Through the Modbus interface, testers can remotely configure the parameters of the simulated equipment in the energy storage simulator, such as setting the working mode (charging, discharging, standby, etc.), alarm thresholds, control strategies, etc.
[0162] The Modbus interface supports receiving control instructions from external systems (for simulated devices in the energy storage simulator) to achieve remote control of the energy storage system, such as starting or stopping the charging / discharging process. When an abnormality occurs in the energy storage system, the Modbus interface provides simulation of fault codes and related information to facilitate diagnosis and troubleshooting. Through the Modbus interface, the energy storage simulator can also be integrated with industrial control systems, SCADA systems or other third-party systems. The Modbus interface also provides an interface for historical data recording, so that the historical operating data of the energy storage system can be queried and analyzed for optimizing system performance and formulating maintenance plans.
[0163] The log services configured in step 175 include, but are not limited to: operation, status, performance, error, system, and debug logs, which are used to record user operations, device status, performance indicators, exception information, etc. These services help testers monitor device status, analyze performance trends, and locate fault causes. The log service supports records at different levels and formats, and ensures effective management and utilization of log information through storage, rotation, and analysis. These features are critical for development and testing, enabling teams to better understand the behavior of the simulator, respond to issues in a timely manner, and continuously optimize device performance.
[0164] Through the above steps 171 to 175, a public log service and HTTP interface are configured for the energy storage simulator, and a dedicated modbus interface is configured for each simulated device, so as to simulate and implement services such as remote control, data query, parameter configuration, and integration with other systems of the energy storage system, and simulate and implement services such as remote control, data query, parameter configuration, and fault analysis of the simulated devices, thereby building a test environment for the energy storage system with high convenience and low cost.
[0165] The energy storage simulator constructed by the above energy storage device simulator generation method can be Fig. 9As shown in the figure, it is obvious that by constructing a virtual energy storage simulator, all energy storage devices of the energy storage system can be simulated and run in a PC. The environment construction only needs to plug in a network cable. During the test, if it is necessary to observe the pulse signal sent by the EMS in a very short time, it can be captured by simply turning on the log function of the device simulator, which greatly reduces the difficulty and cost of environment construction.
[0166] Based on the same concept as the above energy storage device simulator generation method, refer to Fig.10 The embodiment of the present invention further provides an energy storage device simulator generation device 30 , including a configuration acquisition module 310 , a data verification module 320 , a simulator generation module 330 and a service configuration module 340 .
[0167] The configuration acquisition module 310 is used to acquire a device configuration table, wherein the device configuration table includes device configuration information.
[0168] The data verification module 320 is used to verify the data in the device configuration table.
[0169] The simulator generation module 330 is used to obtain an energy storage simulator according to the device configuration information in the device configuration table when the device configuration table is verified. The energy storage simulator includes at least one simulation device of an energy storage device, and the simulation device is used to simulate the operation function of the corresponding energy storage device.
[0170] The service configuration module 340 is used to configure the service interface and log service for the energy storage simulator according to the device configuration table. The service interface is used to provide communication and data services for the energy storage simulator, and the log service is used to record the log information of each simulation device.
[0171] The energy storage device simulator generation device 30 automatically constructs an energy storage simulator composed of simulation devices of various energy storage devices through the coordinated action of the configuration acquisition module 310, the data verification module 320, the simulator generation module 330 and the service configuration module 340. The simulation device realizes the simulation of the energy storage device function, the configured log service records the log service of the simulation device operation, and the configured service interface realizes the communication and data functions of the energy storage device. Thus, the various energy storage devices of the energy storage system can be simulated and run on a computer device, and the test environment of the energy storage system can be built by plugging a network cable, which greatly simplifies the difficulty and cost of environment construction.
[0172] For the specific implementation and effect of the energy storage device simulator generating device 30, please refer to the description of the implementation of the energy storage device simulator generating method in the above text, such as, for the specific implementation and effect of the configuration acquisition module 310, please refer to the description of the relevant content of step 11 in the above text, for the specific implementation and effect of the data verification module 320, please refer to the description of the relevant content of step 13 in the above text, for the specific implementation and effect of the simulator generation module 330, please refer to the description of the relevant content of step 15 in the above text, for the specific implementation and effect of the service configuration module 340, please refer to the description of the relevant content of step 17 in the above text, and no further details will be given here.
[0173] In addition, each module of the energy storage device simulator generating device 30 can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above modules can be embedded in or independent of the processor 220 in the electronic device 20 in the form of hardware, or can be stored in the memory 210 of the electronic device 20 in the form of software, so that the processor 220 can call and execute the operations corresponding to each of the above modules to implement the energy storage device simulator generating method provided above.
[0174] The embodiment of the present invention also provides an electronic device 20, including a processor 220 and a memory 210, wherein the memory 210 stores a computer program executable by the processor 220, and the processor 220 can execute the computer program to implement the energy storage device simulator generation method proposed in the embodiment of the present invention.
[0175] The embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by the processor 220, the method for generating an energy storage device simulator as proposed in the embodiment of the present invention is implemented.
[0176] In summary, the energy storage device simulator generation method, device, electronic device, and storage medium provided by the embodiments of the present invention have at least the following beneficial effects:
[0177] (1) The energy storage device simulator can provide a safe and reliable environment to simulate the operation of the power grid and energy storage system;
[0178] (ii) Automatically create and construct corresponding simulation equipment for each component of the energy storage system, such as the energy storage converter (PCS) controller, the energy storage battery management system (BMS) and the energy storage power station energy management system (EMS), so as to construct an energy storage simulator for the energy storage system, so as to conduct a comprehensive test and verification of the energy storage system based on the energy storage simulator to ensure the reliability of its functions;
[0179] (iii) Simulation testing through energy storage simulators can significantly reduce the cost and time of experimental scenario construction, while improving test efficiency;
[0180] (iv) The energy storage simulator can simulate various energy storage devices in the energy storage system, so as to accurately simulate the operating status under different grid conditions, and be used to test and verify the performance and stability of the energy storage system under different conditions, and help optimize the design and operation of the energy storage system;
[0181] (V) The operation is convenient and simple. You only need to fill in the configuration table and configure the device communication information to automatically generate an energy storage simulator for the energy storage device.
[0182] In several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0183] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0184] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device 120 (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory 210, a random access memory 210, a magnetic disk or an optical disk.
[0185] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for generating an energy storage device simulator, characterized in that: The method comprises: Obtaining a device configuration table; wherein the device configuration table includes device configuration information; Verify the data in the device configuration table; When the verification of the device configuration table is passed, an energy storage simulator is obtained according to the device configuration information of each device in the device configuration table; wherein the energy storage simulator includes at least one simulation device of an energy storage device, and the simulation device is used to simulate the operating function of the corresponding energy storage device; According to the device configuration table, a service interface and a log service are configured for the energy storage simulator; wherein the service interface is used to provide communication and data services for the energy storage simulator, and the log service is used to record log information of each of the simulated devices.
2. The method for generating an energy storage device simulator according to claim 1, characterized in that: The step of obtaining the energy storage simulator according to each of the configuration information in the device configuration table includes: Parsing the device configuration table to obtain at least one device configuration information; Preprocessing the device configuration information to obtain a device information group; For each of the device information groups, convert the device information group into a device dictionary, and store the device dictionary into a variable to obtain a simulated device of an energy storage device; The collection of the simulation devices is used as an energy storage simulator.
3. The method for generating an energy storage device simulator according to claim 2, characterized in that: The step of converting the device information group into a device dictionary comprises: Calling a creation function for the device information group and using the device information group as a parameter of the creation function; By means of the creation function, the information in the device information group is arranged in a preset order to obtain a tuple; The creation function is used to perform list derivation processing on the tuple to obtain a device dictionary.
4. The method for generating an energy storage device simulator according to claim 2, characterized in that: The device configuration information includes device attribute information, communication protocol, network configuration information and device operation specifications; The step of preprocessing the device configuration information to obtain a device information group includes: For each of the device configurations, according to the communication protocol, retrieving the protocol information of the communication protocol; The protocol information is combined with the remaining information of the device configuration information to obtain a device information group.
5. The method for generating an energy storage device simulator according to any one of claims 1 to 4, characterized in that: The step of verifying the data in the device configuration table includes: Verifying the header format of the device configuration table; In case of an error in the header format, print the header error information; When the table header format is verified to be correct, verify each data item in the device configuration table according to the preset verification rules for each data item; In the case where at least one of the data items is erroneous, data error information is printed according to each of the erroneous data items.
6. The method for generating an energy storage device simulator according to claim 5, characterized in that: The step of verifying each data item in the device configuration table according to the preset verification rules of each data item includes: Using the first column in the device configuration table as a verification column; Retrieving the validation rules of the validation column, and converting each data item of the validation column into a list to obtain a validation list; wherein the validation rules include the expected total number of data, the expected data type of each data item, the expected data range, and the validation function; According to the expected total number of data, check the data missing status of the verification column; For each of the data items in the verification list, checking the correctness of the data item according to the expected data type, the expected data range and the verification function of the data item; Determine whether the verification column is the last column of the device configuration table; If yes, then obtain the verification result; If not, the next column after the verification column is used as the next verification column, and the step of returning to execute the verification rule of the verification column, and converting each data item of the verification column into a list to obtain the verification list.
7. The method for generating an energy storage device simulator according to any one of claims 1 to 4, characterized in that: The step of configuring a service interface and a log service for the energy storage simulator according to the device configuration includes: According to the device configuration table, obtain network configuration information of each energy storage device; Configure an HTTP interface for the energy storage simulator, and configure a modbus interface for each of the simulated devices for the energy storage simulator according to each of the network configuration information; Configure a log service function for the energy storage simulator.
8. A device for generating an energy storage device simulator, characterized in that: It includes configuration acquisition module, data verification module, simulator generation module and service configuration module; The configuration acquisition module is used to acquire a device configuration table; wherein the device configuration table includes device configuration information; The data verification module is used to verify the data in the device configuration table; The simulator generation module is used to obtain an energy storage simulator according to each device configuration information in the device configuration table when the verification of the device configuration table passes; wherein the energy storage simulator includes at least one simulation device of an energy storage device, and the simulation device is used to simulate the operating function of the corresponding energy storage device; The service configuration module is used to configure a service interface and a log service for the energy storage simulator according to the device configuration table; wherein the service interface is used to provide communication and data services for the energy storage simulator, and the log service is used to record log information of each of the simulated devices.
9. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores a computer program executable by the processor, and the processor can execute the computer program to implement the energy storage device simulator generation method as described in any one of claims 1 to 7.
10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for generating an energy storage device simulator according to any one of claims 1 to 7 is implemented.