[go: up one dir, main page]

CN116055534A - A data forwarding system and method for multi-serial devices - Google Patents

A data forwarding system and method for multi-serial devices Download PDF

Info

Publication number
CN116055534A
CN116055534A CN202211517836.XA CN202211517836A CN116055534A CN 116055534 A CN116055534 A CN 116055534A CN 202211517836 A CN202211517836 A CN 202211517836A CN 116055534 A CN116055534 A CN 116055534A
Authority
CN
China
Prior art keywords
serial port
data
serial
server
forwarding
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
Application number
CN202211517836.XA
Other languages
Chinese (zh)
Inventor
张朋飞
周厚明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Maiwei Communications Co ltd
Original Assignee
Wuhan Maiwei Communications Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Wuhan Maiwei Communications Co ltd filed Critical Wuhan Maiwei Communications Co ltd
Priority to CN202211517836.XA priority Critical patent/CN116055534A/en
Publication of CN116055534A publication Critical patent/CN116055534A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • H04L67/125Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks involving control of end-device applications over a network
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/40006Architecture of a communication node
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0002Serial port, e.g. RS232C
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

本发明提出了一种多串口设备数据转发系统及方法,涉及工业自动化通信领域,所述系统包括多个控制设备、串口服务器、多个被控制设备和上位机;所述多个控制设备与串口服务器通信连接,用于发送数据到串口服务器;所述多个被控制设备与串口服务器通信连接,用于接收串口服务器转发的数据;所述上位机与串口服务器通信连接,用于接收串口服务器转发的数据;所述串口服务器分别与多个控制设备、多个被控制设备和上位机通信连接,用于接收和发送数据;所述串口服务器包括串口数据转发单元和网口;所述串口数据转发单元与网口通信连接,用于对数据进行信令解析并转发;所述网口与串口数据转发单元和上位机通信连接,用于将数据转发到上位机。

Figure 202211517836

The present invention proposes a multi-serial device data forwarding system and method, which relate to the field of industrial automation communication. The system includes a plurality of control devices, a serial port server, a plurality of controlled devices and a host computer; The server communication connection is used to send data to the serial port server; the plurality of controlled devices are connected to the serial port server for communication, and are used to receive the data forwarded by the serial port server; data; the serial port server is respectively connected with a plurality of control devices, a plurality of controlled devices and the host computer for receiving and sending data; the serial port server includes a serial port data forwarding unit and a network port; the serial port data forwarding The unit communicates with the network port for analyzing and forwarding the data signaling; the network port communicates with the serial port data forwarding unit and the host computer for forwarding the data to the host computer.

Figure 202211517836

Description

一种多串口设备数据转发系统及方法A data forwarding system and method for multi-serial port devices

技术领域technical field

本发明涉及工业自动化通信领域,尤其涉及一种多串口设备数据转发系统及方法。The invention relates to the field of industrial automation communication, in particular to a multi-serial device data forwarding system and method.

背景技术Background technique

目前工业现场仍然存在很多利用RS485/422/232,CAN等工业总线实现工业自动化数据采集和控制的工业自动化应用;基于工业4.0数据采集和控制的需求,工业现场通过串口服务器/CAN服务器完成工业总线和以太网的对接;工业现场的串口设备一般通过串口将通信数据发送至串口服务器,由串口服务器将接收的通信数据转换为IP数据包发送到远程服务器上;远程服务器将接收到的IP数据包还原成串口数据,再将串口数据传输至其他网元,这样便相当于把拉长了串口线,从而可以实现更远距离的传输。At present, there are still many industrial automation applications that use RS485/422/232, CAN and other industrial buses to realize industrial automation data acquisition and control; based on the needs of industry 4.0 data acquisition and control, industrial sites complete industrial bus through serial server/CAN server Docking with Ethernet; the serial device on the industrial site generally sends the communication data to the serial server through the serial port, and the serial server converts the received communication data into IP data packets and sends them to the remote server; the remote server sends the received IP data packets Restore to serial port data, and then transmit the serial port data to other network elements, which is equivalent to lengthening the serial port cable, so as to achieve longer distance transmission.

在实际需求中,人们希望来自不同串口的数据可以转发给多个不同的其他串口,而目前的串口数据转发方法要么是通过位于第三方设备上的虚拟串口软件做中转,要么是在串口服务器上设置一个转发服务模块,而上述两种方法都有一个共同的缺点,一旦设置转发后,来自某个串口的所有数据都有转发给另外一个串口,并不能同时分发给另外几个串口。In actual demand, people hope that the data from different serial ports can be forwarded to multiple different other serial ports, and the current serial port data forwarding method is either through the virtual serial port software located on the third-party device for relay, or on the serial port server. Set a forwarding service module, and the above two methods have a common disadvantage. Once the forwarding is set, all data from a serial port will be forwarded to another serial port, and cannot be distributed to several other serial ports at the same time.

