CN112350909A - Communication system and method based on RS485 bus - Google Patents

Communication system and method based on RS485 bus Download PDF

Info

Publication number
CN112350909A
CN112350909A CN201910722764.4A CN201910722764A CN112350909A CN 112350909 A CN112350909 A CN 112350909A CN 201910722764 A CN201910722764 A CN 201910722764A CN 112350909 A CN112350909 A CN 112350909A
Authority
CN
China
Prior art keywords
control board
main control
frame
equipment
main
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
CN201910722764.4A
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.)
CRRC Zhuzhou Institute Co Ltd
Original Assignee
CRRC Zhuzhou Institute 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 CRRC Zhuzhou Institute Co Ltd filed Critical CRRC Zhuzhou Institute Co Ltd
Priority to CN201910722764.4A priority Critical patent/CN112350909A/en
Publication of CN112350909A publication Critical patent/CN112350909A/en
Pending legal-status Critical Current

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
    • H04L12/40169Flexible bus arrangements
    • H04L12/40176Flexible bus arrangements involving redundancy
    • H04L12/40182Flexible bus arrangements involving redundancy by using a plurality of communication lines
    • 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/40169Flexible bus arrangements
    • H04L12/40176Flexible bus arrangements involving redundancy
    • H04L12/40202Flexible bus arrangements involving redundancy by using a plurality of master stations
    • 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
    • H04L2012/40267Bus for use in transportation systems
    • H04L2012/40293Bus for use in transportation systems the transportation system being a train

Abstract

The invention discloses a communication system and a method based on an RS485 bus, which are applied to a train control network, wherein the communication system comprises a first main control board, a second main control board and a plurality of IO gateway boards; the first main control board and the second main control board are connected with each other through two mutually independent RS485 buses respectively; and the IO gateway boards are connected with the two RS485 buses. According to the communication system and method based on the RS485 bus, the redundancy technology is utilized, when one RS485 bus is abnormal, the first main control board and the second main control board can also realize data interaction with the plurality of IO gateway boards through the other RS485 bus, the breakdown of the whole train control network system caused by the abnormality of a single device or a single line is avoided, and the requirements of the train control network on the safety and reliability of data transmission can be met.

Description

