Serial port server embedded system

By using a serial port server embedded system to process data packet conversion at the link layer, the problems of high cost and data packet loss in Ethernet signal to serial port signal conversion are solved, achieving low-cost and high-efficiency data transmission.

CN116132215BActive Publication Date: 2025-12-30武汉迈威通信股份有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211743777.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-31
Publication Date
2025-12-30
Estimated Expiration
2042-12-31

AI Technical Summary

Technical Problem

Existing methods for converting Ethernet signals to serial signals are costly and may result in data loss, especially during long-distance transmission where transmission bottlenecks are significant.

Method used

Design an embedded serial server system, including an Ethernet module, a serial port module, an interrupt handling module, a mode switch module, a MAC address table, a web server, and a filtering and distribution module. It processes data packets at the link layer to reduce ARP packet transmission and adopts a simplified filtering scheme, making it suitable for low-end hardware platforms such as microcontrollers.

Benefits of technology

It achieves low-cost packet conversion, reduces the amount of ARP packets passing through the bus relay line, avoids data packet loss, is suitable for devices without an operating system, and improves data transmission rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116132215B_ABST
    Figure CN116132215B_ABST
Patent Text Reader

Abstract

The application provides a serial port server embedded system, which comprises at least an Ethernet module, a serial port module, an interrupt processing module, a mode switch module, a MAC address table, a Web server, a filtering and distributing module and a data packet module; the mode switch module can select the working mode of the serial port server; in the normal mode, data conversion is carried out in the application layer of TCP / IP, and in the data transparent mode, network and serial port data conversion is carried out in the link layer of TCP / IP; the MAC address table is used for buffering the correspondence between the MAC address and the IP address of the network device; the Web server is used for providing a web configuration page for users to configure the network address and the working mode of the device; the filtering and distributing module is used for forwarding the message from the network side to the serial port relay line according to the set filtering rule; through the scheme, the data packet can be filtered on the basis of ensuring the data forwarding rate, and the implementation cost is low and no special chip or special router is needed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of network communication, and in particular relates to an embedded system for a serial port server. Background Technology

[0002] Many serial port devices in industrial settings are limited by technology, typically enabling short-distance transmission and failing to meet the monitoring needs of large industrial parks. With the development of IoT technology, upgrading existing serial ports and other bus systems in the field is necessary to connect field data to factory management systems and achieve data access.

[0003] The commonly used Ethernet speed is 100Mbps, while the higher processing speed of serial ports is typically 921600bps. For serial cables, the higher the communication speed, the shorter the transmission distance. When performing long-distance transmission, the baud rate needs to be reduced. In the above application scenarios, the bus will be the bottleneck of the entire link, limiting the amount of data transferred from the serial server to the serial port or other buses.

[0004] Currently, the conversion between Ethernet signals and serial port signals mainly includes two methods: hardware circuit conversion and routing conversion. Hardware circuit conversion requires the development of dedicated chips and is prone to data packet loss. Routing conversion requires the use of dedicated routers or switches, which is relatively expensive. Summary of the Invention

[0005] In view of this, embodiments of the present invention provide a serial port server embedded system to solve the problems of high cost and potential packet loss in existing Ethernet signal to serial port signal conversion methods.

[0006] In a first aspect of the present invention, a serial port server embedded system is provided, comprising:

[0007] Ethernet module, used to send and receive Ethernet data;

[0008] The serial port module is used to send and receive serial port data;

[0009] The interrupt handling module is used to handle interrupts in the communication module and the serial port module.

[0010] The mode switch module is used to select the working mode of the serial port server;

[0011] The working mode is divided into at least a normal mode and a data pass-through mode. The normal mode handles the conversion between network data and serial port data at the application layer of the TCP / IP protocol stack, while the data pass-through mode handles the conversion between network data and serial port data at the link layer of the TCP / IP protocol stack.

[0012] A MAC address table is used to cache the mapping between MAC addresses and IP addresses of network devices.

[0013] A web server is used to provide users with a web configuration page to configure the device's network address and operating mode;

[0014] The filtering and distribution module is used to forward packets from the network side to the serial trunk line according to the set filtering rules.

[0015] The data packet assembly module is used to assemble data from the serial port trunk line into complete Ethernet data packets or wireless network data packets according to a standard format.

[0016] In one embodiment, the MAC address table is divided into a network-side MAC address table and a bus-side MAC address table; the MAC address table determines whether to forward ARP packets from the network-side MAC address table through a serial port trunk line according to preset rules.

[0017] In one embodiment, the MAC address table is updated in real time based on received ARP packets.

[0018] In one embodiment, the serial port server embedded system further includes:

[0019] The network protocol stack is used to process network data in normal mode.

