Serial port distributor

By integrating a serial port distributor with multi-channel serial port management and automatic switching functions, the problem of low system reliability in existing technologies is solved, achieving continuity and flexibility in data transmission, and making it suitable for industrial automation and communication backup scenarios.

CN223842413UActive Publication Date: 2026-01-27SHENYANG AERO-TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202520851240.6
Authority / Receiving Office
CN · China
Patent Type
Utility models(China)
Current Assignee / Owner
Filing Date
2025-04-30
Publication Date
2026-01-27
Estimated Expiration
2035-04-30

AI Technical Summary

Technical Problem

Existing serial communication systems lack automatic detection and remote network control functions for multiple serial links, resulting in low system reliability, complex operation, and susceptibility to data transmission delays or loss.

Method used

A serial port splitter was designed, integrating a serial port receiving unit, a serial port transmitting unit, a network interface driver unit, a DIP switch driver unit, a button driver unit, a control unit U1, a power management unit, and a relay driver unit. The STM32F407ZET6 chip is used to implement multi-channel serial port management, automatic switching, and network control. The MAX3232 level conversion chip is used to convert RS232 to TTL levels. The relay driver unit implements link switching, and the network interface driver unit supports remote monitoring and management.

Benefits of technology

It realizes automatic detection and switching of multiple RS232 serial links, ensuring the continuity of data transmission, improving the reliability and flexibility of the system, supporting remote control and centralized management, and is suitable for industrial automation and communication backup scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN223842413U_ABST
    Figure CN223842413U_ABST
Patent Text Reader

Abstract

The utility model relates to serial port equipment, in particular to a serial port distributor. The device comprises a serial port receiving unit, a serial port sending unit, a network interface driving unit, a dial switch driving unit, a key driving unit, a control unit U1, a power supply management unit and a relay driving unit. The control unit U1 is respectively connected with the serial port receiving unit, the serial port sending unit, the network interface driving unit, the dial switch driving unit, the key driving unit, the power supply management unit and the relay driving unit; and the relay driving unit is connected with the serial port sending unit. On the basis of a traditional serial port distributor, key modules such as level switch, power management, relay drive and network interfaces are optimized, the reliability and anti-jamming capability of a system are improved, and intelligent switching and remote control functions are supported.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This utility model relates to serial port devices, and more particularly to a serial port distributor. Background Technology

[0002] In modern industrial control and communication systems, serial port (RS232) devices are widely used for data transmission due to their simplicity and reliability. However, traditional serial communication systems typically use a single communication link. If the main link fails, data transmission will be interrupted, leading to reduced system reliability. Furthermore, existing technologies lack the ability to switch between multiple serial port links, often requiring manual intervention from the user to switch to a backup link. This not only increases operational complexity but may also cause data transmission delays or loss.

[0003] Existing serial port splitters or switching devices are mostly single-function and cannot simultaneously support automatic detection and remote network control of multiple serial ports. While some devices support multiple serial port inputs, they lack automatic switching mechanisms for data validity; others cannot quickly switch links via manual forced mode, or achieve remote configuration and monitoring in a network environment. Therefore, there is an urgent need for a serial port splitter that integrates multi-port management, automatic switching, forced selection, and network control functions to improve system reliability and flexibility. Summary of the Invention

[0004] This utility model addresses the shortcomings of existing technologies by providing a serial port distributor.

[0005] To achieve the above objectives, this utility model adopts the following technical solution: a serial port distributor includes a serial port receiving unit, a serial port transmitting unit, a network interface driving unit, a DIP switch driving unit, a button driving unit, a control unit U1, a power management unit, and a relay driving unit; the control unit U1 is connected to the serial port receiving unit, the serial port transmitting unit, the network interface driving unit, the DIP switch driving unit, the button driving unit, the power management unit, and the relay driving unit respectively; the relay driving unit is connected to the serial port transmitting unit.

[0006] Furthermore, the control unit U1 includes the STM32F407ZET6 chip; the I2C storage device is connected to the control unit U1 via the I2C1_SCL and I2C1_SDA pins.