中国专利CN102546840A《对虚拟串口和物理串口进行绑定的方法、装置及系统》公开了一种对虚拟串口和物理串口进行绑定的方法、装置及系统,用以降低虚拟串口的管理复杂度,该方法就是通过第三方设备上的虚拟串口对物理串口进行绑定,来实现串口间的数据转发,然而这种绑定只能让来自某个串口的数据同时转发给同一个其他串口,若想再转发给另外一个串口则需要再转发一次。Chinese patent CN102546840A "Method, device and system for binding virtual serial port and physical serial port" discloses a method, device and system for binding virtual serial port and physical serial port to reduce the management complexity of virtual serial port, This method is to bind the physical serial port through the virtual serial port on the third-party device to realize data forwarding between serial ports. However, this binding can only forward the data from one serial port to the same other serial port at the same time. If it is forwarded to another serial port, it needs to be forwarded again.

发明内容Contents of the invention

有鉴于此,本发明提出了一种多串口设备数据转发系统及方法,用于同时将一个串口的数据转发给多个不同的其他串口。In view of this, the present invention proposes a multi-serial port device data forwarding system and method, which are used to simultaneously forward the data of one serial port to multiple different other serial ports.

本发明的技术方案是这样实现的:一方面,本发明提供了一种多串口设备数据转发系统,所述系统包括多个控制设备、串口服务器、多个被控制设备和上位机;The technical solution of the present invention is realized as follows: On the one hand, the present invention provides a multi-serial port device data forwarding system, the system includes multiple control devices, serial port servers, multiple controlled devices and a host computer;

所述多个控制设备与串口服务器通信连接,用于发送数据到串口服务器;The plurality of control devices are communicatively connected to the serial port server for sending data to the serial port server;

所述多个被控制设备与串口服务器通信连接,用于接收串口服务器转发的数据;The multiple controlled devices are communicatively connected to the serial port server for receiving data forwarded by the serial port server;

所述上位机与串口服务器通信连接,用于接收串口服务器转发的数据;The host computer communicates with the serial port server for receiving data forwarded by the serial port server;

所述串口服务器分别与多个控制设备、多个被控制设备和上位机通信连接,用于接收和发送数据;The serial port server is respectively connected to multiple control devices, multiple controlled devices and host computer for receiving and sending data;

所述串口服务器包括串口数据转发单元和网口;The serial port server includes a serial port data forwarding unit and a network port;

所述串口数据转发单元与网口通信连接,用于对数据进行信令解析并转发;The serial port data forwarding unit is communicatively connected to the network port, and is used for signaling analysis and forwarding of data;

所述网口与串口数据转发单元和上位机通信连接,用于将数据转发到上位机。The network port is communicatively connected with the serial port data forwarding unit and the host computer for forwarding data to the host computer.

优选的,所述多个控制设备包括特殊设备和普通设备,特殊设备的数据需要信令解析并转发;普通设备的数据不需要信令解析,直接透传。Preferably, the multiple control devices include special devices and common devices, and the data of the special devices needs to be analyzed and forwarded by signaling; the data of the common devices does not need to be analyzed by signaling, and is directly transparently transmitted.

优选的,所述特殊设备生成特殊报文到串口,串口包括RS485、RS422和RS232。Preferably, the special device generates a special message to the serial port, and the serial port includes RS485, RS422 and RS232.

优选的,所述特殊报文的内容包括是否转发给其他串口、是否转发给网络、是否转发给串口1、…、是否转发到串口n-1、是否转发到串口n和实际的用户数据,n为串口服务器串口数。Preferably, the content of the special message includes whether to forward to other serial ports, whether to forward to the network, whether to forward to serial port 1, ..., whether to forward to serial port n-1, whether to forward to serial port n and actual user data, n It is the serial port number of the serial server.

另一方面,本发明还提供一种多串口设备数据转发方法,包括以下步骤:On the other hand, the present invention also provides a multi-serial device data forwarding method, comprising the following steps:

S1,判断串口对应控制设备是否需要转发数据,若是,则在串口服务器上配置该串口数据是否需要转发给其他串口的状态为able;否则,配置其状态为disable;S1, determine whether the control device corresponding to the serial port needs to forward data, if so, configure the state of whether the serial port data needs to be forwarded to other serial ports on the serial port server as enable; otherwise, configure its state as disable;

S2,当串口对应控制设备不需要转发数据时,对数据直接透传;当串口对应控制设备需要转发数据时,操控控制设备形成特殊报文;S2, when the control device corresponding to the serial port does not need to forward data, directly transparently transmit the data; when the control device corresponding to the serial port needs to forward data, control the control device to form a special message;

S3,根据特殊报文的内容,串口数据转发单元对其做信令解析,根据解析结果将控制设备的串口数据转发。S3, according to the content of the special message, the serial port data forwarding unit performs signaling analysis on it, and forwards the serial port data of the control device according to the analysis result.

优选的,步骤S1具体包括:Preferably, step S1 specifically includes:

