Protocol identification methods, systems, equipment, media, and program products for photovoltaic equipment
By using an address prediction model and a Modbus protocol library, efficient and accurate protocol identification of photovoltaic equipment is achieved, solving the problem of data interaction differences between photovoltaic equipment from different manufacturers in the Modbus protocol, and ensuring intelligent and efficient data interaction of the photovoltaic system.
Patent Information
- Application Number
- CN202411406770.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2044-10-10
AI Technical Summary
The differences in register address mapping and function code application in the Modbus communication protocol of photovoltaic equipment produced by different manufacturers make data interaction difficult, and the flexibility and efficiency of existing automatic identification technology need to be improved.
By employing an address prediction model and Modbus protocol library, the system predicts and confirms the initial device address and uses the target Modbus protocol for command message exchange. This ensures that the photovoltaic equipment protocol matching system can identify and verify the device type, reducing the false identification rate and improving the identification accuracy.
This improves the efficiency and accuracy of the photovoltaic equipment protocol matching process, reduces query time, and ensures intelligent and efficient data interaction of the photovoltaic system.
Smart Images

Figure CN119544570B_ABST
Abstract
Description
Technical Field
[0001] This 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 Technology
[0002] Automatic identification technology of communication protocols plays a crucial role in promoting the grid connection of distributed photovoltaic equipment. Currently, although photovoltaic equipment produced by different manufacturers generally supports the Modbus communication protocol, the Modbus communication protocol used by photovoltaic equipment produced by different manufacturers also differs due to differences in register address mapping and function code application. This poses a challenge to data interaction between photovoltaic equipment.
[0003] Currently, although automatic identification technology is based on the Modbus standardized framework and can identify some photovoltaic devices through a full address polling strategy, its flexibility and efficiency need to be improved due to limitations in the Modbus address range and fixed command communication method. Summary of the Invention
[0004] The present invention aims to at least partially solve one of the technical problems in the related art.
[0005] Therefore, the first objective of this invention is to propose a protocol identification method for photovoltaic (PV) devices, applied to a PV device protocol matching system. The PV device protocol matching system is communicatively connected to several PV devices, each PV device having a unique device address. The method includes:
[0006] Determine at least one initial device address, input the initial device address into a pre-built address prediction model, and obtain the predicted device address; wherein, the initial device address exists in a photovoltaic device;
[0007] The 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 sent to the predicted device address. The first target Modbus protocol is matched with 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. The first instruction message is used to instruct the photovoltaic device at the predicted device address to return the 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, it is confirmed that a photovoltaic device exists at the predicted device address; wherein, the first response message includes a first response value;
[0009] Determine whether the first response value corresponds to the first preset response value;
[0010] In response to the first response value matching the first preset response value, a second target Modbus protocol is retrieved from a pre-built protocol library. A second instruction message is determined based on the second target Modbus protocol and sent to the predicted device address. 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. The second instruction message instructs the photovoltaic device at the predicted device address to return the second response value corresponding to the second function register address. The first target Modbus protocol differs from the second Modbus protocol.
[0011] In response to receiving a second response message returned by the predicted device address, determine whether the second response value included in the second response message corresponds to a second preset response value;
[0012] In response to the second response value and 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 includes:
[0014] If no first response message is received from 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] Where X(k) is the predicted device address at time k, A and B are model prediction coefficients, X(k-1) is the predicted device address at time k-1, U(k-1) is the initial device address where photovoltaic devices exist at time k-1, and V(k) is the noise coefficient.
[0018] In some embodiments, the method further includes:
[0019] Obtain the 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] Based on the instruction information table and the instruction storage structure table, at least two corresponding Modbus protocols are determined for each target photovoltaic device.
[0022] A Modbus protocol library is built based on the Modbus protocol of all target photovoltaic devices.
[0023] In some embodiments, the method further includes:
[0024] In response to the prediction that no photovoltaic device exists at the device address, it is confirmed whether a photovoltaic device exists at the device address between the predicted device address and the most recently confirmed actual device address where a photovoltaic device exists.
[0025] If no photovoltaic device exists at the device address between the predicted device address and the actual device address where the photovoltaic device was last confirmed, the prediction coefficients and noise coefficients of the model are corrected based on the predicted device address and the actual device address to obtain an updated address prediction model.
[0026] The predicted device address was reconfirmed 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 photovoltaic equipment protocol matching system interacts with the target photovoltaic equipment via the Modbus protocol to obtain the equipment information of the target photovoltaic equipment;
[0029] The device information is stored in a doubly linked list. The doubly 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, before obtaining a first target Modbus protocol from a pre-built Modbus protocol library, determining a first command message based on the first target Modbus protocol, and sending the first command message to the predicted device address, the method further includes:
[0031] Confirm whether the photovoltaic equipment's protocol matching system is being powered on for the first time;
[0032] In response to the photovoltaic equipment's protocol matching system being powered on for the first time, the system confirms the execution of the operation of obtaining the first target Modbus protocol from the pre-built Modbus protocol library, determining the first instruction message based on the first target Modbus protocol, and sending the first instruction message to the predicted device address.
[0033] In some embodiments, the method further includes:
[0034] In response to the fact that the protocol matching system for photovoltaic equipment is not powered on for the first time, the system queries whether the target photovoltaic equipment corresponding to the equipment information stored in the doubly linked list exists.
[0035] In response to the absence of the target photovoltaic device, 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 is confirmed.
[0036] The second objective of this invention is to provide a protocol matching system for photovoltaic (PV) devices. This system is communicatively connected to several PV devices, each with a unique device address. The protocol matching system is configured as follows:
[0037] Determine at least one initial device address, input the initial device address into a pre-built address prediction model, and obtain the predicted device address; wherein, the initial device address exists in a photovoltaic device;
[0038] The 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 sent to the predicted device address. The first target Modbus protocol is matched with 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. The first instruction message is used to instruct the photovoltaic device at the predicted device address to return the 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, it is confirmed that a photovoltaic device exists at the predicted device address; wherein, the first response message includes a first response value;
[0040] Determine whether the first response value corresponds to the first preset response value;
[0041] In response to the first response value matching the first preset response value, a second target Modbus protocol is retrieved from a pre-built protocol library. A second instruction message is determined based on the second target Modbus protocol and sent to the predicted device address. 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. The second instruction message instructs the photovoltaic device at the predicted device address to return the second response value corresponding to the second function register address. The first target Modbus protocol differs from the second Modbus protocol.
[0042] In response to receiving a 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;
[0043] In response to the second response value and the second preset response value, the photovoltaic device under the predicted device address is determined to be the target photovoltaic device.
[0044] A third objective of this 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 the processor, when executing the program, implements the protocol identification method for photovoltaic devices as described above.
[0045] A fourth objective of this invention is to provide a non-transitory computer-readable storage medium that stores computer instructions for causing the computer to execute the protocol identification method for photovoltaic devices as described above.
[0046] The fifth objective of this invention is to provide a computer program product comprising computer program instructions that, when executed on a computer, cause the computer to perform the protocol identification method for photovoltaic devices as described above.
[0047] As can be seen from the above description, the photovoltaic device protocol identification method, system, device, medium, and program product 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 contains a photovoltaic device; further, 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 containing the predicted device address to return the 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, it is confirmed that the predicted device address contains a photovoltaic device; wherein, the first response message includes a first response value. Then, it is determined 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, 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 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, 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 addresses where photovoltaic devices may exist to improve query efficiency and save query time. It then selects a target Modbus protocol from a pre-built Modbus protocol library to poll the predicted addresses to confirm whether photovoltaic devices exist at the predicted addresses and whether the existing photovoltaic devices are the target photovoltaic devices. If photovoltaic devices exist at the predicted addresses, the target Modbus protocol is sent to the photovoltaic devices again to further verify the type of photovoltaic devices. This reduces the false identification rate, improves the accuracy of the photovoltaic device protocol matching process, and ensures the efficiency of the entire automatic protocol identification process.
[0048] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0049] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only for this invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0050] Figure 1 A schematic diagram of the protocol matching system for photovoltaic equipment provided in an embodiment of the present invention is shown.
[0051] Figure 2 A schematic flowchart of a protocol identification method for photovoltaic devices provided in an embodiment of the present invention is shown.
[0052] Figure 3 This paper illustrates another flowchart of the protocol identification method for photovoltaic devices provided in an embodiment of the present invention.
[0053] Figure 4 A schematic diagram of the predicted device address query process provided in an embodiment of the present invention is shown.
[0054] Figure 5 A schematic diagram of the Modbus protocol library provided in an embodiment of the present invention is shown.
[0055] Figure 6 A schematic diagram of the protocol confirmation process provided by an embodiment of the present invention is shown.
[0056] Figure 7 A schematic diagram of the power-on process provided in an embodiment of the present invention is shown.
[0057] Figure 8 A schematic diagram of a protocol matching system for a photovoltaic device provided by an embodiment of the present invention is shown.
[0058] Figure 9 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention is shown. Detailed Implementation
[0059] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to specific embodiments and accompanying drawings.
[0060] It should be noted that, unless otherwise defined, the technical or scientific terms used in this invention should have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms "first," "second," and similar terms used in this invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed following the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are used only 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 a core component of photovoltaic power generation systems, has seen its application scope and influence expand rapidly in recent years thanks to the rapid advancements in photovoltaic industry chain technology. Photovoltaic equipment mainly comprises two key components: photovoltaic modules and inverters, which play a crucial role in converting solar energy into electrical energy.
[0062] Inverters are used to convert the direct current (DC) power generated by photovoltaic (PV) modules into alternating current (AC) power to meet the electricity demands of the power grid and users. In addition, inverters also have intelligent control, fault detection, and protection functions to ensure the stable operation of the PV power generation system.
[0063] Automatic identification technology plays a crucial role in promoting the efficient grid connection of distributed photovoltaic (PV) equipment. Most distributed PV equipment manufacturers on the market use the Modbus communication protocol for data exchange. However, due to differences in PV equipment produced by different manufacturers, the Modbus communication protocols supported by these devices also differ in detail (especially in register address mapping and function code application). This necessitates that automatic identification technology possess high flexibility and intelligent parsing capabilities to adapt to these differences. This invention aims to overcome communication barriers caused by manufacturers using different Modbus communication protocol standards, ensuring that the data exchange module of the PV system can intelligently and efficiently identify and adapt to the specifications and models of various PV equipment.
[0064] The Modbus protocol, a widely used industrial communication protocol, plays a crucial role in photovoltaic (PV) systems for data exchange between devices. Through Modbus, master devices (such as monitoring systems, data acquisition systems, or interactive modules) can communicate with slave devices (such as PV modules, inverters, combiner boxes, and other PV equipment) to obtain important information such as the status and operating parameters of the PV equipment. Modbus employs master-slave technology, a query-response communication protocol. Each communication begins with the master sending a data request message; upon receiving the correct message, the slave can send data back to the master in response. Furthermore, the master can directly modify the slave's data, enabling bidirectional read and write operations.
[0065] As described in the background section, existing automatic identification technologies for distributed photovoltaic (PV) devices mainly rely on the standardized framework of the Modbus protocol. While this has certain limitations, since the Modbus address (i.e., the device address containing PV devices) is limited to a range of 1 to 254, a full-address polling strategy can still identify some inverters. Taking PV devices as inverters as an example, the identification process typically includes the following key steps: First, regarding Modbus address polling, the data interaction module starts from Modbus address 1 and sends query requests sequentially to every possible address. Second, regarding message construction, based on market research, a set of standard query messages is pre-defined for the common register addresses supported by most inverters, such as register addresses for key parameters like voltage, current, and power. These messages are designed to trigger the inverter to return specific types of information, forming the basis for identifying the Modbus protocol characteristics of the inverter. Finally, regarding response analysis and protocol judgment, once the inverter receives the query message and responds, the data interaction module analyzes the content of the data packet returned by the inverter, including the response code, data format, and possibly embedded specific vendor identifiers. By comparing with a pre-defined Modbus protocol library, the data interaction module can identify the inverter's manufacturer, model, and the version of the communication protocol it uses. Currently, protocol identification technology typically employs a fixed command to communicate with the inverter, determining the unique information of different manufacturers.
[0066] Furthermore, existing automatic protocol identification technologies for distributed power sources do not require the system to make any judgments when the inverter in a distributed photovoltaic system changes or is powered on again; instead, a new round of dynamic protocol identification is simply initiated. This typically involves polling the entire Modbus address space (1-254) to rediscover online inverter devices. While the current automatic inverter protocol identification technology has relatively simple logic, it often does not need to be re-identified upon power-on, otherwise it would cause excessively long waiting times during the power-on process, severely impacting the customer's user experience.
[0067] In the process of developing this invention, the applicant discovered that, regarding address polling in automatic identification technology, existing inverter protocol automatic identification technologies simply poll from addresses 1-254, retrieving pre-stored instructions for each inverter protocol for each address, without performing conditional checks or prematurely ending the query process. Regarding standardized query messages, current protocol automatic identification technologies all use a fixed set of standard messages for querying. When encountering two inverter protocols from the same manufacturer, or when certain registers in the protocols of two different manufacturers are identical, misjudgments can occur. Regarding response analysis and protocol judgment, existing automatic identification technologies can only judge errors, correctness, and timeouts in inverter feedback messages, and cannot further analyze correct feedback messages. When encountering an inverter not found in the protocol table, it is directly missed, failing to report to the master station in a timely manner. For the power-on process of distributed photovoltaic systems, existing technologies require re-identifying the distributed power protocol or, after confirming the previously identified inverter protocol, still needing to re-polle the other addresses of 1-254 Modbus, resulting in significant time waste. Regarding the identification of multiple inverters, the current protocol's automatic identification technology only performs a simple 1-254 polling process. In practice, it has been found that it can only identify the inverter with the largest address, and other inverters, even if they have been identified, will be updated by the later ones.
[0068] To address the aforementioned issues, this invention proposes a protocol identification method, system, device, medium, and program product for photovoltaic equipment. It aims to construct a highly automated, efficient, widely compatible, and extremely low-error-rate automatic protocol identification technology by 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 full-power status judgment technology.
[0069] The technical solution of the present invention will be further described in detail below through specific embodiments.
[0070] refer to Figure 1 A schematic diagram of the protocol matching system for photovoltaic equipment provided in this embodiment of the invention.
[0071] In this embodiment of the invention, the photovoltaic device protocol matching system is communicatively connected to several photovoltaic devices. Each photovoltaic device has a unique device address. The photovoltaic device protocol matching system includes a data interaction module, which is responsible for exchanging information with the photovoltaic devices.
[0072] In photovoltaic equipment, data is stored in the internal registers of the photovoltaic equipment. Each register that stores data corresponds to a register address. The data interaction module organizes command messages based on these addresses to read and write the data in the registers.
[0073] refer to Figure 2 This is a schematic flowchart of a protocol identification method for photovoltaic devices provided in an embodiment of the present invention.
[0074] This invention employs standardized query command design, inverter address prediction technology, protocol confirmation technology, power-on processing, fault handling, and protocol information storage technologies to construct a communication protocol query and processing technology that can be widely used in Modbus-based devices. Taking photovoltaic equipment as an example of an inverter:
[0075] Step S201: When the photovoltaic equipment's protocol matching system is powered on, check whether it is the first power-on of the system. If it is not the first power-on, execute the system's re-power-on technology. If it is the first power-on, execute the inverter address query technology.
[0076] In step S203, the system uses inverter address lookup technology to confirm whether an inverter exists at a certain initial device address. If an inverter exists, the system continues to execute the next step of inverter protocol confirmation technology.
[0077] In step S205, the protocol confirmation technology further queries and analyzes the initial device address of the inverter obtained in the previous step to confirm the inverter information.
[0078] Step S207: After confirming the inverter information, determine whether the query process is complete based on the sum of the total power of the currently queried inverters or whether the address is 254.
[0079] If the termination condition is not met in step S209, continue to repeat steps S203, S205, and S207 to continue analyzing and determining the device addresses that may contain inverters. If the termination condition is met, save the query information and end the query process.
[0080] Next, the standardized design of query instructions, inverter address prediction technology, protocol confirmation technology, power-on processing, fault handling and protocol information storage technologies involved in the above steps will be further explained with reference to the flowchart of the protocol identification method for photovoltaic equipment provided in the embodiments of the present invention.
[0081] Specifically, query instruction standardization consists of three parts: standardization of instruction information, standardization of instruction storage structure, and automatic package assembly processing.
[0082] As an optional embodiment, the photovoltaic device protocol identification method provided by the applicant needs to obtain the register information of all target photovoltaic devices, 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 instruction information standardization process unifies the Modbus protocol information of mainstream distributed photovoltaic (PV) devices currently on the market. Each queryable piece of information is integrated into the instruction information table and collected uniformly according to Table 1. Specifically, non-existent register information is uniformly modified to 0xFFFF (for example, if PV device A (SUN2000) has no output type, then 0xFFFF is stored in the corresponding location in the Modbus protocol of PV device A).
[0084]
[0085]
[0086] Table 1
[0087] Among them, the device serial number is a unique identifier for the device, 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 equipment can provide to support voltage stability in the power grid. Output type: Describes the type or characteristics of the power output by the equipment, such as AC, DC, etc.
[0090] A / B / C phase voltages: These represent the voltage values of phases A, B, and C in a three-phase electrical system, respectively.
[0091] A / B / C phase currents: These represent the current values of phases A, B, and C in a three-phase electrical system, respectively.
[0092] Active power of phases A / B / C: These represent the active power output of phases A, B, and C in a three-phase electrical system, respectively. Total active power: The total active power output of the three-phase electrical system.
[0093] Rated charging power of energy storage: The maximum charging power designed or specified for an energy storage system (such as a battery pack).
[0094] Rated discharge power of energy storage: The maximum discharge power designed or specified for an energy storage system (such as a battery pack).
[0095] Rated energy storage capacity: The total storage capacity of an energy storage system (such as a battery pack).
[0096] Remaining energy storage capacity: The current remaining storage capacity of the energy storage system.
[0097] Inverter On / Off 1 / 2: Controls the on / off state of the inverter (power conversion equipment), which may indicate different inverters or different operating modes of the same inverter.
[0098] Active power setpoint: The target value for active power output set by the user or the system automatically.
[0099] Rated active power percentage: The percentage of current active power output relative to the rated active power.
[0100] Reactive power setpoint: The target value for reactive power output set automatically by the user or the system.
[0101] Reactive power percentage: The percentage of current reactive power output relative to rated reactive power.
[0102] Power factor setting: A target power factor value set by the user or the system to optimize power transmission efficiency.
[0103] Energy storage charging and discharging: controlling the charging and discharging state of the energy storage system.
[0104] Forced charging power for energy storage: Under specific conditions, the energy storage system is forced to charge at a specific power.
[0105] Energy storage charging cutoff capacity: When the energy storage system reaches this capacity during the charging process, it stops charging.
[0106] Forced discharge power of energy storage: Under specific conditions, the energy storage system is forced to discharge at a specific power.
[0107] Energy storage discharge cutoff capacity: When the energy storage system reaches this capacity during the discharge process, it stops discharging.
[0108] Time (year, month, day - hour, minute, second): Records or displays the current time information.
[0109] Daily power generation and grid connection power: These record the total electricity generated by the system and the electricity sold to the grid (i.e., sold to the grid) within a day.
[0110] Inverter Status: Displays the current operating status of the inverter, such as running, standby, fault, etc.
[0111] The standardization of instruction storage structure is shown in Table 2. According to the standard Modbus protocol, the standardization technology stores instruction information according to: function code, register address, number of registers, endianness, whether it is an array, read / write mode, and gain.
[0112] Serial Number Function Remark 1 Function code 0x03, 0x04, 0x06, 0x10, etc. 2 Register address Tables are formatted in hexadecimal. 3 Number of registers According to actual needs 4 Data types See Table 3 for details 5 Endianness Big-endian: 1; Little-endian: 2 6 Is the data an array? 0: Not an array, 1: Is an array 7 Register read / write mode 0: Read-only; 1: Read-write; 2: Write-only 8 Gain The original data multiplied by the gain equals the true value.
[0113] Table 2
[0114] The function code indicates the purpose of a Modbus information frame, such as reading coil status (01), reading input status (02), reading holding register (03), and reading input register (04). The function code is a crucial part of the instruction information, directly determining the type of operation the photovoltaic device needs to perform. The register address specifies the exact location of the instruction operation, i.e., which register to start the operation from. In the Modbus RTU protocol, the register address is usually represented in two-byte (16-bit) form. The register count indicates the number of registers the instruction needs to operate on. This information is very important when reading or writing multiple registers. Similarly, the register count is also represented in two-byte (16-bit) form. Endianness (Big-Endian or Little-Endian) primarily affects the storage order of multi-byte data. Although the Modbus protocol itself does not directly specify endianness, in practical applications, both communicating parties need to agree on this to ensure correct data parsing. In the Modbus RTU protocol, data is usually transmitted according to 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 as an array. The register address and the number of registers in the instruction together define the range of this "array". The read / 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 state of a single coil and multiple coils (which can be considered as write operations). Gain is usually not a directly defined instruction storage structure element of the Modbus protocol. It is more related to data processing and conversion, and may be applied at the device or software level before / after data is read or written to registers.
[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 mapping table. In the given mapping between data types and their encodings, each data type is assigned a specific hexadecimal code. This encoding method may be used in a specific protocol, file format, or internal system to distinguish and identify different data types.
[0118] In practical implementation, regarding the automatic packet assembly technology, according to Tables 1 and 2, during the packet assembly process, it is only necessary to query the corresponding register information and then copy the corresponding information into the Modbus protocol to form a standard target Modbus protocol, which is convenient and fast. In the processed response message, it is only necessary to determine whether the data is genuine and valid based on information such as endianness, array, and gain. Therefore, the standardized design of the query command further optimizes the query process and greatly improves the system's scalability. The standardized design of the query command, through unified coding design, further standardizes the protocols of various inverter manufacturers, ensuring uniformity in the protocol confirmation process and improving the system's scalability.
[0119] refer to Figure 3 This is another flowchart illustrating the protocol identification method for photovoltaic devices provided in this embodiment of the invention.
[0120] Step S301: Determine at least one initial device address, input the initial device address into a pre-built address prediction model, and obtain the predicted device address; wherein, the initial device address exists in a photovoltaic device.
[0121] According to the standard Modbus protocol, inverter addresses (i.e., device addresses) can only be data between 1 and 254. If all addresses are polled, it will take a long time. Furthermore, if there is no inverter at the current address, it is necessary to wait for a timeout before querying the next inverter address. Taking a timeout of 3 seconds for an inverter address as an example, if each address needs to be checked for timeout, it will take at least 10 minutes. Therefore, optimizing the query method is crucial for the protocol recognition of photovoltaic devices.
[0122] As an optional embodiment, this invention, based on the Kalman filtering principle, further simplifies the coefficient and noise formulas on the basis of first-order Kalman filtering to construct an address prediction model for address prediction:
[0123] X(k)=A*X(k-1)+B*U(k-1)+V(k)
[0124] Where X(k) is the predicted device address at time k, A and B are model prediction coefficients, which are 1 by default, X(k-1) is the predicted device address at time k-1, with an initial value of 1, U(k-1) is the initial device address of the photovoltaic device at time k-1, with an initial value of 0 by default, and V(k) is the noise figure, which is the covariance at time k-1 and then rounded, with an initial value of 0.
[0125] refer to Figure 4 This is a schematic diagram of the predicted device address query process provided in an embodiment of the present invention.
[0126] In this embodiment, the predicted device address can be understood as the device address of a potential inverter predicted by the address prediction model of this invention, and the actual device address can be understood as the device address of an actual inverter. The address prediction model is mainly used to predict and calculate the next possible inverter device address. If the predicted device address does not contain an inverter, the model iterates sequentially from the predicted value to the most recently found actual inverter device address. If no inverter exists there either, the model continues to predict and calculate the next possible inverter device address until the next inverter is found. At this point, based on the predicted device address and the actual device address, the model predicts coefficients A and B, where A = (U(k) - X(k)) / X(k) and B = U(k) / U(k-1). The address prediction model of this invention uses continuous recursion and has the ability to continuously self-correct. Under the condition of limited system computing power, it can efficiently predict the next possible inverter device address. Furthermore, regarding the termination of inverter address determination, based on the characteristics of distributed photovoltaic equipment, the total power of the connected equipment in a distributed photovoltaic system does not exceed a certain power value (default is 20KW). When the total rated power of the inverters that have been queried exceeds 20KW, or when the device address query reaches 254, the photovoltaic equipment protocol matching system automatically determines that the address query has ended.
[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 there is no photovoltaic device at the predicted device address.
[0128] Specifically, the method for determining whether an inverter exists at a predicted device address is as follows: the photovoltaic equipment's protocol matching system sends a message command to the predicted address via a data interaction module. If the data interaction module receives a response message from the predicted device address within a preset time interval, it proves that an inverter exists at that predicted device address. If the data interaction module does not receive a response message from the predicted device address within the preset time interval, it proves that an inverter does not exist at that predicted device address.
[0129] As an optional embodiment, in response to the prediction that no photovoltaic device exists at the device address, it is confirmed whether a photovoltaic device exists at the device address between the predicted device address and the most recently confirmed actual device address; in response to the prediction that no photovoltaic device exists at the device address between the predicted device address and the most recently confirmed actual device address, the model prediction coefficients and noise coefficients are corrected based on the predicted device address and the actual device address to obtain an updated address prediction model; the predicted device address is reconfirmed based on the updated address prediction model.
[0130] Specifically, in the initial stage, the photovoltaic equipment protocol matching system uses a polling method to poll all device addresses to find the first initial device address where an inverter exists. After finding it, the coefficients A and B in the address prediction model are both set to 1, and the address prediction model is used to pre-judge the next device address where an inverter exists. Further, it queries whether the predicted device address is an existing inverter. If it is, it continues to predict the next device address; otherwise, it queries all device addresses between the predicted device address and the most recently confirmed actual device address where a photovoltaic device exists. Based on the query results, it modifies the model prediction coefficients A and B, recalculates the noise figure V(k), and determines whether the query is complete. Therefore, this invention, through a pre-constructed address prediction model, can further improve query efficiency and save device address query time. The inverter address query technology, by combining the address prediction model and the polling method, greatly improves the query speed. Furthermore, by accumulating power or device address codes, the query completion time of the entire process can be accurately predicted.
[0131] Step S303: Obtain a first target Modbus protocol from a pre-built Modbus protocol library, determine a 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 at the predicted device address to return the first response value corresponding to the first function register address.
[0132] In practice, after obtaining the predicted device address based on the pre-built address prediction model, it is necessary to confirm whether an inverter exists at that address, and after confirming the existence of an inverter, to confirm the relevant information of that inverter.
[0133] refer to Figure 5 This 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 various inverters, and each inverter includes various registers. Therefore, all Modbus protocols corresponding to various inverters can be obtained based on the functions of the registers included in all inverters. For example, according to Table 1, the function of the first target register of a certain inverter can be determined as the storage device serial number. Then, the first target Modbus protocol can be determined based on the function code, register address (obtained by encoding the first target register function as the storage device serial number), number of registers, endianness, whether it is an array, read / write mode, and gain. If the function of the second target register of the inverter is to store the active power setting value, the first target Modbus protocol can be determined based on the function code, register address (obtained by encoding the second target register function as the storage power setting value), number of registers, endianness, whether it is an array, read / write mode, and gain.
[0135] Furthermore, once a suitable Modbus protocol (i.e., the first target Modbus protocol) is selected, a command message (i.e., the first command message) needs to be constructed according to this protocol. In the application scenario of this application embodiment, the command message will contain a function code (for example, function code 03 is typically used to read holding registers) and a specific register address on the target device (i.e., the first function register address). This address is determined according to the internal register layout of the photovoltaic device and is used to access the data inside that register. The first command message may also contain other parameters, such as the starting address, the number of registers to be read, etc.
[0136] Furthermore, the constructed first command 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 (PV) device receives a command message, it processes the request in the message and returns a corresponding response message. The response message contains the requested data, specifically the first response value corresponding to the address of the first function register. This value is the data that needs to be obtained from the PV device via Modbus communication. According to the Modbus protocol, the response message returned by the device will also include information such as the function code, starting address, and number of bytes, used to verify the completeness and correctness of the response.
[0138] Step S307: Determine 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, 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 is matched with 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 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.
[0140] Step S3011: 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.
[0141] Step S3013: In response to the second response value and the second preset response value, determine the photovoltaic device under the predicted device address as the target photovoltaic device.
[0142] For steps S307 to S3013, in specific implementation, if the predicted device address can provide a response value, it can be preliminarily determined that an inverter exists at the predicted device address. Further execution of protocol confirmation technology is required. Protocol confirmation technology refers to the technology that, after confirming that an inverter exists at the current predicted device address, further determines the manufacturer, protocol model, and other information of the existing inverter. It mainly includes standard query message packet assembly, protocol judgment, and protocol confirmation functions.
[0143] As mentioned above, query instruction standardization comprises three parts: standardization of instruction information, standardization of instruction storage structure, and automatic packet assembly. Standard query message assembly can be understood as selecting representative registers (or data points) from various manufacturers' protocols. These registers should be able to reflect the inverter's identity or characteristics to a certain extent. Based on the selected registers, a standard query message is constructed. To improve accuracy, two registers with different address and information classes are typically used to compose two query message frames (i.e., the first instruction message and the second instruction message).
[0144] Furthermore, regarding the protocol judgment process, when the data interaction module receives a reply message from the inverter, it first performs a Modbus standard check (such as CRC check) on the received reply message to ensure that the message has not been tampered with during transmission. It then checks whether the message format conforms to the Modbus protocol specifications, including address, function code, and data length. Finally, based on the manufacturer's protocol selected when sending the message, it determines whether the received data is within a reasonable range.
[0145] refer to Figure 6 This is a schematic diagram of the protocol confirmation process provided in an embodiment of the present invention.
[0146] First, based on the obtained inverter device address, the first target Modbus protocol from the first inverter manufacturer in the Modbus protocol library is searched, and the message is packetized to obtain the first command message. Next, the packetized first command message is sent to the inverter, and a first response message is received. Then, it is determined 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 result is negative, the next inverter manufacturer's protocol is used, and the above steps are repeated. If the result is positive, the second target Modbus protocol is used to packetize the second command message and send it to the inverter, and a second response message is received. Again, the second response message is determined whether it 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 result is negative, the next inverter manufacturer's protocol is used, and the above steps are repeated. If the result is positive, the inverter protocol is confirmed, and the identified inverter protocol information is stored. Therefore, the inverter protocol confirmation technology provided by this invention can improve the system's identification accuracy and reduce the false identification rate. The accuracy of inverter protocol identification is further enhanced by using a two-level standard command query (i.e., a combination of the first and second command messages) and reasonable values in the feedback response messages, ensuring the reliability of the automatic identification technology.
[0147] As an optional embodiment, before 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, the method further includes: confirming whether the protocol matching system of the photovoltaic device is powered on for the first time; in response to the photovoltaic device's protocol matching system 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 the first instruction message according to 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 photovoltaic device's protocol matching system not being powered on for the first time, the system queries whether the target photovoltaic device corresponding to the device information stored in the doubly linked list exists; in response to the target photovoltaic device not existing, the system confirms the execution of 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 7This is a schematic diagram of the power-on process provided in an embodiment of the present invention.
[0150] The system determines whether the photovoltaic (PV) equipment's protocol matching system has been re-powered. If so, it executes the re-power-on process, reading the controller's stored information and updating it in the inverter's doubly linked list. Then, it sequentially reads the inverter information from the doubly linked list and performs protocol confirmation. Finally, based on the protocol confirmation, it determines whether inverter identification needs to be re-performed. If, during the process of determining whether the PV equipment's protocol matching system has been re-powered, it is determined that the system is experiencing its first power-on, or if the stored inverter information is no longer present during the process of reading the doubly linked list, the inverter address lookup technology and inverter protocol identification technology are re-executed to search for and identify the inverter, and the inverter information confirmed during this power-on is re-stored. Furthermore, after finding the inverter information, it needs to be stored. This technology uses a doubly linked list for storage, with the head node defaulting to empty. A new node is generated based on the found inverter information and inserted into the end of the linked list, and the process is repeated sequentially. Therefore, the power-on judgment process of this invention can greatly shorten the protocol recognition time of the system's second power-on, ensuring the high efficiency of the entire automatic identification technology and improving the system's operating efficiency.
[0151] As shown in Table 4, the inverter information structure mainly includes a pointer to the previous node, manufacturer number, protocol version number, 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 Pointing to the previous manufacturer information 2 Manufacturer number See Table 5 for details. 3 Protocol version number 4 Device serial number 5 pointer Pointing to the next manufacturer information
[0153] Table 4
[0154] Finally, to ensure unified protocol processing, this invention can also organize the manufacturer codes, as shown in Table 5, sorted in order of market share. Unifying the manufacturer codes further enhances consistency in inverter protocol identification and conversion processes.
[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] Therefore, this invention supports the simultaneous identification of multiple inverters, with inverter information managed uniformly using a doubly linked list. In particular, using a doubly linked list for inverter information storage reduces system runtime. The unique doubly linked list protocol information storage technology ensures that the automatic identification technology can identify multiple inverters while significantly saving storage space.
[0158] It should be noted that during the protocol identification process, if an inverter is predicted to exist at the device address, but the manufacturer code for that inverter is not found in Manufacturer Code Table 5, and there is no corresponding standard identification message in the program, this invention can store this situation and print the information out at the host computer's debugging port after the protocol identification is completed, indicating that an unidentified inverter exists. This invention can further enhance the robustness of the automatic protocol identification technology for fault information processing.
[0159] As can be seen from the above description, the photovoltaic device protocol identification method 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 contains a photovoltaic device; further, 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 containing the predicted device address to return the 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, it is confirmed that the predicted device address contains a photovoltaic device; wherein, the first response message includes a first response value; then, the first... The system first checks whether the response value corresponds to a first preset response value. Next, in response to the first response value corresponding to the first preset response value, it retrieves a second target Modbus protocol from a pre-built protocol library, determines a second instruction message based on the second target Modbus protocol, and sends the second instruction message to the predicted device address. The second target Modbus protocol matches the target photovoltaic device, includes a second function register address and a second preset response value corresponding to the second function register address, and the second instruction message instructs the photovoltaic device 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 determines 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, it determines that the photovoltaic device at the predicted device address is the target photovoltaic device. Based on this, the present invention first predicts the addresses where photovoltaic devices may exist to improve query efficiency and save query time. It then selects a target Modbus protocol from a pre-built Modbus protocol library to poll the predicted addresses to confirm whether photovoltaic devices exist at the predicted addresses and whether the existing photovoltaic devices are the target photovoltaic devices. If photovoltaic devices exist at the predicted addresses, the target Modbus protocol is sent to the photovoltaic devices again to further verify the type of photovoltaic devices. This reduces the false identification rate, improves the accuracy of the photovoltaic device protocol matching process, and ensures the efficiency of the entire automatic protocol identification process.
[0160] It should be noted that the method of this embodiment can be executed by a single device, such as a computer or server. The method of this embodiment can also be applied to a distributed scenario, where multiple devices cooperate to complete the task. In such a distributed scenario, one of these devices may execute only one or more steps of the method of this embodiment, and the multiple devices will interact with each other to complete the method described.
[0161] It should be noted that the above description describes some embodiments of the present invention. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims may be performed in a different order than that shown in the above embodiments and still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order 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 methods provided in any of the above embodiments, the present invention also provides a protocol matching system for photovoltaic equipment.
[0163] refer to Figure 8 This is a schematic diagram of a protocol matching system for a photovoltaic device provided in an embodiment of the present invention.
[0164] The photovoltaic equipment protocol matching system 800 is communicatively connected to several photovoltaic devices 900. Each photovoltaic device has a unique device address. The photovoltaic equipment 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, and obtain the predicted device address; wherein, the initial device address exists in a photovoltaic device;
[0166] The 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 sent to the predicted device address. The first target Modbus protocol is matched with 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. The first instruction message is used to instruct the photovoltaic device at the predicted device address to return the 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, it is confirmed that a photovoltaic device exists at the predicted device address; wherein, the first response message includes a first response value;
[0168] Determine whether the first response value corresponds to the first preset response value;
[0169] In response to the first response value matching the first preset response value, a second target Modbus protocol is retrieved from a pre-built protocol library. A second instruction message is determined based on the second target Modbus protocol and sent to the predicted device address. 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. The second instruction message instructs the photovoltaic device at the predicted device address to return the second response value corresponding to the second function register address. The first target Modbus protocol differs from the second Modbus protocol.
[0170] In response to receiving a 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;
[0171] In response to the second response value and the second preset response value, the photovoltaic device under the predicted device address is determined to be the target photovoltaic device.
[0172] Optionally, the protocol matching system 800 of the photovoltaic equipment is further configured to:
[0173] If no first response message is received from the predicted device address within a preset time interval, it is determined that no photovoltaic device exists at the predicted device address.
[0174] Optionally, the pre-built address prediction model is represented as:
[0175] X(k)=A*X(k-1)+B*U(k-1)+V(k)
[0176] Where X(k) is the predicted device address at time k, A and B are model prediction coefficients, X(k-1) is the predicted device address at time k-1, U(k-1) is the initial device address where photovoltaic devices exist at time k-1, and V(k) is the noise coefficient.
[0177] Optionally, the protocol matching system 800 of the photovoltaic equipment is further configured to:
[0178] Obtain the 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] Based on the instruction information table and the instruction storage structure table, at least two corresponding Modbus protocols are determined for each target photovoltaic device.
[0181] A Modbus protocol library is built based on the Modbus protocol of all target photovoltaic devices.
[0182] Optionally, the protocol matching system 800 of the photovoltaic equipment is further configured to:
[0183] In response to the prediction that no photovoltaic device exists at the device address, it is confirmed whether a photovoltaic device exists at the device address between the predicted device address and the most recently confirmed actual device address where a photovoltaic device exists.
[0184] If no photovoltaic device exists at the device address between the predicted device address and the actual device address where the photovoltaic device was last confirmed, the prediction coefficients and noise coefficients of the model are corrected based on the predicted device address and the actual device address to obtain an updated address prediction model.
[0185] The predicted device address was reconfirmed based on the updated address prediction model.
[0186] Optionally, the protocol matching system 800 of the photovoltaic equipment is further configured to:
[0187] The photovoltaic equipment protocol matching system interacts with the target photovoltaic equipment via the Modbus protocol to obtain the equipment information of the target photovoltaic equipment;
[0188] The device information is stored in a doubly linked list. The doubly 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 ease of description, the above system is described by dividing it into various modules based on their functions. Of course, in implementing this invention, the functions of each module can be implemented in one or more software and / or hardware components.
[0190] The system described in the above embodiments is used to implement the corresponding method in any of the foregoing embodiments and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0191] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this 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 the processor executes the program to implement the protocol identification method for photovoltaic devices described in any of the above embodiments.
[0192] Figure 9This embodiment illustrates a more specific hardware structure of an electronic device, which may include a processor 910, a memory 920, an input / output interface 930, a communication interface 940, and a bus 950. The processor 910, memory 920, input / output interface 930, and communication interface 940 are interconnected internally via the bus 950.
[0193] The processor 910 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, 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 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 920 can store the 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 code is stored in the memory 920 and is called and executed by the processor 910.
[0195] The input / output interface 930 is used to connect input / output modules to enable information input and output. Input / output modules can be configured as components within the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touchscreens, microphones, various sensors, etc., while output devices may include displays, speakers, vibrators, indicator lights, etc.
[0196] The communication interface 940 is used to connect the communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0197] Bus 950 includes a pathway for transmitting information between various components of the device, such as processor 910, memory 920, input / output interface 930, and communication interface 940.
[0198] It should be noted that although the above-described device only shows the processor 910, memory 920, input / output interface 930, communication interface 940, and bus 950, in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the embodiments of this specification, and not necessarily all the components shown in the figures.
[0199] The electronic devices described above are used to implement the protocol identification method for the corresponding photovoltaic devices in any of the foregoing embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0200] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this disclosure also provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the protocol identification method for photovoltaic devices 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, program modules, 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 technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0202] The computer instructions stored in the storage medium of the above embodiments are used to cause the computer to perform the methods 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 photovoltaic device protocol identification method described in any of the above embodiments, this 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 to cause the computer and / or the processor to execute the photovoltaic device protocol identification method. Corresponding to the execution entity for each step in each embodiment of the photovoltaic device protocol identification method, the processor executing the corresponding step can belong to the corresponding execution entity.
[0204] The computer program product of the above embodiments is used to cause the computer and / or the processor to execute the protocol identification method of photovoltaic equipment 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 recognize that embodiments of this disclosure can be implemented as a system, method, or computer program product. Therefore, this disclosure can be implemented as entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software, generally referred to herein as a "circuit," "module," or "system." Furthermore, in some embodiments, this disclosure can also be implemented as a computer program product contained in one or more computer-readable media, which includes computer-readable program code.
[0206] Any combination of one or more computer-readable media may be used. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example,, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (not exhaustive) of a computer-readable storage medium may include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device.
[0207] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0208] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0209] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network (including a local area network (LAN) or a wide area network (WAN)), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0210] It should be understood that each block of a flowchart and / or block diagram, as well as combinations of blocks in a 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 that, when executed by a computer or other programmable data processing device, creates means for implementing the functions / operations specified in the blocks of 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 apparatus to function in a particular manner, such that the instructions stored in the computer-readable medium produce a product comprising an instruction apparatus that implements the functions / operations specified in the boxes of a flowchart and / or block diagram.
[0212] Computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, such that the instructions that execute on the computer or other programmable apparatus can provide a process for implementing the functions / operations specified in the boxes of a flowchart and / or block diagram.
[0213] Furthermore, although the operations of the methods of this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all of the operations shown must be performed to achieve the desired result. Rather, the steps depicted in the flowcharts may be executed in a different order. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0214] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0215] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and 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 exemplary and is not intended to imply that the scope of this disclosure (including the claims) is limited to these examples; within the framework of this disclosure, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the embodiments of this disclosure as described above, which are not provided in detail for the sake of brevity.
[0217] Additionally, to simplify the description and discussion, and to avoid obscuring the embodiments of this disclosure, the provided drawings may or may not show well-known power / ground connections to integrated circuit (IC) chips and other components. Furthermore, the apparatus may be shown in block diagram form to avoid obscuring the embodiments of this disclosure, and this also takes into account the fact that the details of implementation of these block diagram apparatuses are highly dependent on the platform on which the embodiments of this disclosure will be implemented (i.e., these details should be fully understood by those skilled in the art). While specific details (e.g., circuitry) have been set forth to describe exemplary embodiments of this disclosure, it will be apparent to those skilled in the art that the embodiments of this disclosure may be implemented without these specific details or with variations thereof. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0218] Although this disclosure has been described in conjunction with specific embodiments thereof, many substitutions, 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 be used with the embodiments discussed.
[0219] This disclosure is 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 this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A protocol identification method for photovoltaic equipment, characterized in that, A protocol matching system for photovoltaic (PV) equipment, wherein the PV equipment protocol matching system is communicatively connected to a plurality of PV devices, each of which has a unique device address, the method comprising: At least one initial device address is determined, and the initial device address is input into a pre-built address prediction model to obtain a predicted device address; wherein the initial device address contains a photovoltaic device; A first target Modbus protocol is obtained from a pre-built Modbus protocol library. A first instruction message is determined based on the first target Modbus protocol, and the first instruction message is sent to the predicted device address. The first target Modbus protocol is matched with 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. The first instruction message is used to instruct the photovoltaic device at the predicted device address to return the first response value corresponding to the first function register address. In response to receiving a first response message from the predicted device address, it is confirmed that a photovoltaic device exists at the predicted device address; wherein, the first response message includes the first response value; Determine 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. 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. The second instruction message is used to instruct the photovoltaic device 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. In response to receiving a 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; 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.
2. The protocol identification method for photovoltaic equipment according to claim 1, characterized in that, The method further includes: If no first response message is received from 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 represented as follows: X(k)=A*X(k-1)+B*U(k-1)+V(k) Where X(k) is the predicted device address at time k, A and B are model prediction coefficients, X(k-1) is the predicted device address at time k-1, U(k-1) is the initial device address where photovoltaic devices exist 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 includes: Obtain the register information of all target photovoltaic devices and store the register information in the instruction information table; Construct the instruction storage structure table according to the storage format of the standard Modbus protocol; Based on the instruction information table and the instruction storage structure table, at least two corresponding Modbus protocols are determined for each target photovoltaic device. The Modbus protocol library is constructed based on the Modbus protocol of all the target photovoltaic devices.
5. The protocol identification method for photovoltaic equipment according to claim 4, characterized in that, The method further includes: In response to the fact that no photovoltaic device exists at the predicted device address, it is confirmed whether a photovoltaic device exists at the device address between the predicted device address and the most recently confirmed actual device address where a photovoltaic device exists. In response to the absence of photovoltaic equipment at the device address between the predicted device address and the actual device address where the photovoltaic equipment was last confirmed to exist, the model prediction coefficients and the noise coefficients are corrected based on the predicted device address and the actual device address to obtain an updated address prediction model. The predicted device address is reconfirmed based on 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 at the predicted device address is the target photovoltaic device, the method further includes: The photovoltaic equipment protocol matching system interacts with the target photovoltaic equipment through the Modbus protocol of the target photovoltaic equipment to obtain the equipment information of the target photovoltaic equipment. The device information is stored in a doubly linked list; wherein the doubly 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 protocol identification method for photovoltaic equipment according to claim 6, characterized in that, Before obtaining a first target Modbus protocol from a pre-built Modbus protocol library, determining a first command message based on the first target Modbus protocol, and sending the first command message to the predicted device address, the method further includes: Confirm whether the protocol matching system of the photovoltaic equipment is being powered on for the first time; In response to the photovoltaic device's protocol matching system being powered on for the first time, the system confirms the execution of the operation of 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 sending the first instruction message to the predicted device address.
8. The protocol identification method for photovoltaic equipment according to claim 7, characterized in that, The method further includes: In response to the fact that the protocol matching system of the photovoltaic equipment is not powered on for the first time, the system queries whether the target photovoltaic equipment corresponding to the equipment information stored in the doubly linked list exists. In response to the absence of the target photovoltaic device, 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 is confirmed.
9. A protocol matching system for photovoltaic equipment, characterized in that, The protocol matching system of the photovoltaic equipment is communicatively connected to several photovoltaic devices, each of which has a unique device address. The protocol matching system of the photovoltaic equipment is configured as follows: At least one initial device address is determined, and the initial device address is input into a pre-built address prediction model to obtain a predicted device address; wherein the initial device address contains a photovoltaic device; A first target Modbus protocol is obtained from a pre-built Modbus protocol library. A first instruction message is determined based on the first target Modbus protocol, and the first instruction message is sent to the predicted device address. The first target Modbus protocol is matched with 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. The first instruction message is used to instruct the photovoltaic device at the predicted device address to return the first response value corresponding to the first function register address. In response to receiving a first response message from the predicted device address, it is confirmed that a photovoltaic device exists at the predicted device address; wherein, the first response message includes the first response value; Determine 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. 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. The second instruction message is used to instruct the photovoltaic device 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. In response to receiving a 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; 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.
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 executes the program to implement the protocol identification method for a photovoltaic device as described in any one of claims 1 to 8.
11. A non-transitory computer-readable storage medium storing computer instructions for causing 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, It includes computer program instructions that, when executed on a computer, cause the computer to perform the protocol identification method for photovoltaic devices as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Protocol adaptive method between photovoltaic protocol converter and photovoltaic inverter
CN116320062A
Photovoltaic equipment communication protocol self-adaption method
CN117749900A