[0007] Furthermore, the serial port receiving unit includes DB9 connectors J2M-J5M, level conversion chips U4 and U5, and both level conversion chips U4 and U5 use the MAX3232 chip; pin 2 of J2M is connected to pin 8 of level conversion chip U5, pin 3 of J2M is connected to pin 7 of level conversion chip U5, and pin 5 of J2M is grounded; pin 2 of J3M is connected to pin 13 of level conversion chip U5, pin 3 of J3M is connected to pin 14 of level conversion chip U5, and pin 5 of J3M is grounded; pin 2 of J4M is connected to the level conversion chip... Pin 8 of chip U4 and pin 3 of J4M are connected to pin 7 of level conversion chip U4, and pin 5 of J4M is grounded; pin 2 of J5M is connected to pin 13 of level conversion chip U4, pin 3 of J5M is connected to pin 14 of level conversion chip U4, and pin 5 of J5M is grounded; pins 9-12 of level conversion chip U4 are connected to pins 113, 112, 129, and 124 of control unit U1, respectively; pins 9-12 of level conversion chip U5 are connected to pins 102, 101, 113, and 116 of control unit U1, respectively.

[0008] Furthermore, the serial port transmission unit includes a DB9 connector J1F and a level conversion chip U3, which uses a MAX3232 chip. The DB9 connector J1F is connected to the level conversion chip U3 via signal lines to convert between RS232 and TTL levels. Pin 2 of the DB9 connector J1F is connected to pin 14 of the level conversion chip U3, and pin 3 of the DB9 connector J1F is connected to pin 13 of the level conversion chip U3. The level conversion chip U3 is connected to the control unit U1 via signal lines to receive and transmit serial communication data. Pin 11 of the level conversion chip U3 is connected to pin 77 of the control unit U1 to receive external serial port data, and pin 12 of the level conversion chip U3 is connected to pin 78 of the control unit U1 to send data to an external serial port device.

[0009] Furthermore, the relay driving unit includes a relay M1 and a transistor Q1; the base of transistor Q1 is connected to pin 56 of control unit U1 to receive control signals to drive the relay; pins 7 and 2 of the relay contact are connected to pins 14 and 13 of level conversion chip U3, respectively; pins 6 and 3 of the relay contact are connected to pins 8 and 7 of level conversion chip U5, respectively.

[0010] Furthermore, the button driving unit includes toggle switches K2-K5 and LED indicators LED3-LED11. The toggle switches are connected to the GPIO input port of the control unit U1 through their respective independent pins to receive user input signals. Specifically, toggle switch K2 is connected to PE8 of U1; toggle switch K3 is connected to PE10 of U1; toggle switch K4 is connected to PE12 of U1; and toggle switch K5 is connected to PE14 of U1. The LED indicators are connected to the GPIO output port of the control unit U1 through their respective pins, and their on / off state is controlled by the control unit U1. Specifically, LED3 is connected to PE9 of U1; LED4 is connected to PE11 of U1; LED5 is connected to PE13 of U1; LED6 is connected to PE15 of U1; and LED7 to LED11 are connected to PG1 to PG5 of U1, respectively.

[0011] Furthermore, the DIP switch driver unit includes a DIP switch S2. Pins 1 to 8 of the DIP switch S2 are connected to pins 10 to 19 of the control unit U1, respectively, as general purpose input / output (GPIO) pins for configuring the operating mode. Pins 9 to 16 of the DIP switch S2 are grounded, and a pull-down resistor ensures that the level is stable in the inactive state. The DIP switch driver unit provides input signals to the control unit U1 by changing the state of the DIP switch, which is used to configure the system's operating mode or parameters.

[0012] Furthermore, the network interface driver unit includes an RJ45 Ethernet port and a LAN8720A chip. The RJ45 port is connected to the LAN8720A chip via differential signal lines, specifically: pin 1 of the RJ45 is connected to pin 21 of the LAN8720A; pin 2 of the RJ45 is connected to pin 20 of the LAN8720A; pin 3 of the RJ45 is connected to pin 23 of the LAN8720A; and pin 6 of the RJ45 is connected to pin 22 of the LAN8720A. The LAN8720A... It connects to the control unit U1 via the management interface and data interface, where: pin 12 of LAN8720A is connected to pin 36 of STM32F407ZET6; pin 13 of LAN8720A is connected to pin 27 of STM32F407ZET6; pins 17 and 18 of LAN8720A are connected to pins 73 and 74 of STM32F407ZET6 respectively; and pin 14 of LAN8720A is connected to pin 35 of STM32F407ZET6.