在串口服务器上配置该串口数据是否需要转发给其他串口的状态为able时,该串口数据必须至少包含4bit的头,包括是否转发给其他串口和是否转发给网络的信息。When configuring whether the serial port data needs to be forwarded to other serial ports on the serial port server is enabled, the serial port data must contain at least a 4-bit header, including whether to forward to other serial ports and whether to forward to the network.

优选的,步骤S2具体包括:Preferably, step S2 specifically includes:

当串口对应控制设备不需要转发数据时,串口数据不需要数据包头,直接透传,发出实际的用户数据。When the corresponding control device of the serial port does not need to forward data, the data of the serial port does not need a data packet header, and is directly transparently transmitted, and the actual user data is sent.

优选的,步骤S2还包括:Preferably, step S2 also includes:

所述特殊报文包括多个字节,字节中的每一个比特分别定义是否转发给其他串口、是否转发给网络、后续转发标志位长度、是否转发给串口1、…、是否转发到串口n-1、是否转发到串口n和实际的用户数据,The special message includes a plurality of bytes, and each bit in the byte defines whether to forward to other serial ports, whether to forward to the network, the length of the subsequent forwarding flag, whether to forward to serial port 1, ..., whether to forward to serial port n -1. Whether to forward to serial port n and actual user data,

优选的,步骤S3具体包括:Preferably, step S3 specifically includes:

串口数据转发单元对串口数据做信令解析,其第一个字节中的第一个比特为0则表示不转发给其他串口,为1则表示转发给其他串口,按照顺序判断是否转发给其他串口、是否转发给网络、后续转发标志位长度、是否转发给串口1、…、是否转发到串口n-1、是否转发到串口n,最后携带的是实际的用户数据。The serial port data forwarding unit performs signaling analysis on the serial port data. If the first bit in the first byte is 0, it means not forwarded to other serial ports, and if it is 1, it means forwarded to other serial ports. Determine whether to forward it to other Serial port, whether to forward to the network, the length of the subsequent forwarding flag, whether to forward to serial port 1, ..., whether to forward to serial port n-1, whether to forward to serial port n, and finally carry the actual user data.

优选的,步骤S3还包括:Preferably, step S3 also includes:

当是否转发给其他串口的比特为0时,后续转发标志位长度和是否转发给串口n都不存在;当是否转发给其他串口的比特为1时,后续转发标志位长度和是否转发给串口n必须存在,后续转发标志位长度告知该特殊报文中涉及的最大串口号,是否转发给串口n的比特为1则对应需要转发,否则不转发。When the bit of whether to forward to other serial ports is 0, the length of the subsequent forwarding flag and whether to forward to serial port n do not exist; when the bit of whether to forward to other serial ports is 1, the length of the subsequent forwarding flag and whether to forward to serial port n It must exist, and the length of the subsequent forwarding flag tells the maximum serial port number involved in the special message. If the bit of whether to forward to serial port n is 1, it corresponds to the need to forward, otherwise it will not be forwarded.

本发明的一种多串口设备数据转发系统及方法相对于现有技术具有以下有益效果:Compared with the prior art, a multi-serial device data forwarding system and method of the present invention has the following beneficial effects:

(1)通过控制设备形成特殊报文,经由串口服务器上的串口数据转发单元对其做信令解析,使得来自同一个控制设备的串口数据可以分发给不同的串口,满足特定需求;(1) Form a special message through the control device, and perform signaling analysis on it through the serial port data forwarding unit on the serial port server, so that the serial port data from the same control device can be distributed to different serial ports to meet specific needs;

(2)通过区分需要转发数据的控制设备和不需要转发数据的控制设备,在保持通用基本功能,即对于串口数据的正常传送的情况下,还能针对特定场景,满足特殊设备的特殊需求,将其发出的串口数据转发到多个不同串口;(2) By distinguishing between control devices that need to forward data and control devices that do not need to forward data, while maintaining the general basic functions, that is, the normal transmission of serial data, it can also meet the special needs of special devices for specific scenarios, Forward the serial port data sent by it to multiple different serial ports;

(3)将是否转发给其他串口、是否转发给网络、后续转发标志位长度、是否转发给串口n等信息与实际的用户数据组合在一起形成特殊报文,在不损坏原串口数据的同时,给其加上“识别码”,与其他数据区分开来,便于串口数据转发到指定的串口。(3) Combine information such as whether to forward to other serial ports, whether to forward to the network, the length of the subsequent forwarding flag, whether to forward to serial port n, etc., and the actual user data to form a special message, without damaging the original serial port data. Add an "identification code" to it to distinguish it from other data, so that the serial port data can be forwarded to the designated serial port.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without creative work.

图1为本发明的一种多串口设备数据转发系统结构图;Fig. 1 is a kind of multi-serial port device data forwarding system structural diagram of the present invention;