[0020] In this embodiment of the invention, based on user-configured filtering rules and operating modes, combined with a MAC address table and a mode-based power-on / off filtering and distribution module, not only can data packets be quickly forwarded at the link layer without processing through the TCP / IP protocol stack, but data packets can also be filtered. This overcomes the bottleneck limitation of data volume relayed by the serial port server, reduces the amount of data transmitted through the bus relay line in ARP packets, reduces bandwidth consumption, and has low implementation costs without requiring dedicated chips, routers, or switches. Furthermore, this embedded system is simple and compact, and can be implemented on devices without an operating system or on embedded operating systems such as FreeRTOS, making it suitable for low-end hardware platforms such as microcontrollers. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention, 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...

[0022] These are merely some embodiments of the present invention. Those skilled in the art can obtain other drawings based on these drawings without any creative effort.

[0023] Figure 1This is a schematic diagram of an embedded serial server structure provided in one embodiment of the present invention;

[0024] Figure 2 This is a schematic diagram illustrating the working principle of a serial port server according to an embodiment of the present invention. Detailed Implementation

[0025] To make the objectives, features, and advantages of this invention more apparent and understandable, the following will be described...

[0026] The technical solutions of the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings. Obviously, the embodiments described below are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0027] 5. It should be understood that the term "comprising" in the specification, claims, and accompanying drawings of this invention is used in this context.

[0028] And other similar expressions, meaning to cover non-exclusive inclusion, such as a process, method, system, or device that includes a series of steps or units and is not limited to the listed steps or units. In addition, "first" and "second" are used to distinguish different objects and are not used to describe a specific order.

[0029] Please see Figure 1 The present invention provides a schematic diagram of the structure of a serial port server embedded system, comprising:

[0030] Ethernet module 110 is used to send and receive Ethernet data;

[0031] When the Ethernet module is in data pass-through mode, it needs to receive all data on the network. This can be achieved by setting the network card to promiscuous mode.

[0032] The serial port module 120 is used to send and receive serial port data;

[0033] 5. Interrupt handling module 130, used for interrupt handling of the communication module and serial port module;

[0034] The mode switch module 140 is used to select the working mode of the serial port server.

[0035] The working mode is divided into at least a normal mode and a data pass-through mode. The normal mode handles the conversion between network data and serial port data at the application layer of the TCP / IP protocol stack, while the data pass-through mode handles the conversion between network data and serial port data at the link layer of the TCP / IP protocol stack.

[0036] In the data pass-through mode, the filtering and distribution module 170 can be used to filter data at the link layer or IP layer.

[0037] The operating mode can be set via software configuration or via a DIP switch.

[0038] MAC address table 150 is used to cache the mapping between MAC addresses and IP addresses of network devices;

[0039] The MAC address table is divided into a network-side MAC address table and a bus-side MAC address table; the MAC address table determines whether to forward ARP packets from the network-side MAC address table through the serial port trunk line according to preset rules.

[0040] Because serial port relay communication has a low speed, in order to avoid frequent ARP packets preempting the serial port relay bandwidth, the MAC address table needs to determine whether ARP packets from the network side should be forwarded through the serial port relay line.

[0041] The MAC address table is updated in real time based on received ARP packets. ARP (Address Resolution Protocol) is a TCP / IP protocol that obtains the physical address based on the IP address. When a host sends information, it broadcasts an ARP request containing the target IP address to all hosts (or network devices) on the local area network and receives the return message to determine the target's physical address.

[0042] Web server 160 is used to provide users with a web configuration page to configure the device's network address and operating mode;

[0043] Based on the web page provided by Web server 160, users can configure the network addresses of serial port servers and network devices.

[0044] The filtering and distribution module 170 is used to forward packets from the network side to the serial port trunk line according to the set filtering rules.

[0045] Based on the filtering rules set by the user, only allowed packets are forwarded from the network side to the serial trunk line, so as to reduce the instability of the entire system's data communication caused by the bandwidth bottleneck of the serial trunk line.

[0046] The data packet assembly module 180 is used to assemble data from the serial port trunk line into complete Ethernet data packets according to the standard format.

[0047] The data packet assembly module reassembles the data from the serial port trunk line into complete Ethernet data packets according to the format specified by standards such as IEEE 802.3, and forwards them to other modules according to relevant rules.

[0048] Optionally, the serial port server embedded system further includes:

[0049] Network protocol stack 290 is used to process network data in normal mode.

[0050] In this embodiment, most of the data is processed at the data link layer and forwarded directly between the data link layer and the serial port, without needing to go through the TCP / IP protocol stack.

[0051] By setting up two MAC address tables, one on the network side and one on the bus side, the number of ARP packets transmitted through the bus trunk line can be reduced by combining relevant algorithms and predetermined rules, thereby reducing the bandwidth consumption of the packets.

[0052] Based on the MAC address table on the bus side, unicast and other network data belonging to the other side of the bus trunk line can be forwarded directly at the link layer, ensuring data transmission rate.