[0013] Furthermore, the power management unit includes an input power interface J3, an input power interface J4, an LM2596S chip U2, and an LM2596S chip U9. The first pin of the input power interface J3, with a +12V voltage, is connected to the fuse F1 via diode D1, and then to the VIN pin of the LM2596S chip U2. The LM2596S chip U2 is configured to reduce the input voltage to a stable 3.3V output. The first pin of the input power interface J4, with a +12V voltage, is directly connected to the VIN pin of the LM2596S chip U9 via diode D2. The LM2596S chip U9 is configured to reduce the input voltage to a stable 5V output.

[0014] Compared with the prior art, this utility model has the following advantages.

[0015] This utility model of a serial port distributor is used for multi-RS232 serial link signal detection. Through the automatic detection and switching function of the main link and backup link, when the main link fails, the system can automatically switch to the backup link, ensuring the continuity of data transmission and significantly improving the reliability of the system. It integrates a network interface driver unit to monitor link status and send control commands, facilitating centralized management and maintenance.

[0016] Based on the traditional serial port distributor, this utility model optimizes key modules such as level conversion, power management, relay driving, and network interface. It not only improves the reliability and anti-interference capability of the system, but also supports intelligent switching and remote control functions. It is suitable for scenarios with high stability requirements, such as industrial automation and communication backup. Attached Figure Description

[0017] The present invention will be further described below with reference to the accompanying drawings and specific embodiments. The scope of protection of the present invention is not limited to the following description.

[0018] Figure 1 This is the circuit diagram of the control unit U1 and the DIP switch unit.

[0019] Figure 2 This is the circuit diagram of the power management unit.

[0020] Figure 3 This is the circuit diagram of the network interface driver unit.

[0021] Figure 4 This is the circuit diagram for memory U7.

[0022] Figure 5 It is a serial port and relay circuit. Figure 1 .

[0023] Figure 6 It is a serial port and relay circuit. Figure 2 .

[0024] Figure 7 This is the circuit diagram of the button driver unit.

[0025] Figure 8-10 yes Figure 1 A magnified view of a portion of the image. Detailed Implementation

[0026] To make the objectives, technical solutions, and beneficial effects of the embodiments of this utility model clearer, the technical solutions of the embodiments of this utility model will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of this utility model, but not all embodiments.

[0027] like Figure 1-10 As shown, the serial port distributor includes a serial port receiving unit, a serial port transmitting unit, a network interface driver unit, a DIP switch driver unit, a button driver unit, a control unit U1, a power management unit, and a relay driver unit. The control unit U1 is connected to the serial port receiving unit, the serial port transmitting unit, the network interface driver unit, the DIP switch driver unit, the button driver unit, the power management unit, and the relay driver unit, respectively. The relay driver unit is connected to the serial port transmitting unit.

[0028] Preferably, the control unit U1 includes the chip STM32F407ZET6.

[0029] Example 1: Control unit U1 receives and transmits serial data via USART pins, including: pin 105 (PA13) of U1 is connected to pin 4 of J1; pin 109 (PA14) of U1 is connected to pin 6 of J1. Pin 48 of U1 is connected to ground via resistor R5. Pin 136 of U1 is connected to pin 6 of U7. Pin 137 of U1 is connected to pin 5 of U7. Pins 8 and 9 of U1 are connected to the crystal oscillator; pin 115 of U1 is connected to S3; pin 138 of U1 is connected to R4; pin 25 of U1 is connected to S1; pins 23 and 24 of U1 are connected to the 25MHz crystal oscillator; pin 56 of U1 is connected to Q1. The I2C memory device is connected to the control unit via the I2C1_SCL and I2C1_SDA pins, specifically: pin PB6 (I2C1_SCL) and pin PB7 (I2C1_SDA) are connected to the I2C memory (24C04, U7). The control unit uses the above connection method to realize multi-channel serial communication, network communication, relay control, and data read / write operations to external memory.