Communication system and method based on RS485 bus
Technical Field
The invention belongs to the technical field of rail transit information, and particularly relates to a communication system and method based on an RS485 bus.
Background
The train network control platform is used as the brain and nerve of the train, bears important missions such as train data communication, data acquisition, safety control, vehicle-mounted information service and the like, and is an important system for ensuring the safe operation of the train. In recent years, the rail transit industry is rapidly developed, the informatization service is increasingly improved, and the running speed of trains is continuously increased, so that the network control of the trains puts forward more strict requirements on the safety and reliability of data transmission.
The RS485 bus communication technology is widely applied to the field of train network control by virtue of the advantages of low networking cost, high reliability, wide distribution range, short development period and the like, but no unified RS485 communication protocol standard exists in the industry, and the traditional RS485 bus architecture cannot meet the requirement of a train control network on safety.
Disclosure of Invention
One of the technical problems to be solved by the invention is how to realize that an RS485 bus architecture meets the requirement of a train control network on safety.
In order to solve the above technical problem, an embodiment of the present application first provides a communication system based on an RS485 bus, which is applied to a train control network and includes a first main control board, a second main control board, and a plurality of IO gateway boards; the first main control board and the second main control board are connected with each other through two mutually independent RS485 buses respectively; and the IO gateway boards are connected with the two RS485 buses.
Preferably, the IO gateway board includes a slave device and a hot standby slave device, and each RS485 bus is connected to a plurality of slave devices and a plurality of hot standby slave devices.
Preferably, the two main control boards and the plurality of IO gateways adopt master-slave response interactive communication.
The embodiment of the invention also discloses a communication method based on the RS485 bus, which is applied to the communication system, and the communication method comprises the following steps:
setting the first main control board as a main device and the second main control board as a hot standby main device, or setting the second main control board as a main device and the first main control board as a hot standby main device;
the first main control board and the second main control board are powered on, and whether the first main control board and the second main control board are main equipment or not is judged respectively;
the main control board as the main equipment carries out bus initialization and slave equipment scanning;
after initialization is completed, judging whether the current main control board is a main device or not, and if the current main control board is the main device, judging whether a communication fault exists in the current RS485 bus used by the main device or not;
if the current RS485 bus used by the main equipment has communication faults, the current RS485 bus used by the main equipment is switched to another RS485 bus, and if the current RS485 bus used by the main equipment has no communication faults, the step of sending a data request frame to a plurality of IO gateway boards by the main equipment is carried out;
the method comprises the steps that a main device sends a data request frame to a plurality of IO gateway boards;
the method comprises the steps that a master device receives data response frames of a plurality of IO gateway boards;
judging whether the data response frame is overtime or not according to the data response frame, if so, the data response frame is invalid, and if not, the data response frame is valid;
and returning to the step of judging whether the current main control board is the main equipment or not.
Preferably, the communication method further includes:
if the current main control board is not the main equipment, judging whether the current main control board monitors the communication abnormity of the main equipment;
if the current main control board monitors that the communication of the main equipment is abnormal, the current main control board is used as the main equipment, and if the communication of the main equipment is not abnormal, the current main control board is kept as the hot standby main equipment and receives data response frames of a plurality of IO gateway boards;
the method comprises the steps that a main device sends a data request frame to a plurality of IO gateway boards;
the method comprises the steps that a master device receives data response frames of a plurality of IO gateway boards;
judging whether the data response frame is overtime or not according to the data response frame, if so, the data response frame is invalid, and if not, the data response frame is valid;
and returning to the step of judging whether the current main control board is the main equipment or not.
Preferably, the communication method further includes:
electrifying a plurality of IO gateway boards, confirming the identities of slave equipment and hot standby slave equipment included in the IO gateway boards, and distributing corresponding communication IDs according to the identities;
receiving a request frame sent by a master device;
judging whether the ID of the receiving equipment of the request frame is consistent with the communication ID of the current equipment, if so, judging whether the current equipment is slave equipment, and if not, returning to the step of receiving the request frame sent by the master equipment;
if the current equipment is the slave equipment, judging whether the request frame is an initialization and equipment discovery frame;
if the request frame is an initialization and device discovery frame, sending an initialization response frame;
if the request frame is not the initialization and equipment discovery frame, judging whether the request frame is a data request frame;
if the request frame is a data request frame, sending a data response frame;
and if the request frame is not the data request frame, returning to the step of receiving the request frame sent by the master device.
Preferably, the communication method further includes:
if the current equipment is not the slave equipment, judging whether the hot standby slave equipment monitors communication abnormity of the slave equipment;
if the hot standby slave device monitors that the slave device is abnormal in communication, the hot standby slave device is changed into the slave device, whether the request frame is an initialization and device discovery frame or not is judged, and if the hot standby slave device does not monitor that the slave device is abnormal in communication, the hot standby slave device keeps the identity unchanged and returns to the step of receiving the request frame sent by the master device;
if the request frame is an initialization and device discovery frame, sending an initialization response frame;
if the request frame is not the initialization and equipment discovery frame, judging whether the request frame is a data request frame;
if the request frame is a data request frame, sending a data response frame;
and if the request frame is not the data request frame, returning to the step of receiving the request frame sent by the master device.
Preferably, the structure of the frame includes a start byte, a header, a data area, and a check area.
Preferably, the frame header is composed of 7 bytes, each byte indicating a frame type, a transmitting device ID, a receiving device ID, a frame sequence number, a time stamp, a mandatory acknowledgement group, and a data section data length, respectively.
Preferably, the slave device sets a timestamp of the response frame before transmitting the response frame, and the response frame includes an initialization response frame and a data response frame.
Compared with the prior art, one or more embodiments in the above scheme can have the following advantages or beneficial effects:
a communication system based on an RS485 bus is applied to a train control network and comprises a first main control board, a second main control board and a plurality of IO gateway boards; the first main control board and the second main control board are connected with each other through two mutually independent RS485 buses respectively, the first main control board and the second main control board can be connected through any one RS485 bus, and channel redundancy is realized by utilizing the two RS485 buses; a plurality of IO gateway boards all with two RS485 bus connections, a plurality of IO gateway boards can realize data interaction through any RS485 bus and first main control board and second main control board.
By utilizing the redundancy technology, when one RS485 bus is abnormal, the first main control board and the second main control board can also realize data interaction with a plurality of IO gateway boards through another RS485 bus, the breakdown of the whole train control network system caused by the abnormality of a single device or a single line is avoided, and the requirements of the train control network on the safety and the reliability of data transmission can be met.
Additional advantages, objects, and features of the invention will be set forth in part in the description which follows and in part will become apparent to those having ordinary skill in the art upon examination of the following or may be learned from practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
The accompanying drawings are included to provide a further understanding of the technology or prior art of the present application and are incorporated in and constitute a part of this specification. The drawings expressing the embodiments of the present application are used for explaining the technical solutions of the present application, and should not be construed as limiting the technical solutions of the present application.
Fig. 1 is an architecture diagram of an RS485 bus based communication system according to an embodiment of the present invention;
fig. 2 is a structural diagram of a communication frame of an RS485 bus based communication system according to an embodiment of the present invention;
fig. 3 is a first flowchart of a communication method based on an RS485 bus according to an embodiment of the present invention;
fig. 4 is a second flowchart of a communication method based on an RS485 bus according to an embodiment of the present invention.
Detailed Description
The following detailed description of the embodiments of the present invention will be provided with reference to the accompanying drawings and examples, so that how to apply the technical means to solve the technical problems and achieve the corresponding technical effects can be fully understood and implemented. The embodiments and the features of the embodiments can be combined without conflict, and the technical solutions formed are all within the scope of the present invention.
One of the technical problems to be solved by the embodiments of the present invention is: how to realize the RS485 bus architecture meets the requirement of a train control network on safety. In order to solve the above problem, an embodiment of the present invention provides a communication system based on an RS485 bus, which is applied to a train control network, and includes a first main control board, a second main control board, and a plurality of IO gateway boards; the first main control board and the second main control board are connected with each other through two mutually independent RS485 buses respectively, the first main control board and the second main control board can be connected through any one RS485 bus, channel redundancy is realized by utilizing the two RS485 buses, and the abnormality of the whole train control network system caused by the abnormal communication of a single RS485 bus channel can be avoided; a plurality of IO gateway boards all with two RS485 bus connections, a plurality of IO gateway boards can realize data interaction through any RS485 bus and first main control board and second main control board.
By utilizing the redundancy technology, when one RS485 bus is abnormal, the first main control board and the second main control board can also realize data interaction with a plurality of IO gateway boards through another RS485 bus, the breakdown of the whole train control network system caused by the abnormality of a single device or a single line is avoided, and the requirements of the train control network on the safety and the reliability of data transmission can be met.
The invention is further illustrated by the following specific examples.
As shown in fig. 1, a communication system based on an RS485 bus is applied to a train control network, and includes a first main control board, a second main control board, and a plurality of IO gateway boards; the first main control board and the second main control board are connected with each other through two mutually independent RS485 buses respectively, the first main control board and the second main control board can be connected through any one RS485 bus, and channel redundancy is realized by utilizing the two RS485 buses; a plurality of IO gateway boards all with two RS485 bus connections, a plurality of IO gateway boards can realize data interaction through any RS485 bus and first main control board and second main control board.
Further, the IO gateway board comprises a slave device and a hot standby slave device, and each RS485 bus is connected with the plurality of slave devices and the plurality of hot standby slave devices. Each IO network management board comprises a slave device and a hot standby slave device respectively.
The two RS485 buses are called a first RS485 bus and a second RS485 bus. The first main control board and the second main control board realize data interaction with the slave devices and the hot standby slave devices of the plurality of IO gateway boards through the first RS485 bus, or the first main control board and the second main control board realize data interaction with the hot standby slave devices and the hot standby slave devices of the plurality of IO gateway boards through the second RS485 bus. Namely, the slave device and the hot standby slave device of the IO gateway board may perform data interaction with the first main control board and the second main control board through the first RS485 bus or the second RS485 bus.
Each IO gateway board comprises slave equipment and hot standby slave equipment, so that equipment redundancy can be realized, and if the slave equipment of a certain IO gateway board fails, data interaction with the first main control board and the second main control board can be realized through the hot standby slave equipment of the IO gateway board through an RS485 bus.
Compare in traditional communication system based on RS485 bus, in the scheme of this application, realize the main equipment redundancy through setting up two main control boards, realize the channel redundancy through setting up two RS485 buses, IO gateway board includes that slave unit and heat are equipped with slave unit and realize that the slave unit is redundant. The redundancy of the main equipment and the redundancy of the slave equipment enable the communication system based on the RS485 bus to have a redundancy switching function, the problem of communication interruption caused by single equipment failure can be effectively solved, and the stability and the reliability of the communication system are improved. The channel redundancy enables the main control board and the IO gateway board to be connected with two mutually independent RS485 buses in the communication system based on the RS485 buses, the channel diagnosis and switching functions are achieved, the serious consequence that the whole train control network system is abnormal due to single channel faults can be avoided, and the safety and the reliability are higher.
According to the communication system based on the RS485 bus, the two main control boards and the plurality of IO gateways adopt master-slave response interactive communication, namely, the main control boards send request frames to the IO gateway boards, and the IO gateway boards send response frames to the main control boards after receiving the request frames. The main control board and the IO gateway board realize data interaction through a communication frame mode of a request frame and a response frame, and can avoid bus collision and improve the safety and the real-time performance of transmission.
The embodiment of the invention also discloses a communication method based on the RS485 bus, which is applied to the communication system. In the above communication system, each device has a unique device address, which is represented by a communication ID, and occupies 1 byte. The device address may be assigned by software in the train control network in the following manner. For example, the first master control board and the second master control board correspond to different communication IDs, such as 0x51 and 0x52, respectively. Each IO gateway board comprises a slave device and a hot standby slave device, communication IDs are sequentially allocated to the slave devices and the hot standby slave devices of the plurality of IO gateway boards according to the sequence of the IO gateway boards, the communication ID of the slave device of the first IO gateway board is 0xA0, the communication ID of the hot standby slave device of the first IO gateway board is 0xA1, the communication ID of the slave device of the second IO gateway board is 0xA2, the communication ID of the hot standby slave device of the second IO gateway board is 0xA3, and so on.
When the equipment address is detected, if the bit4-bit7 of the equipment address is 0x5, the current equipment is represented as a main control board, if the bit4-bit7 of the equipment address is 0xA, the current equipment is represented as an IO gateway board, and if the bit-bit7 is other values, the current equipment is represented as an illegal value. The numbers of the slave devices and the hot standby slave devices in the master control board or the IO gateway board are represented by bits 0 to bit3 of the device addresses, and priorities can be set according to the numbers, for example, the smaller the number is, the higher the priority is.
As can be seen from the communication IDs set above, the priority of the first main control board with the communication ID of 0x51 is higher than that of the second main control board with the communication ID of 0x52, the first main control board is a main device, and the second main control board is a hot standby main device; the slave of the first IO gateway board with the communication ID 0xA0 has higher priority than the hot standby slave of the first IO gateway board with the communication ID 0xA 1. Under normal conditions, the equipment with high priority carries out data communication, the equipment with low priority monitors the communication state of the equipment with high priority, and when the equipment with high priority fails in communication, the equipment with low priority carries out data communication, thereby realizing redundancy switching.
In the two RS485 buses, the priority of the first RS485 bus is higher than that of the second RS485 bus, data communication is carried out on the first RS485 bus under the default condition, data interaction between the main control board and the IO gateway board is completed, when the first RS485 bus is abnormal, the second RS485 bus is switched to carry out data communication, and data interaction between the main control board and the IO gateway board is completed.
The main control board and the IO gateway board perform data interaction and utilize a communication frame mode, and the frame structure comprises a starting byte, a frame header, a data area and a verification area. The structures of the communication frames are sequentially arranged, as shown in fig. 2, FrameStart is a start byte, and occupies 1 byte, and a fixed value is 0x 7E; the FrameHead is a frame header and is composed of 7 bytes, and each byte respectively indicates a frame type, a sending device ID, a receiving device ID, a frame sequence number, a timestamp, a forced response group and a data area data length; DATA is a DATA area, and the DATA length supports 0-255 bytes; FCS is a check area, and occupies 2 bytes. The data area adopts CRC-16 check mode, which can check the data of the frame head and the data area.
Specifically, the function of the frame header is as follows:
Figure BDA0002157803730000071
referring to fig. 3, with the structure of the communication frame, in the communication system based on the RS485 bus, the communication method based on the RS485 bus includes:
s1, setting the first main control board as a main device and the second main control board as a hot standby main device, or setting the second main control board as a main device and the first main control board as a hot standby main device;
generally, the first main control board is set as a master device, that is: and setting the first main control board as a communication ID with a smaller number.
S2, electrifying the first main control board and the second main control board, and respectively judging whether the first main control board and the second main control board are main devices;
and determining the identity of the first main control board and the second main control board through power-on self-test, namely determining whether the first main control board and the second main control board are the main equipment or the hot standby main equipment. Generally, the first main control board is used as a main device, and the second main control board is used as a hot standby main device.
S3, the main control board as the main device carries out bus initialization and slave device scanning;
generally, a first main control board performs bus initialization and slave device scanning, the first main control board sends an initialization and device discovery frame to an IO gateway board, a slave device of the IO gateway board responds according to the initialization and device discovery frame, a timestamp is set in a frame header of an initialization response frame, and the initialization response frame with the timestamp set is sent to the first main control board.
S4, after the initialization is finished, judging whether the current main control board is a main device;
s51, if the current master control board is the master device, judging whether the current RS485 bus used by the master device has communication fault;
and judging whether the current RS485 bus used by the master device has communication faults or not is realized by utilizing the periodic diagnosis of the current master control board.
S61, if the current RS485 bus used by the main device has communication fault, the current RS485 bus used by the main device is switched to another RS485 bus, the main device uses the another RS485 bus to perform data interaction with the IO gateway board, and if the current RS485 bus used by the main device has no communication fault, the step (S7) of sending a data request frame to a plurality of IO gateway boards by the main device is carried out;
through channel diagnosis and switching, the serious consequence that the fault of a single channel causes the abnormity of the whole train control network system can be avoided, and the method has stronger safety and reliability.
S7, the master device sends a data request frame to a plurality of IO gateway boards;
the master device periodically transmits a data request frame.
S8, the master device receives data response frames of a plurality of IO gateway boards;
s9, judging whether overtime exists according to the data response frame;
and judging whether the time is overtime or not according to the time stamp in the frame header of the data response frame.
S10, if time out, the data response frame is invalid;
s11, if not overtime, the data response frame is valid;
returning to the step of judging whether the current main control board is the main device (S4).
Further, referring to fig. 3, the communication method further includes:
s52, if the current main control board is not the main device, judging whether the current main control board monitors the communication abnormity of the main device;
if the current main control board is not the main device, the current main control board is a hot standby main device, and the communication state of the main device is periodically monitored by using the hot standby main device.
S62, if the current main control board monitors that the communication of the main equipment is abnormal, the current main control board is used as the main equipment, the current main control board used as the main equipment performs data interaction with the IO gateway board, and if the communication of the main equipment is not monitored by the current main control board, the current main control board is kept as the hot standby main equipment, monitors the communication state of the main equipment and receives data response frames of a plurality of IO gateway boards;
the redundant setting of main control board can effectively solve the problem that single equipment failure leads to communication interruption, and improves the stability and reliability of the train control network system.
S7, the master device sends a data request frame to a plurality of IO gateway boards;
the master device periodically transmits a data request frame.
S8, the master device receives data response frames of a plurality of IO gateway boards;
s9, judging whether overtime exists according to the data response frame;
and judging whether the time is overtime or not according to the time stamp in the frame header of the data response frame.
S10, if time out, the data response frame is invalid;
s11, if not overtime, the data response frame is valid;
returning to the step of judging whether the current main control board is the main device (S4).
Further, referring to fig. 4, the RS485 bus based communication method further includes:
s21, electrifying a plurality of IO gateway boards, confirming the identities of slave equipment and hot standby slave equipment included in the IO gateway boards, and distributing corresponding communication IDs according to the identities;
after the plurality of IO gateway boards are powered on, the identities of the IO gateway boards are determined through external hardware signals, whether the devices are slave devices or hot standby slave devices is determined, and corresponding communication IDs are allocated according to the identities, and the above embodiments can be referred to for setting of the communication IDs.
S22, receiving a request frame sent by the master device;
the slave device periodically waits to receive a request frame from the master device.
S23, judging whether the receiving device ID of the request frame is consistent with the communication ID of the current device;
s24, if it is consistent, it is judged whether the current device is the slave device, if not, it returns to the step of receiving the request frame sent by the master device (S22);
s25, if the current device is the slave device, judging whether the request frame is the initialization and device discovery frame;
and judging whether the frame is an initialization and equipment discovery frame or not according to the frame type of the frame head of the request frame.
S26, if the request frame is the initialization and equipment discovery frame, the initialization response frame is sent;
s27, if the request frame is not the initialization and device discovery frame, judging whether the request frame is a data request frame;
and judging whether the frame is a data request frame or not according to the frame type of the frame header of the request frame.
S28, if the request frame is a data request frame, sending a data response frame;
if the request frame is not a data request frame, the step of receiving the request frame sent by the master device is returned (S22).
Further, referring to fig. 4, the RS485 bus based communication method includes:
s251, if the current equipment is not the slave equipment, judging whether the hot standby slave equipment monitors the communication abnormality of the slave equipment;
the hot standby slave device periodically monitors the communication status of the slave device.
S252, if the hot standby slave device monitors that the communication of the slave device is abnormal, the hot standby slave device is changed into the slave device and is used as the slave device to judge whether the request frame is an initialization and device discovery frame (S25), if the hot standby slave device does not monitor that the communication of the slave device is abnormal, the hot standby slave device keeps the identity unchanged and returns to the step of receiving the request frame sent by the master device (S22);
the IO gateway board is provided with the slave equipment and the hot standby slave equipment in a redundant mode, so that the problem of communication interruption caused by single equipment failure can be effectively solved, and the stability and reliability of the train control network system are improved.
S26, if the request frame is the initialization and equipment discovery frame, the initialization response frame is sent;
s27, if the request frame is not the initialization and device discovery frame, judging whether the request frame is a data request frame;
and judging whether the frame is a data request frame or not according to the frame type of the frame header of the request frame.
S28, if the request frame is a data request frame, sending a data response frame;
if the request frame is not a data request frame, the step of receiving the request frame sent by the master device is returned (S22).
In the above embodiment, the slave device sets the time stamp of the response frame before transmitting the response frame, which includes the initialization response frame and the data response frame. By setting the timestamp, bus collision can be avoided, and the transmission safety and real-time performance are improved.
With the communication system and method based on the RS485 bus of the above embodiment, the following performance parameters can be achieved:
Figure BDA0002157803730000101
Figure BDA0002157803730000111
the above description is only a preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A communication system based on an RS485 bus is applied to a train control network and is characterized by comprising a first main control board, a second main control board and a plurality of IO gateway boards;
the first main control board and the second main control board are connected with each other through two mutually independent RS485 buses respectively;
and the IO gateway boards are connected with the two RS485 buses.
2. The RS485 bus based communication system according to claim 1, wherein the IO gateway board comprises slave devices and hot standby slave devices, each RS485 bus is connected with a plurality of slave devices and a plurality of hot standby slave devices.
3. The RS485 bus based communication system according to claim 1, wherein two master control boards and a plurality of IO gateways use master-slave response interactive communication.
4. A communication method based on an RS485 bus, applied to the communication system of any one of claims 1 to 3, the communication method comprising:
setting the first main control board as a main device and the second main control board as a hot standby main device, or setting the second main control board as a main device and the first main control board as a hot standby main device;
the first main control board and the second main control board are powered on, and whether the first main control board and the second main control board are main equipment or not is judged respectively;
the main control board as the main equipment carries out bus initialization and slave equipment scanning;
after initialization is completed, judging whether the current main control board is a main device or not, and if the current main control board is the main device, judging whether a communication fault exists in the current RS485 bus used by the main device or not;
if the current RS485 bus used by the main equipment has communication faults, the current RS485 bus used by the main equipment is switched to another RS485 bus, and if the current RS485 bus used by the main equipment has no communication faults, the step of sending a data request frame to a plurality of IO gateway boards by the main equipment is carried out;
the method comprises the steps that a main device sends a data request frame to a plurality of IO gateway boards;
the method comprises the steps that a master device receives data response frames of a plurality of IO gateway boards;
judging whether the data response frame is overtime or not according to the data response frame, if so, the data response frame is invalid, and if not, the data response frame is valid;
and returning to the step of judging whether the current main control board is the main equipment or not.
5. The RS485 bus based communication method according to claim 1, further comprising:
if the current main control board is not the main equipment, judging whether the current main control board monitors the communication abnormity of the main equipment;
if the current main control board monitors that the communication of the main equipment is abnormal, the current main control board is used as the main equipment, and if the communication of the main equipment is not abnormal, the current main control board is kept as the hot standby main equipment and receives data response frames of a plurality of IO gateway boards;
the method comprises the steps that a main device sends a data request frame to a plurality of IO gateway boards;
the method comprises the steps that a master device receives data response frames of a plurality of IO gateway boards;
judging whether the data response frame is overtime or not according to the data response frame, if so, the data response frame is invalid, and if not, the data response frame is valid;
and returning to the step of judging whether the current main control board is the main equipment or not.
6. The RS485 bus based communication method according to claim 4 or 5, further comprising:
electrifying a plurality of IO gateway boards, confirming the identities of slave equipment and hot standby slave equipment included in the IO gateway boards, and distributing corresponding communication IDs according to the identities;
receiving a request frame sent by a master device;
judging whether the ID of the receiving equipment of the request frame is consistent with the communication ID of the current equipment, if so, judging whether the current equipment is slave equipment, and if not, returning to the step of receiving the request frame sent by the master equipment;
if the current equipment is the slave equipment, judging whether the request frame is an initialization and equipment discovery frame;
if the request frame is an initialization and device discovery frame, sending an initialization response frame;
if the request frame is not the initialization and equipment discovery frame, judging whether the request frame is a data request frame;
if the request frame is a data request frame, sending a data response frame;
and if the request frame is not the data request frame, returning to the step of receiving the request frame sent by the master device.
7. The RS485 bus based communication method according to claim 6, further comprising:
if the current equipment is not the slave equipment, judging whether the hot standby slave equipment monitors communication abnormity of the slave equipment;
if the hot standby slave device monitors that the slave device is abnormal in communication, the hot standby slave device is changed into the slave device, whether the request frame is an initialization and device discovery frame or not is judged, and if the hot standby slave device does not monitor that the slave device is abnormal in communication, the hot standby slave device keeps the identity unchanged and returns to the step of receiving the request frame sent by the master device;
if the request frame is an initialization and device discovery frame, sending an initialization response frame;
if the request frame is not the initialization and equipment discovery frame, judging whether the request frame is a data request frame;
if the request frame is a data request frame, sending a data response frame;
and if the request frame is not the data request frame, returning to the step of receiving the request frame sent by the master device.
8. The RS485 bus based communication method of claim 7, wherein the frame structure comprises a start byte, a header, a data area and a check area.
9. The RS485 bus based communication method according to claim 8, wherein the frame header is composed of 7 bytes, each byte indicating a frame type, a transmitting device ID, a receiving device ID, a frame sequence number, a time stamp, a forced acknowledgement group and a data length of the data area, respectively.
10. The RS485 bus based communication method of claim 9, wherein the slave device sets a time stamp of the response frame before sending the response frame, and the response frame comprises an initialization response frame and a data response frame.
CN201910722764.4A 2019-08-06 2019-08-06 Communication system and method based on RS485 bus Pending CN112350909A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910722764.4A CN112350909A (en) 2019-08-06 2019-08-06 Communication system and method based on RS485 bus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910722764.4A CN112350909A (en) 2019-08-06 2019-08-06 Communication system and method based on RS485 bus

