CN106506306B - Method and device for transmitting data message - Google Patents

Method and device for transmitting data message Download PDF

Info

Publication number
CN106506306B
CN106506306B CN201611133841.5A CN201611133841A CN106506306B CN 106506306 B CN106506306 B CN 106506306B CN 201611133841 A CN201611133841 A CN 201611133841A CN 106506306 B CN106506306 B CN 106506306B
Authority
CN
China
Prior art keywords
broadcast
converter
slave
different
serial port
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.)
Active
Application number
CN201611133841.5A
Other languages
Chinese (zh)
Other versions
CN106506306A (en
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.)
Ruijie Networks Co Ltd
Original Assignee
Ruijie Networks 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 Ruijie Networks Co Ltd filed Critical Ruijie Networks Co Ltd
Priority to CN201611133841.5A priority Critical patent/CN106506306B/en
Publication of CN106506306A publication Critical patent/CN106506306A/en
Application granted granted Critical
Publication of CN106506306B publication Critical patent/CN106506306B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • 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/4013Management of data rate on the bus

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Quality & Reliability (AREA)
  • Small-Scale Networks (AREA)

Abstract

The embodiment of the invention provides a data message transmission method, wherein a converter receives a data message from a bus network, encapsulates the data message into a broadcast message of an Ethernet, and sends the broadcast message in a broadcast domain of the Ethernet to which the converter belongs, so that other converters in the broadcast domain can process the broadcast message conveniently. The embodiment of the invention also provides a device for transmitting the data message, and has the advantages of solving the problem of high-efficiency data transparent transmission when the data communication on the bus network is converted into the Ethernet data communication and realizing the smooth transition from the traditional bus network communication system to the Ethernet communication system.

Description