[0030] Preferably, the serial port receiving unit includes DB9 connectors J2M-J5M, level conversion chips U4 and U5, and level conversion chips U4 and U5 are both MAX3232 chips; DB9 connectors J2M-J5M are connected to level conversion chips U4 and U5 through signal lines to realize the conversion between RS232 level and TTL level. Pin 2 of J2M is connected to pin 8 of level conversion chip U5, pin 3 of J2M is connected to pin 7 of level conversion chip U5, and pin 5 of J2M is grounded; pin 2 of J3M is connected to pin 13 of level conversion chip U5, pin 3 of J3M is connected to pin 14 of level conversion chip U5, and pin 5 of J3M is grounded; pin 2 of J4M is connected to pin 8 of level conversion chip U4, pin 3 of J4M is connected to pin 7 of level conversion chip U4, and pin 5 of J4M is grounded; pin 2 of J5M is connected to pin 13 of level conversion chip U4, pin 3 of J5M is connected to pin 14 of level conversion chip U4, and pin 5 of J5M is grounded. Level conversion chips U4 and U5 are connected to the control unit via signal lines to transmit the converted signals to the control unit for processing. Pins 9-12 of level conversion chip U4 are connected to pins 113, 112, 129, and 124 of control unit U1, respectively. Pins 9-12 of level conversion chip U5 are connected to pins 102, 101, 113, and 116 of control unit U1, respectively. The serial port receiving unit receives serial port data from external devices through multiple DB9 connectors, and after adapting RS232 and TTL levels through the level conversion chips, transmits the data to the main control chip for processing.

[0031] In summary: Pins 2 and 3 of J2M are connected to pins 8 and 7 of U5, and pin 5 of J2M is grounded. Pins 2 and 3 of JM3 are connected to pins 13 and 14 of U5, and pin 5 of J3M is grounded. Pins 2 and 3 of J4M are connected to pins 8 and 7 of U4, and pin 5 of J4M is grounded. Pins 2 and 3 of J5M are connected to pins 13 and 14 of U4, and pin 5 of J5M is grounded. Pins 9, 10, 11, and 12 of U4 are connected to pins 113, 112, 129, and 124 of U1, respectively. Pins 9, 10, 11, and 12 of U5 are connected to pins 102, 101, 113, and 116 of U1, respectively.

[0032] Preferably, the serial port transmitting unit includes a DB9 connector J1F and a level conversion chip U3, wherein the level conversion chip U3 is a MAX3232 chip. The DB9 connector J1F is connected to the level conversion chip U3 via signal lines to convert between RS232 and TTL levels. Pin 2 of the DB9 connector J1F is connected to pin 14 of the level conversion chip U3, and pin 3 of the DB9 connector J1F is connected to pin 13 of the level conversion chip U3. The level conversion chip U3 is connected to the control unit U1 via signal lines to receive and transmit serial communication data. Pin 11 of the level conversion chip U3 is connected to pin 77 of the control unit U1 to receive external serial port data, and pin 12 of the level conversion chip U3 is connected to pin 78 of the control unit U1 to send data to an external serial port device. The serial port transmitting unit is used for serial communication with external devices via the DB9 connector and for adapting RS232 and TTL levels using the level conversion chip.

[0033] More preferably, the relay driving unit includes a relay M1 and a transistor Q1; the base of transistor Q1 is connected to pin 56 of control unit U1 to receive control signals to drive the relay; (relay M1 achieves connection switching between external devices through its contacts,) pins 7 and 2 of the relay contacts are respectively connected to pins 14 and 13 of level conversion chip U3 (serial port transmission part); pins 6 and 3 of the relay contacts are respectively connected to pins 8 and 7 of level conversion chip U5 (main link J2M).

[0034] It features a power-off direct connection function, meaning that when there is no power supply or the control system is not activated, the relay is in the closed state by default, allowing the DB9 connector J1F to be directly connected to the main link connector J2M, ensuring the continuity of the communication path; the relay drive unit adjusts the state of the transistor through the control signal issued by the control unit, thereby controlling the opening and closing of the relay and realizing the connection switching between different external devices.