图2为本发明的一种多串口设备数据转发方法流程图;Fig. 2 is a kind of multi-serial port device data forwarding method flowchart of the present invention;

图3为本发明的一种多串口设备数据转发方法的信令格式图。FIG. 3 is a signaling format diagram of a data forwarding method for multiple serial port devices according to the present invention.

具体实施方式Detailed ways

下面将结合本发明实施方式,对本发明实施方式中的技术方案进行清楚、完整地描述,显然,所描述的实施方式仅仅是本发明一部分实施方式,而不是全部的实施方式。基于本发明中的实施方式,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施方式,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the implementation manners in the present invention, all other implementation manners obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of the present invention.

实施例一Embodiment one

提供一种多串口设备数据转发系统,如图1所示,所述系统包括多个控制设备、串口服务器、多个被控制设备和上位机;A multi-serial device data forwarding system is provided, as shown in Figure 1, the system includes a plurality of control devices, a serial port server, a plurality of controlled devices and a host computer;

多个控制设备与串口服务器通信连接,用于发送数据到串口服务器;Multiple control devices communicate with the serial port server for sending data to the serial port server;

多个被控制设备与串口服务器通信连接,用于接收串口服务器转发的数据;Multiple controlled devices communicate with the serial port server to receive the data forwarded by the serial port server;

上位机与串口服务器通信连接,用于接收串口服务器转发的数据;The upper computer communicates with the serial port server to receive the data forwarded by the serial port server;

串口服务器分别与多个控制设备、多个被控制设备和上位机通信连接,用于接收和发送数据;The serial port server is respectively connected with multiple control devices, multiple controlled devices and the host computer for receiving and sending data;

串口服务器包括串口数据转发单元和网口;The serial port server includes a serial port data forwarding unit and a network port;

串口数据转发单元与网口通信连接,用于对数据进行信令解析并转发;The serial port data forwarding unit communicates with the network port, and is used for signaling analysis and forwarding of data;

网口与串口数据转发单元和上位机通信连接,用于将数据转发到上位机。The network port communicates with the serial port data forwarding unit and the host computer for forwarding data to the host computer.

串口服务器内部需要有一个“串口数据转发单元”;负责根据配置对来自特定端口的数据进行信令解析,并根据信令做数据转发。There needs to be a "serial port data forwarding unit" inside the serial port server; it is responsible for analyzing the signaling of the data from a specific port according to the configuration, and forwarding the data according to the signaling.

所述多个控制设备包括特殊设备和普通设备,特殊设备的数据需要信令解析并转发;普通设备的数据不需要信令解析,直接透传。The multiple control devices include special devices and common devices, and the data of the special devices needs to be analyzed and forwarded by signaling; the data of the common devices does not need to be analyzed by signaling, and is directly transparently transmitted.

控制显示屏等特殊设备根据需要生成并发送特殊报文到串口,串口可以是RS485、RS422也可以是RS232;Control display and other special devices to generate and send special messages to the serial port as needed, the serial port can be RS485, RS422 or RS232;

除特殊设备的串口数据需要进行信令解析外,其他串口的数据不需要进行解析,直接透传。Except for the serial port data of special equipment that needs to be analyzed by signaling, the data of other serial ports does not need to be parsed and can be directly transparently transmitted.

所述特殊设备生成特殊报文到串口,串口包括RS485、RS422和RS232。The special device generates a special message to the serial port, and the serial port includes RS485, RS422 and RS232.

所述特殊报文的内容包括是否转发给其他串口、是否转发给网络、是否转发给串口1、…、是否转发到串口n-1、是否转发到串口n和实际的用户数据,n为串口服务器串口数。The content of the special message includes whether to forward to other serial ports, whether to forward to the network, whether to forward to serial port 1, ..., whether to forward to serial port n-1, whether to forward to serial port n and actual user data, n is the serial port server Number of serial ports.

哪些串口的数据需要解析,通过在web页面上设置“该串口的数据是否需要转发给其他串口”。Which serial port data needs to be parsed, by setting "whether the data of this serial port needs to be forwarded to other serial ports" on the web page.

实施例二Embodiment two

提供一种多串口设备数据转发方法,如图2所示,包括以下步骤:A data forwarding method for multi-serial devices is provided, as shown in Figure 2, comprising the following steps:

S1,判断串口对应控制设备是否需要转发数据,若是,则在串口服务器上配置该串口数据是否需要转发给其他串口的状态为able;否则,配置其状态为disable;S1, determine whether the control device corresponding to the serial port needs to forward data, if so, configure the state of whether the serial port data needs to be forwarded to other serial ports on the serial port server as enable; otherwise, configure its state as disable;

S2,当串口对应控制设备不需要转发数据时,对数据直接透传;当串口对应控制设备需要转发数据时,操控控制设备形成特殊报文;S2, when the control device corresponding to the serial port does not need to forward data, directly transparently transmit the data; when the control device corresponding to the serial port needs to forward data, control the control device to form a special message;