Publications (1)

Publication Number Publication Date
CN112350909A true CN112350909A (en) 2021-02-09

Family

ID=74367218

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910722764.4A Pending CN112350909A (en) 2019-08-06 2019-08-06 Communication system and method based on RS485 bus

Country Status (1)

Country Link
CN (1) CN112350909A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5353413A (en) * 1992-03-19 1994-10-04 Aeg Transportation Systems, Inc. Method and apparatus for christening a trainline monitor system
CN105099777A (en) * 2015-07-23 2015-11-25 南京国电南自轨道交通工程有限公司 Method suitable for communication-gateway double-machine redundancy in rail transit power monitoring system
CN204883335U (en) * 2015-07-24 2015-12-16 重庆川仪自动化股份有限公司 PAS100 control system's redundant framework of bus
CN204883336U (en) * 2015-07-24 2015-12-16 重庆川仪自动化股份有限公司 PAS100 control system's controller and redundant framework of communication module
CN204904019U (en) * 2015-07-24 2015-12-23 重庆川仪自动化股份有限公司 PAS100 control system's overall redundant framework
CN205539996U (en) * 2015-12-12 2016-08-31 重庆川仪自动化股份有限公司 Redundant control system of controller, IO communication bus and communication module
CN205581535U (en) * 2016-05-04 2016-09-14 常熟瑞特电气股份有限公司 High redundancy automated control ware able to programme

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5353413A (en) * 1992-03-19 1994-10-04 Aeg Transportation Systems, Inc. Method and apparatus for christening a trainline monitor system
CN105099777A (en) * 2015-07-23 2015-11-25 南京国电南自轨道交通工程有限公司 Method suitable for communication-gateway double-machine redundancy in rail transit power monitoring system
CN204883335U (en) * 2015-07-24 2015-12-16 重庆川仪自动化股份有限公司 PAS100 control system's redundant framework of bus
CN204883336U (en) * 2015-07-24 2015-12-16 重庆川仪自动化股份有限公司 PAS100 control system's controller and redundant framework of communication module
CN204904019U (en) * 2015-07-24 2015-12-23 重庆川仪自动化股份有限公司 PAS100 control system's overall redundant framework
CN205539996U (en) * 2015-12-12 2016-08-31 重庆川仪自动化股份有限公司 Redundant control system of controller, IO communication bus and communication module
CN205581535U (en) * 2016-05-04 2016-09-14 常熟瑞特电气股份有限公司 High redundancy automated control ware able to programme