[0035] Example 2 includes: G6K_2P relay M1, transistor Q1, and diode D7. The collector of transistor Q1 is grounded, the base is connected to pin 56 of U1, the collector is connected to pin 8 of M1 and the positive terminal of the diode, pin 1 of M1 is connected to the negative terminal of the diode, pin 6 of M1 is connected to pin 8 of U5, pin 3 of M1 is connected to pin 7 of U5, pin 7 of M1 is connected to pin 14 of U3, and pin 2 of M1 is connected to pin 13 of U3.

[0036] Preferably, the button driving unit includes toggle switches K2-K5 and LED indicators LED3-LED11. Each toggle switch is connected to the GPIO input port of the control unit U1 via its independent pin to receive user input signals. Specifically, toggle switch K2 is connected to PE8 of U1; toggle switch K3 is connected to PE10 of U1; toggle switch K4 is connected to PE12 of U1; and toggle switch K5 is connected to PE14 of U1. The LED indicators are connected to the GPIO output port of the control unit U1 via their respective pins, and their on / off state is controlled by the control unit U1. Specifically, LED3 is connected to PE9 of U1; LED4 is connected to PE11 of U1; LED5 is connected to PE13 of U1; LED6 is connected to PE15 of U1; and LEDs 7 to 11 are connected to PG1 to PG5 of U1, respectively. Specific operations are triggered by detecting changes in the state of the toggle switches, and feedback is provided to the user by controlling the on / off state of the corresponding LED indicators. In other words, the system consists of toggle switches K2-K5, LED indicators LED3-LED11, and an STM32F407ZET6 chip. K2 is connected to PE8 pin of U1, K3 is connected to PE10 pin of U1, K4 is connected to PE12 pin of U1, and K5 is connected to PE14 pin of U1. LED3 is connected to PE9 pin of U1, LED4 is connected to PE11 pin of U1, LED5 is connected to PE13 pin of U1, LED6 is connected to PE15 pin of U1, LED7 is connected to PG1 pin of U1, LED8 is connected to PG2 pin of U1, LED9 is connected to PG3 pin of U1, LED10 is connected to PG4 pin of U1, and LED11 is connected to PG5 pin of U1.

[0037] Preferably, the DIP switch driving unit includes a DIP switch S2. Pins 1 to 8 of the DIP switch S2 are connected to pins 10 to 19 of the control unit U1, respectively, as general purpose input / output (GPIO) pins for configuring the operating mode. Pins 9 to 16 of the DIP switch S2 are grounded, and a pull-down resistor ensures stable voltage levels in the inactive state. The DIP switch driving unit provides input signals to the control unit U1 by changing the state of the DIP switch, for configuring the system's operating mode or parameters. Specifically: pin 1 of S2 is connected to pin 10 of U1; pin 2 of S2 is connected to pin 11 of U1; pin 3 of S2 is connected to pin 12 of U1; pin 4 of S2 is connected to pin 13 of U1; pin 5 of S2 is connected to pin 14 of U1; pin 6 of S2 is connected to pin 15 of U1; pin 7 of S2 is connected to pin 18 of U1; and pin 8 of S2 is connected to pin 19 of U1. Pins 9-16 of S2 are grounded.

[0038] Preferably, the network interface driver unit includes an RJ45 network port (J6) and an Ethernet physical layer chip (LAN8720A, U6). The RJ45 network port (J6) is connected to the LAN8720A chip (U6) via differential signal lines, wherein: pin 1 of the RJ45 is connected to pin 21 of the LAN8720A; pin 2 of the RJ45 is connected to pin 20 of the LAN8720A; pin 3 of the RJ45 is connected to pin 23 of the LAN8720A; and pin 6 of the RJ45 is connected to pin 22 of the LAN8720A. The AN8720A chip (U6) connects to the control unit U1 via a management interface and a data interface. Specifically: pin 12 of the AN8720A is connected to pin 36 of the STM32F407ZET6; pin 13 of the AN8720A is connected to pin 27 of the STM32F407ZET6; pins 17 and 18 of the AN8720A are connected to pins 73 and 74 of the STM32F407ZET6, respectively; and pin 14 of the AN8720A is connected to pin 35 of the STM32F407ZET6. The network interface driver unit implements Ethernet communication functionality, supporting data transmission and reception via the RJ45 port. Specifically: pin 1 of the RJ45 port is connected to pin 21 of U6; pin 2 of the RJ45 port is connected to pin 20 of U6; pin 3 of the RJ45 port is connected to pin 23 of U6; and pin 6 of the RJ45 port is connected to pin 22 of U6. Pin 12 of U6 is connected to pin 36 of U1; pin 13 of U6 is connected to pin 27; pins 17 and 18 of U6 are connected to pins 73 and 74 of U1; pin 16 of U6 is connected to pin 70 of U1; pins 8 and 7 of U6 are connected to pins 44 and 45 of U1; pin 11 of U6 is connected to pin 43 of U1; pin 14 of U6 is connected to pin 35 of U1; and pin 15 of U6 is connected to pin 118 of U1.