S3,根据特殊报文的内容,串口数据转发单元对其做信令解析,根据解析结果将控制设备的串口数据转发。S3, according to the content of the special message, the serial port data forwarding unit performs signaling analysis on it, and forwards the serial port data of the control device according to the analysis result.

用户在串口服务器配置界面上设置“来自串口1的数据需要转发给其他串口”,串口数据转发单元保存该配置。The user sets "data from serial port 1 needs to be forwarded to other serial ports" on the serial port server configuration interface, and the serial port data forwarding unit saves the configuration.

当用户在“控制显示屏01”按下按键时,该控制屏后台程序可以根据配置决定该命令是否转发给其他串口,形成特殊报文。串口可以是RS485、RS422和RS232等。When the user presses a button on the "control display screen 01", the background program of the control screen can decide whether to forward the command to other serial ports according to the configuration to form a special message. The serial port can be RS485, RS422 and RS232 etc.

步骤S1具体包括:Step S1 specifically includes:

在串口服务器上配置该串口数据是否需要转发给其他串口的状态为able时,该串口数据必须至少包含4bit的头,包括是否转发给其他串口和是否转发给网络的信息。When configuring whether the serial port data needs to be forwarded to other serial ports on the serial port server is enabled, the serial port data must contain at least a 4-bit header, including whether to forward to other serial ports and whether to forward to the network.

步骤S2具体包括:Step S2 specifically includes:

当串口对应控制设备不需要转发数据时,串口数据不需要数据包头,直接透传,发出实际的用户数据。When the corresponding control device of the serial port does not need to forward data, the data of the serial port does not need a data packet header, and is directly transparently transmitted, and the actual user data is sent.

所述特殊报文包括多个字节,字节中的每一个比特分别定义是否转发给其他串口、是否转发给网络、后续转发标志位长度、是否转发给串口1、…、是否转发到串口n-1、是否转发到串口n和实际的用户数据,The special message includes a plurality of bytes, and each bit in the byte defines whether to forward to other serial ports, whether to forward to the network, the length of the subsequent forwarding flag, whether to forward to serial port 1, ..., whether to forward to serial port n -1. Whether to forward to serial port n and actual user data,

步骤S3具体包括:Step S3 specifically includes:

串口数据转发单元对串口数据做信令解析,其第一个字节中的第一个比特为0则表示不转发给其他串口,为1则表示转发给其他串口,按照顺序判断是否转发给其他串口、是否转发给网络、后续转发标志位长度、是否转发给串口1、…、是否转发到串口n-1、是否转发到串口n,最后携带的是实际的用户数据。The serial port data forwarding unit performs signaling analysis on the serial port data. If the first bit in the first byte is 0, it means not forwarded to other serial ports, and if it is 1, it means forwarded to other serial ports. Determine whether to forward it to other Serial port, whether to forward to the network, the length of the subsequent forwarding flag, whether to forward to serial port 1, ..., whether to forward to serial port n-1, whether to forward to serial port n, and finally carry the actual user data.

如果数据需要转发给其他串口,则信令中“是否转发给其他串口”设置为1,否则设置为0;If the data needs to be forwarded to other serial ports, set "whether to forward to other serial ports" in the signaling to 1, otherwise set to 0;

如果数据需要转发给网络上设备,则信令中“是否转发给网络”设置为1,否则设置为0;If the data needs to be forwarded to the device on the network, the "whether to forward to the network" in the signaling is set to 1, otherwise it is set to 0;

当是否转发给其他串口的比特为0时,后续转发标志位长度和是否转发给串口n都不存在;当是否转发给其他串口的比特为1时,后续转发标志位长度和是否转发给串口n必须存在,后续转发标志位长度告知该特殊报文中涉及的最大串口号,是否转发给串口n的比特为1则对应需要转发,否则不转发。When the bit of whether to forward to other serial ports is 0, the length of the subsequent forwarding flag and whether to forward to serial port n do not exist; when the bit of whether to forward to other serial ports is 1, the length of the subsequent forwarding flag and whether to forward to serial port n It must exist, and the length of the subsequent forwarding flag tells the maximum serial port number involved in the special message. If the bit of whether to forward to serial port n is 1, it corresponds to the need to forward, otherwise it will not be forwarded.

当某个设备不需要转发数据时,在串口服务器上的配置页面上配置“该串口的数据是否需要转发给其他串口”为disable。此时不需要数据包头,该串口发出的就是“实际的用户数据”。When a device does not need to forward data, configure "whether the data of this serial port needs to be forwarded to other serial ports" on the configuration page of the serial port server as disable. At this time, the data packet header is not needed, and what the serial port sends out is "actual user data".

结合图1和图2,“控制显示屏01”程序发送串口数据到串口服务器的串口1;Combined with Figure 1 and Figure 2, the "Control Display 01" program sends serial data to serial port 1 of the serial server;

