Multi-communication protocol conversion method
By adopting the terminal communication protocol conversion method in the data center, using the communication protocol conversion module and other related modules to realize the conversion of the Ethernet protocol and 485 protocol, the unified monitoring and management problems of different types of devices in the data center are solved, and the compatibility of multiple communication protocols and device communication functions are realized.
Patent Information
- Application Number
- CN202411861832.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-05-02
AI Technical Summary
The prior art is difficult to achieve unified monitoring and management of different types of sensors and control terminals in data centers, especially with challenges in the conversion and compatibility issues between multiple communication protocols.
A terminal communication protocol conversion method is adopted, including communication protocol conversion module, Ethernet protocol module, 485 protocol module, parameter storage module and indicator control module. Through the two-way data connection and protocol conversion of these modules, mutual conversion between the Ethernet protocol and 485 protocol is realized, and TCP/IP and MODBUS-RTU upload functions are supported.
It realizes unified monitoring and management of different types of devices in the data center, solves the compatibility problem between multiple communication protocols through protocol conversion, and has the equipment communication and parameter setting and storage functions of multiple control units.
Smart Images

Figure CN119922246A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of computer communication, and in particular relates to a multi-communication protocol conversion method. Background Art
[0002] In modern large-scale data center system management, different types of sensors and control terminals are included, including fans, water pumps, solenoid valves, fluorine pumps, display terminals, etc. Therefore, how to integrate the information of these devices for monitoring and management is a very important issue. The data center IoT communication protocol converter has multiple downstream communication interfaces and one or more upstream network interfaces, which is equivalent to a monitorable computer. Through the downstream communication interface of the console, the real-time data, node signals and other information can be collected, and the data can be transmitted back to the dispatch center to achieve the purpose of remote output of dispatch commands. Summary of the invention
[0003] Purpose of the invention: In view of the problems existing in the prior art, the present invention provides a terminal communication protocol conversion method.
[0004] Invention content: To solve the above technical problems, the present invention adopts the following technical solutions: A terminal communication protocol conversion method, including a communication protocol conversion module, and an Ethernet protocol module, a 485 protocol module, a parameter storage module and an indicator light control module bidirectionally connected to the communication protocol conversion module, and the communication protocol conversion between the modules includes the following steps: S1, the main program starts and each module is initialized; S2, after completing the initialization settings, the host scans all control terminal 485 addresses and connects to the host via socket using TCP; S3, after the main program determines that the udp setting command is received, it parses and processes the udp data and proceeds to the next step; if the main program determines that the udp setting command is not received, it proceeds to the next step; S4, the main program determines whether a TCP control instruction is received. When a TCP control instruction is received, the main program performs TCP to 485 protocol conversion and sends it to the corresponding controlled terminal. The controlled terminal replies to the main program and proceeds to the next step; when no TCP control instruction is received, the main program directly proceeds to the next step; S5: If the state of the controlled terminal is changed or updated, a 485 instruction is generated and TCP protocol conversion is performed, and the state information is uploaded and reported to the main program via TCP or MODBUS-RTU.
[0005] Furthermore, the main program is based on the STM32F103RCT6 chip.
[0006] Furthermore, step S3 performs format verification and content processing on the received UDP packet.
[0007] Beneficial effects: Compared with the prior art, the present invention has the following functions: 1) Drive the 485 interface, control the opening and closing of the terminal, and receive feedback information from the terminal; drive the Ethernet port and communicate with the host system; 2) Convert Ethernet protocol and 485 protocol to each other; with device communication of multiple control units and TCP / IP and MODBUS-RTU upload functions, control logic can be realized.
[0008] 3) Parameter setting and storage. The core function of this project is the mutual conversion between Ethernet protocol and 485 protocol. The CPU uses stm32f103rct6, which is connected to the second-generation host in the north and all control execution modules in the south. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] Figure 1 It is a logical flow diagram of the terminal communication protocol conversion method described in the present invention. DETAILED DESCRIPTION
[0010] The present invention will be further described below in conjunction with specific examples. It should be understood that these examples are only used to illustrate the present invention and are not intended to limit the scope of the present invention. After reading the present invention, modifications to various equivalent forms of the present invention by those skilled in the art all fall within the scope defined by the appended claims of the present application.
[0011] The terminal communication protocol conversion system of the present invention mainly includes a communication protocol conversion module based on the STM32F103RCT6 chip design, and an Ethernet protocol module, a 485 protocol module, a parameter storage module and an indicator light control module bidirectionally connected to the communication protocol conversion module. The interface design of each module and the communication protocol conversion module is as follows: 1. The main external interfaces of the Ethernet chip driver module: Chip initialization service: initialization pins, initialization interrupts, etc.; Chip network address setting service: set the local IP address, MAC address, etc.; Network socket parameter setting service: set the socket type to TCP or UDP, local port number, server IP, server port number, etc. Network socket open and close service: open / close socket; Services that send data via Socket: network data sending; Check whether the socket has received data service: network data reception; 2. The main external interfaces of the Ethernet protocol module: UDP packet parsing service: configure the communication protocol according to the function definition requirements.
[0012] TCP data packet parsing service: Functional definition requirements: Format verification and content processing of received TCP packets.
[0013] 3. The working logic flow of the scheduling and protocol conversion module is as follows Figure 1 As shown: S1, the main program starts and each module is initialized; S2, after completing the initialization settings, the host scans all control terminal 485 addresses and connects to the host via socket using TCP; S3, after the main program determines that the udp setting command is received, it parses and processes the udp data and proceeds to the next step; if the main program determines that the udp setting command is not received, it proceeds to the next step; S4, the main program determines whether a TCP control instruction is received. When a TCP control instruction is received, the main program performs TCP to 485 protocol conversion and sends it to the corresponding controlled terminal. The controlled terminal replies to the main program and proceeds to the next step; when no TCP control instruction is received, the main program directly proceeds to the next step; S5: If the state of the controlled terminal is changed or updated, a 485 instruction is generated and TCP protocol conversion is performed, and the state information is uploaded and reported to the main program via TCP or MODBUS-RTU.
[0014] 4. The main external interface of 485 protocol module 485 serial port data sending service: 485 serial port data packet parsing service: perform format verification and content processing on the received serial port data according to the terminal 485 communication protocol instructions.
[0015] 5. The main external interfaces of the serial port driver module: serial port hardware initialization; serial port data sending; serial port data receiving.
[0016] This system uses distributed computer communication technology and system integration technology to transmit real-time information to each terminal system in the data center to achieve the purpose of centralized, efficient and convenient use, control and management of operation information.
[0017] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A terminal communication protocol conversion method, characterized in that: It includes a communication protocol conversion module, and an Ethernet protocol module, a 485 protocol module, a parameter storage module and an indicator light control module that are bidirectionally connected to the communication protocol conversion module. The communication protocol conversion between the modules includes the following steps: S1, the main program starts and each module is initialized; S2, after completing the initialization settings, the host scans all control terminal 485 addresses and connects to the host via socket using TCP; S3, after the main program determines that the udp setting command is received, it parses and processes the udp data and proceeds to the next step; if the main program determines that the udp setting command is not received, it proceeds to the next step; S4, the main program determines whether a TCP control instruction is received. When a TCP control instruction is received, the main program performs TCP to 485 protocol conversion and sends it to the corresponding controlled terminal. The controlled terminal replies to the main program and proceeds to the next step; when no TCP control instruction is received, the main program directly proceeds to the next step; S5: If the state of the controlled terminal is changed or updated, a 485 instruction is generated and TCP protocol conversion is performed, and the state information is uploaded and reported to the main program via TCP or MODBUS-RTU.
2. The terminal communication protocol conversion method according to claim 1, characterized in that: The main program is based on the STM32F103RCT6 chip.
3. The terminal communication protocol conversion method according to claim 1, characterized in that: Step S3 performs format verification and content processing on the received UDP packet.