[0039] Preferably, the power management unit includes an input power interface J3, an input power interface J4, an LM2596S chip U2, and an LM2596S chip U9. The first pin of the input power interface J3, with a +12V voltage, is connected to a fuse F1 via a diode D1, and then connected to the VIN pin of the LM2596S chip U2. The LM2596S chip U2 is configured to reduce the input voltage to a stable 3.3V output. The first pin of the input power interface J4, with a +12V voltage, is directly connected to the VIN pin of the LM2596S chip U9 via a diode D2. The LM2596S chip U9 is configured to reduce the input voltage to a stable 5V output.

[0040] Example 3: The power management unit includes: white connectors J3 and J4, Schottky diodes D1, D2, and D5, fuses, LM2596S-3.3V DC-DC power chip U2, LM2596S-5V DC-DC power chip U5, and a 68uH power inductor. J3 is connected to D1, D1 to F1, F1 to pin 1 of U2, pin 2 of U2 to the 68uH power inductor, pin 2 of U2 to D5, pin 3 of U2 to pins 5 and 6, and ground. Pin 4 is connected to the other end of the inductor.

[0041] This utility model serial port distributor is used for multi-RS232 serial link signal detection. It is divided into two types: main link and backup link. When the backup link is compared with the main link, if it is detected that the backup link is receiving data but the main link is not receiving data, a time threshold is set. When this state exceeds the time threshold, the system judges that there is a problem with the main link, and switches to the backup link with data for transmission, while pushing alarm information.

[0042] The selection process uses an automatic selection method, and a forced selection method is also available. Forced selection is performed manually, and automatic selection will not be performed after forced selection.

[0043] Its working mode is as follows:

[0044] 1. When the host computer sends data to the device input terminal, the four input ports of the serial port distributor receive the data. At this time, the COM light of the corresponding port of the serial port distributor is in a constant state. If the corresponding port of the serial port distributor does not receive data, the COM light is in a constant state of being off.

[0045] 2. When data is input, store the data in the predefined buffer and check the validity of the data. If the data is valid, set the valid data flag to 1.

[0046] 3. Determine the output mode of the serial port distributor. If any port of the serial port distributor is in forced mode, the device will select the port to transmit data regardless of whether the data on that port is valid or not. If multiple ports are in forced mode, the port selection will be based on the priority order of COM1>COM2>COM3>COM4.

[0047] 4. If no port is in forced mode, the device will be in automatic mode. In this mode, the validity of the data will be checked first. If the data is valid, it will be stored in a specific buffer.

[0048] 5. In automatic mode, if multiple ports have valid data, one port will be selected for output according to the priority order of COM1>COM2>COM3>COM4. At this time, the corresponding USER light will be constantly lit and the other USER lights will be constantly off.

[0049] 6. If the current output link has no valid data, it needs to switch to another link. The switching method is as follows: if the current valid link has no valid data, but other links have received N valid data, then switch to the link that received N valid data first. N is the maximum number of valid data to switch, and its value can be set through software.

[0050] 7. Output the selected link data from the USER_COM port.

[0051] 8. When data is transmitted in reverse, data is input from the original output port and output from the original input port.

[0052] 9. During reverse transmission, the microcontroller first checks if the data is valid. If the data is valid, the microcontroller transmits the data; otherwise, it does not transmit the data.

[0053] 10. There are two output modes to choose from when transmitting in reverse: the first is to output all 4 channels of data, and the second is to transmit according to the valid path of the input mode.