串口服务器的“串口数据转发单元”判断用户是否设置了“该串口的数据是否需要转发给其他串口”为enable(默认是disable);The "serial port data forwarding unit" of the serial port server judges whether the user has set "whether the data of this serial port needs to be forwarded to other serial ports" as enable (default is disable);

如果是enable,则按照“信令格式”(如图3)中解析数据;If it is enable, then parse the data according to the "signaling format" (as shown in Figure 3);

解析出是否需要转发给网络;并根据该标志位控制数据是否转发给网络;如果需要,则按照配置的规则,转发给对应的一个或者多个网络设备。Analyze whether it needs to be forwarded to the network; and control whether the data is forwarded to the network according to the flag bit; if necessary, forward it to one or more corresponding network devices according to the configured rules.

解析出是否需要转给串口;如果需要,则解析信令中串口bit位,并按照bit位指示,发送给对应的串口。如果不需要,则数据不会发送其他串口。Analyze whether it needs to be transferred to the serial port; if necessary, analyze the serial port bit in the signaling, and send it to the corresponding serial port according to the bit instruction. Data is not sent to other serial ports if not required.

信令格式如图3所示,以8串口服务器为例:The signaling format is shown in Figure 3, taking the server with 8 serial ports as an example:

当某个设备不需要转发数据时,在串口服务器上的配置页面上配置“该串口的数据是否需要转发给其他串口”为disable。此时不需要数据包头,该串口发出的就是“实际的用户数据”;When a device does not need to forward data, configure "whether the data of this serial port needs to be forwarded to other serial ports" on the configuration page of the serial port server as disable. At this time, the data packet header is not needed, and the serial port sends out "actual user data";

当在串口服务器上的配置页面上配置“该串口的数据是否需要转发给其他串口”为enable时,对应串口的设备必须发出的串口数据必须至少包含4bit的头,包含“是否转发给其他串口”和“是否转发给网络”信息。When configuring "whether the data of this serial port needs to be forwarded to other serial ports" on the configuration page of the serial port server as enable, the serial data sent by the device corresponding to the serial port must contain at least a 4-bit header, including "whether to forward to other serial ports" and "Forward to network" information.

以上所述仅为本发明的较佳实施方式而已,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above description is only a preferred embodiment of the present invention, and is not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included in the scope of the present invention. within the scope of protection.

Claims (10)

