Photovoltaic Inverter Identification Method, Device, Computer Equipment and Storage Medium
By creating a script execution environment in the concentrator, importing and judging the photovoltaic inverter protocol files, and achieving adaptive adaptation, it solves the problem of communication difficulties between inverters and concentrators of different manufacturers, improves data acquisition and regulation efficiency, and shortens the development cycle.
Patent Information
- Application Number
- CN202411825569.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2044-12-12
AI Technical Summary
Different manufacturers have difficulty in communicating with photovoltaic inverters and concentrators, which leads to difficulties in collection and regulation. The existing methods require modification of procedures to adapt to the protocols of different manufacturers, increasing the development cycle and difficulty.
By creating a script execution environment, importing protocol script files for multiple photovoltaic inverters, using script protocol files to achieve adaptive adaptation, and data collection and regulation are collected and regulated after the communication is judged. The script files are stored in FLASH or EEPROM, supporting protocol adaptation from different manufacturers.
It reduces the difficulty of data acquisition of photovoltaic inverters, improves development efficiency, shortens the project development cycle, solves the upgrade difficulties caused by protocol mismatch, and realizes communication and regulation of inverters from different manufacturers.
Smart Images

Figure CN119298401B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power collection terminals, and particularly to a method and device for identifying a photovoltaic inverter, a computer device, and a storage medium. Background Art
[0002] With the rapid development and wide application of renewable energy, especially photovoltaic power generation technology, distributed photovoltaic systems are playing an increasingly important role in the energy field. However, since the power generation of photovoltaic inverters depends on external environmental factors such as solar radiation, their output power has certain volatility and uncertainty, posing challenges to the safe and stable operation of the power grid. In order to improve the reliability and economy of distributed photovoltaics, research on distributed photovoltaic control aims to flexibly control the operation of photovoltaic systems in real-time scheduling, achieve optimal utilization of photovoltaic power generation, and improve the efficiency and stability of distributed photovoltaic systems, which is of great significance.
[0003] Currently, there are already some photovoltaic monitoring systems, but these systems have some defects and deficiencies, mainly in the following aspects:
[0004] ① Since photovoltaic inverters are an industry developed in recent years, different manufacturers' photovoltaic inverters use different standards and communication protocols. Therefore, there are compatibility problems in the communication between photovoltaic inverters and concentrators, resulting in the inability to collect and analyze photovoltaic inverters and the inability to regulate photovoltaic inverters.
[0005] ② Since there are many photovoltaic inverters on-site, the concentrator cannot be factory-fitted with the protocols of many manufacturers. It often needs to remotely upgrade the entire concentrator engineering program to increase the adaptation of more manufacturer protocols.
[0006] Currently, collection terminals generally use the Modbus RTU protocol (the Modbus RTU protocol is an open serial communication protocol) to communicate with photovoltaic inverters. The collection terminal serves as the host, and the photovoltaic inverter serves as the slave. The host request frame structure is: slave address, function code, register start address, number of registers, CRC (Cyclic Redundancy Check) check code. Among them, the register start address and the number of registers are customized by photovoltaic inverter manufacturers, and there are significant differences between manufacturers. Therefore, adapting to the protocols of different manufacturers' photovoltaic inverters is the key and difficulty in photovoltaic inverter collection.
[0007] Currently, the conventional method for collection terminals to adapt to photovoltaic inverter protocols is to write the register start address and the number of registers in different manufacturers' photovoltaic inverter protocols into the program. If the photovoltaic inverter protocol changes or other photovoltaic inverter protocols need to be adapted, the program needs to be modified. This approach lengthens the project development cycle, increases the number of program version changes, and is not conducive to subsequent upgrades. Summary of the Invention
[0008] In view of this, the present invention provides a method and device for identifying a photovoltaic inverter, a computer device, and a storage medium, so as to solve the problem of difficult communication between photovoltaic inverters of different manufacturers and a concentrator, resulting in problems with the acquisition and control of photovoltaic inverters.
[0009] In a first aspect, the present invention provides a method for identifying a photovoltaic inverter, which is applied to a concentrator; the method includes:
[0010] Create a script execution environment, and import multiple script protocol files corresponding to the photovoltaic inverter protocols of multiple photovoltaic inverters through the script execution environment;
[0011] When starting the photovoltaic inverter acquisition task thread, based on each script protocol file, enable the concentrator to communicate with any designated photovoltaic inverter, and determine whether the communication is successful;
[0012] After the communication is successful, collect the data of the photovoltaic inverter with successful communication, and control the photovoltaic inverter.
[0013] The method for identifying a photovoltaic inverter provided by the present invention realizes the adaptive adaptation of the photovoltaic inverter protocols of each manufacturer to the concentrator by means of a script file through a built-in photovoltaic inverter protocol library, reduces the difficulty of collecting data of the photovoltaic inverter, and realizes the data collection and control of the photovoltaic inverter through the correctly identified photovoltaic inverter manufacturer protocol, effectively improving the development efficiency of the photovoltaic inverter and shortening the project development cycle, overcoming the problem of spending a lot of time upgrading the program due to the mismatch of the inverter protocol, and solving the problem of difficult communication between photovoltaic inverters of different manufacturers and the concentrator, resulting in problems with the acquisition and control of photovoltaic inverters.
[0014] In an optional implementation manner, the concentrator includes a FLASH storage space; importing multiple script protocol files corresponding to the photovoltaic inverter protocols of multiple photovoltaic inverters through the script execution environment includes:
[0015] Import multiple script protocol files corresponding to the photovoltaic inverter protocols of multiple photovoltaic inverters from the script protocol library in the form of string files according to the script serial numbers through the script execution environment, and decompress and verify the multiple script protocol files and then store them in the FLASH storage space.
[0016] The method for identifying a photovoltaic inverter provided by the present invention separates the photovoltaic inverter protocol from the program, and stores the script protocol file corresponding to the photovoltaic inverter protocol as a configuration file in the FLASH storage space, providing conditions for adapting to the photovoltaic inverter protocols of different manufacturers.
[0017] In an optional implementation manner, decompressing and verifying the multiple script protocol files includes:
[0018] Unzip multiple script protocol files and verify the header information of each script protocol file; the header information includes CRC check code, photovoltaic inverter protocol file name, photovoltaic inverter version information, original length of the script file, compressed length of the script file, and magic word.
[0019] When the header information is consistent with the header information of the corresponding script protocol file recorded in the script protocol library, it is determined that the corresponding script protocol file is legal; otherwise, the corresponding script protocol file is discarded and multiple script protocol files of the script protocol library are received again.
[0020] The photovoltaic inverter identification method provided by the present invention unzips multiple script protocol files and verifies the header information of each script protocol file to judge the legality of the script protocol file, ensuring the correctness and reliability of the script protocol file during the transmission process and providing conditions for adapting to the photovoltaic inverter protocols of different manufacturers.
[0021] In an optional implementation manner, the concentrator further includes a function interface, and the function interface includes an inverter identification function interface.
[0022] Based on each script protocol file, enabling the concentrator to communicate with any specified photovoltaic inverter and determining whether the communication is successful includes:
[0023] Obtain the photovoltaic inverter protocol of the specified photovoltaic inverter, read the first script protocol file from the FLASH storage space based on the photovoltaic inverter protocol and according to the script serial number, and call the inverter identification function of the first script protocol file through the inverter identification function interface for registration and loading. If there is return data when the inverter identification function is sent to the specified photovoltaic inverter, it is determined that the concentrator communicates successfully with any specified photovoltaic inverter; otherwise, it is determined that the communication fails.
[0024] The photovoltaic inverter identification method provided by the present invention obtains the photovoltaic inverter protocol, adapts through the script protocol file, and determines whether the communication is successful by whether there is return data when sent to the photovoltaic inverter, solving the problem of spending a lot of time upgrading the program due to the incompatibility of the photovoltaic inverter protocol.
[0025] In an optional implementation manner, based on each script protocol file, enabling the concentrator to communicate with any specified photovoltaic inverter and determining whether the communication is successful further includes:
[0026] If the communication fails, increment the script serial number and continue to read the next script protocol file from the FLASH storage space, and again call the inverter identification function of the corresponding script protocol file through the inverter identification function interface for registration and loading until the communication is successful.
[0027] The photovoltaic inverter identification method provided by the present invention sequentially reads the next script protocol file from the FLASH storage space according to the script serial number, and then calls the inverter identification function of the corresponding script protocol file through the inverter identification function interface for registration and loading until the communication is successful. It realizes the purpose of adapting different photovoltaic inverter protocols through multiple script protocol files, so that there is no compatibility problem in the communication between the concentrator and the photovoltaic inverter.
[0028] In an alternative embodiment, the concentrator further includes an EEPROM storage space. Multiple script protocol files at the time of the concentrator's factory are stored in the EEPROM storage space in the order of script serial numbers. Based on each script protocol file, the concentrator communicates with any specified photovoltaic inverter, and determining whether the communication is successful further includes:
[0029] If the communication fails and the script serial number exceeds the maximum script serial number of the FLASH storage space when incremented again, the first script protocol file is read from the EEPROM storage space, and the inverter identification function of the corresponding script protocol file is called through the inverter identification function interface for registration and loading until the communication is successful. If the communication fails and the script serial number exceeds the maximum script serial number of the EEPROM storage space when incremented again, a new script protocol file of the photovoltaic inverter protocol corresponding to the communication-failed photovoltaic inverter is added to the FLASH storage space through the script execution environment, and the inverter identification function of the new script protocol file is called through the inverter identification function interface for registration and loading to make the communication between the concentrator and the photovoltaic inverter successful.
[0030] The photovoltaic inverter identification method provided by the present invention adds a new script protocol file of the photovoltaic inverter protocol corresponding to the communication-failed photovoltaic inverter to the FLASH storage space, and calls the inverter identification function of the new script protocol file through the inverter identification function interface for registration and loading to make the communication between the concentrator and the photovoltaic inverter successful. Writing the corresponding script protocol file according to the photovoltaic inverter protocol and sending it to the concentrator can adapt to the photovoltaic inverter protocols of different manufacturers, update the script protocol file in real time, and better adapt to the photovoltaic inverters of different manufacturers.
[0031] In an alternative embodiment, the function interface further includes an interface for reading the basic information of the photovoltaic inverter, an interface for reading the real-time data of the photovoltaic inverter, an interface for reading the electrical energy of the photovoltaic inverter, an interface for reading the status of the photovoltaic inverter, an interface for reading the events of the photovoltaic inverter, an interface for regulating the active power of the inverter, and an interface for the inverter to execute commands;
[0032] After the communication is successful, the concentrator collects the data of the photovoltaic inverter with successful communication and regulates the photovoltaic inverter, including:
[0033] After successful communication, in accordance with a preset cycle, the functions of reading the basic information of the PV inverter, reading the real-time data of the PV inverter, reading the electrical energy of the PV inverter, reading the status of the PV inverter, and reading the events of the PV inverter in the corresponding script protocol file are called in sequence through the interfaces of reading the basic information of the PV inverter, reading the real-time data of the PV inverter, reading the electrical energy of the PV inverter, reading the status of the PV inverter, and reading the events of the PV inverter, so as to read the basic information of the PV inverter, read the real-time data of the PV inverter, read the electrical energy of the PV inverter, read the status of the PV inverter, and read the events of the PV inverter;
[0034] When it is necessary to control the PV inverter, the functions of controlling the active power of the inverter and the functions of executing commands of the inverter in the corresponding script protocol file are called through the interfaces of controlling the active power of the inverter and the interfaces of executing commands of the inverter, so as to control the active power of the inverter and / or execute commands of the inverter.
[0035] The PV inverter identification method provided by the present invention uses corresponding function interfaces to call corresponding functions, realizing the acquisition of data of PV inverters from different manufacturers and the control of PV inverters.
[0036] In an alternative embodiment, the PV inverter identification method further includes: upgrading multiple script protocol files in the FLASH storage space through differential upgrade.
[0037] The PV inverter identification method provided by the present invention differentially upgrades multiple script protocol files in the FLASH storage space, greatly reducing the size of the transmitted files and avoiding the risks brought by the upgrade of the concentrator.
[0038] In a second aspect, the present invention provides a PV inverter identification device, which is applied to a concentrator; the device includes:
[0039] A script protocol file import module, configured to create a script execution environment and import multiple script protocol files corresponding to the PV inverter protocols of multiple PV inverters through the script execution environment;
[0040] A communication module, configured to, when starting a PV inverter acquisition task thread, communicate the concentrator with any specified PV inverter based on each script protocol file and determine whether the communication is successful;
[0041] An acquisition and control module, configured to, when the communication is successful, acquire the data of the PV inverter with successful communication and control the PV inverter.
[0042] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to implement the photovoltaic inverter identification method according to the first aspect or any corresponding embodiment thereof.
[0043] In a fourth aspect, the present invention provides a computer-readable storage medium, on which computer instructions are stored. The computer instructions are used to cause a computer to execute the photovoltaic inverter identification method according to the first aspect or any corresponding embodiment thereof.
[0044] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions, which are used to cause a computer to execute the photovoltaic inverter identification method according to the first aspect or any corresponding embodiment thereof. Description of the Drawings
[0045] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0046] Figure 1 is a schematic flowchart of a photovoltaic inverter identification method according to an embodiment of the present invention;
[0047] Figure 2 is a schematic flowchart of another photovoltaic inverter identification method according to an embodiment of the present invention;
[0048] Figure 3 is a schematic flowchart of yet another photovoltaic inverter identification method according to an embodiment of the present invention;
[0049] Figure 4 is a schematic flowchart of still another photovoltaic inverter identification method according to an embodiment of the present invention;
[0050] Figure 5 is a schematic flowchart of still yet another photovoltaic inverter identification method according to an embodiment of the present invention;
[0051] Figure 6 is a schematic diagram of the internal protocol library space allocation of a concentrator according to an embodiment of the present invention;
[0052] Figure 7 is a schematic diagram of another internal protocol library space allocation of a concentrator according to an embodiment of the present invention;
[0053] Figure 8It is a structural block diagram of a photovoltaic inverter identification device according to an embodiment of the present invention;
[0054] Figure 9 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed implementation manners
[0055] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0056] According to an embodiment of the present invention, an embodiment of a method for identifying a photovoltaic inverter is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.
[0057] In this embodiment, a method for identifying a photovoltaic inverter is provided, which can be used for a concentrator. Figure 1 It is a flowchart of a method for identifying a photovoltaic inverter according to an embodiment of the present invention. As Figure 1 shown, the process includes the following steps:
[0058] Step S101, create a script execution environment, and import multiple script protocol files corresponding to the photovoltaic inverter protocols of multiple photovoltaic inverters through the script execution environment.
[0059] Specifically, as Figure 4 shown, the script execution environment is a Lua (a lightweight scripting language written in standard C language) script environment, and the multiple script protocol files are all Lua script protocol files corresponding to the photovoltaic inverter protocols of different photovoltaic inverters.
[0060] Exemplarily, as Figure 6 shown, when the concentrator leaves the factory, multiple script protocol files in the Lua script protocol library can be imported into the internal EEPROM storage space and the external FLASH storage space. In the protocol library storage space of the Lua execution environment, try to import the Lua script protocol files according to the script serial numbers, and each Lua script protocol file is filled with a 4K-sized space.
[0061] As Figure 7As shown, the concentrator internally contains a series of function interfaces, such as the inverter identification function interface and the inverter information reading function interface. Each Lua script protocol file also contains function interfaces corresponding to the concentrator, that is, the function interface names of these function interfaces are the same in different Lua script protocol files. The concentrator uses the corresponding function operation interface and the method of string matching to replace the corresponding functions inside the function interface, so as to achieve the purpose of replacing the photovoltaic inverter protocol.
[0062] Step S102, when starting the photovoltaic inverter acquisition task thread, based on each script protocol file, the concentrator communicates with any specified photovoltaic inverter and determines whether the communication is successful.
[0063] Exemplarily, as Figure 4 shown, when starting the photovoltaic inverter acquisition task thread, first, the Lua script file is read from the FLASH storage space, registered, loaded, and the function interface is replaced. The thread calls the loaded inverter identification function through the function interface and executes the inverter identification function to attempt to communicate with the photovoltaic inverter. If there is return data when the inverter identification function is sent to the photovoltaic inverter, it is considered that the communication is successful.
[0064] A more specific process is as Figure 5 shown. If there is no return data and it times out when the inverter identification function is sent to the photovoltaic inverter, it is considered that the communication fails. The thread will read the next Lua script file from the FLASH storage space in ascending order of the script number, register and load the inverter identification function again according to the same operation. If it fails and exceeds the maximum Lua script number under the FLASH storage space, the Lua script protocol file under the EEPROM storage space will be used, and the registration, loading, and communication will be carried out according to the same process. After the communication with the photovoltaic inverter is successful, it is considered that the protocol adaptation is successful.
[0065] Step S103, when the communication is successful, collect the data of the photovoltaic inverter with successful communication and control the photovoltaic inverter.
[0066] Specifically, when the communication is successful, the concentrator collects the data of the photovoltaic inverter periodically and monitors the photovoltaic inverter. A more specific process is as Figure 5 shown.
[0067] The photovoltaic inverter identification method provided in this embodiment realizes the adaptive adaptation of the photovoltaic inverter protocols of each manufacturer to the concentrator by means of a built-in photovoltaic inverter protocol library and in the form of a script file, reduces the difficulty of collecting data of the photovoltaic inverter, and realizes the data collection and control of the photovoltaic inverter through the correctly identified photovoltaic inverter manufacturer protocol, effectively improving the development efficiency of the photovoltaic inverter, shortening the project development cycle, overcoming the problem of spending a lot of time upgrading the program due to the mismatch of the inverter protocol, and solving the problem of the communication difficulty between the photovoltaic inverters of different manufacturers and the concentrator resulting in the collection and control of the photovoltaic inverter.
[0068] In this embodiment, a photovoltaic inverter identification method is provided, which can be used for a concentrator. Figure 2 It is a flowchart of the photovoltaic inverter identification method according to an embodiment of the present invention, as Figure 2 shown. The process includes the following steps:
[0069] Step S201, create a script execution environment, and import multiple script protocol files corresponding to the photovoltaic inverter protocols of multiple photovoltaic inverters through the script execution environment.
[0070] Specifically, the above step S201 includes:
[0071] Step a. Import multiple script protocol files corresponding to the photovoltaic inverter protocols of multiple photovoltaic inverters from the script protocol library in the form of string files through the script execution environment, decompress and verify the multiple script protocol files, and store them in the FLASH storage space.
[0072] The multiple script protocol files are Lua script protocol files. When creating a Lua script protocol file, download the latest version of the Lua source code from the Lua official website, decompress it and add it to the already created C language project. Send the Lua script protocol files corresponding to the photovoltaic inverter protocols of different manufacturers to the concentrator through 698 messages (referring to a specific data transmission format in the DLT645-2007 specification). After the concentrator verifies and decompresses the Lua script protocol files, it stores them in the FLASH storage space and / or the EEPROM storage space and updates the valid file bitmap. Read the valid file bitmap stored in the FLASH storage space and / or the EEPROM storage space, and read and verify the Lua script protocol files stored in the FLASH storage space / or the EEPROM storage space according to the valid file bitmap.
[0073] In some optional implementation manners, decompressing and verifying the multiple script protocol files in step a. includes:
[0074] Step a1: Unzip multiple script protocol files and verify the header information of each script protocol file. The header information includes CRC check code, PV inverter protocol file name, PV inverter version information, original length of the script file, compressed length of the script file, and magic word.
[0075] Specifically, as Figure 6 shown, the Lua script protocol file with added header information is stored in the FLASH storage space and / or EEPROM storage space.
[0076] Step a2: When the header information is consistent with the header information of the corresponding script protocol file recorded in the script protocol library, determine that the corresponding script protocol file is legal; otherwise, discard the corresponding script protocol file and receive multiple script protocol files from the script protocol library again.
[0077] Specifically, after the concentrator receives the 698 message of the downloaded Lua script protocol file, it verifies the file header magic word and file CRC check code in the file header information respectively, and then searches the FLASH storage space and EEPROM storage space based on the file name to check whether a file with the same name has been downloaded from the script protocol library. If a file with the same name has been downloaded, compare whether the file contents are consistent (if the file contents are consistent, exit the process; if the file contents are inconsistent, write the new file contents at the original storage location). If a file with the same name has not been downloaded, find a new space in the FLASH storage space or EEPROM storage space for storage, and then update the valid file bitmap.
[0078] The PV inverter identification method provided in this embodiment unzips multiple script protocol files and verifies the header information of each script protocol file to determine the legality of the script protocol file, ensuring the correctness and reliability of the script protocol file during the transmission process and providing conditions for adapting to PV inverter protocols of different manufacturers.
[0079] Step S202: When starting the PV inverter acquisition task thread, based on each script protocol file, enable the concentrator to communicate with any specified PV inverter and determine whether the communication is successful.
[0080] Specifically, the concentrator further includes a function interface, and the function interface includes an inverter identification function interface. The above step S202 includes:
[0081] Step S2021: Obtain the photovoltaic inverter protocol of the specified photovoltaic inverter. Based on the photovoltaic inverter protocol, read the first script protocol file from the FLASH storage space according to the script serial number, and call the inverter identification function of the first script protocol file through the inverter identification function interface for registration and loading. If there is return data when the inverter identification function is sent to the specified photovoltaic inverter, it is determined that the concentrator communicates successfully with any specified photovoltaic inverter; otherwise, it is determined that the communication fails.
[0082] Specifically, as Figure 4 shown, when the concentrator starts the photovoltaic inverter acquisition task thread, it will first read the Lua script file from the FLASH storage space, register and load it, and replace the function interface. The thread calls and executes the inverter identification function through the function interface to attempt to communicate with the photovoltaic inverter. If there is return data when the inverter identification function is sent to the photovoltaic inverter, it is considered that the communication is successful. If there is no return data and it times out when the inverter identification function is sent to the photovoltaic inverter, it is considered that the communication fails.
[0083] Exemplarily, when the Lua script protocol file is created, it first defines 10 working states in the inverter acquisition process, namely idle, pre-acquisition preparation, protocol identification, reading inverter basic information, reading inverter real-time data, reading inverter electrical energy, reading inverter status, reading inverter events, regulating inverter active power, and inverter executing commands.
[0084] Then, 9 functions for implementing different functions are defined in the Lua script, corresponding to the 9 working states except idle above, namely prepare (idle, pre-acquisition preparation state), identify (inverter protocol identification state), readInfo (reading inverter basic information), readReal (reading inverter real-time data state), readEnergy (reading inverter electrical energy state), readState (reading inverter status), readEvent (reading inverter events), adjPower (regulating inverter active power), and cmd (regulating inverter execution commands).
[0085] Define the valid file bitmap as a uint8 array (size: maximum number of files / 8). Each of the 8 bits in each byte of the array can be used to represent whether 8 files are valid. Download the latest version of the Lua source code from the Lua official website, decompress it, and add it to the already created C language project.
[0086] The Lua script protocol files corresponding to the inverter protocols of different manufacturers are sent to the acquisition terminal through the 698 message (a specific data transmission format in the DLT645-2007 specification). After the acquisition terminal verifies and decompresses the Lua script, it stores it in the FLASH and EEPROM and updates the valid file bitmap. Read the valid file bitmap stored in the FLASH and EEPROM, and read and verify the Lua script protocol file stored in the FLASH and EEPROM according to the valid file bitmap.
[0087] Then, use the functions provided by the Lua source code to create an instance of the Lua virtual machine, set the inverter acquisition status to the pre-acquisition preparation status, and call the prepare function in the Lua script protocol file through the function provided by the Lua source code (with the input parameter prepare). Set the slave address in the prepare function.
[0088] When the concentrator starts the photovoltaic inverter acquisition task thread, switch the inverter acquisition status to the inverter protocol identification status, and call the identify function in the Lua script protocol file through the function provided by the Lua source code (with the input parameter identify). Read the inverter model in the identify function, and judge the inverter protocol identification result according to the return value of the identify function. If the identification fails, read the next Lua script protocol file from the FLASH storage space, that is, execute step S2022.
[0089] Step S2022: If the communication fails, increment the script serial number and continue to read the next script protocol file from the FLASH storage space, and call the inverter identification function of the corresponding script protocol file through the inverter identification function interface for registration and loading until the communication is successful.
[0090] Specifically, the thread will increment the script serial number to read the next Lua script file from the FLASH storage space, and register and load the inverter identification function again according to the same operation until the communication is successful.
[0091] The photovoltaic inverter identification method provided in this embodiment reads the next script protocol file from the FLASH storage space in sequence according to the script serial number, and calls the inverter identification function of the corresponding script protocol file through the inverter identification function interface for registration and loading until the communication is successful, achieving the purpose of adapting different photovoltaic inverter protocols through multiple script protocol files, so that there is no compatibility problem in the communication between the concentrator and the photovoltaic inverter.
[0092] Step S2023, the concentrator further includes an EEPROM storage space. Multiple script protocol files at the time of the concentrator's factory are stored in the EEPROM storage space in the order of script serial numbers. If, after communication fails and the script serial number is incremented again and exceeds the maximum script serial number of the FLASH storage space, the first script protocol file is read from the EEPROM storage space, and the inverter identification function of the corresponding script protocol file is called through the inverter identification function interface for registration and loading until the communication is successful. If, after communication fails and the script serial number is incremented again and exceeds the maximum script serial number of the EEPROM storage space, a new script protocol file of the photovoltaic inverter protocol corresponding to the communication-failed photovoltaic inverter is added to the FLASH storage space through the script execution environment, and the inverter identification function of the new script protocol file is called through the inverter identification function interface for registration and loading, so that the concentrator and the photovoltaic inverter communicate successfully.
[0093] Specifically, as Figure 5 shown, if the communication fails and exceeds the maximum Lua script serial number in the FLASH storage space, the Lua script protocol file in the EEPROM storage space is adopted, and the registration, loading, and communication are performed according to the same process. After the communication with the photovoltaic inverter is successful, it is considered that the protocol adaptation is successful.
[0094] The photovoltaic inverter identification method provided in this embodiment adds a new script protocol file of the photovoltaic inverter protocol corresponding to the communication-failed photovoltaic inverter to the FLASH storage space, and calls the inverter identification function of the new script protocol file through the inverter identification function interface for registration and loading, so that the concentrator and the photovoltaic inverter communicate successfully. By writing the corresponding script protocol file according to the photovoltaic inverter protocol and sending it to the concentrator, it can adapt to the photovoltaic inverter protocols of different manufacturers, update the script protocol file in real time, and better adapt to the photovoltaic inverters of different manufacturers.
[0095] Step S203, when the communication is successful, collect the data of the photovoltaic inverter with successful communication and control the photovoltaic inverter. For details, please refer to Figure 1 step S103 of the embodiment shown here, which will not be elaborated here.
[0096] The photovoltaic inverter identification method provided in this embodiment separates the photovoltaic inverter protocol from the program, stores the script protocol file corresponding to the photovoltaic inverter protocol as a configuration file in the FLASH storage space and the EEPROM storage space, providing conditions for adapting to the photovoltaic inverter protocols of different manufacturers. Obtain the photovoltaic inverter protocol and adapt it through the script protocol file, and determine whether the communication is successful by whether there is a return data when sending it to the photovoltaic inverter, solving the problem that a large amount of time is required to upgrade the program due to the incompatibility of the photovoltaic inverter protocol.
[0097] In this embodiment, a method for identifying a photovoltaic inverter is provided, which can be used in a concentrator. Figure 3 It is a flowchart of the method for identifying a photovoltaic inverter according to an embodiment of the present invention. As Figure 3 shown, the process includes the following steps:
[0098] Step S301, create a script execution environment, and import multiple script protocol files corresponding to multiple photovoltaic inverters through the script execution environment. For details, please refer to Figure 2 step S201 of the embodiment shown here, which will not be elaborated herein.
[0099] Step S302, when starting the photovoltaic inverter acquisition task thread, based on each script protocol file, enable the concentrator to communicate with any designated photovoltaic inverter, and determine whether the communication is successful. For details, please refer to Figure 2 step S202 of the embodiment shown here, which will not be elaborated herein.
[0100] Step S303, when the communication is successful, collect the data of the photovoltaic inverter with successful communication, and regulate the photovoltaic inverter.
[0101] Specifically, as Figure 7 shown, the function interface further includes an interface for reading the basic information of the photovoltaic inverter, an interface for reading the real-time data of the photovoltaic inverter, an interface for reading the electrical energy of the photovoltaic inverter, an interface for reading the status of the photovoltaic inverter, an interface for reading the events of the photovoltaic inverter, an interface for regulating the active power of the inverter, and an interface for executing commands of the inverter; the above step S303 includes:
[0102] Step S3031, when the communication is successful, sequentially call the functions for reading the basic information of the photovoltaic inverter, the functions for reading the real-time data of the photovoltaic inverter, the functions for reading the electrical energy of the photovoltaic inverter, the functions for reading the status of the photovoltaic inverter, and the functions for reading the events of the photovoltaic inverter in the corresponding script protocol files through the interface for reading the basic information of the photovoltaic inverter, the interface for reading the real-time data of the photovoltaic inverter, the interface for reading the electrical energy of the photovoltaic inverter, the interface for reading the status of the photovoltaic inverter, and the interface for reading the events of the photovoltaic inverter at a preset period, so as to read the basic information of the photovoltaic inverter, read the real-time data of the photovoltaic inverter, read the electrical energy of the photovoltaic inverter, read the status of the photovoltaic inverter, and read the events of the photovoltaic inverter.
[0103] Specifically, after the photovoltaic inverter protocol is successfully identified, the acquisition status of the photovoltaic inverter is sequentially switched to reading the basic information of the inverter, reading the real-time data of the inverter, reading the electrical energy of the inverter, reading the status of the inverter, and reading the events of the inverter. The readInfo function, readReal function, readEnergy function, readState function, and readEvent function in the Lua script are called respectively through the functions provided by the Lua source code, and the returned data is stored in the FLASH storage space.
[0104] Step S3032, when it is necessary to regulate the PV inverter, call the functions of regulating the active power of the inverter and the functions of executing commands of the inverter in the corresponding script protocol file by regulating the active power interface of the inverter and the command execution interface of the inverter, so as to regulate the active power of the inverter and / or the commands executed by the inverter.
[0105] Specifically, when it is necessary to regulate the active power of the inverter or the commands executed by the inverter, switch the acquisition status of the PV inverter to the status of regulating the active power of the inverter, and call the adjPower function and the cmd function in the Lua script protocol file through the functions provided by the Lua source code (the input parameters are adjPower and cmd respectively), so as to realize the regulation of the active power of the inverter and the commands executed by the inverter.
[0106] Step S304, upgrade multiple script protocol files in the FLASH storage space by differential upgrade method.
[0107] Specifically, differential upgrade, also known as incremental upgrade or patch upgrade, is a technology for updating software versions on multiple computers. Its core principle is to compare the differences between the current version and the latest version, generate a special file (differential file or incremental file) containing these differences, and users only need to download this differential file and apply it to the current version to complete the upgrade. For subsequent on-site maintenance, the main methods are Bluetooth transmission upgrade and master station remote transparent transmission upgrade. In this embodiment, the differential upgrade is used for the LUA script protocol file in the FLASH space.
[0108] The PV inverter identification method provided in this embodiment uses corresponding functional function interfaces to call corresponding functions, so as to realize the acquisition of data of PV inverters from different manufacturers and the regulation of PV inverters. By differentially upgrading multiple script protocol files in the FLASH storage space, the size of the transmitted file is greatly reduced, and the risk brought by the concentrator upgrade is avoided.
[0109] As one or more specific application embodiments of the embodiment of the present invention, the PV inverter identification method provided by the present invention is further described in detail as follows:
[0110] The specific creation process of the Lua script protocol file is as follows:
[0111] A. Define 10 working states in the acquisition process of the PV inverter, namely idle, preparation before acquisition, protocol identification, reading basic information of the inverter, reading real-time data of the inverter, reading electrical energy of the inverter, reading status of the inverter, reading events of the inverter, regulating the active power of the inverter, and executing commands of the inverter.
[0112] B. Define nine functions in the Lua script protocol file to implement different functions, corresponding to the nine working states except the idle state mentioned above. They are the prepare function (preparation state before acquisition), the identify function (inverter protocol identification state), the readInfo function (reading the basic information of the inverter), the readReal function (reading the real-time data of the inverter), the readEnergy function (reading the electrical energy state of the inverter), the readState (reading the state of the inverter), the readEvent function (reading the events of the inverter), the adjPower function (regulating the active power of the inverter), and the cmd function (regulating the execution commands of the inverter).
[0113] C. Define the valid file bitmap as a uint8 array (with a size of the maximum number of files / 8). Each of the 8 bits in each byte of the array can be used to represent whether 8 files are valid or not.
[0114] D. Download the latest version of the Lua source code from the official Lua website, and after decompression, add it to the C language project that has been created.
[0115] E. Send the Lua script protocol files corresponding to the photovoltaic inverter protocols of different manufacturers to the concentrator through the 698 message (which refers to a specific data transmission format in the DLT645-2007 specification). After the concentrator verifies and decompresses the Lua script protocol files, it stores them in the FLASH storage space and the EEPROM storage space, and updates the valid file bitmap.
[0116] F. Read the valid file bitmap stored in the FLASH storage space and the EEPROM storage space, and read and verify the Lua script protocol files stored in the FLASH and EEPROM according to the valid file bitmap.
[0117] G. Use the functions provided by the Lua source code to create an instance of the Lua virtual machine, and set the acquisition state of the photovoltaic inverter to the preparation state before acquisition. Call the prepare function in the Lua script protocol file through the function provided by the Lua source code (with the input parameter of prepare), and set the slave address in the prepare function.
[0118] H. Switch the acquisition state of the photovoltaic inverter to the inverter protocol identification state. Call the identify function in the Lua script protocol file through the function provided by the Lua source code (with the input parameter of identify). Read the model of the photovoltaic inverter in the identify function, and judge the result of the photovoltaic inverter protocol identification according to the return value of the identify function. If the identification fails, that is, the communication fails, then return to step E to read the next Lua script protocol file.
[0119] I. After the photovoltaic inverter protocol is successfully recognized, the acquisition status of the photovoltaic inverter is sequentially switched to reading the basic information of the inverter, reading the real-time data of the inverter, reading the electrical energy of the inverter, reading the status of the inverter, and reading the events of the inverter. The readInfo function, readReal function, readEnergy function, readState function, and readEvent function in the Lua script protocol file are called through the functions provided by the Lua source code, and the data returned by the photovoltaic inverter is stored in the FLASH storage space.
[0120] J. When it is necessary to regulate the active power of the photovoltaic inverter or execute commands on the inverter, the acquisition status of the photovoltaic inverter is switched to the status of regulating the active power of the inverter. The adjPower function and cmd function in the Lua script protocol file are called through the functions provided by the Lua source code (the input parameters are adjPower and cmd respectively), so as to realize regulating the active power of the inverter and executing commands on the inverter.
[0121] In step E, if the Lua script protocol file is too large (larger than 4K), which is not conducive to the single-frame message sending, the characters such as spaces and line breaks in the Lua script protocol file can be deleted and the file can be compressed using algorithms such as minilzo or lzma. Then, file information (file header magic number, file name, version information, compressed length, original length, file CRC checksum (cyclic redundancy checksum)) is added at the beginning of the file. Finally, the file content is read in string format and composed into a 698 message.
[0122] In step E, after the concentrator receives the 698 message for sending the Lua script protocol file, it verifies the file header magic number and file CRC checksum in the file header information respectively. Then, it searches in the FLASH and EEPROM to check whether a file with the same name has been sent. If a file with the same name has been sent, it compares whether the file contents are the same (if the file contents are the same, the process exits; if the file contents are different, the new file content is written at the original storage location). If a file with the same name has not been sent, a new space is found in the FLASH storage space or EEPROM storage space for storage, and then the valid file bitmap is updated.
[0123] In step F, the bit0 of the first byte in the valid file bitmap represents the file of script number 1, the bit0 of the second byte represents the file of script number 9, and so on, so as to find the offsets of all valid files stored in the FLASH storage space or EEPROM storage space. For example, if the file of script number X is valid in the EEPROM storage space, the starting offset of the configuration file is M and the file block size is N (M <= N), then the offset of this file in the EEPROM is 。
[0124] In step F, after reading the file content according to the valid file bitmap, it is necessary to verify the file header magic word and the file CRC check code in the file header information respectively. In addition, if the compressed length is less than the original length, the file content except the file header information needs to be decompressed with the compression algorithm in step E.
[0125] In this embodiment, taking the photovoltaic inverter communicating with the Modbus protocol in the photovoltaic monitoring system platform as an example, the photovoltaic inverter identification method provided by the present invention will be further described in detail. Among them, the concentrator uses C language as the host language, and the specific process is as follows:
[0126] ① When the concentrator starts the photovoltaic inverter acquisition task, it will initialize the photovoltaic inverter port structure, which contains the information of the photovoltaic inverter under the unique port, because there are multiple photovoltaic inverters with the concentrator.
[0127] ② Register the Lua interpreter by port to create a Lua execution thread, and import the standard library and the custom basic library through the Lua script protocol library loading function. The content of the custom basic library includes custom operations such as feeding the dog and register operations of the Modbus protocol. These library functions are for the Lua script protocol file program to call these library functions to realize the communication with the photovoltaic inverter when calling the Lua script protocol file later.
[0128] ③ The Lua language is mainly used in the Lua script protocol file to implement 6 functions, including: 1. Reading operation of the basic information of the photovoltaic inverter. 2. Reading operation of the real-time data of the photovoltaic inverter. 3. Reading operation of the electric energy data. 4. Reading operation of the status quantity of the photovoltaic inverter. 5. Reading operation of the event data of the photovoltaic inverter. 6. Execution operation of the regulation command of the photovoltaic inverter.
[0129] ④ After the Lua script protocol file is registered, the main program macro-defines the string function name, searches for the corresponding function operation in the Lua script protocol file by the way of string index, executes and calls the library function, and finally returns the data to the main program. The main program stores or reports to the master station in the way of the 698 protocol through protocol recombination. The main program obtains functions 1 to 5 in step ③ by cycle.
[0130] ⑤ When the master station needs to directly regulate the photovoltaic inverter, the main program can directly realize the regulation of the photovoltaic inverter by calling the interface of function 6.
[0131] ⑥ When on-site, if the photovoltaic inverter protocol not previously entered in the protocol library is connected to the lower end of the concentrator, the Lua script protocol file forwarded by Bluetooth or the master station can be used to replace the Lua script protocol file of the FLASH protocol library to realize the adaptation of the protocol of the inverter.
[0132] The photovoltaic inverter identification method provided in this embodiment realizes the adaptive adaptation of the photovoltaic inverter protocols of each manufacturer by building a photovoltaic inverter protocol library in the concentrator in the form of Lua scripts, reduces the difficulty of collecting data of the photovoltaic inverter, and realizes the data collection and regulation of the photovoltaic inverter through the correctly identified photovoltaic inverter manufacturer protocol.
[0133] In this embodiment, a photovoltaic inverter identification device is also provided. This device is used to implement the above-mentioned embodiments and preferred implementation manners, and those that have been described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that realizes a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0134] This embodiment provides a photovoltaic inverter identification device, which is applied to a concentrator; as Figure 8 shown, it includes:
[0135] A script protocol file import module 801, which is used to create a script execution environment and import, through the script execution environment, a plurality of script protocol files corresponding to the photovoltaic inverter protocols of a plurality of photovoltaic inverters.
[0136] A communication module 802, which is used to, when starting a photovoltaic inverter collection task thread, communicate the concentrator with any designated photovoltaic inverter based on each script protocol file and determine whether the communication is successful.
[0137] A collection and regulation module 803, which is used to, when the communication is successful, collect the data of the photovoltaic inverter with successful communication and regulate the photovoltaic inverter.
[0138] In some optional implementation manners, the concentrator includes a FLASH storage space; the script protocol file import module 801 includes:
[0139] An import and storage unit, which is used to import, through the script execution environment in the form of string files from the script protocol library, a plurality of script protocol files corresponding to the photovoltaic inverter protocols of a plurality of photovoltaic inverters, decompress and verify the plurality of script protocol files, and store them in the FLASH storage space.
[0140] In some optional implementation manners, the import and storage unit includes:
[0141] A decompression and verification subunit, which is used to decompress the plurality of script protocol files and verify the header information of each script protocol file; the header information includes a CRC check code, a photovoltaic inverter protocol file name, a photovoltaic inverter version information, an original length of the script file, a compressed length of the script file, and a magic word.
[0142] A legality judgment subunit, configured to determine that the corresponding script protocol file is legal when the header information is consistent with the header information of the corresponding script protocol file recorded in the script protocol library; otherwise, discard the corresponding script protocol file and receive multiple script protocol files of the script protocol library again.
[0143] In some alternative embodiments, the concentrator further includes a function interface, and the function interface includes an inverter identification function interface; the concentrator further includes an EEPROM storage space, and multiple script protocol files at the time of the concentrator's factory are stored in the EEPROM storage space in the order of the script numbers. The communication module 802 includes:
[0144] A first communication unit, configured to obtain the photovoltaic inverter protocol of a specified photovoltaic inverter, read the first script protocol file from the FLASH storage space based on the photovoltaic inverter protocol and according to the script number, and call the inverter identification function of the first script protocol file through the inverter identification function interface for registration and loading. If there is return data when the inverter identification function is sent to the specified photovoltaic inverter, it is determined that the concentrator communicates successfully with any specified photovoltaic inverter; otherwise, it is determined that the communication fails.
[0145] A second communication unit, configured to, if the communication fails, increment the script number and continue to read the next script protocol file from the FLASH storage space, and again call the inverter identification function of the corresponding script protocol file through the inverter identification function interface for registration and loading until the communication is successful.
[0146] A third communication unit, configured to, if the script number is incremented again after the communication fails and exceeds the maximum script number of the FLASH storage space, read the first script protocol file from the EEPROM storage space, call the inverter identification function of the corresponding script protocol file through the inverter identification function interface for registration and loading until the communication is successful. If the script number is incremented again after the communication fails and exceeds the maximum script number of the EEPROM storage space, a new script protocol file corresponding to the photovoltaic inverter protocol of the communication-failed photovoltaic inverter is added to the FLASH storage space through the script execution environment, and the inverter identification function of the new script protocol file is called through the inverter identification function interface for registration and loading to make the concentrator and the photovoltaic inverter communicate successfully.
[0147] In some alternative embodiments, the function interface further includes an interface for reading the basic information of the photovoltaic inverter, an interface for reading the real-time data of the photovoltaic inverter, an interface for reading the electrical energy of the photovoltaic inverter, an interface for reading the status of the photovoltaic inverter, an interface for reading the events of the photovoltaic inverter, an interface for regulating the active power of the inverter, and an interface for executing commands on the inverter; the acquisition and regulation module 803 includes:
[0148] The acquisition unit is used to, after successful communication, sequentially call the functions of reading basic information of the PV inverter, reading real-time data of the PV inverter, reading electrical energy of the PV inverter, reading the status of the PV inverter, and reading events of the PV inverter in the corresponding script protocol files through the interfaces of reading basic information of the PV inverter, reading real-time data of the PV inverter, reading electrical energy of the PV inverter, reading the status of the PV inverter, and reading events of the PV inverter according to a preset period, so as to read the basic information of the PV inverter, read the real-time data of the PV inverter, read the electrical energy of the PV inverter, read the status of the PV inverter, and read the events of the PV inverter.
[0149] The regulation unit is used to, when it is necessary to regulate the PV inverter, call the functions of regulating the active power of the inverter and executing commands of the inverter in the corresponding script protocol files through the interfaces of regulating the active power of the inverter and executing commands of the inverter, so as to regulate the active power of the inverter and / or execute commands of the inverter.
[0150] In some optional embodiments, the PV inverter identification device further includes:
[0151] The differential upgrade module is used to upgrade multiple script protocol files in the FLASH storage space by differential upgrade.
[0152] The further function descriptions of the above-mentioned various modules and units are the same as those in the corresponding above embodiments, and will not be elaborated here.
[0153] The PV inverter identification device in this embodiment is presented in the form of functional units. Here, the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and a memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0154] The embodiment of the present invention also provides a computer device having the above Figure 8 shown PV inverter identification device.
[0155] Please refer to Figure 9 , Figure 9 which is a schematic structural diagram of a computer device provided by an optional embodiment of the present invention. As shown in Figure 9As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. Each component communicates with each other using different buses and can be installed on a common motherboard or in other ways as needed. The processor can process instructions executed within the computer device, including instructions stored in the memory or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some alternative embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories. Similarly, multiple computer devices can be connected, and each device provides part of the necessary operations (such as an array of servers, a set of blade servers, or a multi-processor system). Figure 9 Taking one processor 10 as an example in
[0156] The processor 10 can be a central processing unit, a network processor, or a combination thereof. Among them, the processor 10 can further include a hardware chip. The above hardware chip can be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The above programmable logic device can be a complex programmable logic device, a field programmable gate array, a generic array logic, or any combination thereof.
[0157] Among them, the memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiments.
[0158] The memory 20 can include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created according to the use of the computer device. In addition, the memory 20 can include high-speed random access memory and can also include non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some alternative embodiments, the memory 20 can optionally include a memory remotely set relative to the processor 10, and these remote memories can be connected to the computer device through a network. Examples of the above network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0159] The memory 20 can include volatile memory, such as random access memory; the memory can also include non-volatile memory, such as flash memory, a hard disk, or a solid-state drive; the memory 20 can also include a combination of the above types of memory.
[0160] The computer device further includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30, and the output device 40 may be connected by a bus or other means. Figure 9 Take the connection through the bus as an example.
[0161] The input device 30 can receive input digital or character information and generate key signal inputs related to the user settings and function controls of the computer device, such as a touch screen, a keypad, a mouse, a trackpad, a touchpad, a pointing stick, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED), and a haptic feedback device (e.g., a vibration motor), etc. The above display device includes, but is not limited to, a liquid crystal display, a light emitting diode, a display, and a plasma display. In some alternative embodiments, the display device may be a touch screen.
[0162] The embodiments of the present invention further provide a computer-readable storage medium. The methods according to the embodiments of the present invention can be implemented in hardware, firmware, or be implemented as computer code that can be recorded on a storage medium, or be implemented as computer code that is originally stored in a remote storage medium or a non-transitory machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, so that the methods described herein can be processed by such software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid-state drive, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by the computer, the processor, or the hardware, the methods shown in the above embodiments are implemented.
[0163] A part of the present invention can be applied as a computer program product, such as computer program instructions. When executed by a computer, through the operation of the computer, the methods and / or technical solutions according to the present invention can be called or provided. Those skilled in the art should be able to understand that the forms of existence of computer program instructions in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executes the instructions, or the computer compiles the instructions and then executes the corresponding compiled program, or the computer reads and executes the instructions, or the computer reads and installs the instructions and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible by the computer.
[0164] Although embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations fall within the scope defined by the appended claims.
Claims
1. A method for identifying a photovoltaic inverter, characterized in that, Applied to a concentrator; the method includes: Create a script execution environment, and import multiple script protocol files corresponding to the photovoltaic inverter protocols of multiple photovoltaic inverters through the script execution environment; the multiple script protocol files are all Lua script protocol files corresponding to the photovoltaic inverter protocols of different photovoltaic inverters; When starting the photovoltaic inverter acquisition task thread, based on each script protocol file, enable the concentrator to communicate with any specified photovoltaic inverter, and determine whether the communication is successful; When the communication is successful, collect the data of the photovoltaic inverter with successful communication, and regulate the photovoltaic inverter; The concentrator includes a FLASH storage space; The importing multiple script protocol files corresponding to the photovoltaic inverter protocols of multiple photovoltaic inverters through the script execution environment includes: Through the script execution environment, import multiple script protocol files corresponding to the photovoltaic inverter protocols of multiple photovoltaic inverters from the script protocol library in the form of string files, and decompress and verify the multiple script protocol files and store them in the FLASH storage space; The concentrator further includes a function interface, and the function interface includes an interface for reading the basic information of the photovoltaic inverter, an interface for reading the real-time data of the photovoltaic inverter, an interface for reading the electrical energy of the photovoltaic inverter, an interface for reading the status of the photovoltaic inverter, an interface for reading the events of the photovoltaic inverter, an interface for regulating the active power of the inverter, and an interface for executing commands of the inverter; The when the communication is successful, collect the data of the photovoltaic inverter with successful communication, and regulate the photovoltaic inverter includes: When the communication is successful, sequentially call the functions for reading the basic information of the photovoltaic inverter, the functions for reading the real-time data of the photovoltaic inverter, the functions for reading the electrical energy of the photovoltaic inverter, the functions for reading the status of the photovoltaic inverter, and the functions for reading the events of the photovoltaic inverter in the corresponding script protocol files through the interface for reading the basic information of the photovoltaic inverter, the interface for reading the real-time data of the photovoltaic inverter, the interface for reading the electrical energy of the photovoltaic inverter, the interface for reading the status of the photovoltaic inverter, and the interface for reading the events of the photovoltaic inverter at a preset period to read the basic information of the photovoltaic inverter, the real-time data of the photovoltaic inverter, the electrical energy of the photovoltaic inverter, the status of the photovoltaic inverter, and the events of the photovoltaic inverter; When it is necessary to regulate the photovoltaic inverter, call the function for regulating the active power of the inverter and the function for executing commands of the inverter through the interface for regulating the active power of the inverter and the interface for executing commands of the inverter to regulate the active power of the inverter and / or execute commands of the inverter.
2. The method according to claim 1, wherein The decompressing and verifying the multiple script protocol files includes: Decompress the multiple script protocol files, and verify the header information of each script protocol file; the header information includes a CRC check code, the name of the photovoltaic inverter protocol file, the version information of the photovoltaic inverter, the original length of the script file, the compressed length of the script file, and a magic word; When the header information is consistent with the header information of the corresponding script protocol file recorded in the script protocol library, it is determined that the corresponding script protocol file is legal, otherwise the corresponding script protocol file is discarded, and multiple script protocol files in the script protocol library are received again.
3. The method according to claim 2, wherein The function interface further includes an inverter identification function interface; Based on each script protocol file, enabling the concentrator to communicate with any designated photovoltaic inverter and determining whether the communication is successful includes: Obtaining the photovoltaic inverter protocol of the designated photovoltaic inverter, based on the photovoltaic inverter protocol and reading the first script protocol file from the FLASH storage space according to the script serial number, and calling the inverter identification function of the first script protocol file through the inverter identification function interface for registration and loading. If there is return data when the inverter identification function is sent to the designated photovoltaic inverter, it is determined that the concentrator has successfully communicated with any designated photovoltaic inverter; otherwise, it is determined that the communication has failed.
4. The method according to claim 3, characterized in that, Based on each script protocol file, enabling the concentrator to communicate with any designated photovoltaic inverter and determining whether the communication is successful further includes: If the communication fails, increment the script serial number and continue to read the next script protocol file from the FLASH storage space, and again call the inverter identification function of the corresponding script protocol file through the inverter identification function interface for registration and loading until the communication is successful.
5. The method according to claim 4, wherein The concentrator further includes an EEPROM storage space, and the EEPROM storage space stores multiple script protocol files at the time of the concentrator's factory in the order of the script serial numbers. Based on each script protocol file, enabling the concentrator to communicate with any designated photovoltaic inverter and determining whether the communication is successful further includes: If the communication fails and the script serial number is incremented again and exceeds the maximum script serial number of the FLASH storage space, read the first script protocol file from the EEPROM storage space, and call the inverter identification function of the corresponding script protocol file through the inverter identification function interface for registration and loading until the communication is successful. If the communication fails and the script serial number is incremented again and exceeds the maximum script serial number of the EEPROM storage space, add a new script protocol file corresponding to the photovoltaic inverter protocol of the photovoltaic inverter with communication failure in the FLASH storage space through the script execution environment, and call the inverter identification function of the new script protocol file through the inverter identification function interface for registration and loading to enable the concentrator and the photovoltaic inverter to communicate successfully.
6. The method according to claim 1, characterized in that The method further includes: upgrading multiple script protocol files in the FLASH storage space by means of differential upgrade.
7. A photovoltaic inverter identification device, characterized in that, Applying a concentrator; the device includes: A script protocol file import module, configured to create a script execution environment and import multiple script protocol files corresponding to the photovoltaic inverter protocols of multiple photovoltaic inverters through the script execution environment; the multiple script protocol files are all Lua script protocol files corresponding to the photovoltaic inverter protocols of different photovoltaic inverters; A communication module, configured to, when starting a photovoltaic inverter acquisition task thread, enable the concentrator to communicate with any designated photovoltaic inverter based on each script protocol file and determine whether the communication is successful; An acquisition and regulation module, configured to, after the communication is successful, acquire data of the photovoltaic inverter with successful communication and regulate the photovoltaic inverter; The concentrator includes a FLASH storage space; The importing of multiple script protocol files corresponding to the photovoltaic inverter protocols of multiple photovoltaic inverters through the script execution environment includes: Import multiple script protocol files corresponding to the photovoltaic inverter protocols of multiple photovoltaic inverters from the script protocol library in the form of string files through the script execution environment, decompress and verify the multiple script protocol files, and store them in the FLASH storage space; The concentrator further includes function interfaces, and the function interfaces include an interface for reading the basic information of the photovoltaic inverter, an interface for reading the real-time data of the photovoltaic inverter, an interface for reading the electrical energy of the photovoltaic inverter, an interface for reading the status of the photovoltaic inverter, an interface for reading the events of the photovoltaic inverter, an interface for regulating the active power of the inverter, and an interface for executing commands for the inverter; After the communication is successful, collecting the data of the photovoltaic inverter with successful communication and regulating the photovoltaic inverter includes: After the communication is successful, call the function for reading the basic information of the photovoltaic inverter, the function for reading the real-time data of the photovoltaic inverter, the function for reading the electrical energy of the photovoltaic inverter, the function for reading the status of the photovoltaic inverter, and the function for reading the events of the photovoltaic inverter in the corresponding script protocol files in sequence through the interface for reading the basic information of the photovoltaic inverter, the interface for reading the real-time data of the photovoltaic inverter, the interface for reading the electrical energy of the photovoltaic inverter, the interface for reading the status of the photovoltaic inverter, and the interface for reading the events of the photovoltaic inverter at a preset period, so as to read the basic information of the photovoltaic inverter, the real-time data of the photovoltaic inverter, the electrical energy of the photovoltaic inverter, the status of the photovoltaic inverter, and the events of the photovoltaic inverter; When it is necessary to regulate the photovoltaic inverter, call the function for regulating the active power of the inverter and the function for executing commands for the inverter through the interface for regulating the active power of the inverter and the interface for executing commands for the inverter, so as to regulate the active power of the inverter and / or execute commands for the inverter.
8. A computer device, characterized in that, Including: A memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to execute the photovoltaic inverter identification method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, Computer instructions are stored on the computer-readable storage medium, and the computer instructions are used to cause a computer to execute the photovoltaic inverter identification method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Distributed photovoltaic communication protocol self-identification interaction device and method
CN119093601A