Similar Documents

Publication Publication Date Title
CN110474943B (en) Vehicle network redundancy system and gateway switching method based on MVB and Ethernet
CN102407856B (en) Hot backup redundancy method and hot backup redundancy system of train central control unit
JP7254191B2 (en) Train network control system, method, apparatus, and train
US9565270B2 (en) LPC2468-based MVB-WTB gateway and working method thereof
US8306004B2 (en) Communication network system having high-ranking network and low-ranking networks, interchange terminal connecting high-ranking network and low-ranking network, microcomputer controlling connection between transmission line of low-ranking network and transmission line of high-ranking network, and communication transmitter-receiver connected with transmission line of low-ranking network and transmission line of high-ranking network
CN101237345A (en) A network management method for CAN bus
CN101557379B (en) Link reconfiguration method for PCIE interface and device thereof
CN106921834A (en) KVM light matrix switching systems
CN110213144B (en) Redundant network system for train door
US20160134553A1 (en) Flexible scheduling method and apparatus in lin communication
CN103825791A (en) Method for controlling parallel redundancy of MVB master
KR20170117634A (en) Method for supplying power in network and apparatus therefor
CN103078756B (en) Mode switching method and CAN (Controller Area Network)
CN114253897B (en) System PCIe topology dynamic switching system and method
CN104536853B (en) A kind of device ensureing dual controller storage device resource continuous availability
CN111884898B (en) Train network control system and fusion method based on software and hardware fusion
CN112350909A (en) Communication system and method based on RS485 bus
CN115733729B (en) Communication fault processing method, system and equipment
CN114615106B (en) Ring data processing system, method and network equipment
JP6134720B2 (en) Connection method
CN202615229U (en) Central control device in train network control system
CN214384911U (en) Train network communication device and system
CN114979036A (en) Dual-computer hot standby system of network gate based on heartbeat and isolation switching matrix
US9571298B2 (en) Network system
KR102029371B1 (en) Power Supply system and method for ethernet communication network in vehicle

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210209