1.一种多串口设备数据转发系统,所述系统包括多个控制设备、串口服务器、多个被控制设备和上位机;1. A multi-serial device data forwarding system, said system comprising a plurality of control devices, a serial port server, a plurality of controlled devices and a host computer; 所述多个控制设备与串口服务器通信连接,用于发送数据到串口服务器;The plurality of control devices are communicatively connected to the serial port server for sending data to the serial port server; 所述多个被控制设备与串口服务器通信连接,用于接收串口服务器转发的数据;The multiple controlled devices are communicatively connected to the serial port server for receiving data forwarded by the serial port server; 所述上位机与串口服务器通信连接,用于接收串口服务器转发的数据;The host computer communicates with the serial port server for receiving data forwarded by the serial port server; 所述串口服务器分别与多个控制设备、多个被控制设备和上位机通信连接,用于接收和发送数据;The serial port server is respectively connected to multiple control devices, multiple controlled devices and host computer for receiving and sending data; 所述串口服务器包括串口数据转发单元和网口;The serial port server includes a serial port data forwarding unit and a network port; 所述串口数据转发单元与网口通信连接,用于对数据进行信令解析并转发;The serial port data forwarding unit is communicatively connected to the network port, and is used for signaling analysis and forwarding of data; 所述网口与串口数据转发单元和上位机通信连接,用于将数据转发到上位机。The network port is communicatively connected with the serial port data forwarding unit and the host computer for forwarding data to the host computer. 2.如权利要求1所述的一种多串口设备数据转发系统,其特征在于,所述多个控制设备包括特殊设备和普通设备,特殊设备的数据需要信令解析并转发;普通设备的数据不需要信令解析,直接透传。2. A kind of multi-serial device data forwarding system as claimed in claim 1, is characterized in that, described multiple control equipments comprise special equipment and common equipment, and the data of special equipment needs signaling analysis and forwarding; The data of common equipment It does not require signaling analysis and can be directly transparently transmitted. 3.如权利要求2所述的一种多串口设备数据转发系统,其特征在于,所述特殊设备生成特殊报文到串口,串口包括RS485、RS422和RS232。3. A multi-serial device data forwarding system as claimed in claim 2, wherein said special device generates a special message to the serial port, and the serial port includes RS485, RS422 and RS232. 4.如权利要求3所述的一种多串口设备数据转发系统,其特征在于,所述特殊报文的内容包括是否转发给其他串口、是否转发给网络、是否转发给串口1、…、是否转发到串口n-1、是否转发到串口n和实际的用户数据,n为串口服务器串口数。4. A kind of multi-serial port device data forwarding system as claimed in claim 3, is characterized in that, the content of described special message comprises whether to forward to other serial ports, whether to forward to network, whether to forward to serial port 1, ..., whether Forward to serial port n-1, whether to forward to serial port n and actual user data, n is the serial port number of the serial port server. 5.一种多串口设备数据转发方法,其特征在于,包括以下步骤:5. a multi-serial device data forwarding method, is characterized in that, comprises the following steps: S1,判断串口对应控制设备是否需要转发数据,若是,则在串口服务器上配置该串口数据是否需要转发给其他串口的状态为able;否则,配置其状态为disable;S1, determine whether the control device corresponding to the serial port needs to forward data, if so, configure the state of whether the serial port data needs to be forwarded to other serial ports on the serial port server as enable; otherwise, configure its state as disable; S2,当串口对应控制设备不需要转发数据时,对数据直接透传;当串口对应控制设备需要转发数据时,操控控制设备形成特殊报文;S2, when the control device corresponding to the serial port does not need to forward data, directly transparently transmit the data; when the control device corresponding to the serial port needs to forward data, control the control device to form a special message; S3,根据特殊报文的内容,串口数据转发单元对其做信令解析,根据解析结果将控制设备的串口数据转发。S3, according to the content of the special message, the serial port data forwarding unit performs signaling analysis on it, and forwards the serial port data of the control device according to the analysis result. 6.如权利要求5所述的一种多串口设备数据转发方法,其特征在于,所述步骤S1具体包括:6. A kind of multi-serial device data forwarding method as claimed in claim 5, is characterized in that, described step S1 specifically comprises: 在串口服务器上配置该串口数据是否需要转发给其他串口的状态为able时,该串口数据必须至少包含4bit的头,包括是否转发给其他串口和是否转发给网络的信息。When configuring whether the serial port data needs to be forwarded to other serial ports on the serial port server is enabled, the serial port data must contain at least a 4-bit header, including whether to forward to other serial ports and whether to forward to the network. 7.如权利要求6所述的一种多串口设备数据转发方法,其特征在于,所述步骤S2具体包括:7. A kind of multi-serial device data forwarding method as claimed in claim 6, is characterized in that, described step S2 specifically comprises: 当串口对应控制设备不需要转发数据时,串口数据不需要数据包头,直接透传,发出实际的用户数据。When the corresponding control device of the serial port does not need to forward data, the data of the serial port does not need a data packet header, and is directly transparently transmitted, and the actual user data is sent. 8.如权利要求7所述的一种多串口设备数据转发方法,其特征在于,所述步骤S2还包括:8. A kind of multi-serial device data forwarding method as claimed in claim 7, is characterized in that, described step S2 also comprises: 所述特殊报文包括多个字节,字节中的每一个比特分别定义是否转发给其他串口、是否转发给网络、后续转发标志位长度、是否转发给串口1、…、是否转发到串口n-1、是否转发到串口n和实际的用户数据。The special message includes a plurality of bytes, and each bit in the byte defines whether to forward to other serial ports, whether to forward to the network, the length of the subsequent forwarding flag, whether to forward to serial port 1, ..., whether to forward to serial port n -1. Whether to forward to serial port n and actual user data. 9.如权利要求8所述的一种多串口设备数据转发方法,其特征在于,所述步骤S3具体包括:9. A kind of multi-serial device data forwarding method as claimed in claim 8, is characterized in that, described step S3 specifically comprises: 串口数据转发单元对串口数据做信令解析,其第一个字节中的第一个比特为0则表示不转发给其他串口,为1则表示转发给其他串口,按照顺序判断是否转发给其他串口、是否转发给网络、后续转发标志位长度、是否转发给串口1、…、是否转发到串口n-1、是否转发到串口n,最后携带的是实际的用户数据。The serial port data forwarding unit performs signaling analysis on the serial port data. If the first bit in the first byte is 0, it means not forwarded to other serial ports, and if it is 1, it means forwarded to other serial ports. Determine whether to forward it to other Serial port, whether to forward to the network, the length of the subsequent forwarding flag, whether to forward to serial port 1, ..., whether to forward to serial port n-1, whether to forward to serial port n, and finally carry the actual user data. 10.如权利要求9所述的一种多串口设备数据转发方法,其特征在于,所述步骤S3还包括:10. A kind of multi-serial device data forwarding method as claimed in claim 9, is characterized in that, described step S3 also comprises: 当是否转发给其他串口的比特为0时,后续转发标志位长度和是否转发给串口n都不存在;当是否转发给其他串口的比特为1时,后续转发标志位长度和是否转发给串口n必须存在,后续转发标志位长度告知该特殊报文中涉及的最大串口号,是否转发给串口n的比特为1则对应需要转发,否则不转发。When the bit of whether to forward to other serial ports is 0, the length of the subsequent forwarding flag and whether to forward to serial port n do not exist; when the bit of whether to forward to other serial ports is 1, the length of the subsequent forwarding flag and whether to forward to serial port n It must exist, and the length of the subsequent forwarding flag tells the maximum serial port number involved in the special message. If the bit of whether to forward to serial port n is 1, it corresponds to the need to forward, otherwise it will not be forwarded.
CN202211517836.XA 2022-11-29 2022-11-29 A data forwarding system and method for multi-serial devices Pending CN116055534A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211517836.XA CN116055534A (en) 2022-11-29 2022-11-29 A data forwarding system and method for multi-serial devices

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211517836.XA CN116055534A (en) 2022-11-29 2022-11-29 A data forwarding system and method for multi-serial devices

