Multi-source access system based on protocol self-learning and communication interface self-adaption
By designing circuits that automatically identify and adapt to RS-232, TTL levels and RS-485 communication interfaces, the problem of different interface standards in different inverter systems is solved, automatic file building and regulation conversion is realized, system automation level is improved and cost is reduced.
Patent Information
- Application Number
- CN202411965734.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2044-12-30
AI Technical Summary
In existing photovoltaic inverter systems, different manufacturers or models of inverters adopt different communication interface standards, resulting in the need to prepare multiple adapters or controllers, which increases system complexity and cost.
Design a circuit that can automatically identify three communication interfaces: RS-232, TTL level and RS-485, automatically connect to the corresponding decoding circuit, and have encoding anti-interference ability to prevent decoding circuits from interfering with each other.
It realizes automatic file building and regulation conversion of distributed photovoltaic inverters of different brands and models, improves the automation level of the system, reduces complexity and cost, and has fault protection and self-recovery functions.
Smart Images

Figure CN119906604A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of multi-source access to smart grids, and in particular to a multi-source access system based on protocol self-learning and communication interface adaptation. Background Art
[0002] With the continuous deepening of the power system reform, the scale of distributed power sources has increased year by year. In recent years, the country has also begun to pay attention to the protocol self-learning technology of distributed power sources. Through smart meter technology, power companies can obtain power consumption information in real time, so as to adjust the output of distributed power sources according to actual load changes. These smart meters and communication equipment usually support automatic identification and learning of the operating status of the power grid. Through data collection and analysis, the power system can realize dynamic load distribution and power scheduling.
[0003] In existing photovoltaic inverter systems, inverters from different manufacturers or different models may use different communication interface standards, such as RS485, RS232, and TTL levels. This inconsistency requires the preparation of corresponding adapters or controllers for each interface, which increases the complexity and cost of the system. By studying the communication interface adaptation, compatibility with different buses can be achieved without having to understand the bus type and set the communication type in advance, thereby improving the level of automation.
[0004] By studying the differences and characteristics of the three communication interfaces, a circuit is designed that can automatically identify the three communication interfaces, automatically connect the corresponding decoding circuit for a specific interface, and have a certain coding anti-interference ability to prevent the decoding circuits from interfering with each other. Summary of the invention
[0005] In view of the deficiencies of the prior art, the present invention provides a multi-source access system based on protocol self-learning and communication interface adaptation, which solves the problems raised in the above background technology.
[0006] To achieve the above objectives, the present invention is implemented through the following technical solutions: a multi-source access system based on protocol self-learning and communication interface adaptation, including a multi-protocol automatic learning and autonomous archiving and protocol conversion system and a variety of communication interface adaptation systems;
[0007] The multi-protocol automatic learning and autonomous archiving and protocol conversion system includes the file self-maintenance process, protocol self-learning process and protocol conversion process;
[0008] The multiple communication interface adaptive system consists of three parts: RS-232 bus judgment circuit, TTL level-RS-485 bus judgment circuit, and signal isolation circuit;
[0009] The RS-232 bus judgment circuit judges whether it is an RS-232 bus; if so, the RS-232 communication circuit is enabled and the RS-485 and TTL related circuits are disabled, otherwise the RS-232 communication circuit is disabled;
[0010] The TTL level-RS-485 bus judgment circuit judges whether it is TTL level; if so, the TTL level communication circuit is enabled and the RS-485 related circuit is disabled, otherwise the TTL level communication related circuit is disabled and the RS-485 communication circuit is enabled;
[0011] The signal isolation circuit isolates the sending and receiving of the communication interface circuit and transmits the current communication interface type to the system side. The system side does not need to care about the external communication interface type, making the system side work safer and more reliable.
[0012] The three communication interface connection methods are as follows: the RS-232 transmitting end, the TTL level transmitting end, and the RS-485 A end are short-circuited together, the RS-232 receiving end, the TTL level receiving end, and the RS-485 B end are short-circuited together, and the reference grounds (RS-232 bus, TTL level) are short-circuited together.
[0013] Optionally, the file self-maintenance process is used to implement port file management and inverter protocol identification, and the specific process is as follows:
[0014] S1, task starts;
[0015] S2, perform initialization and read file parameters;
[0016] S3, enter the archive management process;
[0017] S4, protocol self-learning operation.
[0018] Optionally, the file management process is used to implement port file management, as follows:
[0019] When the device is powered on for the first time, if the file is empty, a framework file is created and protocol adaptation is performed on each port; if a valid file exists, a protocol test is performed on the existing file after restart; other ports without valid files enter the idle state.
[0020] Optionally, the protocol self-learning operation is used to realize the identification of the inverter protocol corresponding to each file, as follows:
[0021] If the newly created file does not contain protocol information, the protocol self-learning is performed to obtain the learning results and complete the recognition process;
[0022] For files that have been successfully learned, the protocol information is confirmed or deleted through protocol testing. For files that have not passed the test, the protocol self-learning is performed again;
[0023] Repeat the above process until the protocol identification of all files is completed;
[0024] After the protocol self-learning step is completed, it enters the idle state and waits for the next round of self-adaptation to arrive before executing a new round of protocol self-learning from the archive management.
[0025] Optionally, the protocol self-learning process is used to complete the learning of four parameters: communication baud rate, check bit, site, and protocol type, as follows:
[0026] After the process starts, it starts from the first site range, where the site is the priority site, and tries each protocol in turn, using the set baud rate, check bit, and priority site to combine; then the identification method is used to complete the group test frame, and after sending it downlink, a response is obtained;
[0027] If there is a response during the test, the current baud rate, checksum, and site information are recorded; if the response content meets the requirements of the identification method, other identification methods set in the protocol are tested. If all meet the requirements, the protocol type is determined;
[0028] If any item does not meet the requirements, use the learned baud rate, checksum, and site information, change the protocol, and continue testing until all the identification methods of the protocol meet the requirements.
[0029] If all protocols are traversed using the learned baud rate, checksum, and site, and the protocol still cannot be determined, the test ends;
[0030] If all priority sites have been tried and there is no response, switch to the normal site and continue testing, trying to get a response, until all possibilities have been tested.
[0031] The final learning results may be:
[0032] 1. No information was learned;
[0033] 2. Learned baud rate, checksum, and station;
[0034] 3. Learned baud rate, checksum, station, and protocol type.
[0035] Optionally, the site is any one of 1 to 255, wherein 1, 2, 3, and 247 are priority sites, and the remaining sites after excluding the priority sites from 1 to 255 are common sites, wherein each protocol in the protocol library has the authority to set its own priority site.
[0036] Optionally, each of the regulations is as follows:
[0037] ① Regulations identification;
[0038] ②Baud rate enumeration;
[0039] ③Check digit enumeration;
[0040] ④ Priority site enumeration;
[0041] ⑤ Enumeration of identification methods;
[0042] ⑥Reading method enumeration;
[0043] ⑦Write method enumeration;
[0044] ⑧ State identification method enumeration.
[0045] Optionally, the protocol conversion process is used to complete the communication conversion between 698 commands and modbus commands, as follows:
[0046] (1) After entering the function, determine whether all ports have been initialized. If so, proceed to the next step. If not, wait until all ports have been initialized before proceeding to the next step.
[0047] (2) Obtain the port number based on the TSA logical address of the 698 command and check whether the port is being used as a proxy. If it is, wait until the proxy ends.
[0048] (3) Obtain the pointer to the protocol library corresponding to this port, convert the OAD into the corresponding method in the library, execute the methods in sequence, convert the data format and save it in the specified location until all methods are completed;
[0049] (4) The function returns the execution result for reference in the 698 group of frames.
[0050] The present invention provides a multi-source access system based on protocol self-learning and communication interface adaptation, which has the following beneficial effects:
[0051] This multi-source access system based on protocol self-learning and communication interface adaptation establishes an information collection model in a complex environment, establishes a communication feature library of the inverter from multiple dimensions of telemetry, telesignaling and remote control, realizes protocol learning for distributed photovoltaic inverters of different brands and models, and can realize automatic archiving and protocol conversion of mainstream inverters on the current market; and based on the design concept of maintenance-free and plug-and-play, studies self-management algorithms, monitors changes in connected inverters in real time, and can self-diagnose inverter access, communication failures, normal shutdown or brand replacement; updates archives in time according to self-diagnosis results, removes invalid archives, etc., and studies data self-analysis and self-conversion algorithms of different protocols based on the principles of non-intervention and self-analysis; establishes an abstract mathematical model through the data value characteristics of each protocol, and the model must contain key information such as numerical meaning, numerical type, and numerical unit; through the translation algorithm, uniformly encapsulates data of different protocols and different types to achieve self-translation.
[0052] By studying the adaptability of communication interfaces, compatibility with different buses is achieved, and there is no need to understand the bus type and set the communication type in advance, thereby improving the level of automation; by studying the differences and characteristics of the three communication interfaces, a circuit is designed that can automatically identify the three communication interfaces, automatically connect the corresponding decoding circuit for a specific interface, and have a certain encoding anti-interference ability to prevent the decoding circuits from interfering with each other; the bus protection mechanism is studied, and communication isolation technology is used to isolate the interface bus from the system to ensure the safety of the system. At the same time, it can cope with various fault conditions, such as overvoltage, overcurrent, short circuit, etc., so that the interface circuit has fault protection and self-recovery functions.
[0053] The present invention realizes automatic compatibility of three communication interfaces (RS485, RS232, TTL level), and the control side does not need to care about the type of communication interface; the communication interface type is identified by judging the characteristic voltages of the receiving end of the RS232 bus, the receiving end of the TTL level, and the B end of the RS485 bus; because the RS232 bus adopts negative logic to transmit data, the RS232 bus is judged first, thereby ensuring the safety and reliability of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 This is the main flow chart of the self-maintenance of the archives in the invention;
[0055] Figure 2 A self-learning flow chart for the specification in the invention;
[0056] Figure 3 It is a protocol conversion flow chart in the invention;
[0057] Figure 4 This is a bus judgment logic flow chart in the invention;
[0058] Figure 5 It is the signal isolation circuit diagram of the invention;
[0059] Figure 6 It is the RS232 bus judgment circuit diagram in the invention;
[0060] Figure 7 This is the TTL level-RS485 bus judgment circuit diagram in the invention. DETAILED DESCRIPTION
[0061] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0062] The present invention provides a technical solution: a multi-source access system based on protocol self-learning and communication interface adaptation, including a multi-protocol automatic learning and autonomous archiving and protocol conversion system and a variety of communication interface adaptation systems;
[0063] The multi-protocol automatic learning and autonomous archiving and protocol conversion system includes the file self-maintenance process, protocol self-learning process and protocol conversion process;
[0064] The file self-maintenance process is used to realize port file management and inverter protocol identification. The specific process is as follows:
[0065] S1, task starts;
[0066] S2, perform initialization and read file parameters;
[0067] S3, enter the file management process. When the device is powered on for the first time, if the file is empty, a framework file is created and protocol adaptation is performed on each port. If a valid file exists, the protocol test is performed on the existing file after restart. Other ports without valid files enter the idle state.
[0068] S4, protocol self-learning operation, if the newly created file does not have protocol information, then perform protocol self-learning, obtain the learning results, and complete the recognition process;
[0069] For files that have been successfully learned, the protocol information is confirmed or deleted through protocol testing. For files that have not passed the test, the protocol self-learning is performed again;
[0070] Repeat the above process until the protocol identification of all files is completed;
[0071] After the protocol self-learning step is completed, it enters the idle state and waits for the next round of self-adaptation to arrive and then executes a new round of protocol self-learning from the archive management again, such as Figure 1 As shown;
[0072] The protocol self-learning process is used to complete the learning of four parameters: communication baud rate, check bit, station, and protocol type. The details are as follows:
[0073] like Figure 2 As shown, after the process starts, it starts from the first site range, where the site is the priority site, and tries each protocol in turn (① protocol identification; ② baud rate enumeration; ③ check bit enumeration; ④ priority site enumeration; ⑤ identification method enumeration; ⑥ reading method enumeration; ⑦ writing method enumeration; ⑧ status identification method enumeration), and combines the set baud rate, check bit, and priority site; then uses the identification method to complete the group test frame, and after sending it downlink, obtains the response;
[0074] If there is a response during the test, the current baud rate, checksum, and site information are recorded; if the response content meets the requirements of the identification method, other identification methods set in the protocol are tested. If all meet the requirements, the protocol type is determined;
[0075] If any item does not meet the requirements, use the learned baud rate, checksum, and site information, change the protocol, and continue testing until all the identification methods of the protocol meet the requirements.
[0076] If all protocols are traversed using the learned baud rate, checksum, and site, and the protocol still cannot be determined, the test ends;
[0077] If all priority sites have been tested and there is no response, switch to the normal site and continue testing, trying to get a response, until all possibilities have been tested;
[0078] The final learning results may be:
[0079] 1. No information was learned;
[0080] 2. Learned baud rate, checksum, and station;
[0081] 3. Learned baud rate, checksum, station, and protocol type;
[0082] The site is any one from 1 to 255, of which 1, 2, 3, and 247 are priority sites. The remaining sites after excluding the priority sites from 1 to 255 are common sites. Each protocol in the protocol library has the authority to set its own priority site.
[0083] like Figure 3 As shown in the figure, the protocol conversion process is used to complete the communication conversion between 698 commands and modbus commands, as follows:
[0084] (1) After entering the function, determine whether all ports have been initialized. If so, proceed to the next step. If not, wait until all ports have been initialized before proceeding to the next step.
[0085] (2) Obtain the port number based on the TSA logical address of the 698 command and check whether the port is being used as a proxy. If it is, wait until the proxy ends.
[0086] (3) Obtain the pointer to the protocol library corresponding to this port, convert the OAD into the corresponding method in the library, execute the methods in sequence, convert the data format and save it in the specified location until all methods are completed;
[0087] (4) The function returns the execution result for 698 frame reference;
[0088] The multiple communication interface adaptive system consists of three parts: RS-232 bus judgment circuit, TTL level-RS-485 bus judgment circuit, and signal isolation circuit;
[0089] The RS-232 bus judgment circuit judges whether it is an RS-232 bus; if so, the RS-232 communication circuit is enabled and the RS-485 and TTL related circuits are disabled; otherwise, the RS-232 communication circuit is disabled, such as Figure 6 As shown;
[0090] The TTL level-RS-485 bus judgment circuit judges whether it is TTL level; if so, the TTL level communication circuit is enabled and the RS-485 related circuit is disabled; otherwise, the TTL level communication related circuit is disabled and the RS-485 communication circuit is enabled. Figure 4 As shown;
[0091] The signal isolation circuit isolates the sending and receiving of the communication interface circuit and transmits the current communication interface type to the system side. The system side does not need to care about the external communication interface type, making the system side work safer and more reliable. Figure 5 As shown;
[0092] The three communication interface connection methods are as follows: the RS-232 transmitter, the TTL level transmitter, and the RS-485 A terminal are short-circuited together; the RS-232 receiver, the TTL level receiver, and the RS-485 B terminal are short-circuited together; and the reference ground (RS-232 bus, TTL level) is short-circuited together. Figure 7 shown.
[0093] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A multi-source access system based on protocol self-learning and communication interface adaptation, characterized in that: Including multi-protocol automatic learning and autonomous archiving and protocol conversion system and multiple communication interface adaptive systems; The multi-protocol automatic learning and autonomous archiving and protocol conversion system includes the file self-maintenance process, protocol self-learning process and protocol conversion process; The multiple communication interface adaptive system consists of three parts: RS-232 bus judgment circuit, TTL level-RS-485 bus judgment circuit, and signal isolation circuit; The RS-232 bus judgment circuit judges whether it is an RS-232 bus; If yes, enable RS-232 communication circuit and disable RS-485 and TTL related circuits, otherwise disable RS-232 communication circuit; TTL level - RS-485 bus judgment circuit determines whether it is TTL level; If yes, enable the TTL level communication circuit and disable the RS-485 related circuit; otherwise disable the TTL level communication related circuit and enable the RS-485 communication circuit; The signal isolation circuit isolates the sending and receiving of the communication interface circuit and transmits the current communication interface type to the system side. The system side does not need to care about the external communication interface type, making the system side work safer and more reliable. The three communication interface connection modes are as follows: the sending end of RS-232, the sending end of TTL level, and the A end of RS-485 are short-circuited together; the receiving end of RS-232, the receiving end of TTL level, and the B end of RS-485 are short-circuited together.
2. The multi-source access system based on protocol self-learning and communication interface adaptation according to claim 1 is characterized in that: The file self-maintenance process is used to realize port file management and inverter protocol identification. The specific process is as follows: S1, task starts; S2, perform initialization and read file parameters; S3, enter the archive management process; S4, protocol self-learning operation.
3. The multi-source access system based on protocol self-learning and communication interface adaptation according to claim 2 is characterized in that: The file management process is used to implement the management of port files, as follows: When the device is powered on for the first time, if the file is empty, a framework file is created and protocol adaptation is performed on each port; if a valid file exists, a protocol test is performed on the existing file after restart; other ports without valid files enter the idle state.
4. The multi-source access system based on protocol self-learning and communication interface adaptation according to claim 2 is characterized in that: The protocol self-learning operation is used to realize the identification of the inverter protocol corresponding to each file, as follows: If the newly created file does not contain protocol information, the protocol self-learning is performed to obtain the learning results and complete the recognition process; For files that have been successfully learned, the protocol information is confirmed or deleted through protocol testing. For files that have not passed the test, the protocol self-learning is performed again; Repeat the above process until the protocol identification of all files is completed; After the protocol self-learning step is completed, it enters the idle state and waits for the next round of self-adaptation to arrive before executing a new round of protocol self-learning from the archive management.
5. The multi-source access system based on protocol self-learning and communication interface adaptation according to claim 1 is characterized in that: The protocol self-learning process is used to complete the learning of four parameters: communication baud rate, check bit, station, and protocol type, as follows: After the process starts, it starts from the first site range, where the site is the priority site, and tries each protocol in turn, using the set baud rate, check bit, and priority site to combine; then the identification method is used to complete the group test frame, and after sending it downlink, a response is obtained; If there is a response during the test, the current baud rate, checksum, and site information are recorded; if the response content meets the requirements of the identification method, other identification methods set in the protocol are tested. If all meet the requirements, the protocol type is determined; If any item does not meet the requirements, use the learned baud rate, checksum, and site information, change the protocol, and continue testing until all the identification methods of the protocol meet the requirements. If all protocols are traversed using the learned baud rate, checksum, and site, and the protocol still cannot be determined, the test ends; If all priority sites have been tried and there is no response, switch to the normal site and continue testing, trying to get a response, until all possibilities have been tested. The final learning results may be:
1. No information was learned; 2. Learned baud rate, checksum, and station; 3. Learned baud rate, checksum, station, and protocol type.
6. The multi-source access system based on protocol self-learning and communication interface adaptation according to claim 5 is characterized in that: The site is any one of 1 to 255, of which 1, 2, 3, and 247 are priority sites, and the remaining sites after excluding the priority sites from 1 to 255 are common sites, wherein each protocol in the protocol library has the authority to set its own priority site.
7. The multi-source access system based on protocol self-learning and communication interface adaptation according to claim 5 is characterized in that: Each of the regulations is as follows: ① Regulations identification; ②Baud rate enumeration; ③Check digit enumeration; ④ Priority site enumeration; ⑤ Enumeration of identification methods; ⑥Reading method enumeration; ⑦Write method enumeration; ⑧ State identification method enumeration.
8. The multi-source access system based on protocol self-learning and communication interface adaptation according to claim 1 is characterized in that: The protocol conversion process is used to complete the communication conversion between 698 commands and modbus commands, as follows: (1) After entering the function, determine whether all ports have been initialized. If so, proceed to the next step. If not, wait until all ports have been initialized before proceeding to the next step. (2) Obtain the port number based on the TSA logical address of the 698 command and check whether the port is being used as a proxy. If it is, wait until the proxy ends. (3) Obtain the pointer to the protocol library corresponding to this port, convert the OAD into the corresponding method in the library, execute the methods in sequence, convert the data format and save it in the specified location until all methods are completed; (4) The function returns the execution result for 698 frame reference.
Citation Information
Patent Citations
Communication method, communication device and communication system
CN103312547A
Communication method for serial port and multiple running agreement stipulations
CN104283887A
Power distribution network wireless communication device capable of adaptively converting multiple interface protocols
CN107517210A
Method for self-adapting TTL and RS232 serial port communication mode
CN107818060A
Multi-protocol protocol wireless conversion device based on neural network
CN113536738A