CN111162916A - Serial port transmitting-receiving isolation packet capturing device and method - Google Patents
Serial port transmitting-receiving isolation packet capturing device and method Download PDFInfo
- Publication number
- CN111162916A CN111162916A CN201911259399.4A CN201911259399A CN111162916A CN 111162916 A CN111162916 A CN 111162916A CN 201911259399 A CN201911259399 A CN 201911259399A CN 111162916 A CN111162916 A CN 111162916A
- Authority
- CN
- China
- Prior art keywords
- driver
- serial port
- packet capturing
- programmer
- uplink
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/02—Details
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L49/00—Packet switching elements
- H04L49/20—Support for services
- H04L49/208—Port mirroring
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention discloses a serial port transceiving isolation packet capturing device and a method, wherein the serial port transceiving isolation packet capturing device comprises: the system comprises an uplink device, a downlink device and a first driver connected with the uplink device; the programmer is connected with the first driver, the second driver is connected with the programmer, and the downlink equipment is connected with the second driver; a third driver and a fourth driver respectively connected to the programmer. The invention can display the printing of the device and the output of the console on the console software, and can input and output simultaneously and can see the complete display of the command.
Description
Technical Field
The invention relates to the technical field of embedded driving, in particular to a serial port transmitting and receiving isolation packet capturing device and method.
Background
Serial ports are generally used as input and output tools for a console of a device, and serial port hardware works in a full-duplex state and can simultaneously receive and transmit characters. Under a multitasking and multithreading operating system, a serial port is operated by more than one task, and sometimes an A task waits for input and a B task prints information. The serial port belongs to character equipment, and the minimum unit of one-time input or output of the serial port is a character. The input of the task A and the output of the task B are performed alternately in most cases, and the task B can be output without waiting for the completion of the input of the task A. When a large amount of information is printed in the task B, the command input in the console becomes very difficult, the information output is disturbed by the flushing of the information when the operator cannot see the content input by the operator, the operator is difficult to input the command correctly, and even the equipment is abnormal or even restarted due to the input of an incorrect command, which is very serious.
In the prior art, under the condition that a large amount of output information is printed on a screen of a serial port, in order to easily see complete input information, a software mode can be used for switching printed information, the printed information can be printed only after the printed information is input and started, but some software does not have a switching function, sometimes added printing or even third-party software does not improve source codes to support switching, and under the condition, the switching of the software becomes ineffective.
As shown in fig. 1, a serial console and a device are connected directly through a serial port, so that the printing of the device and the output of the console are displayed on the console software, and if the input and the input are performed simultaneously, the output result seen on the software is very confused. Under the condition that the serial port is in the continuous screen refreshing, a user inputs a command at the serial port, the input information is cut off, and the user cannot see the input information at all, for example, when the serial port is in the continuous screen refreshing, the user inputs a show board command, and cannot see the complete display of the 2 words of the show board at all.
Accordingly, the prior art is yet to be improved and developed.
Disclosure of Invention
The invention mainly aims to provide a serial port transmitting and receiving isolation packet capturing device and a serial port transmitting and receiving isolation packet capturing method, and aims to overcome the defects in the prior art.
In order to achieve the above object, the present invention provides a serial port transmit-receive isolation packet capturing device, wherein the serial port transmit-receive isolation packet capturing device comprises:
the system comprises an uplink device, a downlink device and a first driver connected with the uplink device;
the programmer is connected with the first driver, the second driver is connected with the programmer, and the downlink equipment is connected with the second driver;
a third driver and a fourth driver respectively connected to the programmer.
Optionally, the serial port transceiving isolated packet capturing device further includes:
and the MCU is connected with the programmer.
Optionally, the serial port transceiving isolation packet capturing device, wherein the programmer is a CPLD or an FPGA.
Optionally, the serial port transceiving isolation packet capturing device, wherein the first driver, the second driver, the third driver and the fourth driver are RS232 drivers.
Optionally, the serial port transceiving isolation packet capture device, wherein the MCU is configured to manage and control the first driver, the second driver, the third driver, the fourth driver, and the encoder.
Optionally, the serial port receiving and transmitting isolation packet capturing device, wherein the encoder is connected with the MCU through an IO BUS.
Optionally, the serial port transceiving isolation packet capturing device is configured, wherein the uplink device is a router, and the downlink device is a computer.
In addition, in order to achieve the above object, the present invention further provides a serial port transceiving isolated packet capturing method based on the serial port transceiving isolated packet capturing device, wherein the serial port transceiving isolated packet capturing method comprises:
the upstream device is connected to the first driver and the downstream device is connected to the second driver;
in the uplink direction, the network message of the uplink layer is received by the second driver in the form of a digital signal, and the encoder forwards the data received by the second driver to the first driver; the data received by the second driver is forwarded to the fourth driver, and then the data is sent to message analysis equipment through the fourth driver;
in the downlink direction, the network message of the uplink layer is received by the second driver in the form of a digital signal, and the encoder forwards the data received by the second driver to the first driver; and the data received by the second driver is forwarded to the third driver and then sent to the message analysis equipment through the third driver.
In the invention, the serial port transmitting-receiving isolation packet grabbing device comprises: the system comprises an uplink device, a downlink device and a first driver connected with the uplink device; the programmer is connected with the first driver, the second driver is connected with the programmer, and the downlink equipment is connected with the second driver; a third driver and a fourth driver respectively connected to the programmer. The invention can display the printing of the device and the output of the console on the console software, and can input and output simultaneously and can see the complete display of the command.
Drawings
FIG. 1 is a diagram illustrating a serial console and a device connected via a serial port in the prior art;
FIG. 2 is a schematic diagram of an operating environment of a serial port transceiving isolated packet capturing system according to a preferred embodiment of the present invention;
FIG. 3 is a diagram showing the connection between the serial console and the device in the preferred embodiment of the serial transceiving isolation packet capturing system of the present invention;
fig. 4 is a flow chart of the method for isolated packet capture for serial port transceiving according to the preferred embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer and clearer, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As shown in fig. 2, the serial port transmitting/receiving isolating packet capturing device according to the preferred embodiment of the present invention includes:
the device comprises an uplink device, a downlink device and a first driver (RS232 driver 1) connected with the uplink device; a programmer connected with the first driver, a second driver (RS232 driver 2) connected with the programmer, and the downlink device is connected with the second driver; and a third driver (RS232 driver 3) and a fourth driver (RS232 driver 4) respectively connected with the programmer.
Driver, in this context, refers broadly to drive hardware that drives a certain type of device. In the computer field, a drive refers to a disk drive. A storage area formatted by a file system and having a drive number. The storage area may be a floppy disk, CD, hard disk, or other type of disk. Clicking the corresponding icon in "Windows explorer" or "My computer" can view the contents of the drive. The MAIN functions of the driver in the whole control link are to receive signals from a MAIN control box (NC CARD), process the signals, transfer the signals to a motor and a SENSOR (SENSOR) related to the motor, and feed back the working condition of the motor to the MAIN control box (MAIN CONTROL).
Further, the first driver, the second driver, the third driver and the fourth driver are all RS232 drivers.
Among them, RS232 standard interface (also known as EIARS-232) is one of the commonly used serial communication interface standards, which was commonly established by the american Electronic Industry Association (EIA) in conjunction with bell systems, modem manufacturers, and computer terminal manufacturers in 1970, and is named as "serial binary data exchange interface technology standard between Data Terminal Equipment (DTE) and Data Communication Equipment (DCE)". In serial communication, both communication parties are required to adopt a standard interface, so that different devices can be conveniently connected for communication. The RS-232-C interface (also known as EIARS-232-C) is the most common serial communication interface at present
Furthermore, the programmer is a CPLD (Complex Pr Programmable Logic Device Complex Programmable Logic Device, which adopts CMOS EPROM, EEPROM, flash memory, SRAM and other programming technologies, thereby forming a high-density, high-speed and low-power consumption Programmable Logic Device, the CPLD mainly consists of three parts, namely a Logic block, a Programmable interconnect channel and an I/O block) or an FPGA (Field Programmable Gate Array, which is a product further developed on the basis of Programmable devices such as PAL and GAL, and the FPGA appears as a semi-custom circuit in the Field of application specific integrated circuits, thereby not only solving the disadvantages of custom circuits, but also overcoming the limitation of Gate circuits of the original Programmable devices.
The FPGA device belongs to a semi-custom circuit in an application-specific integrated circuit, is a programmable logic array, and can effectively solve the problem of less gate circuits of the original device. The basic structure of the FPGA comprises a programmable input/output unit, a configurable logic block, a digital clock management module, an embedded block RAM, wiring resources, an embedded special hard core and a bottom layer embedded functional unit. The FPGA has the characteristics of abundant wiring resources, high repeatable programming and integration level and low investment, and is widely applied to the field of digital circuit design. The design process of the FPGA comprises algorithm design, code simulation, design and board machine debugging, wherein an algorithm framework is established by a designer and actual requirements, an EDA (electronic design automation) is used for establishing a design scheme or an HD (high definition) for compiling design codes, the code simulation is used for ensuring that the design scheme meets the actual requirements, finally, board level debugging is carried out, related files are downloaded into an FPGA chip by a configuration circuit, and the actual operation effect is verified.
Further, the serial port transceiving isolation packet capturing device further comprises: the MCU (micro controller Unit) or the Single Chip Microcomputer (Single Chip Microcomputer) is connected with the programmer, the frequency and the specification of a Central Processing Unit (CPU) are properly reduced, peripheral interfaces such as a memory (memory), a counter (Timer), a USB (universal serial bus), an A/D (analog/digital) converter, a UART (universal asynchronous receiver transmitter), a PLC (programmable logic controller), a DMA (direct memory access), and even an LCD (liquid crystal display) driving circuit are integrated on a Single Chip to form a Chip-level computer, and different combination control is carried out on different application occasions. Such as mobile phones, PC peripherals, remote controls, to automotive electronics, industrial stepper motors, robotic arm controls, etc., see the silhouette of the MCU. The MCU is used for controlling the first driver, the second driver, the third driver, the fourth driver and the encoder.
Further, the encoder is connected to the MCU through an IO BUS (IO BUS). Bus (Bus) is a common communication trunk line for transmitting information between various functional units of a computer, and is a transmission line bundle composed of wires, and the Bus of the computer can be divided into a data Bus, an address Bus and a control Bus according to the type of information transmitted by the computer, and is used for transmitting data, data addresses and control signals respectively. The bus is an internal structure, it is a public channel for CPU, internal memory, input and output equipment to transfer information, all the components of the host computer are connected by means of bus, and the external equipment is connected with bus by means of correspondent interface circuit so as to form the computer hardware system. In a computer system, a common path for transferring information between components is called a bus, and a microcomputer is connected to each functional component in a bus structure.
The uplink device may be a router, and the downlink device may be a computer. For example, a computer is connected to a router to surf the internet, the router is an uplink device, and the computer is a downlink device of the router.
Further, as shown in fig. 3, a serial console (generally, a PC) is connected to a port P1 of the apparatus (serial transceiver isolator) of the present invention, and a serial port of the apparatus is connected to a port P0 of the apparatus of the present invention; using two additional computers, one for serial port printing of special receiving equipment, and connecting to P2 port; the other is specially used for receiving the command output of the console and is connected with a P3 port; the output information of the equipment is displayed on the PC connected with the console and the P2 port at the same time; command information of the console is displayed on the PC connected with the software of the console and the P3 port; thus, serial port input and output can not interfere with each other.
Further, based on the above serial port transceiving isolated packet capturing device, the present invention further provides a serial port transceiving isolated packet capturing method, as shown in fig. 4, the serial port transceiving isolated packet capturing method comprising:
step S10, the upstream device is connected to the first driver, and the downstream device is connected to the second driver;
step S20, in the uplink direction, the network packet of the uplink layer is received by the second driver in the form of a digital signal, and the encoder forwards the data received by the second driver to the first driver; the data received by the second driver is forwarded to the fourth driver, and then the data is sent to message analysis equipment through the fourth driver;
step S30, in the downlink direction, the network message of the uplink layer is received by the second driver in the form of digital signal, and the encoder forwards the data received by the second driver to the first driver; and the data received by the second driver is forwarded to the third driver and then sent to the message analysis equipment through the third driver.
Specifically, two communication parties of the packet to be grabbed are firstly connected to an uplink port and a downlink port of the serial port transceiving isolated packet grabbing device, as shown in fig. 2, it is assumed that the RS232 driver 1 is connected to an uplink device, and the RS232 driver 2 is connected to a downlink device. The upstream direction is the lower data flow in fig. 2, and the downstream direction is the upper data flow in fig. 2. The network message of the uplink layer is received by the physical layer chip RS232 driver 2 in the form of digital signal, and then the CPLD/FPGA in the device forwards the data received by the RS232 driver 2 to the transmitting direction of the RS232 driver 1 (for RS232 driver interface, RXD of the driver 2 is connected to TXD of the driver 1), and at the same time, forwards the data received by the RS232 driver 2 to the RS232 driver 4, and then to the message analysis device. The same applies to the red data stream in the downstream direction, which is copied to the interface on which the RS232 driver 3 is located. Thus, the bidirectional data of both communication parties are respectively copied to the interfaces where the RS232 drivers 3 and 4 are located, and the MCU in the figure is used for managing the CPLD/FPGA.
In summary, the present invention provides a serial port transceiving isolated packet capturing device and method, wherein the serial port transceiving isolated packet capturing device comprises: the system comprises an uplink device, a downlink device and a first driver connected with the uplink device; the programmer is connected with the first driver, the second driver is connected with the programmer, and the downlink equipment is connected with the second driver; a third driver and a fourth driver respectively connected to the programmer. The invention can display the printing of the device and the output of the console on the console software, and can input and output simultaneously and can see the complete display of the command.
Of course, it will be understood by those skilled in the art that all or part of the processes of the methods of the above embodiments may be implemented by a computer program, which may be stored in a computer readable storage medium, and may include the processes of the above method embodiments when executed. The storage medium may be a memory, a magnetic disk, an optical disk, etc.
It is to be understood that the invention is not limited to the examples described above, but that modifications and variations may be effected thereto by those of ordinary skill in the art in light of the foregoing description, and that all such modifications and variations are intended to be within the scope of the invention as defined by the appended claims.
Claims (8)
1. The utility model provides a packet device is grabbed in serial ports receiving and dispatching isolation which characterized in that, packet device is grabbed in serial ports receiving and dispatching isolation includes:
the system comprises an uplink device, a downlink device and a first driver connected with the uplink device;
the programmer is connected with the first driver, the second driver is connected with the programmer, and the downlink equipment is connected with the second driver;
a third driver and a fourth driver respectively connected to the programmer.
2. The device for grabbing packets through serial port transmit-receive isolation according to claim 1, wherein the device for grabbing packets through serial port transmit-receive isolation further comprises:
and the MCU is connected with the programmer.
3. The serial port transceiving isolation packet capture device according to claim 1, wherein the programmer is a CPLD or an FPGA.
4. The serial port transceiving isolated packet capturing device according to claim 1, wherein the first driver, the second driver, the third driver and the fourth driver are all RS232 drivers.
5. The serial port transceiving isolated packet capture device according to claim 2, wherein the MCU is configured to manage the first driver, the second driver, the third driver, the fourth driver, and the encoder.
6. The serial port transceiving isolated packet capturing device according to claim 2, wherein the encoder is connected with the MCU through an IO BUS.
7. The serial port transceiving isolated packet capturing device according to claim 1, wherein the uplink device is a router, and the downlink device is a computer.
8. A serial port transceiving isolation packet capturing method based on the serial port transceiving isolation packet capturing device of any one of claims 1 to 7, wherein the serial port transceiving isolation packet capturing method comprises the following steps:
the upstream device is connected to the first driver and the downstream device is connected to the second driver;
in the uplink direction, the network message of the uplink layer is received by the second driver in the form of a digital signal, and the encoder forwards the data received by the second driver to the first driver; the data received by the second driver is forwarded to the fourth driver, and then the data is sent to message analysis equipment through the fourth driver;
in the downlink direction, the network message of the uplink layer is received by the second driver in the form of a digital signal, and the encoder forwards the data received by the second driver to the first driver; and the data received by the second driver is forwarded to the third driver and then sent to the message analysis equipment through the third driver.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911259399.4A CN111162916A (en) | 2019-12-10 | 2019-12-10 | Serial port transmitting-receiving isolation packet capturing device and method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911259399.4A CN111162916A (en) | 2019-12-10 | 2019-12-10 | Serial port transmitting-receiving isolation packet capturing device and method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111162916A true CN111162916A (en) | 2020-05-15 |
Family
ID=70556705
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911259399.4A Pending CN111162916A (en) | 2019-12-10 | 2019-12-10 | Serial port transmitting-receiving isolation packet capturing device and method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111162916A (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030137940A1 (en) * | 1998-11-24 | 2003-07-24 | Schwartz Steven J. | Pass/drop apparatus and method for network switching node |
CN201114167Y (en) * | 2007-08-20 | 2008-09-10 | 浙江纺织服装职业技术学院 | Dynamically reconfigurable multipath serial interface connector |
KR20130093845A (en) * | 2012-01-27 | 2013-08-23 | 주식회사 시큐아이 | Network device and method of managing link thereof |
CN104008077A (en) * | 2014-05-07 | 2014-08-27 | 武汉精测电子技术股份有限公司 | Device and method for achieving serial port package capturing based on single chip microcomputer |
CN204030716U (en) * | 2013-11-21 | 2014-12-17 | 国家电网公司 | Be applied to intelligent substation network of network message and intercept instrument |
CN105282151A (en) * | 2015-09-18 | 2016-01-27 | 北京锐安科技有限公司 | System for separation treatment of data message |
-
2019
- 2019-12-10 CN CN201911259399.4A patent/CN111162916A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030137940A1 (en) * | 1998-11-24 | 2003-07-24 | Schwartz Steven J. | Pass/drop apparatus and method for network switching node |
CN201114167Y (en) * | 2007-08-20 | 2008-09-10 | 浙江纺织服装职业技术学院 | Dynamically reconfigurable multipath serial interface connector |
KR20130093845A (en) * | 2012-01-27 | 2013-08-23 | 주식회사 시큐아이 | Network device and method of managing link thereof |
CN204030716U (en) * | 2013-11-21 | 2014-12-17 | 国家电网公司 | Be applied to intelligent substation network of network message and intercept instrument |
CN104008077A (en) * | 2014-05-07 | 2014-08-27 | 武汉精测电子技术股份有限公司 | Device and method for achieving serial port package capturing based on single chip microcomputer |
CN105282151A (en) * | 2015-09-18 | 2016-01-27 | 北京锐安科技有限公司 | System for separation treatment of data message |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102033807B (en) | SOC (System On Chip) chip debugging equipment, method and device | |
CN104484301B (en) | A kind of IO bus units based on FPGA with self-recognition function | |
CN106453383A (en) | UART (universal asynchronous receiver/transmitter)-based master-slave multi-processor communication system and method | |
CN100386754C (en) | Device and method for operating USB interface device | |
CN103095537A (en) | Numerical control device capable of concurrently controlling two-class industrial Ethernet bus slave station equipment | |
CN101763333A (en) | Bus controller and method for realizing multi-host communication | |
CN102279827A (en) | Multifunctional communication transit box | |
CN105117319A (en) | Method for realizing real-time monitoring of multi-channel MDIO (Management Data Input Output) devices based on FPGA | |
CN107391419A (en) | Support the universal serial bus hub equipment of more main frames and automobile-used main frame | |
CN106649021A (en) | Testing device for PCIe slave device | |
US6825827B2 (en) | Information processing apparatus | |
CN109358570A (en) | Support the controller and its communicating control method of a variety of bus driver communications protocol | |
US7793024B2 (en) | Method for utilizing a PCI-Express bus to communicate between system chips | |
CN103941625A (en) | Can bus data transmission monitoring system | |
CN102445981B (en) | Data transmission system and data transmission method | |
CN111162916A (en) | Serial port transmitting-receiving isolation packet capturing device and method | |
CN102662894B (en) | General bus slave unit interface | |
CN110795369A (en) | Method and terminal for realizing MIDO slave function based on GPIO pin | |
CN105068962A (en) | I2C controller access method and I2C controller access system | |
CN212647461U (en) | Synchronous or asynchronous serial communication control circuit based on PCI bus | |
CN203554485U (en) | CAN bus test equipment | |
CN114513383A (en) | Real-time Ethernet field bus data packet processing method based on original socket | |
CN101867510A (en) | Plate-level double system interconnecting method | |
CN114513382B (en) | Real-time Ethernet field bus network data packet processing method based on network card | |
Depari et al. | IEEE1451 smart sensors supporting USB connectivity |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200515 |
|
RJ01 | Rejection of invention patent application after publication |