Publications (1)

Publication Number Publication Date
CN116055534A true CN116055534A (en) 2023-05-02

Family

ID=86114949

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211517836.XA Pending CN116055534A (en) 2022-11-29 2022-11-29 A data forwarding system and method for multi-serial devices

Country Status (1)

Country Link
CN (1) CN116055534A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117544609A (en) * 2024-01-09 2024-02-09 广州美凯信息技术股份有限公司 Data transmission method of serial port transmission system based on KVM control

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102214155A (en) * 2011-07-08 2011-10-12 南京理工大学 Serial server
CN102624738A (en) * 2012-03-28 2012-08-01 瑞斯康达科技发展股份有限公司 A serial port server, co-transfer chip and data transmission method
CN102819513A (en) * 2012-06-29 2012-12-12 安科智慧城市技术(中国)有限公司 Interactive method and interactive device based on serial port communication
CN104915308A (en) * 2015-05-15 2015-09-16 深圳市双翼科技有限公司 Method and device for supporting serial port and interface communication protocol stacks of TCP and UDP at same time
CN106713351A (en) * 2017-01-20 2017-05-24 北京东土军悦科技有限公司 Secure communication method and device based on serial server
CN115086104A (en) * 2022-06-23 2022-09-20 武汉迈威通信股份有限公司 Method for supporting data disconnection retransmission and serial server

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102214155A (en) * 2011-07-08 2011-10-12 南京理工大学 Serial server
CN102624738A (en) * 2012-03-28 2012-08-01 瑞斯康达科技发展股份有限公司 A serial port server, co-transfer chip and data transmission method
CN102819513A (en) * 2012-06-29 2012-12-12 安科智慧城市技术(中国)有限公司 Interactive method and interactive device based on serial port communication
CN104915308A (en) * 2015-05-15 2015-09-16 深圳市双翼科技有限公司 Method and device for supporting serial port and interface communication protocol stacks of TCP and UDP at same time
CN106713351A (en) * 2017-01-20 2017-05-24 北京东土军悦科技有限公司 Secure communication method and device based on serial server
CN115086104A (en) * 2022-06-23 2022-09-20 武汉迈威通信股份有限公司 Method for supporting data disconnection retransmission and serial server

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117544609A (en) * 2024-01-09 2024-02-09 广州美凯信息技术股份有限公司 Data transmission method of serial port transmission system based on KVM control
CN117544609B (en) * 2024-01-09 2024-04-02 广州美凯信息技术股份有限公司 Data transmission method of serial port transmission system based on KVM control

Similar Documents

Publication Publication Date Title
US6378009B1 (en) KVM (keyboard, video, and mouse) switch having a network interface circuit coupled to an external network and communicating in accordance with a standard network protocol
EP2047370B1 (en) Method and apparatus for distributing usb hub functions across a network
CN107026764A (en) A remote debugging method, device, server and system
CN104486146A (en) Communication method for testing console and testing equipment
CN109600420B (en) Method and system for realizing online remote control based on raspberry pi technology
CN116055534A (en) A data forwarding system and method for multi-serial devices
CN104702386A (en) Full-network-based centralized control system and method
CN110035113A (en) A kind of remote-control system and method in multichannel isomery radio station
CN108733871A (en) A kind of method of pure software emulation bus communication
CN107769960B (en) A BMC Management Architecture Based on CAN Bus
CN112838934A (en) System and method for realizing remote access to switch serial port
CN108123865B (en) Message processing method and device
CN113138732A (en) Multi-display controller system, access control system, and display controller
Cisco Message Structure Overview
CN111193586B (en) Information processing method, packet transport network device and quantum key device
CN117793021B (en) Sideband management message processing method and circuit
CN111447270A (en) Data forwarding middleware for Internet of things
CN114338265B (en) Program downloading system and method based on TTP/C bus
CN107196802A (en) A kind of Outband network management system
US20110153886A1 (en) Device that uses parameters to provide multi-channel serial data transmissions and method thereof
CN113074449B (en) Communication method, device and system of fresh air system
CN214311388U (en) Multi-channel serial port control equipment based on TD-LTE5800 system
CN103019995A (en) Interface board card based on 1553B bus
KR100265979B1 (en) Method and apparatus for converting communication protocol between host computer and branch processor
KR100266261B1 (en) Method interface using java language in full electronic telephone exchange

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