Method and device for transmitting data message
Technical Field
The present invention relates to the field of data communication technologies, and in particular, to a method and an apparatus for transmitting data messages.
Background
The RS485 bus is a common networking mode of an industrial field control system, is a bidirectional and balanced transmission standard interface widely used in industry, is widely applied in the fields of remote meter reading, intelligent home, remote monitoring and the like by virtue of the characteristics of low component cost, high reliability, large distribution range and the like, and does not specify a unified bus communication protocol.
The RS485 bus supports a point-to-multipoint communication mode, and a data collision detection mechanism does not exist, so that the whole system is controlled in an all-around mode mainly through a host. Generally, a communication mode of one master and multiple slaves is adopted, the master polls the slaves in the whole network, identifies the slaves through address codes, and confirms whether the equipment exists in the network and whether the equipment operates normally. The master and the slaves are mainly communicated through a response mechanism, the master sends an instruction in a broadcast mode, each slave receives a relevant instruction, the address code in the instruction corresponds to the address code of the slave, if the slave sends the instruction, the relevant instruction is immediately executed, the result of executing the instruction is responded to the master, and if the result is not, the instruction is discarded, and fig. 1 is a schematic diagram of a communication topology of an RS485 bus, a master and a plurality of slaves.
The ethernet based on TCP/IP is a standard interactive and open network, the network speed is fast, and the data transmission is reliable, which has become the main direction of network development in the control field. Compared with serial communication, the Ethernet has the advantages of bandwidth, high speed, long-distance communication and the like, and the networking communication distance can be infinitely prolonged, so that monitoring in the global range is realized. And the number of nodes which can be connected on the RS485 bus is limited, so that the networking scale is limited.
In industrial control communication equipment, at present, more serial devices using RS485 are used, and if all the serial devices are upgraded to network devices, the cost is very high, how to realize data conversion between ethernet and serial devices becomes a problem which needs to be solved urgently at present, and the conversion of serial data into ethernet for transmission becomes a research and development hotspot of a networking process of the serial devices. Therefore, by adopting the method of converting the RS485 bus transmission into the transmission through the Ethernet, the RS485 bus equipment and the software system before modification are not needed, the upgrading cost is low, the implementation is easy, and the plug and play are realized.
In the conventional method, data on a serial device is converted into an ethernet packet and transmitted to a remote monitoring PC in the following manner, and fig. 2 is a schematic diagram of a serial-to-ethernet communication topology.
As shown in fig. 2, firstly, the monitoring PC needs to establish a point-to-point TCP connection or UDP connection with the serial-to-ethernet device, and the configuration (IP address, working mode is server/client, etc.) required for establishing the connection needs to be configured in advance, and generally needs to be configured manually. And then converting the serial port data frame into an Ethernet message through a virtual serial port on the monitoring PC, transmitting the Ethernet message to serial port-to-Ethernet equipment through network transmission, and reducing the Ethernet message into serial port data by the serial port-to-Ethernet equipment and transmitting the serial port data to the serial port equipment. In the reverse direction, the serial port-to-Ethernet device receives serial port data sent by the serial port device, encapsulates serial port data frames into Ethernet messages and transmits the Ethernet messages to the monitoring PC through the Ethernet, and the PC restores the Ethernet messages into serial port data through the virtual serial port.
The scheme only considers the scene that the serial port data are transmitted to the remote PC through conversion into the Ethernet messages, the transparent transmission scene of the serial port data on the RS485 bus network cannot be well applied, and the number of the established point-to-point connections is increased inevitably along with the increase of the number of the serial port devices and the increase of the number of the required converter devices, so that a large number of redundant messages exist in the Ethernet network or the established large number of point-to-point connections are in an idle state, the characteristic of master-slave communication of the RS485 bus network is not aimed at, network resources cannot be efficiently utilized, and the cost of deployed hardware is increased. Secondly, with the increase of the number of the devices, the workload of the converter needing manual configuration is increased, the configuration error rate is increased, and the difficulty of upgrading the device system is increased.
Disclosure of Invention
In order to solve the above technical problem, an embodiment of the present invention discloses a method for transmitting a data message, including the following steps: the converter receives a data message from a bus network, packages the data message into a broadcast message of an Ethernet network, and sends the broadcast message in a broadcast domain of the Ethernet network to which the converter belongs, so that other converters in the broadcast domain can process the broadcast message conveniently.
Optionally, the converter is a first slave converter, a serial port of the first slave converter is connected with serial ports of the slaves through a bus network and is connected with slave converters connected with other slaves through a first broadcast domain, a serial port of the master converter is connected with a serial port of the host through a bus network and is connected with a second broadcast domain of the ethernet network,
optionally, the method specifically includes:
the first slave converter and the master converter establish a TCP connection with the second broadcast domain through the first broadcast domain, the first slave converter receives a data packet sent by the host through the master converter through the TCP connection, encapsulates the data packet into a broadcast packet of an ethernet network, and sends the broadcast packet in the first broadcast domain, so that other slave converters in the first broadcast domain can process the broadcast packet.
Optionally, the converter is a first slave converter, a serial port of the first slave converter is connected to a serial port of a slave through a bus network and to slave converters connected to other slaves through a third broadcast domain, a serial port of the master converter is connected to a serial port of a host through a bus network and the master converter is connected to the third broadcast domain, where the method specifically includes:
the first slave converter receives a first data message which is sent by the master converter from a bus network after receiving a data message sent by the host through different serial ports and carries serial port numbers of the different serial ports, encapsulates the first data message into a broadcast message of an Ethernet network carrying Vlan identifiers corresponding to the different serial port numbers according to a preset one-to-one correspondence relationship between the different serial port numbers and different Vlan identifiers, sends the broadcast message in the third broadcast domain, so that other slave converters in the third broadcast domain decapsulate the broadcast message according to the Vlan identifiers corresponding to the serial port numbers, and sends the data message in the broadcast message to serial ports of other slave converters corresponding to the serial port numbers according to the correspondence relationship for processing.
Optionally, the method specifically includes: the first slave converter and the master converter establish TCP connection with the second broadcast domain through the first broadcast domain, the slave converter receives second data messages sent by the host through different port numbers of the master converter through the TCP connection, packages the second data messages into broadcast messages of an Ethernet carrying Vlan identifiers corresponding to the different port numbers according to a preset one-to-one correspondence relationship between the different port numbers and different Vlan identifiers, and sends the broadcast messages in the first broadcast domain, so that other slave converters in the first broadcast domain decapsulate the broadcast messages according to the Vlan identifiers corresponding to the port numbers, and send the second data messages in the broadcast messages to ports of other slave converters corresponding to the port numbers for processing according to the correspondence relationship.
Optionally, the method specifically includes: the first slave converter and the master converter establish a TCP connection with the second broadcast domain through the first broadcast domain, the first slave converter receives, through the TCP connection, a third data packet which is sent by the master converter through a different port after receiving a data packet sent by the host computer through a different serial port, the third data packet carrying serial port numbers of the different serial ports and port numbers of the different ports, the third data packet is encapsulated into a broadcast packet of an ethernet network carrying Vlan identifiers corresponding to the different port numbers and serial port numbers according to a preset one-to-one correspondence relationship among the different port numbers, the different serial port numbers and Vlan identifiers, and the broadcast packet is sent in the first broadcast domain so that other converters in the first broadcast domain decapsulate the broadcast packet according to the Vlan identifiers, and sending the third data message in the broadcast message to the ports of other slave converters corresponding to the port numbers for processing according to the corresponding relation, and then sending the third data message to the serial ports of other slave converters corresponding to the serial port numbers for processing.
Another aspect of the embodiments of the present invention is to provide an apparatus for data packet transmission, including:
a receiving module for receiving data messages from the bus network,
an encapsulation module for encapsulating the data message into a broadcast message of an Ethernet network,
a sending module, configured to send the broadcast packet in a broadcast domain of an ethernet network to which the converter belongs, so that other converters in the broadcast domain process the broadcast packet.
Optionally, the apparatus further comprises:
the serial port is used for being connected with the serial port of the slave through a bus network;
an Ethernet port for connecting with slave switches connected with other slaves through a first broadcast domain,
a connection establishing module for establishing a TCP connection with a primary switch via the first broadcast domain and a second broadcast domain,
the receiving module is specifically configured to receive, through the TCP connection, a data packet sent by a host through a primary converter, where a serial port of the primary converter is connected to a serial port of the host through a bus network, and the primary converter is connected to the second broadcast domain of the ethernet network;
the sending module is specifically configured to send the broadcast packet in the first broadcast domain, so that other slave converters in the first broadcast domain process the broadcast packet.
Optionally, the apparatus further comprises:
the serial port is used for being connected with the serial port of the slave through a bus network;
the Ethernet port is used for connecting slave converters connected with other slaves through a third broadcast domain;
the receiving module is specifically configured to receive a first data packet which is sent by a master converter from a bus network and carries serial port numbers of different serial ports after receiving the data packet sent by the host through the different serial ports; the serial port of the main converter is connected with the serial port of the host through a bus network, and the main converter is connected with the third broadcast domain;
the encapsulation module is specifically configured to encapsulate the first data packet into a broadcast packet of an ethernet network carrying Vlan identifiers corresponding to different serial port numbers according to a one-to-one correspondence relationship between the preset different serial port numbers and the different Vlan identifiers;
the sending module is specifically configured to send the broadcast packet in the third broadcast domain, so that other slave converters in the third broadcast domain decapsulate the broadcast packet according to the Vlan identifier corresponding to the serial port number, and send a data packet in the broadcast packet to serial ports of other slave converters corresponding to the serial port number according to the correspondence for processing.
Optionally, the receiving module is specifically configured to receive, through the TCP connection, a second data packet sent by the host through a different port number of the primary converter,
the encapsulating module is specifically configured to encapsulate the second data message into a broadcast message of an ethernet network carrying Vlan identifiers corresponding to different port numbers according to a one-to-one correspondence relationship between the preset different port numbers and the different Vlan identifiers,
the sending module is specifically configured to send the broadcast packet in the first broadcast domain, so that other slave converters in the first broadcast domain decapsulate the broadcast packet according to the Vlan identifier corresponding to the port number, and send the second data packet in the broadcast packet to ports of other slave converters corresponding to the port number according to the correspondence for processing.
Optionally, the receiving module is specifically configured to receive, through the TCP connection, a third data packet which is sent by a different port of the primary converter and carries serial port numbers of different serial ports and port numbers of different ports,
the encapsulation module is specifically configured to encapsulate the third data packet into an ethernet broadcast packet carrying Vlan identifiers corresponding to the different port numbers and serial port numbers according to a one-to-one correspondence relationship among the preset different port numbers, different serial port numbers, and Vlan identifiers,
the sending module is specifically configured to send the broadcast packet in the first broadcast domain, so that other converters in the first broadcast domain decapsulate the broadcast packet according to the Vlan identifier, send the third data packet in the broadcast packet to ports of other slave converters corresponding to port numbers according to the correspondence, and then send the third data packet to serial ports of other slave converters corresponding to serial port numbers for processing.
The embodiment of the invention has the advantages that the converter receives the data message from the bus network, encapsulates the data message into the broadcast message of the Ethernet, and sends the broadcast message in the broadcast domain of the Ethernet to which the converter belongs, so that other converters in the broadcast domain can process the broadcast message conveniently. Therefore, the problem of efficient data transparent transmission when data communication on a bus network is converted into Ethernet data communication is solved, and smooth transition from a traditional bus network communication system to an Ethernet communication system is realized.
Description of the drawings:
in order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a prior art diagram of a network topology;
FIG. 2 is a prior art network topology block diagram;
FIG. 3 is a schematic diagram of a system according to an embodiment of the present invention;
FIG. 4 is a flow chart of a method provided by an embodiment of the present invention;
FIG. 5 is a flow chart of a method provided by an embodiment of the present invention;
FIG. 6 is a flow chart of a method provided by an embodiment of the present invention;
FIG. 7 is a flow chart of a method provided by an embodiment of the present invention;
FIG. 8 is a flow chart of a method provided by an embodiment of the present invention;
FIG. 9 is a schematic diagram of a system according to an embodiment of the present invention;
FIG. 10 is a block diagram of an apparatus according to an embodiment of the present invention;
fig. 11 is a structural diagram of an apparatus according to an embodiment of the present invention.
The specific implementation mode is as follows:
the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 3 is a system configuration diagram of the embodiment of the present invention.
The monitoring host is connected with a plurality of slaves in the same broadcast domain through the converter.
The embodiment of the invention discloses a data message transmission method, which comprises the following steps as shown in figure 4:
s101, the converter receives a data message from a bus network,
s103, packaging the data message into a broadcast message of an Ethernet,
s105, the broadcast message is sent in the broadcast domain of the Ethernet to which the converter belongs, so that other converters in the broadcast domain can process the broadcast message conveniently.
According to the point-to-multipoint characteristic of the bus network communication system, each slave machine of data sent by the host machine to the bus network can receive the data, therefore, under the condition that the host machine is close to each slave machine and can be deployed in the same broadcast domain, the bus network data message sent by the host machine or the slave machine is packaged into a broadcast message to be transmitted in the Ethernet, and the broadcast message is received by a converter corresponding to each slave machine and then is unpacked and restored into a bus network data message to be sent to the slave machine. Therefore, the host or the slave only needs to send one data message, and other equipment can receive the data message, so that the serial bus network conforms to the characteristics of a serial bus, network resources can be efficiently utilized, the bus network can be an RS485 bus network, and of course, other bus networks with the point-to-multipoint characteristics can also be suitable.
Alternatively to this, the first and second parts may,
the converter is a first slave converter, the serial port of the first slave converter is connected with the serial ports of the slaves through a bus network and the slave converters connected with other slaves are connected through a first broadcast domain, the serial port of the master converter is connected with the serial port of the host through the bus network and the master converter is connected with a second broadcast domain of the Ethernet network,
as shown in fig. 5, the method further comprises:
step S1011:
the first slave switch and the master switch establish a TCP connection with the second broadcast domain through the first broadcast domain,
the step S101 specifically includes:
the first slave translator receives data messages sent by the host through the master translator through the TCP connection,
the step S105 specifically includes:
and transmitting the broadcast message in the first broadcast domain so as to facilitate other slave converters of the first broadcast domain to process the broadcast message.
In the embodiment of the invention, when the slaves are deployed in the same broadcast domain, the master is deployed at a far end (the master is deployed in another broadcast domain) of a cross-network segment relative to the slaves, at this time, the master switch connected with the master can select one slave switch connected with the slave from all the slaves as a slave agent, and establishes TCP connection with the slave agent, communication data of the master and all the slaves are all sent to the slave agent through the TCP connection, and then the slave agent broadcasts a data message to other slaves, so that the master only needs to send one piece of data and all other slaves can receive the data message. When the bus network is an RS485 bus network, the specific process of the embodiment of the present invention is as follows: when the host has data to send, the RS485 data message received by the connected master converter is encapsulated into a TCP message and sent to the slave agent through the Ethernet, the slave agent receives the TCP message and unpacks the TCP message, then a part of the TCP message can be reserved and sent to the slave directly connected with the slave agent, then a part of the TCP message is encapsulated into a broadcast message and sent to the Ethernet, and other slave converters in the same broadcast domain receive the broadcast message and unpack the broadcast message and send the data message to the slave machines respectively connected, so that the purpose that one data message of the remote host reaches the slave machines is achieved, and all the slave machines receive the data through a broadcast mode. When the slave computer has response data to send to the host computer, the connected slave converter encapsulates the RS485 data message received by the serial port into a broadcast message to be sent to the Ethernet, the slave computer agent under the same broadcast domain receives the broadcast message and then de-encapsulates the broadcast message, then the data message is re-encapsulated into a TCP message, the TCP message is sent to the master converter connected with the host computer through the Ethernet (other slave computers also receive the data and discard the data due to address code mismatch in the meantime), and the host computer uplink converter de-encapsulates and restores the received TCP message into the RS485 data message to be sent to the host computer. Therefore, the transparent transmission of the communication data of the host and all the slave machines on the bus is completed, the Ethernet resources are efficiently utilized, and the hardware deployment cost is saved.
Optionally, the converter is a first slave converter, a serial port of the first slave converter is connected to a serial port of a slave through a bus network and a slave converter connected to another slave is connected through a third broadcast domain, a serial port of the master converter is connected to a serial port of a host through a bus network and the master converter is connected to the third broadcast domain, as shown in fig. 6, the step S101 specifically includes:
the first slave converter receives a first data message which is sent by the master converter from the bus network after receiving the data message sent by the host by using different serial ports and carries serial port numbers of the different serial ports,
the step S103 specifically includes:
according to the preset one-to-one correspondence relationship between the different serial port numbers and the different virtual local area network Vlan identifiers, encapsulating the first data message into a broadcast message of an ethernet network carrying Vlan identifiers corresponding to the different serial port numbers,
the step S105 specifically includes:
and sending the broadcast message in the third broadcast domain so that other slave converters in the third broadcast domain decapsulate the broadcast message according to the Vlan identifier corresponding to the serial port number, and send the data message in the broadcast message to serial ports of other slave converters corresponding to the serial port number for processing according to the corresponding relationship.
Optionally, as shown in fig. 7, the step S101 specifically includes:
the first slave translator and the master translator establish a TCP connection with the second broadcast domain via the first broadcast domain, the slave translator receives a second data packet from the host via the TCP connection via a different port number of the master translator,
the step S103 specifically includes: according to the preset one-to-one correspondence relationship between the different port numbers and the different VLAN identifications, encapsulating the second data message into a broadcast message of the Ethernet carrying the VLAN identifications corresponding to the different port numbers,
the step S105 specifically includes: and sending the broadcast message in the first broadcast domain, so that other slave converters in the first broadcast domain decapsulate the broadcast message according to the Vlan identifier corresponding to the port number, and send the second data message in the broadcast message to ports of other slave converters corresponding to the port number according to the correspondence for processing.
Optionally, as shown in fig. 8, the step S101 specifically includes:
the first slave converter and the master converter establish TCP connection with the second broadcast domain through the first broadcast domain, the first slave converter receives through the TCP connection third data messages which are sent by the master converter through different ports of the master converter and carry serial port numbers of different serial ports and port numbers of different ports after receiving the data messages sent by the host through different serial ports,
the step S103 specifically includes:
according to the preset one-to-one correspondence relationship among the different port numbers, the different serial port numbers and the virtual local area network Vlan identifiers, encapsulating the third data message into a broadcast message of an ethernet network carrying the Vlan identifiers corresponding to the different port numbers and serial port numbers,
the step S105 specifically includes: and sending the broadcast message in the first broadcast domain so that other converters in the first broadcast domain decapsulate the broadcast message according to the Vlan identifier, and send the third data message in the broadcast message to ports of other slave converters corresponding to port numbers according to the corresponding relationship for processing, and then send the third data message to serial ports of other slave converters corresponding to serial port numbers for processing.
In an embodiment of the present invention, the bus network may be an RS485 bus network, and for a case where there are multiple serial ports on the converter, that is, a converter of an RS485 relay ethernet has multiple serial ports, so that multiple RS485 bus network devices (such as a water meter and an electric meter) can be connected downstream. Under the condition that the local area networks are in the same broadcast domain, when RS485 data messages received by different serial ports are packaged into broadcast messages, the virtual local area network tag VLAN tag is taken, the one-to-one correspondence relationship between different serial port numbers and different virtual local area network VLAN identifications is preset, so that the broadcast messages corresponding to the data messages of the different serial ports can be transmitted in the broadcast domains of the different VLANs, and each serial port only receives data in the broadcast message of the same VLAN, so that the data of the different serial ports can be well isolated, and the serial port data and the non-serial port data can be conveniently isolated in the access switch. Under the condition of a cross-network segment (the host and the slave are not in a broadcast domain), a master converter connected with the host is connected with a plurality of monitoring hosts of an RS485 bus network, RS485 data messages received by different serial ports are packaged into TCP messages, different port numbers are set, therefore, TCP connections of a plurality of different port numbers are established according to the number of the serial ports, the data messages of each serial port are transmitted to the slave agent through the TCP connection of the respective port number, and thus, the data messages of each serial port have a dedicated TCP connection to realize the isolated transparent transmission of the serial data messages.
In another embodiment of the present invention, as shown in fig. 9, RS485 bus network data packets sent from the slaves a1, a2, and A3 interact with each other through broadcast packets encapsulated by VLAN a, and RS485 bus network data packets sent from the slaves B1, B2, and B3 interact with each other through broadcast packets encapsulated by VLAN B. The RS485 monitoring host A and the RS485 bus network data message sent from the slave end VLAN a are interacted through the TCP connection with the TCP port number A, and the RS485 monitoring host B and the RS485 bus network data message sent from the slave end VLAN B are interacted through the TCP connection with the TCP port number B. The slave agent determines which serial port to send and which VLAN to send the data message according to the port number according to the one-to-one correspondence among the preset different port numbers, different serial port numbers and the VLAN identifier, the slave agent determines which serial port to send the data message and which port TCP connection to send the data message according to the VLAN tag from the received broadcast message, and the RS485 data message received from the serial port determines which VLAN to transmit and which port TCP connection to send the data message according to the serial port number.
Another aspect of the embodiments of the present invention is to provide an apparatus for transmitting data packets, as shown in fig. 10, including:
a receiving module 201, configured to receive a data packet from a bus network,
an encapsulation module 203, configured to encapsulate the data packet into a broadcast packet of an ethernet network,
a sending module 205, configured to send the broadcast packet in a broadcast domain of an ethernet network to which the converter belongs, so that other converters in the broadcast domain process the broadcast packet.
Optionally, as shown in fig. 11, the apparatus further includes:
the serial port 207 is used for being connected with a serial port of a slave through a bus network;
an Ethernet port 209 for connection with slave switches connected to other slaves through the first broadcast domain,
a connection establishing module 211, configured to establish a TCP connection with the primary switch via the first broadcast domain and the second broadcast domain,
the receiving module 201 is specifically configured to receive, through the TCP connection, a data packet sent by a host through a primary converter, where a serial port of the primary converter is connected to a serial port of the host through a bus network, and the primary converter is connected to the second broadcast domain of the ethernet network;
the sending module 205 is specifically configured to send the broadcast packet in the first broadcast domain, so that other slave switches in the first broadcast domain process the broadcast packet.
Optionally, as shown in fig. 11, the apparatus further includes:
the serial port 207 is used for being connected with a serial port of a slave through a bus network;
an ethernet port 209 for connection with slave switches connected to other slaves through a third broadcast domain;
the receiving module 201 is specifically configured to receive a first data packet which is sent by a master converter from a bus network and carries serial port numbers of different serial ports after receiving data packets sent by the host computer by using the different serial ports; the serial port of the main converter is connected with the serial port of the host through a bus network, and the main converter is connected with the third broadcast domain;
the encapsulating module 203 is specifically configured to encapsulate the first data packet into a broadcast packet of an ethernet network that carries Vlan identifiers corresponding to different serial port numbers according to a one-to-one correspondence relationship between the preset different serial port numbers and different Vlan identifiers;
the sending module 205 is specifically configured to send the broadcast packet in the third broadcast domain, so that other slave converters in the third broadcast domain decapsulate the broadcast packet according to the Vlan identifier corresponding to the serial port number, and send a data packet in the broadcast packet to serial ports of other slave converters corresponding to the serial port number for processing according to the correspondence.
Optionally, the receiving module 201 is specifically configured to receive, through the TCP connection, a second data packet sent by the host through a different port number of the primary converter,
the encapsulating module 203 is specifically configured to encapsulate the second data packet into a broadcast packet of an ethernet network carrying Vlan identifiers corresponding to different port numbers according to a one-to-one correspondence relationship between the preset different port numbers and the different Vlan identifiers,
the sending module 205 is specifically configured to send the broadcast packet in the first broadcast domain, so that other slave converters in the first broadcast domain decapsulate the broadcast packet according to the Vlan id corresponding to the port number, and send the second data packet in the broadcast packet to ports of other slave converters corresponding to the port number according to the correspondence for processing.
Optionally, the receiving module 201 is specifically configured to, after receiving the data packet sent by the host through the TCP connection, send a third data packet carrying serial numbers of different serial ports and port numbers of different ports through different ports of the primary converter,
the encapsulating module 203 is specifically configured to encapsulate the third data packet into an ethernet broadcast packet carrying Vlan identifiers corresponding to the different port numbers and serial port numbers according to a one-to-one correspondence relationship among the preset different port numbers, different serial port numbers, and Vlan identifiers,
the sending module 205 is specifically configured to send the broadcast packet in the first broadcast domain, so that other converters in the first broadcast domain decapsulate the broadcast packet according to the Vlan identifier, send the third data packet in the broadcast packet to ports of other slave converters corresponding to port numbers according to the correspondence, and then send the third data packet to serial ports of other slave converters corresponding to serial port numbers for processing.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (6)

