Protocol identification method, system and equipment of photovoltaic equipment, medium and program product
Through the pre-constructed address prediction model and Modbus protocol library, the initial device address is determined, address prediction and protocol verification is carried out, and the flexibility and efficiency problems caused by protocol differences in data interaction between photovoltaic devices are solved, achieving efficient and accurate protocol identification.
Patent Information
- Application Number
- CN202411406770.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-10-10
AI Technical Summary
In the data interaction between photovoltaic equipment, the flexibility and efficiency need to be improved due to the differences in Modbus communication protocols of different manufacturers.
A protocol identification method for photovoltaic equipment is proposed. Through a pre-constructed address prediction model and Modbus protocol library, the initial device address is determined, address prediction is carried out, the device existence is counted, and the device type is further verified through the target Modbus protocol.
The recognition accuracy of the protocol matching process of photovoltaic equipment is improved, the error recognition rate is reduced, and the efficiency of the automatic protocol identification process is ensured.
Smart Images

Figure CN119544570A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a protocol identification method, system, device, medium and program product for photovoltaic equipment. Background Art
[0002] The automatic identification technology of communication protocols plays a vital role in promoting the access of distributed photovoltaic equipment to the power grid. In the current market, although photovoltaic equipment produced by different manufacturers generally supports the Modbus communication protocol, there are differences in register address mapping and function code application between photovoltaic equipment produced by different manufacturers. Therefore, there are differences in the Modbus communication protocol used by photovoltaic equipment produced by different manufacturers, which brings challenges to the data interaction between photovoltaic equipment.
[0003] At present, although the automatic identification technology is based on the Modbus standardized framework and can identify some photovoltaic equipment through the full-address polling strategy, it is limited by the Modbus address range and fixed command communication method, and its flexibility and efficiency need to be improved. Summary of the invention
[0004] The present invention aims to solve one of the technical problems in the related art at least to a certain extent.
[0005] To this end, the first object of the present invention is to propose a protocol identification method for photovoltaic equipment, which is applied to a protocol matching system of photovoltaic equipment. The protocol matching system of photovoltaic equipment is communicatively connected with a plurality of photovoltaic equipment, and each photovoltaic equipment has a unique device address. The method comprises:
[0006] Determine at least one initial device address, input the initial device address into a pre-built address prediction model to obtain a predicted device address; wherein the initial device address has a photovoltaic device;
[0007] A first target Modbus protocol is obtained from a pre-built Modbus protocol library, a first instruction message is determined according to the first target Modbus protocol, and the first instruction message is sent to the predicted device address; wherein the first target Modbus protocol matches the target photovoltaic device, the first target Modbus protocol includes a first function register address and a first preset response value corresponding to the first function register address, and the first instruction message is used to instruct the photovoltaic device where the predicted device address exists to return a first response value corresponding to the first function register address;
[0008] In response to receiving a first response message returned by the predicted device address, confirming that a photovoltaic device exists at the predicted device address; wherein the first response message includes a first response value;
[0009] determining whether the first response value corresponds to a first preset response value;
[0010] In response to the first response value corresponding to the first preset response value, a second target Modbus protocol is obtained from a pre-built protocol library, a second instruction message is determined according to the second target Modbus protocol, and the second instruction message is sent to the predicted device address; wherein the second target Modbus protocol matches the target photovoltaic device, the second target Modbus protocol includes a second function register address and a second preset response value corresponding to the second function register address, and the second instruction message is used to instruct the photovoltaic device that exists at the predicted device address to return a second response value corresponding to the second function register address; the first target Modbus protocol is different from the second target Modbus protocol;
[0011] In response to receiving a second response message returned by the predicted device address, determining whether a second response value included in the second response message corresponds to a second preset response value;
[0012] In response to the second response value corresponding to the second preset response value, the photovoltaic device under the predicted device address is determined to be the target photovoltaic device.
[0013] In some embodiments, the method further comprises:
[0014] In response to not receiving a first response message returned by the predicted device address within a preset time interval, it is determined that no photovoltaic device exists at the predicted device address.
[0015] In some embodiments, the pre-built address prediction model is represented as:
[0016] X(k)=A*X(k-1)+B*U(k-1)+V(k)
[0017] Among them, X(k) is the predicted device address at time k, A and B are the model prediction coefficients, X(k-1) is the predicted device address at time k-1, U(k-1) is the initial device address of the photovoltaic device at time k-1, and V(k) is the noise coefficient.
[0018] In some embodiments, the method further comprises:
[0019] Obtain register information of all target photovoltaic devices and store the register information in the instruction information table;
[0020] Construct the instruction storage structure table according to the storage format of the standard Modbus protocol;
[0021] Determine at least two corresponding Modbus protocols for each target photovoltaic device according to the instruction information table and the instruction storage structure table;
[0022] Build a Modbus protocol library according to the Modbus protocol of all target PV devices.
[0023] In some embodiments, the method further comprises:
[0024] In response to the predicted device address not having a photovoltaic device, confirming whether a photovoltaic device exists at a device address between the predicted device address and a real device address where the photovoltaic device is most recently confirmed to exist;
[0025] In response to the fact that there is no photovoltaic device at a device address between the predicted device address and the real device address that was most recently confirmed to have a photovoltaic device, correcting the model prediction coefficient and the noise coefficient according to the predicted device address and the real device address to obtain an updated address prediction model;
[0026] Reconfirm the predicted device address based on the updated address prediction model.
[0027] In some embodiments, after determining that the photovoltaic device at the predicted device address is the target photovoltaic device, the method further includes:
[0028] The protocol matching system of the photovoltaic equipment exchanges data with the target photovoltaic equipment through the Modbus protocol of the target photovoltaic equipment to obtain the equipment information of the target photovoltaic equipment;
[0029] The device information is stored in a bidirectional linked list; wherein the bidirectional linked list includes a predecessor pointer and a successor pointer, the predecessor pointer points to the device information of the previous photovoltaic device of the target photovoltaic device, and the successor pointer points to the device information of the next photovoltaic device of the target photovoltaic device.
[0030] In some embodiments, a first target Modbus protocol is obtained from a pre-built Modbus protocol library, a first instruction message is determined according to the first target Modbus protocol, and before the first instruction message is sent to the predicted device address, the method further includes:
[0031] Confirm whether the protocol matching system of the photovoltaic equipment is powered on for the first time;
[0032] In response to the protocol matching system of the photovoltaic device being powered on for the first time, confirming the execution of obtaining a first target Modbus protocol from a pre-built Modbus protocol library, determining a first instruction message according to the first target Modbus protocol, and sending the first instruction message to the predicted device address.
[0033] In some embodiments, the method further comprises:
[0034] In response to the protocol matching system of the photovoltaic device not being powered on for the first time, querying whether a target photovoltaic device corresponding to the device information stored in the bidirectional linked list exists;
[0035] In response to the target photovoltaic device not existing, confirming the execution of the operation of acquiring a first target Modbus protocol from a pre-built Modbus protocol library, determining a first instruction message according to the first target Modbus protocol, and sending the first instruction message to the predicted device address.
[0036] The second object of the present invention is to provide a protocol matching system for photovoltaic devices, wherein the protocol matching system for photovoltaic devices is communicatively connected to a plurality of photovoltaic devices, each photovoltaic device has a unique device address, and the protocol matching system for photovoltaic devices is configured as follows:
[0037] Determine at least one initial device address, input the initial device address into a pre-built address prediction model to obtain a predicted device address; wherein the initial device address has a photovoltaic device;
[0038] A first target Modbus protocol is obtained from a pre-built Modbus protocol library, a first instruction message is determined according to the first target Modbus protocol, and the first instruction message is sent to the predicted device address; wherein the first target Modbus protocol matches the target photovoltaic device, the first target Modbus protocol includes a first function register address and a first preset response value corresponding to the first function register address, and the first instruction message is used to instruct the photovoltaic device where the predicted device address exists to return a first response value corresponding to the first function register address;
[0039] In response to receiving a first response message returned by the predicted device address, confirming that a photovoltaic device exists at the predicted device address; wherein the first response message includes a first response value;
[0040] determining whether the first response value corresponds to a first preset response value;
[0041] In response to the first response value corresponding to the first preset response value, a second target Modbus protocol is obtained from a pre-built protocol library, a second instruction message is determined according to the second target Modbus protocol, and the second instruction message is sent to the predicted device address; wherein the second target Modbus protocol matches the target photovoltaic device, the second target Modbus protocol includes a second function register address and a second preset response value corresponding to the second function register address, and the second instruction message is used to instruct the photovoltaic device that exists at the predicted device address to return a second response value corresponding to the second function register address; the first target Modbus protocol is different from the second target Modbus protocol;
[0042] In response to receiving a second response message returned by the predicted device address, determining whether a second response value included in the second response message corresponds to a second preset response value;
[0043] In response to the second response value corresponding to the second preset response value, the photovoltaic device under the predicted device address is determined to be the target photovoltaic device.
[0044] The third object of the present invention is to provide an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the protocol identification method for the photovoltaic device as described above is implemented.
[0045] A fourth object of the present invention is to provide a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the protocol identification method for the photovoltaic device as described above.
[0046] A fifth object of the present invention is to provide a computer program product, comprising computer program instructions, which, when executed on a computer, enable the computer to execute the above-mentioned protocol identification method for a photovoltaic device.
[0047] As can be seen from the above, the protocol identification method, system, device, medium and program product of the photovoltaic device provided by the present invention first determine at least one initial device address, input the initial device address into a pre-built address prediction model, and obtain a predicted device address; wherein, the initial device address exists in the photovoltaic device; further, obtain the first target Modbus protocol from the pre-built Modbus protocol library, determine the first instruction message according to the first target Modbus protocol, and send the first instruction message to the predicted device address; wherein, the first target Modbus protocol matches the target photovoltaic device, the first target Modbus protocol includes a first function register address and a first preset response value corresponding to the first function register address, and the first instruction message is used to instruct the photovoltaic device where the predicted device address exists to return a first response value corresponding to the first function register address; next, in response to receiving the first response message returned by the predicted device address, confirm that the predicted device address exists in the photovoltaic device; wherein the first response message includes the first response value ; Then, determine whether the first response value corresponds to the first preset response value; next, in response to the first response value corresponding to the first preset response value, obtain the second target Modbus protocol from the pre-built protocol library, determine the second instruction message according to the second target Modbus protocol, and send the second instruction message to the predicted device address; wherein, the second target Modbus protocol matches the target photovoltaic device, the second target Modbus protocol includes a second function register address and a second preset response value corresponding to the second function register address, and the second instruction message is used to instruct the photovoltaic device existing at the predicted device address to return the second response value corresponding to the second function register address; the first target Modbus protocol is different from the second target Modbus protocol; then, in response to receiving the second response message returned by the predicted device address, determine whether the second response value included in the second response message corresponds to the second preset response value; finally, in response to the second response value corresponding to the second preset response value, determine that the photovoltaic device under the predicted device address is the target photovoltaic device. Based on this, the present invention first predicts the address where a photovoltaic device may exist to improve query efficiency and save query time, selects a target Modbus protocol from a pre-built Modbus protocol library to poll the predicted address to confirm whether there is a photovoltaic device at the predicted address and whether the existing photovoltaic device is the target photovoltaic device. When a photovoltaic device exists at the predicted address, the target Modbus protocol is sent to the photovoltaic device again to further verify the type of the photovoltaic device, thereby reducing the misrecognition rate, improving the recognition accuracy of the protocol matching process of the photovoltaic device, and ensuring the efficiency of the entire protocol automatic recognition process.
[0048] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only for the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0050] Figure 1 A schematic diagram of a protocol matching system for a photovoltaic device provided by an embodiment of the present invention is shown.
[0051] Figure 2 A schematic flow chart of a protocol identification method for photovoltaic equipment provided by an embodiment of the present invention is shown.
[0052] Figure 3 Another schematic flow chart of a protocol identification method for photovoltaic equipment provided by an embodiment of the present invention is shown.
[0053] Figure 4 A schematic diagram of a predicted device address query process provided by an embodiment of the present invention is shown.
[0054] Figure 5 A schematic diagram of a Modbus protocol library provided by an embodiment of the present invention is shown.
[0055] Figure 6 A schematic diagram of a protocol confirmation process provided by an embodiment of the present invention is shown.
[0056] Figure 7 A schematic diagram of a power-on process flow provided by an embodiment of the present invention is shown.
[0057] Figure 8 A schematic diagram of a protocol matching system for photovoltaic equipment provided by an embodiment of the present invention is shown.
[0058] Fig. 9 A schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0059] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings.
[0060] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0061] Photovoltaic equipment, as the core component of photovoltaic power generation system, has been increasingly applied and influential in recent years with the rapid advancement of photovoltaic industry chain technology. Photovoltaic equipment mainly includes two key components: photovoltaic modules and inverters, which play a vital role in converting solar energy into electrical energy.
[0062] Inverters are used to convert the DC power generated by photovoltaic modules into AC power to meet the power needs of the power grid and users. In addition, inverters also have functions such as intelligent control, fault detection and protection to ensure the stable operation of photovoltaic power generation systems.
[0063] Automatic identification technology plays a vital role in promoting the efficient access of distributed photovoltaic equipment to the power grid. Distributed photovoltaic equipment manufacturers in the market generally use Modbus communication protocol to realize data interaction of photovoltaic equipment. However, due to differences in photovoltaic equipment produced by different manufacturers, the Modbus communication protocol supported by photovoltaic equipment produced by different manufacturers also differs in details (especially different register address mapping and function code application differences). This requires automatic identification technology to have high flexibility and intelligent analysis capabilities to adapt to the problems of different register address mapping and function code application differences. The present invention aims to overcome the communication barrier problem caused by manufacturers using Modbus communication protocols of different standards, and ensure that the data interaction module of the photovoltaic system can intelligently and efficiently identify and adapt the specifications and models of various photovoltaic equipment.
[0064] As a widely used industrial communication protocol, Modbus protocol is used to realize data exchange between devices and plays a key role in photovoltaic systems. Through the Modbus protocol, the master device (such as a monitoring system, data acquisition system or interactive module) can communicate with the slave device (such as photovoltaic modules, inverters, combiner boxes and other photovoltaic equipment) to obtain important information such as the status and operating parameters of the photovoltaic equipment. The Modbus protocol adopts master-slave technology and is a question-and-answer communication protocol. Each communication is initiated by the host to send data request information. After receiving the correct message, the slave can send data to the host in response to the request. In addition, the host can also directly send information to modify the data of the slave to achieve two-way reading and writing.
[0065] As described in the background technology section, the existing automatic identification technology for distributed photovoltaic equipment protocols mainly relies on the standardized framework of the Modbus protocol. Although there are certain limitations, since the Modbus address (i.e., the device address of the photovoltaic device) range is only limited to between 1 and 254, some inverters can still be identified through the full address polling strategy. Taking the photovoltaic device as an inverter as an example, the identification process usually includes the following key steps: First, in terms of Modbus address polling, the data interaction module will start from Modbus address 1 and send a query request to each possible address in sequence. Secondly, in terms of message construction, based on market research, a set of standard query messages are pre-set for the general register addresses supported by most inverters, such as the register addresses of key parameters such as voltage, current, and power. These messages are designed to trigger the inverter to return a specific type of information, which is the basis for identifying the Modbus protocol characteristics of the inverter. Finally, in terms of response analysis and protocol judgment, once the inverter receives the query message and responds, the data interaction module will analyze the data packet content returned by the inverter, including the response code, data format, and a specific manufacturer identifier that may be embedded. By comparing the preset Modbus protocol library, the data interaction module can identify the manufacturer, model and communication protocol version of the inverter. In this process, the current protocol identification technology uses a fixed instruction to communicate with the inverter to determine the unique information of various manufacturers.
[0066] In addition, the existing distributed power supply protocol automatic identification technology does not need to make any judgment when the inverter in the distributed photovoltaic system changes or is powered on again. It will simply start a new round of protocol dynamic identification. This usually involves polling the entire Modbus address space (1-254) to rediscover the online inverter device. Although the current inverter protocol automatic identification technology has a relatively simple logic, it often does not need to be re-identified when the power is turned on again, otherwise it will cause an extremely long waiting time during the power-on process, seriously affecting the customer's user experience.
[0067] In the process of implementing the present invention, the applicant found that for the address polling technology in the automatic identification technology, the existing inverter protocol automatic identification technology will only simply poll from 1-254 addresses, and poll and retrieve the pre-stored inverter protocol instructions for each address for query, and cannot perform conditional judgment and end the query process in advance. In terms of standardized query messages, the current protocol automatic identification technology uses a fixed set of standard messages for query. When encountering two inverter protocols of a manufacturer or some registers in the inverter protocols of two manufacturers are the same, the protocol automatic identification technology will misjudge. In terms of response analysis and protocol judgment, the existing automatic identification technology can only make errors, correctness and timeout judgments for inverter feedback messages, and cannot further analyze the correct feedback messages. When encountering an inverter that does not exist in the protocol table, the inverter is directly omitted and cannot be reported to the master station in time. For the re-power-on process of the distributed photovoltaic system, the existing technology needs to re-identify the distributed power supply protocol or after confirming the inverter protocol identified last time, it still needs to re-poll 1-254 other modbus addresses, resulting in a large waste of time. Regarding the identification of multiple inverters, the current protocol automatic identification technology only uses a simple 1-254 polling process. During use, it is found that only the inverter with the largest address can be identified. Even if other inverters have been identified, they will be updated by later ones.
[0068] In response to the above problems, the present invention proposes a protocol identification method, system, device, medium and program product for photovoltaic equipment, aiming to jointly build a highly automated, efficient, widely compatible and extremely low error rate protocol automatic identification technology through querying a standardized message library, an inverter address prediction algorithm, a systematic protocol query process, an intelligent power-on processing mechanism, a unified information storage structure and a full-power status judgment technology.
[0069] The technical solution of the present invention is further described in detail below through specific embodiments.
[0070] refer to Figure 1 , a schematic diagram of a protocol matching system for a photovoltaic device provided in an embodiment of the present invention.
[0071] In an embodiment of the present invention, a protocol matching system of a photovoltaic device is communicatively connected with a plurality of photovoltaic devices, each photovoltaic device has a unique device address, and the protocol matching system of the photovoltaic device includes a data interaction module, which is responsible for information interaction with the photovoltaic device.
[0072] In photovoltaic equipment, data is stored in the internal registers of the photovoltaic equipment. Each register storing data corresponds to a register address. The data interaction module organizes command messages according to these addresses to read and write data in the registers.
[0073] refer to Figure 2 , is a flow chart of a protocol identification method for photovoltaic equipment provided in an embodiment of the present invention.
[0074] The present invention adopts query instruction standardization design, inverter address prediction technology, protocol confirmation technology, power-on processing, fault processing and protocol information storage technology to build a communication protocol query and processing technology that can be widely used in devices based on the Modbus protocol. Taking photovoltaic equipment as an inverter as an example:
[0075] Step S201, when the protocol matching system of the photovoltaic device is powered on, checking whether it is the first time the system is powered on, if not the first time, executing the system re-power-on technology, if it is the first time, executing the inverter address query technology.
[0076] In step S203, the system confirms whether there is an inverter at a certain initial device address according to the inverter address query technology. If there is an inverter, the next step of the inverter protocol confirmation technology is continued.
[0077] Step S205: The protocol confirmation technology further queries and analyzes the initial device address of the existing inverter obtained in the previous step to confirm the inverter information.
[0078] Step S207, after the inverter information is confirmed, whether the query process is completed is determined based on whether the sum of the total power of the inverter currently queried or the address is 254 as a judgment condition.
[0079] Step S209: if the end condition is not met, continue to repeat steps S203, S205 and S207, continue to analyze and determine the device address of the inverter that may exist, and if the end condition is met, save the query information and end the query process.
[0080] Next, the query instruction standardization design, inverter address prediction technology, protocol confirmation technology, power-on processing, fault processing and protocol information storage technologies involved in the above steps will be further explained in combination with the flow chart of the protocol identification method of photovoltaic equipment provided in an embodiment of the present invention.
[0081] Specifically, query instruction standardization includes standardization of instruction information, standardization of instruction storage structure and automatic package processing.
[0082] As an optional embodiment, the protocol identification method of the photovoltaic equipment provided by itself needs to obtain the register information of all target photovoltaic devices and store the register information in the instruction information table; construct an instruction storage structure table according to the storage format of the standard Modbus protocol; determine at least two corresponding Modbus protocols for each target photovoltaic device based on the instruction information table and the instruction storage structure table; and construct a Modbus protocol library based on the Modbus protocols of all target photovoltaic devices.
[0083] The command information standardization uniformly processes the Modbus protocol information of the mainstream distributed photovoltaic devices currently on the market, integrates each queried information into the command information table, and uniformly collects it in the manner of Table 1. Among them, the non-existent register information is uniformly modified to 0xFFFF (for example, if the A photovoltaic device SUN2000 has no output type, 0xFFFF is stored in the corresponding position of the Modbus protocol of the A photovoltaic device).
[0084]
[0085]
[0086] Table 1
[0087] Among them, the equipment serial number is a number that uniquely identifies the equipment and is used for tracking, management and maintenance.
[0088] Rated active power: the maximum power (active power) that the equipment is designed or specified to continuously output.
[0089] Rated reactive power: The maximum reactive power that the device can provide, used to support the voltage stability of the power grid. Output type: Describes the type or characteristics of the power output of the device, such as AC, DC, etc.
[0090] A / B / C phase voltage: represents the voltage values of phases A, B, and C in a three-phase power system.
[0091] A / B / C phase current: represents the current value of phase A, B and C in a three-phase power system respectively.
[0092] A / B / C phase active power: represents the active power output of phases A, B, and C in a three-phase power system. Total active power: the total active power output of a three-phase power system.
[0093] Energy storage rated charging power: the maximum charging power designed or specified for the energy storage system (such as a battery pack).
[0094] Energy storage rated discharge power: the maximum discharge power designed or specified for the energy storage system (such as a battery pack).
[0095] Energy storage rated capacity: the total storage capacity of an energy storage system (such as a battery pack).
[0096] Remaining energy storage capacity: The remaining storage capacity of the energy storage system.
[0097] Inverter On / Off 1 / 2: Controls the on / off state of the inverter (power conversion device), which may indicate different inverters or different operating modes of the same inverter.
[0098] Active power set value: Active power output target value set automatically by the user or the system.
[0099] Rated active power percentage: The percentage of current active power output to rated active power.
[0100] Reactive power set value: reactive power output target value set automatically by the user or the system.
[0101] Reactive power percentage: The percentage of current reactive power output to rated reactive power.
[0102] Power factor setpoint: The power factor target value set automatically by the user or the system to optimize power transmission efficiency.
[0103] Energy storage charging and discharging: Control the charging and discharging status of the energy storage system.
[0104] Energy storage forced charging power: Under certain conditions, the energy storage system is forced to charge at a specific power.
[0105] Energy storage charging cut-off capacity: The energy storage system stops charging when it reaches this capacity during the charging process.
[0106] Energy storage forced discharge power: Under certain conditions, the energy storage system is forced to discharge at a specific power.
[0107] Energy storage discharge cut-off capacity: The energy storage system stops discharging when it reaches this capacity during the discharge process.
[0108] Time (year month day hour minute second): record or display the current time information.
[0109] Daily power generation and online power generation: record the total power generated by the system and the power connected to the grid (i.e. sold to the grid) in one day.
[0110] Inverter status: Displays the current working status of the inverter, such as running, standby, fault, etc.
[0111] The standardization of the instruction storage structure is shown in Table 2. According to the standard Modbus protocol, the standardized technology stores the instruction information according to: function code, register address, number of registers, big-endian mode, whether it is an array, read-write mode and gain size.
[0112] Serial number Function Remark 1 Function code 0x03, 0x04, 0x06, 0x10, etc. 2 Register Address Hexadecimal table 3 Number of registers According to actual needs 4 Data Types See Table 3 for details 5 Data endian mode Big endian: 1; Little endian: 2 6 Is the data an array? 0: not an array, 1: an array 7 Register read and write mode 0: read only; 1: read and write; 2: write only 8 Gain The original data is multiplied by the gain to get the true value
[0113] Table 2
[0114] Among them, the function code is used to indicate the purpose of a Modbus information frame, such as reading coil status (01), reading input status (02), reading holding register (03), reading input register (04), etc. The function code is the key part of the instruction information and directly determines the type of operation that the photovoltaic device needs to perform. The register address specifies the specific location of the instruction operation, that is, which register to start the operation. In the Modbus RTU protocol, the register address is usually expressed in the form of two bytes (16 bits). The number of registers indicates the number of registers that the instruction needs to operate. This information is very important when reading or writing multiple registers. Similarly, the number of registers is also expressed in the form of two bytes (16 bits). The big-endian or little-endian mode mainly affects the storage order of multi-byte data. Although the Modbus protocol itself does not directly specify the big-endian mode, in actual applications, the communicating parties need to reach an agreement on this point to ensure the correct parsing of the data. In the Modbus RTU protocol, data is usually transmitted in network byte order (Big-Endian). The Modbus protocol does not directly distinguish whether the object of the instruction operation is an array. However, when reading or writing multiple consecutive registers, these registers can be considered to form an array. The register address and the number of registers in the instruction together define the scope of this "array". The read and write mode is determined by the function code. For example, function codes 03 and 04 are used to read the values of holding registers and input registers respectively, while function codes 05 and 15 are used to force the status of single coils and multiple coils (which can be regarded as write operations). Gain size is usually not an instruction storage structure element directly specified by the Modbus protocol. It is more related to data processing and conversion, which may be applied at the device or software level before / after the data is read or written to the register.
[0115] Serial number Data Types coding 1 int8 0x10 2 uint8 0x11 3 int16 0x20 4 uint16 0x21 5 int32 0x30 6 uint32 0x31
[0116] Table 3
[0117] Table 3 is a data type encoding correspondence table. In the given mapping of data types and encodings, each data type is assigned a specific hexadecimal encoding. This encoding method may be used in a specific protocol, file format or internal system to distinguish and identify different data types.
[0118] In the specific implementation, for the automatic package assembly technology, according to Table 1 and Table 2, in the package assembly process, you only need to query the corresponding register information and then copy the corresponding information to the Modbus protocol to form a standard target Modbus protocol, which is convenient and fast. In the processed response message, you only need to judge whether the data is true and valid according to the big and small ends, arrays, gains and other information. It can be seen that the standardized design of query instructions further optimizes the query process and greatly improves the scalability of the system. The standardized design of query instructions, through the unified coding design, further standardizes the protocols of various different inverter manufacturers, ensures the uniformity in the protocol confirmation process, and improves the scalability of the system.
[0119] refer to Figure 3 , which is another flow chart of the protocol identification method for photovoltaic equipment provided in an embodiment of the present invention.
[0120] Step S301, determining at least one initial device address, inputting the initial device address into a pre-built address prediction model to obtain a predicted device address; wherein the initial device address contains a photovoltaic device.
[0121] According to the standard Modbus protocol, the inverter address (i.e., device address) can only be data between 1 and 254. If all addresses are polled, it will take a long time, and if there is no inverter at the current address, it is necessary to wait for a timeout before querying the next inverter address. For example, if the waiting time for an inverter address is 3s, assuming that each address needs to be judged to time out, it will take at least 10 minutes. Therefore, optimizing the query method is crucial to the protocol identification of photovoltaic equipment.
[0122] As an optional embodiment, the present invention further simplifies the coefficient and noise formula based on the first-order Kalman filter according to the Kalman filter principle to construct an address prediction model for address prediction:
[0123] X(k)=A*X(k-1)+B*U(k-1)+V(k)
[0124] Among them, X(k) is the predicted device address at time k, A and B are the model prediction coefficients, which default to 1, X(k-1) is the predicted device address at time k-1, and its initial value is 1, U(k-1) is the initial device address of the photovoltaic device at time k-1, and its initial value defaults to 0, and V(k) is the noise coefficient, which is the covariance at time k-1 and then rounded up, and its initial value is 0.
[0125] refer to Figure 4 , is a schematic diagram of the predicted device address query process provided by an embodiment of the present invention.
[0126] In the embodiment of the present application, the predicted device address can be understood as the device address where the inverter may be obtained by predicting the address prediction model of the present invention, and the real device address can be understood as the device address where the inverter actually exists. The address prediction model is mainly used to predict and calculate the next device address where the inverter may exist. If there is no inverter at the predicted device address, polling is performed in sequence from the predicted value to the real device address of the inverter that was found most recently. If there is no inverter, the next device address where the inverter may exist is continued to be predicted and calculated until the next inverter is found. At this time, according to the predicted device address and the real device address, the model predicts coefficients A and B, where A = (U(k)-X(k)) / X(k), B = U(k) / U(k-1). The address prediction model of the present invention adopts continuous recursion and has the ability to continuously self-correct. Under the condition of limited computing power of the system, it can efficiently predict the device address where the inverter may exist next time. Furthermore, the inverter address ends the judgment. According to the characteristics of distributed photovoltaic equipment, the total power of the equipment connected to the distributed photovoltaic system is not greater than a certain power value (the default is 20KW). When the total rated power of the inverters that have been queried exceeds 20KW, or when the device address is queried to 254, the protocol matching system of the photovoltaic equipment automatically determines that the query address ends.
[0127] As an optional embodiment, in response to not receiving a first response message returned by the predicted device address within a preset time interval, it is determined that no photovoltaic device exists at the predicted device address.
[0128] Specifically, the method for determining whether the predicted device address has an inverter is that the protocol matching system of the photovoltaic device sends a message instruction to the predicted address through the data interaction module. If the data interaction module receives a response message fed back by the predicted device address within a preset time interval, it proves that the predicted device address has an inverter. If the data interaction module does not receive a response message returned by the predicted device address within the preset time interval, it proves that the predicted device address does not have an inverter.
[0129] As an optional embodiment, in response to the absence of photovoltaic equipment at the predicted device address, confirming whether there is a photovoltaic equipment at a device address between the predicted device address and the real device address where the photovoltaic equipment was last confirmed to exist; in response to the absence of photovoltaic equipment at a device address between the predicted device address and the real device address where the photovoltaic equipment was last confirmed to exist, correcting the model prediction coefficient and the noise coefficient based on the predicted device address and the real device address to obtain an updated address prediction model; and reconfirming the predicted device address based on the updated address prediction model.
[0130] Specifically, at the beginning, the protocol matching system of the photovoltaic device uses a polling method to poll all device addresses, finds the initial device address of the first existing inverter, and after finding it, sets the coefficients A and B in the address prediction model to 1, and uses the address prediction model to pre-judge the device address of the next existing inverter. Further, query whether the predicted device address is an existing inverter. If it exists, continue to predict the next device address. If not, query all device addresses between the predicted device address and the real device address of the photovoltaic device that was confirmed to exist the most recently, modify the model prediction coefficients A and B according to the query result, recalculate the noise coefficient V (k), and judge whether the query is over. It can be seen that the present invention can further improve the query efficiency and save the query time of the device address through the pre-constructed address prediction model. The inverter address query technology greatly improves the query speed by combining the address prediction model with the polling method. In addition, the query end time of the entire process can be accurately predicted by power accumulation or accumulation judgment of device address coding.
[0131] Step S303, obtaining a first target Modbus protocol from a pre-built Modbus protocol library, determining a first instruction message according to the first target Modbus protocol, and sending the first instruction message to the predicted device address; wherein the first target Modbus protocol matches the target photovoltaic device, the first target Modbus protocol includes a first function register address and a first preset response value corresponding to the first function register address, and the first instruction message is used to instruct the photovoltaic device where the predicted device address exists to return a first response value corresponding to the first function register address.
[0132] In a specific implementation, after obtaining the predicted device address according to the pre-built address prediction model, it is necessary to confirm whether there is an inverter at the address, and after confirming the existence of the inverter, confirm the relevant information of the inverter.
[0133] refer to Figure 5 , is a schematic diagram of the Modbus protocol library provided in an embodiment of the present invention.
[0134] Specifically, the pre-built Modbus protocol library includes multiple inverters, and each inverter includes multiple registers. Therefore, all Modbus protocols corresponding to the multiple inverters can be obtained according to the register functions included in all inverters. For example, according to Table 1, it can be determined that the first target register function of a certain inverter is to store the device serial number, and the first target Modbus protocol can be determined according to the function code, register address (obtained by encoding the first target register function as the storage device serial number), the number of registers, the big-endian mode, whether it is an array, the read-write mode and the gain size. If the second target register function of the inverter is to store the active power setting value, the first target Modbus protocol can be determined according to the function code, register address (obtained by encoding the second target register function as the storage active power setting value), the number of registers, the big-endian mode, whether it is an array, the read-write mode and the gain size.
[0135] Further, once a suitable Modbus protocol (i.e., the first target Modbus protocol) is selected, it is necessary to construct a command message (i.e., the first command message) according to this protocol. In the application scenario of the embodiment of the present application, the command message will include a function code (e.g., function code 03 is usually used to read the holding register), and a specific register address on the target device (i.e., the first function register address). This address is determined based on the internal register layout of the photovoltaic device and is used to access the data inside the register. The first command message may also include other parameters, such as the starting address, the number of registers to be read, etc.
[0136] Furthermore, the constructed first instruction message is sent to the predicted device address using the first target Modbus protocol. The device address is an identifier that uniquely identifies the device in a network or serial connection.
[0137] When the photovoltaic device receives the command message, it will process it according to the request in the message and return the corresponding response message. The response message will contain the requested data, that is, the first response value corresponding to the first function register address. This value is the data that needs to be obtained from the photovoltaic device through Modbus communication. According to the provisions of the Modbus protocol, the response message returned by the device will also contain information such as function code, starting address, number of bytes, etc., which is used to verify the integrity and correctness of the response.
[0138] Step S307, determining whether the first response value corresponds to the first preset response value.
[0139] Step S309, in response to the first response value corresponding to the first preset response value, obtain the second target Modbus protocol from the pre-built protocol library, determine the second instruction message according to the second target Modbus protocol, and send the second instruction message to the predicted device address; wherein the second target Modbus protocol matches the target photovoltaic device, the second target Modbus protocol includes a second function register address and a second preset response value corresponding to the second function register address, and the second instruction message is used to instruct the photovoltaic device where the predicted device address exists to return a second response value corresponding to the second function register address; the first target Modbus protocol is different from the second target Modbus protocol.
[0140] Step S3011, in response to receiving a second response message returned by the predicted device address, determining whether a second response value included in the second response message corresponds to a second preset response value.
[0141] Step S3013, in response to the second response value corresponding to the second preset response value, determining that the photovoltaic device under the predicted device address is the target photovoltaic device.
[0142] For steps S307 to S3013, in the specific implementation, if the predicted device address can feedback a response value, it can be preliminarily determined that there is an inverter at the predicted device address, and it is necessary to further execute the protocol confirmation technology. The protocol confirmation technology refers to the technology of further judging the manufacturer, protocol model and other information of the existing inverter after confirming that there is an inverter at the current predicted device address. It mainly includes standard query message packaging, protocol judgment and protocol confirmation functions.
[0143] As mentioned above, query instruction standardization includes standardization of instruction information, standardization of instruction storage structure and automatic packet processing. Standard query message packetization can be understood as selecting representative registers (or data points) from the protocols of various manufacturers. These registers should be able to reflect the identity or characteristics of the inverter to a certain extent. Based on the selected registers, a standard query message is constructed. In order to improve accuracy, two registers with different addresses and information types are usually used to form two frames of query messages. (That is, the first instruction message and the second instruction message).
[0144] Furthermore, for the protocol judgment process, when the data interaction module receives the inverter reply message, first, the received inverter reply message is checked according to the Modbus standard (such as CRC check) to ensure that the message has not been tampered with during transmission. Check whether the format of the message complies with the provisions of the Modbus protocol, including address, function code, data length, etc. Then, according to the manufacturer protocol selected by the sent message, judge whether the received data is within a reasonable range.
[0145] refer to Figure 6 , is a schematic diagram of the protocol confirmation process provided by an embodiment of the present invention.
[0146] First, according to the device address of the inverter that has been obtained, the first target Modbus protocol of the first inverter manufacturer in the Modbus protocol library is searched, and the first command message is packaged to obtain the first command message. Further, the packaged first command message is sent to the inverter, and the first response message is collected. Further, it is judged whether the received first response message conforms to the modbus protocol (i.e., whether the first response value corresponds to the first preset response value), whether it is correct, and whether it is within a reasonable range. If the judgment result is no, continue to use the next inverter manufacturer's protocol and repeat the above steps. If the judgment result is yes, use the second target Modbus protocol to package the second command message and send it to the inverter, and collect the second response message. Further, it is judged whether the received second response message conforms to the modbus protocol (i.e., whether the second response value corresponds to the second preset response value), whether it is correct, and whether it is within a reasonable range. If the judgment result is no, continue to use the next inverter manufacturer's protocol and repeat the above steps. If the judgment result is yes, confirm the inverter protocol and store the identified inverter protocol information. It can be seen that the inverter protocol confirmation technology provided by the present invention can improve the recognition accuracy of the system and reduce the false recognition rate. The accuracy of inverter protocol recognition is further enhanced by the reasonable value of the secondary standard command query (i.e., the combination of the first command message and the second command message) and the feedback response message, ensuring the reliability of the automatic recognition technology.
[0147] As an optional embodiment, obtaining a first target Modbus protocol from a pre-built Modbus protocol library, determining a first instruction message based on the first target Modbus protocol, and before sending the first instruction message to the predicted device address, it also includes: confirming whether the protocol matching system of the photovoltaic device is powered on for the first time; in response to the protocol matching system of the photovoltaic device being powered on for the first time, confirming the execution of the operation of obtaining the first target Modbus protocol from the pre-built Modbus protocol library, determining a first instruction message based on the first target Modbus protocol, and sending the first instruction message to the predicted device address.
[0148] As an optional embodiment, in response to the fact that the protocol matching system of the photovoltaic device is not powered on for the first time, it is queried whether the target photovoltaic device corresponding to the device information stored in the bidirectional linked list exists; in response to the target photovoltaic device not existing, it is confirmed to execute the operation of obtaining the first target Modbus protocol from the pre-built Modbus protocol library, determining the first instruction message according to the first target Modbus protocol, and sending the first instruction message to the predicted device address.
[0149] refer to Figure 7, is a schematic diagram of the power-on process flow provided in an embodiment of the present invention.
[0150] Determine whether the protocol matching system of the photovoltaic equipment is powered on again. If so, execute the power-on process again. The system reads the controller storage information and updates the storage information to the inverter's bidirectional linked list; then reads the inverter information in the bidirectional linked list in sequence and performs protocol confirmation; finally, according to the protocol confirmation, determine whether it is necessary to re-identify the inverter. In the process of determining whether the protocol matching system of the photovoltaic equipment is powered on again, if it is determined that the system is powered on for the first time, or if it is determined that the stored inverter no longer exists during the process of reading the inverter information in the bidirectional linked list, the inverter query address technology and inverter protocol identification technology are re-executed to search and identify the inverter, and the inverter information that has been confirmed for this power-on is re-stored. Furthermore, after the inverter information is queried, the currently queried inverter information needs to be stored. This technology designs a bidirectional linked list storage, and the default head node is empty. The queried inverter information generates a new node and inserts it behind the linked list, and is processed in sequence. It can be seen that the present invention executes the re-power-on judgment process, which can greatly shorten the protocol recognition time of the system being powered on for the second time, ensure the high efficiency of the entire automatic recognition technology, and improve the system operation efficiency.
[0151] As shown in Table 4, the inverter information structure mainly includes a pointer to the previous node, a manufacturer number, a protocol version number, a device sequence list, and a pointer to the next node. If there is no next node, it points to null.
[0152] Serial number Data content Remark 1 pointer Point to the previous manufacturer information 2 Manufacturer No. See Table 5 for details 3 Protocol version number 4 Device serial number 5 pointer Point to the next manufacturer information
[0153] Table 4
[0154] Finally, in order to unify the protocol processing, the present invention can also sort the manufacturer codes, as shown in Table 5, and sort them in order according to market share. Unifying the manufacturer codes can further achieve uniformity in the inverter protocol identification and protocol conversion process.
[0155] Serial number factory coding Serial number factory coding 1 Manufacturer 1 0x0001 11 Manufacturer 11 0x0011 2 Manufacturer 2 0x0002 12 Manufacturer 12 0x0012 3 Manufacturer 3 0x0003 13 Manufacturer 13 0x0013 4 Manufacturer 4 0x0004 14 Manufacturer 14 0x0014 5 Manufacturer 5 0x0005 15 Manufacturer 15 0x0015 6 Manufacturer 6 0x0006 16 Manufacturer 16 0x0016 7 Manufacturer 7 0x0007 17 Manufacturer 17 0x0017 8 Manufacturer 8 0x0008 18 Manufacturer 18 0x0018 9 Manufacturer 9 0x0009 19 Manufacturer 19 0x0019 10 Manufacturer 10 0x0010 20
[0156] Table 5
[0157] It can be seen that the present invention supports simultaneous identification of multiple inverters, and the inverter information is uniformly managed using a bidirectional linked list. In particular, the use of a bidirectional linked list to store inverter information can reduce system operation space. The unique bidirectional linked list protocol information storage technology ensures that the automatic identification technology can identify multiple inverter information and greatly save storage space.
[0158] It should be noted that, during the protocol identification process, if the predicted device address has an inverter, but there is no inverter manufacturer code in the manufacturer code table 5, and there is no corresponding standard identification message in the program, the present invention can store this situation, and after the protocol identification is completed, the information is printed out at the host computer debugging port to prompt that there is an unidentified inverter. The present invention can further enhance the robustness of the protocol automatic identification technology for fault information processing.
[0159] As can be seen from the above, the protocol identification method for photovoltaic equipment provided by the present invention first determines at least one initial device address, inputs the initial device address into a pre-built address prediction model, and obtains a predicted device address; wherein, the initial device address exists in the photovoltaic device; further, obtains the first target Modbus protocol from the pre-built Modbus protocol library, determines the first instruction message according to the first target Modbus protocol, and sends the first instruction message to the predicted device address; wherein, the first target Modbus protocol matches the target photovoltaic device, the first target Modbus protocol includes a first function register address and a first preset response value corresponding to the first function register address, and the first instruction message is used to instruct the photovoltaic device where the predicted device address exists to return a first response value corresponding to the first function register address; next, in response to receiving the first response message returned by the predicted device address, confirms that the predicted device address exists in the photovoltaic device; wherein the first response message includes the first response value; then, determines the first target Modbus protocol. whether a response value corresponds to a first preset response value; next, in response to the first response value corresponding to the first preset response value, a second target Modbus protocol is obtained from a pre-built protocol library, a second instruction message is determined according to the second target Modbus protocol, and the second instruction message is sent to the predicted device address; wherein the second target Modbus protocol matches the target photovoltaic device, the second target Modbus protocol includes a second function register address and a second preset response value corresponding to the second function register address, and the second instruction message is used to instruct the photovoltaic device existing at the predicted device address to return a second response value corresponding to the second function register address; the first target Modbus protocol is different from the second target Modbus protocol; then, in response to receiving the second response message returned by the predicted device address, it is determined whether the second response value included in the second response message corresponds to the second preset response value; finally, in response to the second response value corresponding to the second preset response value, the photovoltaic device under the predicted device address is determined to be the target photovoltaic device. Based on this, the present invention first predicts the address where a photovoltaic device may exist to improve query efficiency and save query time, selects a target Modbus protocol from a pre-built Modbus protocol library to poll the predicted address to confirm whether there is a photovoltaic device at the predicted address and whether the existing photovoltaic device is the target photovoltaic device. When a photovoltaic device exists at the predicted address, the target Modbus protocol is sent to the photovoltaic device again to further verify the type of the photovoltaic device, thereby reducing the misrecognition rate, improving the recognition accuracy of the protocol matching process of the photovoltaic device, and ensuring the efficiency of the entire protocol automatic recognition process.
[0160] It should be noted that the method of the embodiment of the present invention can be performed by a single device, such as a computer or a server. The method of this embodiment can also be applied in a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present invention, and the multiple devices will interact with each other to complete the described method.
[0161] It should be noted that some embodiments of the present invention are described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0162] Based on the same inventive concept, corresponding to the method provided in any of the above embodiments, the present invention also provides a protocol matching system for photovoltaic equipment.
[0163] refer to Figure 8 , is a schematic diagram of a protocol matching system for a photovoltaic device provided in an embodiment of the present invention.
[0164] The photovoltaic device protocol matching system 800 is in communication connection with a plurality of photovoltaic devices 900, each photovoltaic device has a unique device address, and the photovoltaic device protocol matching system 800 is configured as follows:
[0165] Determine at least one initial device address, input the initial device address into a pre-built address prediction model to obtain a predicted device address; wherein the initial device address has a photovoltaic device;
[0166] A first target Modbus protocol is obtained from a pre-built Modbus protocol library, a first instruction message is determined according to the first target Modbus protocol, and the first instruction message is sent to the predicted device address; wherein the first target Modbus protocol matches the target photovoltaic device, the first target Modbus protocol includes a first function register address and a first preset response value corresponding to the first function register address, and the first instruction message is used to instruct the photovoltaic device where the predicted device address exists to return a first response value corresponding to the first function register address;
[0167] In response to receiving a first response message returned by the predicted device address, confirming that a photovoltaic device exists at the predicted device address; wherein the first response message includes a first response value;
[0168] determining whether the first response value corresponds to a first preset response value;
[0169] In response to the first response value corresponding to the first preset response value, a second target Modbus protocol is obtained from a pre-built protocol library, a second instruction message is determined according to the second target Modbus protocol, and the second instruction message is sent to the predicted device address; wherein the second target Modbus protocol matches the target photovoltaic device, the second target Modbus protocol includes a second function register address and a second preset response value corresponding to the second function register address, and the second instruction message is used to instruct the photovoltaic device that exists at the predicted device address to return a second response value corresponding to the second function register address; the first target Modbus protocol is different from the second target Modbus protocol;
[0170] In response to receiving a second response message returned by the predicted device address, determining whether a second response value included in the second response message corresponds to a second preset response value;
[0171] In response to the second response value corresponding to the second preset response value, the photovoltaic device under the predicted device address is determined to be the target photovoltaic device.
[0172] Optionally, the photovoltaic device protocol matching system 800 is further configured as follows:
[0173] In response to not receiving a first response message returned by the predicted device address within a preset time interval, it is determined that no photovoltaic device exists at the predicted device address.
[0174] An optional, pre-built address prediction model is represented as:
[0175] X(k)=A*X(k-1)+B*U(k-1)+V(k)
[0176] Among them, X(k) is the predicted device address at time k, A and B are the model prediction coefficients, X(k-1) is the predicted device address at time k-1, U(k-1) is the initial device address of the photovoltaic device at time k-1, and V(k) is the noise coefficient.
[0177] Optionally, the photovoltaic device protocol matching system 800 is further configured as follows:
[0178] Obtain register information of all target photovoltaic devices and store the register information in the instruction information table;
[0179] Construct the instruction storage structure table according to the storage format of the standard Modbus protocol;
[0180] Determine at least two corresponding Modbus protocols for each target photovoltaic device according to the instruction information table and the instruction storage structure table;
[0181] Build a Modbus protocol library according to the Modbus protocol of all target PV devices.
[0182] Optionally, the photovoltaic device protocol matching system 800 is further configured as follows:
[0183] In response to the predicted device address not having a photovoltaic device, confirming whether a photovoltaic device exists at a device address between the predicted device address and a real device address that was most recently confirmed to have a photovoltaic device;
[0184] In response to the fact that there is no photovoltaic device at a device address between the predicted device address and the real device address that was most recently confirmed to have a photovoltaic device, correcting the model prediction coefficient and the noise coefficient according to the predicted device address and the real device address to obtain an updated address prediction model;
[0185] Reconfirm the predicted device address based on the updated address prediction model.
[0186] Optionally, the photovoltaic device protocol matching system 800 is further configured as follows:
[0187] The protocol matching system of the photovoltaic equipment exchanges data with the target photovoltaic equipment through the Modbus protocol of the target photovoltaic equipment to obtain the equipment information of the target photovoltaic equipment;
[0188] The device information is stored in a bidirectional linked list; wherein the bidirectional linked list includes a predecessor pointer and a successor pointer, the predecessor pointer points to the device information of the previous photovoltaic device of the target photovoltaic device, and the successor pointer points to the device information of the next photovoltaic device of the target photovoltaic device.
[0189] For the convenience of description, the above system is described as being divided into various modules according to their functions. Of course, when implementing the present invention, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0190] The system of the above embodiment is used to implement the corresponding method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0191] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments, the present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the protocol identification method for the photovoltaic device described in any of the above embodiments is implemented.
[0192] Fig. 9A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 910, a memory 920, an input / output interface 930, a communication interface 940, and a bus 950. The processor 910, the memory 920, the input / output interface 930, and the communication interface 940 are connected to each other through the bus 950 in the device.
[0193] The processor 910 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0194] The memory 920 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 920 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 920 and are called and executed by the processor 910.
[0195] The input / output interface 930 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0196] The communication interface 940 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).
[0197] The bus 950 includes a path that transmits information between the various components of the device (eg, the processor 910 , the memory 920 , the input / output interface 930 , and the communication interface 940 ).
[0198] It should be noted that, although the above device only shows the processor 910, the memory 920, the input / output interface 930, the communication interface 940 and the bus 950, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.
[0199] The electronic device of the above embodiment is used to implement the protocol identification method of the corresponding photovoltaic device in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.
[0200] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present disclosure also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the protocol identification method of the photovoltaic device as described in any of the above embodiments.
[0201] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0202] The computer instructions stored in the storage medium of the above embodiments are used to enable the computer to execute the method described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0203] Based on the same inventive concept, corresponding to the protocol identification method of the photovoltaic device described in any of the above embodiments, the present disclosure also provides a computer program product, which includes computer program instructions. In some embodiments, the computer program instructions can be executed by one or more processors of a computer so that the computer and / or the processor execute the protocol identification method of the photovoltaic device. Corresponding to the execution subject corresponding to each step in each embodiment of the protocol identification method of the photovoltaic device, the processor that executes the corresponding step may belong to the corresponding execution subject.
[0204] The computer program product of the above embodiment is used to enable the computer and / or the processor to execute the protocol identification method of the photovoltaic device as described in any of the above embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0205] Those skilled in the art will appreciate that the embodiments of the present disclosure may be implemented as a system, method, or computer program product. Therefore, the present disclosure may be specifically implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software, generally referred to herein as a "circuit," "module," or "system." In addition, in some embodiments, the present disclosure may also be implemented in the form of a computer program product in one or more computer-readable media, which contains computer-readable program code.
[0206] Any combination of one or more computer-readable media may be used. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive examples) of computer-readable storage media may include, for example: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device.
[0207] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0208] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0209] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0210] It should be understood that each box in the flowchart and / or block diagram and the combination of boxes in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine, and these computer program instructions are executed by a computer or other programmable data processing device to produce a device that implements the functions / operations specified in the boxes in the flowchart and / or block diagram.
[0211] These computer program instructions may also be stored in a computer-readable medium that enables a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable medium produce a product that includes an instruction device that implements the functions / operations specified in the blocks in the flowchart and / or block diagram.
[0212] Computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby enabling the instructions executed on the computer or other programmable device to provide a process for implementing the functions / operations specified in the blocks in the flowchart and / or block diagram.
[0213] In addition, although the operations of the disclosed method are described in a particular order in the accompanying drawings, this does not require or imply that the operations must be performed in this particular order, or that all the operations shown must be performed to achieve the desired results. On the contrary, the steps depicted in the flow chart can be performed in a different order. Additionally or alternatively, some steps can be omitted, multiple steps can be combined into one step, and / or one step can be decomposed into multiple steps.
[0214] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. 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 boxes represented in succession 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 or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0215] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0216] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples. Based on the concept of the present disclosure, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present disclosure as described above, which are not provided in detail for the sake of simplicity.
[0217] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present disclosure difficult to understand, the known power / ground connections to the integrated circuit (IC) chips and other components may or may not be shown in the provided figures. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present disclosure difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which the embodiments of the present disclosure will be implemented (that is, these details should be fully within the scope of understanding of those skilled in the art). Where specific details (e.g., circuits) are set forth to describe exemplary embodiments of the present disclosure, it is apparent to those skilled in the art that the embodiments of the present disclosure can be implemented without these specific details or with changes in these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0218] Although the present disclosure has been described in conjunction with specific embodiments of the present disclosure, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
[0219] The embodiments of the present disclosure are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present disclosure should be included in the scope of protection of the present disclosure.
Claims
1. A protocol identification method for photovoltaic equipment, characterized in that: A protocol matching system applied to a photovoltaic device, wherein the protocol matching system of the photovoltaic device is communicatively connected with a plurality of photovoltaic devices, each of the photovoltaic devices corresponding to a unique device address, and the method comprises: Determine at least one initial device address, input the initial device address into a pre-built address prediction model to obtain a predicted device address; wherein a photovoltaic device exists at the initial device address; Obtaining a first target Modbus protocol from a pre-built Modbus protocol library, determining a first instruction message according to the first target Modbus protocol, and sending the first instruction message to the predicted device address; wherein the first target Modbus protocol matches the target photovoltaic device, the first target Modbus protocol includes a first function register address and a first preset response value corresponding to the first function register address, and the first instruction message is used to instruct the photovoltaic device at the predicted device address to return a first response value corresponding to the first function register address; In response to receiving a first response message returned by the predicted device address, confirming that a photovoltaic device exists at the predicted device address; wherein the first response message includes the first response value; determining whether the first response value corresponds to the first preset response value; In response to the first response value corresponding to the first preset response value, a second target Modbus protocol is obtained from a pre-built protocol library, a second instruction message is determined according to the second target Modbus protocol, and the second instruction message is sent to the predicted device address; wherein the second target Modbus protocol matches the target photovoltaic device, the second target Modbus protocol includes a second function register address and a second preset response value corresponding to the second function register address, and the second instruction message is used to instruct the photovoltaic device that exists at the predicted device address to return a second response value corresponding to the second function register address; the first target Modbus protocol is different from the second target Modbus protocol; In response to receiving a second response message returned by the predicted device address, determining whether a second response value included in the second response message corresponds to the second preset response value; In response to the second response value corresponding to the second preset response value, the photovoltaic device under the predicted device address is determined to be a target photovoltaic device.
2. The method for identifying a photovoltaic device according to claim 1, characterized in that: The method further comprises: In response to not receiving a first response message returned by the predicted device address within a preset time interval, it is determined that no photovoltaic device exists at the predicted device address.
3. The protocol identification method for photovoltaic equipment according to claim 2, characterized in that: The pre-built address prediction model is expressed as: X(k)=A*X(k-1)+B*U(k-1)+V(k) Among them, X(k) is the predicted device address at time k, A and B are the model prediction coefficients, X(k-1) is the predicted device address at time k-1, U(k-1) is the initial device address of the photovoltaic device at time k-1, and V(k) is the noise coefficient.
4. The protocol identification method for photovoltaic equipment according to claim 3, characterized in that: The method further comprises: Acquire register information of all target photovoltaic devices, and store the register information into a command information table; Construct the instruction storage structure table according to the storage format of the standard Modbus protocol; Determine at least two corresponding Modbus protocols for each target photovoltaic device according to the instruction information table and the instruction storage structure table; The Modbus protocol library is constructed according to the Modbus protocols of all the target photovoltaic devices.
5. The protocol identification method for photovoltaic equipment according to claim 4, characterized in that: The method further comprises: In response to the fact that no photovoltaic device exists at the predicted device address, confirming whether there is a photovoltaic device at a device address between the predicted device address and a real device address that was most recently confirmed to have a photovoltaic device; In response to the absence of a photovoltaic device at a device address between the predicted device address and a real device address that was most recently confirmed to have a photovoltaic device, correcting the model prediction coefficient and the noise coefficient according to the predicted device address and the real device address to obtain an updated address prediction model; The predicted device address is reconfirmed according to the updated address prediction model.
6. The protocol identification method for photovoltaic equipment according to claim 5, characterized in that: After determining that the photovoltaic device under the predicted device address is the target photovoltaic device, the method further includes: The protocol matching system of the photovoltaic device performs data exchange with the target photovoltaic device through the Modbus protocol of the target photovoltaic device to obtain device information of the target photovoltaic device; The device information is stored in a bidirectional linked list; wherein the bidirectional linked list includes a predecessor pointer and a successor pointer, the predecessor pointer points to the device information of the previous photovoltaic device of the target photovoltaic device, and the successor pointer points to the device information of the next photovoltaic device of the target photovoltaic device.
7. The method for identifying a protocol of a photovoltaic device according to claim 6, characterized in that: The method further comprises: obtaining a first target Modbus protocol from a pre-built Modbus protocol library, determining a first instruction message according to the first target Modbus protocol, and sending the first instruction message to the predicted device address before: Confirm whether the protocol matching system of the photovoltaic device is powered on for the first time; In response to the protocol matching system of the photovoltaic device being powered on for the first time, confirming the execution of an operation of acquiring a first target Modbus protocol from a pre-built Modbus protocol library, determining a first instruction message according to the first target Modbus protocol, and sending the first instruction message to the predicted device address.
8. The method for identifying a protocol of a photovoltaic device according to claim 7, characterized in that: The method further comprises: In response to the protocol matching system of the photovoltaic device not being powered on for the first time, querying whether a target photovoltaic device corresponding to the device information stored in the bidirectional linked list exists; In response to the target photovoltaic device not existing, confirming the execution of the operation of acquiring a first target Modbus protocol from a pre-built Modbus protocol library, determining a first instruction message according to the first target Modbus protocol, and sending the first instruction message to the predicted device address.
9. A protocol matching system for photovoltaic equipment, characterized in that: The protocol matching system of the photovoltaic device is in communication connection with a plurality of photovoltaic devices, each of which has a unique device address. The protocol matching system of the photovoltaic device is configured as follows: Determine at least one initial device address, input the initial device address into a pre-built address prediction model to obtain a predicted device address; wherein a photovoltaic device exists at the initial device address; Obtaining a first target Modbus protocol from a pre-built Modbus protocol library, determining a first instruction message according to the first target Modbus protocol, and sending the first instruction message to the predicted device address; wherein the first target Modbus protocol matches the target photovoltaic device, the first target Modbus protocol includes a first function register address and a first preset response value corresponding to the first function register address, and the first instruction message is used to instruct the photovoltaic device at the predicted device address to return a first response value corresponding to the first function register address; In response to receiving a first response message returned by the predicted device address, confirming that a photovoltaic device exists at the predicted device address; wherein the first response message includes the first response value; determining whether the first response value corresponds to the first preset response value; In response to the first response value corresponding to the first preset response value, a second target Modbus protocol is obtained from a pre-built protocol library, a second instruction message is determined according to the second target Modbus protocol, and the second instruction message is sent to the predicted device address; wherein the second target Modbus protocol matches the target photovoltaic device, the second target Modbus protocol includes a second function register address and a second preset response value corresponding to the second function register address, and the second instruction message is used to instruct the photovoltaic device that exists at the predicted device address to return a second response value corresponding to the second function register address; the first target Modbus protocol is different from the second target Modbus protocol; In response to receiving a second response message returned by the predicted device address, determining whether a second response value included in the second response message corresponds to the second preset response value; In response to the second response value corresponding to the second preset response value, the photovoltaic device under the predicted device address is determined to be a target photovoltaic device.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the protocol identification method for a photovoltaic device as claimed in any one of claims 1 to 8 when executing the program. 11 . A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the protocol identification method for a photovoltaic device according to any one of claims 1 to 8.
12. A computer program product, characterized in that The method comprises computer program instructions, and when the computer program instructions are executed on a computer, the computer is caused to execute the protocol identification method for a photovoltaic device as claimed in any one of claims 1 to 8.
Citation Information
Patent Citations
Internet of Things meter reading method, system and device based on photovoltaic inverter
CN115175023A
Protocol adaptive method between photovoltaic protocol converter and photovoltaic inverter
CN116320062A
Photovoltaic equipment monitoring method, computer equipment and storage medium
CN117595784A
Photovoltaic equipment communication protocol self-adaption method
CN117749900A