[0054] 11. Data can also be transmitted over a network. When a corresponding command is sent in the software, the device will transmit the currently selected link data to the host computer through the network port.

[0055] Specifically, in the serial port distributor's processing, the microcontroller selects the highest priority data from the valid data received from each serial port for output, according to priority order. When a forced command is triggered, the microcontroller outputs data from the forced port. The microcontroller's functions can be controlled by sending commands via the network port. The specific method is as follows:

[0056] Compare and select the received signal:

[0057] The received comparison data is placed in a specific buffer and it is determined whether the data is valid. If the data is valid, the valid flag is set to 1 for subsequent data processing.

[0058] Waiting time for validity determination:

[0059] When the device is powered on, it will make an initial comparison and determine the validity of the data.

[0060] When a link is used as a data input link, if there is no valid data input after a settable period of time, the input link will be re-evaluated, and the link with valid data will be used as the input link. If there are multiple valid input links, the link will be selected according to its fixed priority.

[0061] Process the valid data:

[0062] When data for a particular link is valid, the data for that link is stored in its corresponding cache, and then stored in all other links except the current one. Due to priority issues, the link with the highest priority is blocked first.

[0063] When data for a certain link is valid, the data for that link is stored in its corresponding cache.

[0064] If multiple valid data streams exist, the input link that arrives first is selected as the valid output link. When multiple links generate valid data simultaneously, the link with the highest priority blocks the other links.

[0065] Forced mode:

[0066] Each link corresponds to a forced switch. When the forced switch is turned on, the device will be forced to switch from the current link to the forced link to receive data from the forced link, regardless of whether the data is valid.

[0067] Each link corresponds to a forced switch. When the forced switch is turned on, the device will be forced to switch from the current link to the forced link, regardless of whether the transmitted data is valid, and will use the forced link for data transmission.

[0068] When multiple links are forced to open simultaneously, the links are selected according to the pre-set priority.

[0069] Automatic mode:

[0070] When all forced switches are in the off state, the device is in automatic mode. In this mode, the device will select data from the link with the highest priority and valid input data according to the preset priority order.

[0071] Network control:

[0072] The device can be connected to the network via its Ethernet port, and its basic parameters can be set through the network.

[0073] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "preferred embodiment," "detailed description," or "preferred embodiment," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0074] The above embodiments are only used to illustrate the technical solutions of this utility model, and are not intended to limit it. Although this utility model 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 or all of the technical features therein. Therefore, these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope defined by the claims of this utility model.

Claims

1. A serial port distributor, characterized in that: It includes a serial port receiving unit, a serial port transmitting unit, a network interface driver unit, a DIP switch driver unit, a button driver unit, a control unit U1, a power management unit, and a relay driver unit; The control unit U1 is connected to the serial port receiving unit, the serial port transmitting unit, the network interface driving unit, the DIP switch driving unit, the button driving unit, the power management unit, and the relay driving unit, respectively. The relay driver unit is connected to the serial port transmission unit.

2. A serial port distributor according to claim 1, characterized in that: The control unit U1 includes the STM32F407ZET6 chip; the I2C storage device is connected to the control unit U1 through the I2C1_SCL and I2C1_SDA pins.

3. A serial port distributor according to claim 2, characterized in that: The serial port receiving unit includes DB9 connectors J2M-J5M, level conversion chips U4 and U5, and both level conversion chips U4 and U5 use the MAX3232 chip; pin 2 of J2M is connected to pin 8 of level conversion chip U5, pin 3 of J2M is connected to pin 7 of level conversion chip U5, and pin 5 of J2M is grounded; pin 2 of J3M is connected to pin 13 of level conversion chip U5, pin 3 of J3M is connected to pin 14 of level conversion chip U5, and pin 5 of J3M is grounded; pin 2 of J4M is connected to level conversion chip U... Pin 8 of J4M and pin 3 of J4M are connected to pin 7 of level conversion chip U4, and pin 5 of J4M is grounded; pin 2 of J5M is connected to pin 13 of level conversion chip U4, pin 3 of J5M is connected to pin 14 of level conversion chip U4, and pin 5 of J5M is grounded; pins 9-12 of level conversion chip U4 are connected to pins 113, 112, 129, and 124 of control unit U1, respectively; pins 9-12 of level conversion chip U5 are connected to pins 102, 101, 113, and 116 of control unit U1, respectively.