1. A method of data message transmission, characterized in that,
a converter receives a data message from a bus network, packages the data message into a broadcast message of an Ethernet network, and sends the broadcast message in a broadcast domain of the Ethernet network to which the converter belongs, so that other converters in the broadcast domain can process the broadcast message conveniently;
wherein the converter is a first slave converter, the serial port of the first slave converter is connected with the serial ports of the slaves through a bus network, the first slave converter is connected with the slave converters connected with other slaves through a first broadcast domain, the serial port of the master converter is connected with the serial port of the host through the bus network, and the master converter is connected with a second broadcast domain of the Ethernet network,
the method specifically comprises the following steps:
the first slave converter and the master converter establish a TCP connection with the second broadcast domain through the first broadcast domain, the first slave converter receives a data packet sent by the host through the master converter through the TCP connection, encapsulates the data packet into a broadcast packet of an ethernet network, and sends the broadcast packet in the first broadcast domain, so that other slave converters in the first broadcast domain can process the broadcast packet;
or
The converter is a first slave converter, a serial port of the first slave converter is connected with serial ports of slaves through a bus network, the first slave converter is connected with slave converters connected with other slaves through a third broadcast domain, a serial port of the master converter is connected with a serial port of a host through the bus network, and the master converter is connected with the third broadcast domain, and the method specifically comprises the following steps:
the first slave converter receives a first data message which is sent by the master converter from a bus network after receiving a data message sent by the host through different serial ports and carries serial port numbers of the different serial ports, encapsulates the first data message into a broadcast message of an Ethernet network carrying Vlan identifiers corresponding to the different serial port numbers according to a preset one-to-one correspondence relationship between the different serial port numbers and different Vlan identifiers, sends the broadcast message in the third broadcast domain, so that other slave converters in the third broadcast domain decapsulate the broadcast message according to the Vlan identifiers corresponding to the serial port numbers, and sends the data message in the broadcast message to serial ports of other slave converters corresponding to the serial port numbers according to the correspondence relationship for processing.
2. The method of claim 1,
the method specifically comprises the following steps: the first slave converter and the master converter establish a TCP connection with the second broadcast domain through the first broadcast domain, the first slave converter receives a second data packet, the second data packet is sent to the first slave converter through TCP connections of different ports of the master converter after a serial port of the master converter receives a data packet sent by the host, the second data packet is encapsulated into a broadcast packet of an ethernet network carrying Vlan identifiers corresponding to different TCP port numbers according to a preset one-to-one correspondence relationship between the different TCP port numbers and different Vlan identifiers, and the broadcast packet is sent in the first broadcast domain, so that the first slave converter sends the second data packet in the broadcast packet to TCP ports of other slave converters corresponding to the TCP port numbers according to the correspondence relationship for processing, and then, other slave converters in the first broadcast domain decapsulate the broadcast message according to the Vlan identifier corresponding to the port number.
3. The method of claim 1,
the method specifically comprises the following steps: the first slave converter and the master converter establish a TCP connection with the second broadcast domain through the first broadcast domain, the first slave converter receives, through the TCP connection, a third data packet which is sent by the master converter through a different port after receiving a data packet sent by the host computer through a different serial port, the third data packet is sent by the master converter through a different port of the master converter and carries serial port numbers of the different serial ports and port numbers of the different port, the third data packet is encapsulated into a broadcast packet of an ethernet network carrying Vlan identifiers corresponding to the different port numbers and serial port numbers according to a preset one-to-one correspondence relationship among the different port numbers, the different serial port numbers and a Vlan identifier of a virtual local area network, the broadcast packet is sent in the first broadcast domain, so that the first slave converter sends the third data packet in the broadcast packet to a TCP connection process corresponding to the port number according to the correspondence relationship, and then, other slave converters in the first broadcast domain decapsulate the broadcast message according to the Vlan identifier, and send a third data message in the broadcast message to the serial ports of other slave machines corresponding to the serial port number according to the corresponding relationship for processing.
4. An apparatus for data message transmission, applied in a converter, comprising:
a receiving module for receiving data messages from the bus network,
an encapsulation module for encapsulating the data message into a broadcast message of an Ethernet network,
a sending module, configured to send the broadcast packet in a broadcast domain of an ethernet network to which the converter belongs, so that other converters in the broadcast domain process the broadcast packet;
wherein the apparatus further comprises:
the serial port is used for being connected with the serial port of the slave through a bus network;
an Ethernet port for connecting with slave switches connected with other slaves through a first broadcast domain,
a connection establishing module for establishing a TCP connection with a primary switch via the first broadcast domain and a second broadcast domain,
the receiving module is specifically configured to receive, through the TCP connection, a data packet sent by a host through a primary converter, where a serial port of the primary converter is connected to a serial port of the host through a bus network, and the primary converter is connected to the second broadcast domain of the ethernet network;
the sending module is specifically configured to send the broadcast packet in the first broadcast domain, so that other slave converters in the first broadcast domain process the broadcast packet;
or
The device further comprises:
the serial port is used for being connected with the serial port of the slave through a bus network;
the Ethernet port is used for connecting slave converters connected with other slaves through a third broadcast domain;
the receiving module is specifically used for receiving a first data message which is sent by a main converter from a bus network after receiving data messages sent by a host through different serial ports and carries serial port numbers of the different serial ports; the serial port of the main converter is connected with the serial port of the host through a bus network, and the main converter is connected with the third broadcast domain;
the encapsulation module is specifically configured to encapsulate the first data packet into a broadcast packet of an ethernet network carrying Vlan identifiers corresponding to different serial port numbers according to a one-to-one correspondence relationship between the preset different serial port numbers and the different Vlan identifiers;
the sending module is specifically configured to send the broadcast packet in the third broadcast domain, so that other slave converters in the third broadcast domain decapsulate the broadcast packet according to the Vlan identifier corresponding to the serial port number, and send a data packet in the broadcast packet to serial ports of other slave converters corresponding to the serial port number according to the correspondence for processing.
5. The apparatus of claim 4,
the receiving module is specifically configured to receive a second data packet, where the second data packet is sent to the first slave converter through TCP connections at different ports of the master converter after the serial port of the master converter receives the data packet sent by the host,
the encapsulation module is specifically configured to encapsulate the second data packet into a broadcast packet of an ethernet network that carries Vlan identifiers corresponding to different TCP port numbers according to a one-to-one correspondence relationship between the preset different TCP port numbers and the different Vlan identifiers,
the sending module is specifically configured to send the broadcast packet in the first broadcast domain, so that the first slave converter sends the second data packet in the broadcast packet to TCP ports of other slave converters corresponding to port numbers according to the correspondence, and then the other slave converters in the first broadcast domain decapsulate the broadcast packet according to Vlan identifiers corresponding to the port numbers.
6. The apparatus of claim 4,
the receiving module is specifically configured to receive, through the TCP connection, a third data packet that is sent by the primary converter through a different port of the primary converter and carries serial port numbers of different serial ports and port numbers of different ports after the primary converter receives the data packet sent by the host through the different serial ports;
the encapsulation module is specifically configured to encapsulate the third data packet into an ethernet broadcast packet carrying Vlan identifiers corresponding to the different port numbers and serial port numbers according to a one-to-one correspondence relationship among the preset different port numbers, different serial port numbers, and Vlan identifiers,
the sending module is specifically configured to send the broadcast packet in the first broadcast domain, so that the first slave converter sends the third data packet in the broadcast packet to a TCP connection process corresponding to a port number according to the correspondence, and then the other slave converters in the first broadcast domain decapsulate the broadcast packet according to the Vlan identifier and send the third data packet in the broadcast packet to serial ports of other slaves corresponding to the serial port number according to the correspondence for processing.
CN201611133841.5A 2016-12-10 2016-12-10 Method and device for transmitting data message Active CN106506306B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611133841.5A CN106506306B (en) 2016-12-10 2016-12-10 Method and device for transmitting data message

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611133841.5A CN106506306B (en) 2016-12-10 2016-12-10 Method and device for transmitting data message