[0053] It adopts a dedicated simplified filtering scheme, which is small and flexible. It can be implemented on devices without an operating system or on embedded operating systems such as FreeRTOS, and is suitable for low-end hardware platforms such as microcontrollers.

[0054] This system implements a dedicated filtering scheme for network packets, avoiding the problem that traditional dedicated chips cannot perform traffic filtering. Furthermore, it eliminates the need for dedicated chips; by utilizing Layer 2 and Layer 3 technologies on a microcontroller platform, data routing between buses such as Ethernet and serial ports can be achieved, resulting in lower implementation costs.

[0055] In one embodiment, a schematic diagram of the working principle of the serial port server based on the embedded system of the serial port server is also provided, such as... Figure 2 As shown, it includes:

[0056] When forwarding messages:

[0057] The serial port server periodically sends ARP requests to the network side. Users can configure the ARP sending interval, ARP aging time, and static ARP table. For industrial networks using static IP addresses, a static ARP table is more suitable, or the ARP aging time can be set as long as possible. Since device IP addresses are typically fixed in industrial environments, to minimize the amount of ARP packet data, the IP and MAC addresses of the network devices participating in communication are statically bound on the first serial port server. Simultaneously, the IP address range of the participating network devices is configured.

[0058] When the first serial port server receives an ARP reply packet and detects changes in the network-side MAC address table (including additions, deletions, and modifications), it forwards the ARP packet to the second serial port server via the serial trunk line. Upon receiving the ARP packet, the second serial port server updates its bus-side MAC address table and simultaneously forwards the ARP packet to all network devices on the right side via its network port. The reverse is also true.

[0059] When the first serial port server receives an ARP request broadcast from a host, if it detects that the IP address falls within the IP range of the participating communication devices on the right (meaning the IP can be found in the first serial port server's bus-side MAC address table), the first serial port server combines the corresponding MAC address and IP address into an ARP reply packet and sends it to the corresponding network-side device. If the IP address cannot be found in the first serial port server's bus-side MAC address table, the broadcast packet is sent to the second serial port server via the serial port trunk line. Upon receiving the packet, the second serial port server updates its network-side MAC address table and simultaneously broadcasts the packet to all network devices on the right. When a network device on the right detects that the query is for its own IP address, it replies with a normal ARP reply packet. Upon receiving this reply packet, the second serial port server updates its network-side MAC address table and sends the data back to the first serial port server via the serial port trunk line; the first serial port server updates its bus-side MAC address table and sends the data to the designated host via the network port. The reverse is also true.

[0060] When performing data filtering:

[0061] Users can configure the IP address range of network devices participating in communication via the web. The filtering and distribution module queries the bus-side MAC address table to obtain the MAC address corresponding to the IP address. Then, upon receiving a link-layer data packet, it checks whether the destination MAC address is in the bus-side MAC address table. If it is, it directly sends the data packet to the second serial port server via the serial port trunk line. After receiving the data, the second serial port server uses the data packet assembly module to form an Ethernet data packet, and then sends it out unchanged via the Ethernet module.

[0062] For broadcast messages, users can configure which broadcast messages, such as DHCP / ARP, are allowed to be forwarded through serial port trunk lines.

[0063] Most ICMP messages are unicast messages and can be forwarded according to unicast message rules.

[0064] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the system and modules described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0065] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0066] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A serial server embedded system, comprising: Comprise: Ethernet module, for sending and receiving Ethernet data; Serial module, for sending and receiving serial data; Interrupt processing module, for interrupt processing of communication module and serial module; Mode switch module, for selecting the working mode of serial server; Wherein, the working mode is at least divided into normal mode and data transparent mode, the normal mode is to process the mutual conversion of network data and serial data in the application layer of TCP / IP protocol stack, and the data transparent mode is to process the mutual conversion of network data and serial data in the link layer of TCP / IP protocol stack; MAC address table, for caching the correspondence between MAC address and IP address of network device; Wherein, the MAC address table is updated in real time according to the received ARP message; Web server, for providing web configuration page for user to configure the network address and working mode of device; Filter distribution module, for forwarding the message from network side to serial relay line according to the set filter rule; Data packet module, for packing the data from serial relay line into complete Ethernet data packet or wireless network data packet according to standard format.

2. The system of claim 1, wherein, The MAC address table is divided into network side MAC address table and bus side MAC address table; The MAC address table judges whether to forward the ARP message from network side MAC address table through serial relay line according to preset rule.

3. The system of claim 1, wherein, The serial server embedded system further comprises: Network protocol stack, for processing network data in normal mode.

Citation Information

Patent Citations

  • Method of realizing adaptive switching between two modes of transparent transmission and Modbus protocol conversion in network serial port

    CN109587158A