4. A serial port distributor according to claim 2, characterized in that: The serial port transmission unit includes a DB9 connector J1F and a level conversion chip U3, which uses a MAX3232 chip. The DB9 connector J1F is connected to the level conversion chip U3 via signal lines to convert between RS232 and TTL levels. Pin 2 of the DB9 connector J1F is connected to pin 14 of the level conversion chip U3, and pin 3 of the DB9 connector J1F is connected to pin 13 of the level conversion chip U3. The level conversion chip U3 is connected to the control unit U1 via signal lines to receive and transmit serial communication data. Pin 11 of the level conversion chip U3 is connected to pin 77 of the control unit U1 to receive external serial port data, and pin 12 of the level conversion chip U3 is connected to pin 78 of the control unit U1 to send data to external serial port devices.

5. A serial port distributor according to claim 4, characterized in that: The relay drive unit includes a relay M1 and a transistor Q1; the base of transistor Q1 is connected to pin 56 of control unit U1 to receive control signals to drive the relay; pins 7 and 2 of the relay contact are connected to pins 14 and 13 of level conversion chip U3, respectively; pins 6 and 3 of the relay contact are connected to pins 8 and 7 of level conversion chip U5, respectively.

6. A serial port distributor according to claim 1, characterized in that: The button driving unit includes toggle switches K2-K5 and LED indicators LED3-LED11. Each toggle switch is connected to the GPIO input port of the control unit U1 via its independent pin to receive user input signals. Specifically, toggle switch K2 is connected to PE8 of U1; toggle switch K3 is connected to PE10 of U1; toggle switch K4 is connected to PE12 of U1; and toggle switch K5 is connected to PE14 of U1. The LED indicators are connected to the GPIO output port of the control unit U1 via their respective pins, and their on / off state is controlled by the control unit U1. Specifically, LED3 is connected to PE9 of U1; LED4 is connected to PE11 of U1; LED5 is connected to PE13 of U1; LED6 is connected to PE15 of U1; and LEDs 7 to 11 are connected to PG1 to PG5 of U1, respectively.

7. A serial port distributor according to claim 1, characterized in that: The DIP switch driver unit includes a DIP switch S2. Pins 1 to 8 of the DIP switch S2 are connected to pins 10 to 19 of the control unit U1, respectively, as general purpose input / output (GPIO) pins for configuring the operating mode. Pins 9 to 16 of the DIP switch S2 are grounded.

8. A serial port distributor according to claim 2, characterized in that: The network interface driver unit includes an RJ45 Ethernet port and a LAN8720A chip. The RJ45 port connects to the LAN8720A chip via differential signal lines, specifically: pin 1 of the RJ45 port connects to pin 21 of the LAN8720A chip; pin 2 of the RJ45 port connects to pin 20 of the LAN8720A chip; pin 3 of the RJ45 port connects to pin 23 of the LAN8720A chip; and pin 6 of the RJ45 port connects to pin 22 of the LAN8720A chip. The LAN8720A chip communicates with the LAN8720A chip via management... The interface and data interface are connected to the control unit U1, wherein: pin 12 of LAN8720A is connected to pin 36 of STM32F407ZET6; pin 13 of LAN8720A is connected to pin 27 of STM32F407ZET6; pins 17 and 18 of LAN8720A are connected to pins 73 and 74 of STM32F407ZET6 respectively; and pin 14 of LAN8720A is connected to pin 35 of STM32F407ZET6.

9. A serial port distributor according to claim 1, characterized in that: The power management unit includes input power interface J3, input power interface J4, LM2596S chip U2, and LM2596S chip U9. The first pin of input power interface J3, with +12V, is connected to fuse F1 via diode D1, and then to the VIN pin of LM2596S chip U2. LM2596S chip U2 is configured to reduce the input voltage to a stable 3.3V output. The first pin of input power interface J4, with +12V, is directly connected to the VIN pin of LM2596S chip U9 via diode D2. LM2596S chip U9 is configured to reduce the input voltage to a stable 5V output.