Publications (2)

Publication Number Publication Date
CN106506306A CN106506306A (en) 2017-03-15
CN106506306B true CN106506306B (en) 2020-11-20

Family

ID=58330786

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611133841.5A Active CN106506306B (en) 2016-12-10 2016-12-10 Method and device for transmitting data message

Country Status (1)

Country Link
CN (1) CN106506306B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109471818B (en) * 2018-11-22 2021-08-31 武汉虹识技术有限公司 Bus structure implementation method and device
CN111026064A (en) * 2019-12-26 2020-04-17 成都云尚物联环境科技有限公司 Distributed control system based on GOOSE communication and working method thereof
CN112311641B (en) * 2020-12-30 2021-04-06 深圳市法拉第电驱动有限公司 CAN communication-based communication method and system for upper computer and lower computer
CN113765761B (en) * 2021-09-09 2023-03-14 深圳市信锐网科技术有限公司 Data transmission method, device, equipment, system and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0853406A2 (en) * 1997-01-06 1998-07-15 Digital Equipment Corporation Management of a computer network switched repeater
CN101741849A (en) * 2009-12-23 2010-06-16 北京格林伟迪科技有限公司 Method, system and device for transmitting serial port service data
CN102325282A (en) * 2011-09-06 2012-01-18 杭州开鼎科技有限公司 PON-based (passive optical network-based) RS485/RS232 data frame and Ethernet data frame uplink method
CN105959288A (en) * 2016-05-27 2016-09-21 姹や寒 Network protocol conversion method for power grid system and intercommunication method of power grid system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0853406A2 (en) * 1997-01-06 1998-07-15 Digital Equipment Corporation Management of a computer network switched repeater
CN101741849A (en) * 2009-12-23 2010-06-16 北京格林伟迪科技有限公司 Method, system and device for transmitting serial port service data
CN102325282A (en) * 2011-09-06 2012-01-18 杭州开鼎科技有限公司 PON-based (passive optical network-based) RS485/RS232 data frame and Ethernet data frame uplink method
CN105959288A (en) * 2016-05-27 2016-09-21 姹や寒 Network protocol conversion method for power grid system and intercommunication method of power grid system

