Data communication gateway machine for improving communication quality of serial port and network port
By designing a data communication gateway for improving the communication quality of serial ports and network ports, combining multiple measures of hardware and software, the problem of unstable communication quality in the existing technology is solved, and a more efficient and reliable communication effect is achieved.
Patent Information
- Application Number
- CN202411586520.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-02-14
AI Technical Summary
In industrial communication and Internet of Things communication, serial port and network port communication are susceptible to problems such as data loss, delay, code errors and electromagnetic interference, resulting in unstable communication quality.
Design a data communication gateway, combining software and hardware, adopting advanced signal processing algorithms and high-performance hardware architecture, including main control unit, serial interface module, network interface module and power module, combining data cache and optimization, protocol management Module and error detection and correction are used to improve communication quality.
Effectively reduce high-frequency noise and electromagnetic interference in serial communication, improve signal integrity and clarity, reduce bit error rate and loss of data transmission, improve system response speed and equipment compatibility, and ensure stable communication quality in different environments .
Smart Images

Figure CN119449531A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a data communication gateway for improving the communication quality of a serial port and a network port. Background Art
[0002] In today's industrial communications and Internet of Things communications applications, information transmission between devices usually relies on two main interfaces: serial ports, such as RS-232, RS-485, and network ports; however, these interfaces have always faced problems such as data loss, delay, and bit error; for serial ports, their data transmission is easily affected by external electromagnetic interference, resulting in signal distortion; and for network ports, especially in high-traffic environments, their network congestion, data packet loss, and transmission delays caused by various reasons will affect the overall communication effect of the system; existing solutions usually rely on increasing hardware protection and simple software redundancy mechanisms, but these methods cannot completely solve the above problems; and most of the existing equipment designs are relatively rigid and cannot flexibly respond to changing working environments and needs; for this reason, the applicant proposes a data communication gateway for improving the communication quality of serial ports and network ports, achieving more efficient and reliable communication, and providing stable communication quality in different application environments. Summary of the invention
[0003] In order to solve the above technical problems, the present invention proposes a data communication gateway for improving the communication quality of serial ports and network ports. The present invention adopts advanced signal processing algorithms and high-performance hardware architecture by combining software and hardware. The hardware increases the hardware anti-interference ability by setting a main control unit, a serial port interface module, a network port interface module and a power supply module, and improves the shielding layer and grounding to reduce signal interference at the physical level. The software sets data caching and optimization, a protocol management module and error detection and correction, adopts the TCP congestion control algorithm to achieve priority-based flow control, and uses a moving average filtering algorithm to reduce the influence of high-frequency noise, thereby effectively improving the communication quality of serial ports and network ports.
[0004] To achieve the above object, the technical solution adopted by the present invention is:
[0005] A data communication gateway for improving the communication quality of serial ports and network ports, characterized in that: the data communication gateway for improving the communication quality of serial ports and network ports adopts advanced signal processing algorithms and high-performance hardware architecture by combining software and hardware to improve the stability and efficiency of data transmission; specifically:
[0006] Hardware settings: main control unit, serial port interface module, network port interface module and power module;
[0007] Main control unit: equipped with high-performance processor, providing real-time multi-tasking capability, built-in on-chip buffer memory, improving data throughput, supporting dynamic allocation, and integrated hardware watchdog to ensure automatic reset and recovery of the system in extreme situations;
[0008] Serial port interface module: supports multi-protocol compatibility, has automatic detection and switching functions, uses PCB wiring optimization and twisted pair technology to increase anti-interference ability, and has built-in ESD protection circuit to prevent electrostatic interference;
[0009] Network port interface module: equipped with Gigabit Ethernet interface, supports automatic negotiation rate adjustment, compatible with 10 / 100 / 1000Mbps, with network port link redundancy and LACP (Link Aggregation Control Protocol), improves the overall network reliability, integrates network traffic monitoring chip, and analyzes and adjusts data flow strategy in real time;
[0010] Power module: The power module supports wide voltage input and has transient suppression and overvoltage protection capabilities, ensuring that the gateway remains stable and available under extreme power conditions. It integrates a power factor correction (PFC) module to ensure efficient and stable power supply under different voltage environments. It is equipped with a power low-power strategy and consumes very little power in standby mode, improving the energy efficiency of the overall system.
[0011] Software settings: data caching and optimization, protocol management module and error detection and correction;
[0012] Data caching and optimization: Run intelligent caching algorithms on embedded operating systems to optimize data flow and reduce network latency; implement priority-based flow control to ensure that critical data is transmitted first;
[0013] Protocol management module: supports multiple industrial protocols, such as Modbus TCP / UDP, HTTP, and MQTT, provides flexible protocol stack switching, automatically identifies device protocol types, and performs traffic priority management;
[0014] Error detection and correction: It has advanced error detection algorithms, supports multi-level CRC verification technology, records abnormalities in real time, and feeds back to system management through the log analysis module to assist in troubleshooting;
[0015] Algorithm settings: TCP congestion control algorithm and moving average filtering algorithm
[0016] TCP congestion control algorithm: implements priority-based flow control, mainly controlling the transmission rate through four core stages: slow start, congestion avoidance, fast retransmission, and fast recovery, and setting congestion signal perception, SP strategy, long-term goals, stability improvement, efficient communication, and intelligent functions;
[0017] Moving average filter algorithm: Set the window size to control the number of data points used to calculate the average value. The larger the window, the stronger the filter's suppression of noise, but the sensitivity will decrease. Set boundary processing to solve the problem that the window may overflow the array boundary at the beginning of the data. Use the current valid points to calculate the average value, effectively reducing the impact of high-frequency noise.
[0018] Furthermore, the data communication gateway for improving the communication quality of the serial port and the network port is provided with a TCP congestion control algorithm, and the TCP congestion control algorithm sets four core stages of slow start, congestion avoidance, fast retransmission and fast recovery to control the transmission rate, specifically:
[0019] Slow Start:
[0020] 1) Initial stage: Each time a new TCP connection is established, the congestion window (cwnd) is usually initialized to a small value, such as 1 MSS maximum segment size;
[0021] 2) Growth mode: When there is no sign of congestion, cwnd grows exponentially. Every time a new ACK is received, cwnd increases by 1 MSS; the formula is: cwnd = cwnd + MSS. This exponential growth effect enables the connection to quickly utilize the available bandwidth of the network;
[0022] 3) Threshold reached: This process continues until cwnd reaches a slow start threshold (ssthresh) or the network experiences packet loss;
[0023] Congestion Avoidance:
[0024] 1) Linear growth: Once ssthresh is reached, the congestion avoidance phase begins, and cwnd grows linearly rather than exponentially: cwnd = cwnd + MSS / cwnd. This process is designed to more carefully find the maximum throughput of the network and avoid triggering network congestion.
[0025] 2) Packet loss event processing: If packet loss is detected during this phase, ssthresh will be adjusted to half of the current cwnd, indicating the presence of network congestion;
[0026] Fast Retransmit:
[0027] Packet loss judgment: When the sender receives three repeated ACKs, it considers the packet lost, triggering the fast retransmission mechanism. ISPs generally believe that the most likely cause of packet loss is network congestion, which will drive the control mechanism to adjust the transmission rate;
[0028] Fast Recovery:
[0029] Window adjustment: after fast retransmit Do not enter slow start immediately, but through fast recovery, set ssthresh to half of the previous cwnd, ssthresh = that is, use this new ssthresh as cwnd to continue transmission, slightly increase it to adapt. This method reduces the impact of extreme data flow rate reduction caused by congestion while maintaining relatively high bandwidth usage;.
[0030] Furthermore, the data communication gateway for improving the communication quality of the serial port and the network port is provided with a TCP congestion control algorithm, and the TCP congestion control algorithm sets congestion signal perception, SP strategy, long-term goal, stability improvement, efficient communication and intelligent functions, specifically:
[0031] Congestion signal perception: TCP congestion control mechanism relies on network feedback, such as delay increase, duplicate ACK reception rate, and timeout events, to dynamically adjust cwnd and ssthresh;
[0032] SP's policy: The network may be adjusted over time, and ISPs often update their policies accordingly by analyzing the TCP traffic status in different time slots;
[0033] Long-term goal: Ensure the stability and efficiency of transmission, and strike a balance between user experience and effective use of network resources. TCP congestion control dynamically adjusts the transmission window to prevent network overload while making the best possible use of network bandwidth. These stages and mechanisms work together to enable TCP congestion management to adjust strategies to maintain stable and efficient transmission in the face of various network conditions.
[0034] Improved stability: Multiple hardware and software safeguards minimize the risk of accidental communication interruption and data loss;
[0035] Efficient communication: Supports advanced protocol management and flow control mechanisms to ensure efficient data exchange even in complex network environments.
[0036] Intelligence: Through automatic detection, dynamic adjustment and intelligent error recovery functions, the need for manual operation is reduced and the system's self-healing ability is improved.
[0037] The benefits of this application are:
[0038] 1. The data communication gateway function used to improve the communication quality of serial ports and network ports can effectively reduce the high-frequency noise and electromagnetic interference in serial port communication, and improve the integrity and clarity of the signal;
[0039] 2. The data communication gateway used to improve the communication quality of serial ports and network ports has multiple error detection and correction functions, which effectively improves the accuracy of data transmission and reduces bit error rate and data loss;
[0040] 3. The data communication gateway used to improve the communication quality of serial ports and network ports has intelligent cache optimization. By using high-speed cache and intelligent flow control algorithms, it ensures smooth exchange and fast processing of data streams and improves system response speed;
[0041] 4. The data communication gateway used to improve the communication quality of serial ports and network ports adopts dynamic protocol management, which can automatically identify and adapt to a variety of industrial protocols, ensuring efficient data transmission even in an environment with diverse protocols;
[0042] 5. The data communication gateway used to improve the communication quality of serial ports and network ports has multi-protocol adaptation capabilities and supports a variety of serial port and network port protocols, such as RS-232, RS-485, Modbus TCP, etc. It can be seamlessly integrated in various application scenarios to improve device compatibility;
[0043] 6. The data communication gateway used to improve the communication quality of serial ports and network ports has link redundancy and automatic recovery, link aggregation and network redundancy functions, can automatically handle network disconnection or failure, and maintain a high level of communication availability. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 It is a schematic diagram of the overall structure of the present invention;
[0045] Figure 2 This is a schematic diagram of the serial port signal processing flow of the present invention;
[0046] Figure 3 Schematic diagram of the network port data optimization architecture of the present invention. DETAILED DESCRIPTION
[0047] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments:
[0048] like Figure 1-3 As shown, a data communication gateway for improving the communication quality of serial ports and network ports is shown. The data communication gateway for improving the communication quality of serial ports and network ports uses advanced signal processing algorithms and high-performance hardware architecture in a combination of software and hardware to improve the stability and efficiency of data transmission; specifically:
[0049] Hardware settings: main control unit, serial port interface module, network port interface module and power module;
[0050] Main control unit: equipped with high-performance processor, providing real-time multi-tasking capability, built-in on-chip buffer memory, improving data throughput, supporting dynamic allocation, and integrated hardware watchdog to ensure automatic reset and recovery of the system in extreme situations;
[0051] Serial port interface module: supports multi-protocol compatibility, has automatic detection and switching functions, uses PCB wiring optimization and twisted pair technology to increase anti-interference ability, and has built-in ESD protection circuit to prevent electrostatic interference;
[0052] Network port interface module: equipped with Gigabit Ethernet interface, supports automatic negotiation rate adjustment, compatible with 10 / 100 / 1000Mbps, with network port link redundancy and LACP (Link Aggregation Control Protocol), improves the overall network reliability, integrates network traffic monitoring chip, and analyzes and adjusts data flow strategy in real time;
[0053] Power module: The power module supports wide voltage input and has transient suppression and overvoltage protection capabilities, ensuring that the gateway remains stable and available under extreme power conditions. It integrates a power factor correction (PFC) module to ensure efficient and stable power supply under different voltage environments. It is equipped with a power low-power strategy and consumes very little power in standby mode, improving the energy efficiency of the overall system.
[0054] Software settings: data caching and optimization, protocol management module and error detection and correction;
[0055] Data caching and optimization: Run intelligent caching algorithms on embedded operating systems to optimize data flow and reduce network latency; implement priority-based flow control to ensure that critical data is transmitted first;
[0056] Protocol management module: supports multiple industrial protocols, such as Modbus TCP / UDP, HTTP, and MQTT, provides flexible protocol stack switching, automatically identifies device protocol types, and performs traffic priority management;
[0057] Error detection and correction: It has advanced error detection algorithms, supports multi-level CRC verification technology, records abnormalities in real time, and feeds back to system management through the log analysis module to assist in troubleshooting;
[0058] Algorithm settings: TCP congestion control algorithm and moving average filtering algorithm
[0059] TCP congestion control algorithm: implements priority-based flow control, mainly controlling the transmission rate through four core stages: slow start, congestion avoidance, fast retransmission, and fast recovery, and setting congestion signal perception, SP strategy, long-term goals, stability improvement, efficient communication, and intelligent functions;
[0060] Moving average filter algorithm: Set the window size to control the number of data points used to calculate the average value. The larger the window, the stronger the filter's suppression of noise, but the sensitivity will decrease. Set boundary processing to solve the problem that the window may overflow the array boundary at the beginning of the data. Use the current valid points to calculate the average value, effectively reducing the impact of high-frequency noise.
[0061] The data communication gateway machine shown for improving the communication quality of the serial port and the network port is provided with a TCP congestion control algorithm. The TCP congestion control algorithm shown sets four core stages of slow start, congestion avoidance, fast retransmission and fast recovery to control the transmission rate, specifically:
[0062] Slow Start:
[0063] 1) Initial stage: Each time a new TCP connection is established, the congestion window (cwnd) is usually initialized to a small value, such as 1 MSS maximum segment size;
[0064] 2) Growth mode: When there is no sign of congestion, cwnd grows exponentially. Every time a new ACK is received, cwnd increases by 1 MSS; the formula is: cwnd = cwnd + MSS. This exponential growth effect enables the connection to quickly utilize the available bandwidth of the network;
[0065] 3) Threshold reached: This process continues until cwnd reaches a slow start threshold (ssthresh) or the network experiences packet loss;
[0066] Congestion Avoidance:
[0067] 1) Linear growth: Once ssthresh is reached, the congestion avoidance phase begins, and cwnd grows linearly rather than exponentially: cwnd = cwnd + MSS / cwnd. This process is designed to more carefully find the maximum throughput of the network and avoid triggering network congestion.
[0068] 2) Packet loss event processing: If packet loss is detected during this phase, ssthresh will be adjusted to half of the current cwnd, indicating the presence of network congestion;
[0069] Fast Retransmit:
[0070] Packet loss judgment: When the sender receives three repeated ACKs, it considers the packet lost, triggering the fast retransmission mechanism. ISPs generally believe that the most likely cause of packet loss is network congestion, which will drive the control mechanism to adjust the transmission rate;
[0071] Fast Recovery:
[0072] Window adjustment: After fast retransmission, slow start is not entered immediately, but through fast recovery, ssthresh is set to half of the previous cwnd, ssthresh = that is, use this new ssthresh as cwnd to continue transmission, and increase it slightly to adapt. This method reduces the impact of extreme data flow rate reduction caused by congestion while maintaining relatively high bandwidth usage;.
[0073] The data communication gateway machine shown for improving the communication quality of the serial port and the network port is provided with a TCP congestion control algorithm. The TCP congestion control algorithm shown sets congestion signal perception, SP strategy, long-term goal, stability improvement, efficient communication and intelligent functions, specifically:
[0074] Congestion signal perception: TCP congestion control mechanism relies on network feedback, such as delay increase, duplicate ACK reception rate, and timeout events, to dynamically adjust cwnd and ssthresh;
[0075] SP's policy: The network may be adjusted over time, and ISPs often update their policies accordingly by analyzing the TCP traffic status in different time slots;
[0076] Long-term goal: Ensure the stability and efficiency of transmission, and strike a balance between user experience and effective use of network resources. TCP congestion control dynamically adjusts the transmission window to prevent network overload while making the best possible use of network bandwidth. These stages and mechanisms work together to enable TCP congestion management to adjust strategies to maintain stable and efficient transmission in the face of various network conditions.
[0077] Improved stability: Multiple hardware and software safeguards minimize the risk of accidental communication interruption and data loss;
[0078] Efficient communication: Supports advanced protocol management and flow control mechanisms to ensure efficient data exchange even in complex network environments.
[0079] Intelligence: Through automatic detection, dynamic adjustment and intelligent error recovery functions, the need for manual operation is reduced and the system's self-healing ability is improved.
[0080] Shown for improving serial port and The data communication gateway machine of the network port communication quality is provided with a moving average filtering algorithm. The program of the moving average filtering algorithm in C language is as follows:
[0081]
[0082]
[0083] like Figure 3 As shown, the communication process is specifically as follows:
[0084] Data reception and preprocessing shown: After the signal is received, it is initially filtered and level adjusted by the serial port interface module and then transmitted to the main control unit for in-depth processing;
[0085] Data processing and cache management shown: The main control unit parses, optimizes and monitors errors of the original data, stores it in a ring buffer, and waits for transmission instructions; according to the network quality, the protocol management module dynamically optimizes the transmission frame length and rate;
[0086] The network port signal shown is received by the data receiving module and temporarily stored in the data buffer module. After pre-processing such as compression, encryption and redundancy, it passes through the protocol stack module and the QoS management module to reach the data sending module.
[0087] Data sending and confirmation shown: The optimized data is sent quickly through the network port, and the confirmation mechanism is used to ensure the data integrity of the receiver.
[0088] The above description is only a preferred embodiment of the present invention and does not constitute any other form of limitation to the present invention. Any modification or equivalent change made based on the technical essence of the present invention still falls within the scope of protection required by the present invention.
Claims
1. A data communication gateway for improving the communication quality of serial ports and network ports, characterized in that: The data communication gateway for improving the communication quality of the serial port and the network port adopts advanced signal processing algorithms and high-performance hardware architecture by combining software and hardware to improve the stability and efficiency of data transmission; specifically: Hardware settings: main control unit, serial port interface module, network port interface module and power module; Main control unit: equipped with high-performance processor, providing real-time multi-tasking capability, built-in on-chip buffer memory, improving data throughput, supporting dynamic allocation, and integrated hardware watchdog to ensure automatic reset and recovery of the system in extreme situations; Serial port interface module: supports multi-protocol compatibility, has automatic detection and switching functions, uses PCB wiring optimization and twisted pair technology to increase anti-interference ability, and has built-in ESD protection circuit to prevent electrostatic interference; Network port interface module: equipped with Gigabit Ethernet interface, supports automatic negotiation rate adjustment, compatible with 10 / 100 / 1000Mbps, with network port link redundancy and LACP link aggregation control protocol, improves the overall network reliability, integrates network traffic monitoring chip, and analyzes and adjusts data flow strategy in real time; Power module: The power module supports wide voltage input and has transient suppression and overvoltage protection capabilities, ensuring that the gateway remains stable and available under extreme power conditions. It integrates a power factor correction (PFC) module to ensure efficient and stable power supply under different voltage environments. It is equipped with a power low-power strategy and consumes very little power in standby mode, improving the energy efficiency of the overall system. Software settings: data caching and optimization, protocol management module and error detection and correction; Data caching and optimization: Run intelligent caching algorithms on embedded operating systems to optimize data flow and reduce network latency; Implement priority-based flow control to ensure that critical data is transmitted first; Protocol management module: supports multiple industrial protocols, such as Modbus TCP / UDP, HTTP, and MQTT, provides flexible protocol stack switching, automatically identifies device protocol types, and performs traffic priority management; Error detection and correction: It has advanced error detection algorithms, supports multi-level CRC verification technology, records abnormalities in real time, and feeds back to system management through the log analysis module to assist in troubleshooting; Algorithm settings: TCP congestion control algorithm and moving average filtering algorithm TCP congestion control algorithm: implements priority-based flow control, mainly controlling the transmission rate through four core stages: slow start, congestion avoidance, fast retransmission, and fast recovery, and setting congestion signal perception, SP strategy, long-term goals, stability improvement, efficient communication, and intelligent functions; Moving average filter algorithm: Set the window size to control the number of data points used to calculate the average value. The larger the window, the stronger the filter's suppression of noise, but the sensitivity will decrease. Set boundary processing to solve the problem that the window may overflow the array boundary at the beginning of the data. Use the current valid points to calculate the average value, effectively reducing the impact of high-frequency noise.
2. A data communication gateway for improving the communication quality of serial ports and network ports according to claim 1, characterized in that: The data communication gateway for improving the communication quality of the serial port and the network port is provided with a TCP congestion control algorithm, and the TCP congestion control algorithm sets four core stages of slow start, congestion avoidance, fast retransmission and fast recovery to control the transmission rate, specifically: Slow Start: 1) Initial stage: Each time a new TCP connection is established, the congestion window is usually initialized to a small value, such as 1 MSS; 2) Growth mode: When there is no sign of congestion, cwnd grows exponentially. Every time a new ACK is received, cwnd increases by 1 MSS; the formula is: cwnd = cwnd + MSS. This exponential growth effect enables the connection to quickly utilize the available bandwidth of the network; 3) Reaching the threshold: This process continues until cwnd reaches a slow start threshold or the network experiences packet loss; Congestion Avoidance: 1) Linear growth: Once ssthresh is reached, the congestion avoidance phase begins, and cwnd grows linearly rather than exponentially: cwnd = cwnd + MSS / cwnd. This process is designed to more carefully find the maximum throughput of the network and avoid triggering network congestion. 2) Packet loss event processing: If packet loss is detected during this phase, ssthresh will be adjusted to half of the current cwnd, indicating the presence of network congestion; Fast Retransmit: Packet loss judgment: When the sender receives three repeated ACKs, it considers the packet lost, triggering the fast retransmission mechanism. ISPs generally believe that the most likely cause of packet loss is network congestion, which will drive the control mechanism to adjust the transmission rate; Quick Recovery: Window adjustment: After fast retransmission, instead of entering slow start immediately, fast recovery is used to set ssthresh to half of the previous cwnd. ssthresh = This means that the new ssthresh is used as cwnd to continue transmission, and the value is slightly increased to adapt. This method maintains a relatively high When bandwidth is used, reduce the impact of extreme data rate reduction caused by congestion.
3. A data communication gateway for improving the communication quality of serial ports and network ports according to claim 1, characterized in that: The data communication gateway for improving the communication quality of the serial port and the network port is provided with a TCP congestion control algorithm, and the TCP congestion control algorithm is provided with congestion signal perception, SP strategy, long-term goal, stability improvement, efficient communication and intelligent functions, specifically: Congestion signal perception: TCP congestion control mechanism relies on network feedback, such as delay increase, duplicate ACK reception rate, and timeout events, to dynamically adjust cwnd and ssthresh; SP's policy: The network may be adjusted over time, and ISPs often update their policies accordingly by analyzing the TCP traffic status in different time slots; Long-term goal: Ensure the stability and efficiency of transmission, and strike a balance between user experience and effective use of network resources. TCP congestion control dynamically adjusts the transmission window to prevent network overload while making the best possible use of network bandwidth. These stages and mechanisms work together to enable TCP congestion management to adjust strategies to maintain stable and efficient transmission in the face of various network conditions. Improved stability: Multiple hardware and software safeguards minimize the risk of accidental communication interruption and data loss; Efficient communication: Supports advanced protocol management and flow control mechanisms to ensure efficient data exchange even in complex network environments. Intelligence: Through automatic detection, dynamic adjustment and intelligent error recovery functions, the need for manual operation is reduced and the system's self-healing ability is improved.