Also Published As

Publication number Publication date
CN106506306A (en) 2017-03-15

Similar Documents

Publication Publication Date Title
CN106506306B (en) Method and device for transmitting data message
KR101536141B1 (en) Apparatus and method for converting signal between ethernet and can in a vehicle
CN112272132B (en) DDS protocol real-time transmission method and system for realizing CAN data based on FPGA
WO2022062052A1 (en) 5g-based method, module and terminal for realizing low scheduling latency and high speed access, and secondary electrical device
WO2021021495A1 (en) Intelligent controller and sensor network bus, system and method
WO2007066752A1 (en) Relay apparatus and method for connecting client device with server
EP2606615A2 (en) Method and system for layer-2 pseudo-wire rapid-deployment service over unknown internet protocol networks
JP5716133B2 (en) Industrial controller device capable of low error rate and ultra-high speed serial communication and driving method thereof
CN107124393B (en) Remote host management over a network
CN105573200B (en) A kind of communication device and communication means for wind electric converter
CN104993979A (en) Network connection monitoring method, terminal equipment and communication system
CN113115346A (en) Gateway multi-protocol conversion device based on 5G and method thereof
CN105553795A (en) Method for transmitting standard Ethernet data in industrial Ethernet
CN106100960B (en) Method, device and system for Fabric intercommunication of cross-storage area network
Jia et al. 5G MEC gateway system design and application in industrial communication
CN106533934A (en) Border gateway applicable to all interconnected manufacturing networks
CN108306755B (en) Method and system for establishing management channel
CN110958590B (en) Heterogeneous equipment integrated system based on multi-protocol edge computing gateway
CN104320322A (en) Message control method and equipment
CN111131267A (en) Ethernet self-adaption method, device and system based on FPGA
CN114039810B (en) Flexible automatic control system based on Ethernet
Apostolov To GOOSE or not to GOOSE?-that is the question
CN110519243A (en) The system and its working method to interconnect between a kind of stage heterogeneous device
EP4120637A1 (en) Dialing message processing method, network elements, system, and network device
CN112351355B (en) Management method and system of ONU channel based on gPC

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant