CN109104346B - Train network data transmission method, system and device based on CANopen protocol - Google Patents

Train network data transmission method, system and device based on CANopen protocol Download PDF

Info

Publication number
CN109104346B
CN109104346B CN201710475924.0A CN201710475924A CN109104346B CN 109104346 B CN109104346 B CN 109104346B CN 201710475924 A CN201710475924 A CN 201710475924A CN 109104346 B CN109104346 B CN 109104346B
Authority
CN
China
Prior art keywords
node
heartbeat
network
channel
sent
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
CN201710475924.0A
Other languages
Chinese (zh)
Other versions
CN109104346A (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.)
BYD Co Ltd
Original Assignee
BYD 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 BYD Co Ltd filed Critical BYD Co Ltd
Priority to CN201710475924.0A priority Critical patent/CN109104346B/en
Publication of CN109104346A publication Critical patent/CN109104346A/en
Application granted granted Critical
Publication of CN109104346B publication Critical patent/CN109104346B/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
    • H04L12/4013Management of data rate on the bus
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/40143Bus networks involving priority mechanisms
    • H04L12/4015Bus networks involving priority mechanisms by scheduling the transmission of messages at the communication node
    • 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/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40215Controller Area Network CAN

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Quality & Reliability (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Small-Scale Networks (AREA)
  • Maintenance And Management Of Digital Transmission (AREA)

Abstract

The invention discloses a train network data transmission method, a train network data transmission system and a train network data transmission device based on a CANopen protocol, wherein the method comprises the following steps: monitoring heartbeat messages sent by all slave nodes related to an active master node through a first CAN channel on a heartbeat signal network according to a pre-configured network node list, analyzing the heartbeat messages to check working states of a second CAN channel and a third CAN channel of a first node if judging that the heartbeat messages sent by the first node are received on the heartbeat signal network in a preset first heartbeat period is known, receiving data sent by the first node on a main network if inquiring that the second CAN channel of the first node is normal, and receiving data sent by the first node on a standby network if inquiring that the second CAN channel of the first node is in fault and the third CAN channel is normal. Therefore, the data transmission efficiency of the train network is improved, the good running of the whole train is ensured, and the redundancy effect of the train network is improved.

Description

Train network data transmission method, system and device based on CANopen protocol
Technical Field
The invention relates to the technical field of vehicle communication, in particular to a train network data transmission method, a train network data transmission system and a train network data transmission device based on a CANopen protocol.
Background
At present, the train communication network is widely applied to Train Communication Network (TCN) bus technology, and the TCN covers four buses, namely, MVB (multifunction vehicle bus), WTB (wire train bus), ethernet and CAN (field bus). One common requirement among the design requirements for the four buses, i.e., MVB, WTB, ethernet, and CAN, is a network redundancy design. The network redundancy means that a standby network is set for each communication network, namely, each node on the network adopts a two-wire connection mode of an A wire and a B wire, when the network fails, the communication can be realized through the standby network, the smooth interaction of product data on the network is ensured, and the operating environment of the train communication network has high availability.
However, in the train network in the prior art, whether the product data transmitted by using the active network or the standby network includes data such as heartbeat messages and PDO messages, the two different mechanisms of the product data are transmitted in one network, which may cause the two to seize resources mutually, resulting in loss of the product data or untimely response.
Disclosure of Invention
The object of the present invention is to solve at least to some extent one of the above mentioned technical problems.
Therefore, the first purpose of the invention is to provide a train network data transmission method based on the CANopen protocol, which improves the data transmission efficiency of the train network, and ensures the good running of the whole train and the redundancy effect of the train network.
The second purpose of the invention is to provide another train network data transmission method based on the CANopen protocol.
A third object of the invention is to propose an active master node.
A fourth object of the invention is to propose a slave node.
The fifth purpose of the invention is to provide a train network data transmission system based on the CANopen protocol.
A sixth object of the invention is to propose a computer device.
A seventh object of the invention is to propose another computer device.
An eighth object of the present invention is to provide a storage medium.
A ninth object of the invention is to propose another storage medium.
In order to achieve the above object, an embodiment of the first aspect of the present invention provides a train network data transmission method based on a CANopen protocol, including the following steps: monitoring heartbeat messages sent by all slave nodes related to the active master node through a first CAN channel on a heartbeat signal network according to a pre-configured network node list; judging whether the first CAN channel of each slave node fails according to the timing condition of a heartbeat timer corresponding to each slave node and the receiving condition of the heartbeat message; if judging and knowing that a heartbeat message sent by the first node is received on the heartbeat signal network in a preset first heartbeat period, analyzing the heartbeat message to check the working states of a second CAN channel and a third CAN channel of the first node, wherein the first node is any slave node related to the movable master node; if the second CAN channel of the first node is found to be normal through inquiry, receiving data sent by the first node on the main network; and if the second CAN channel of the first node is found to be in fault and the third CAN channel is normal through inquiry, receiving data sent by the first node on a standby network.
In order to achieve the above object, another train network data transmission method based on the CANopen protocol according to an embodiment of the second aspect of the present invention includes the following steps: monitoring heartbeat messages sent by all nodes related to the slave nodes through a first CAN channel on a heartbeat signal network according to a pre-configured network node list; judging whether the first CAN channel of each slave node fails according to the timing condition of a heartbeat timer corresponding to each slave node and the receiving condition of the heartbeat message; if the heartbeat message of a second node is received on the heartbeat signal network in a preset heartbeat period is judged and known, analyzing the heartbeat message to check the working states of a second CAN channel and a third CAN channel of the second node, wherein the second node is any slave node or movable master node related to the slave node; if the second CAN channel of the second node is found to be normal through inquiry, receiving data sent by the second node on the main network; and if the second CAN channel of the second node is found to be in fault and the third CAN channel is normal through inquiry, receiving data sent by the second node on the standby network.
In order to achieve the above object, an embodiment of a third aspect of the present invention provides an active master node, including: the first monitoring module is used for monitoring heartbeat messages sent by all slave nodes related to the active master node through a first CAN channel on a heartbeat signal network according to a pre-configured network node list; the first judgment module is used for judging whether the first CAN channel of each slave node fails according to the timing condition of a heartbeat timer corresponding to each slave node and the receiving condition of the heartbeat message; the first analysis module is used for analyzing the heartbeat message to check the working states of a second CAN channel and a third CAN channel of the first node when judging and knowing that the heartbeat message sent by the first node is received on the heartbeat signal network in a preset first heartbeat period, wherein the first node is any slave node related to the movable master node; the first receiving module is used for receiving data sent by the first node on the main network when the second CAN channel of the first node is found to be normal through inquiry; the first receiving module is further configured to receive data sent by the first node on a standby network when the second CAN channel of the first node is queried to be faulty and the third CAN channel is normal.
In order to achieve the above object, a slave node according to a fourth aspect of the present invention includes: the second monitoring module is used for monitoring heartbeat messages sent by all nodes related to the slave nodes through a first CAN channel on a heartbeat signal network according to a pre-configured network node list; the second judging module is used for judging whether the first CAN channel of each slave node fails according to the timing condition of a heartbeat timer corresponding to each slave node and the receiving condition of the heartbeat message; the second analysis module is used for analyzing the heartbeat message to check the working states of a second CAN channel and a third CAN channel of a second node when judging and knowing that the heartbeat message of the second node is received on the heartbeat signal network in a preset heartbeat period, wherein the second node is any slave node or movable master node related to the slave node; the second receiving module is used for receiving data sent by the second node on the main network when the second CAN channel of the second node is found to be normal through inquiry; the second receiving module is further configured to receive data sent by the second node on the standby network when the second CAN channel of the second node is found to be faulty and the third CAN channel is normal.
In order to achieve the above object, a train network data transmission system based on the CANopen protocol according to an embodiment of a fifth aspect of the present invention includes: the slave node of the fourth aspect of the present invention is configured to perform interaction of heartbeat messages with the heartbeat signal network through a first CAN channel, perform data interaction with the master network through a second CAN channel, and perform data interaction with the backup network through a third CAN channel.
In order to achieve the above object, a computer device according to a sixth embodiment of the present invention includes a memory, a processor, and a computer program stored in the memory and operable on the processor, where the processor executes the computer program to implement the train network data transmission method based on the CANopen protocol according to the first embodiment of the present invention.
In order to achieve the above object, a seventh embodiment of the present invention provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and operable on the processor, wherein the processor, when executing the computer program, implements the train network data transmission method based on the CANopen protocol according to the second embodiment of the present invention.
In order to achieve the above object, an eighth aspect of the present invention provides a storage medium for storing an application program, where the application program is configured to execute the train network data transmission method based on the CANopen protocol according to the embodiment of the first aspect of the present invention.
In order to achieve the above object, a storage medium according to a ninth aspect of the present invention is a storage medium for storing an application program, where the application program is configured to execute the train network data transmission method based on the CANopen protocol according to the second aspect of the present invention.
The technical scheme provided by the embodiment of the invention has the following beneficial technical effects:
the heartbeat messages and the data are transmitted on different lines, so that the data transmission efficiency and the response speed of the train network are improved, when one or some slave nodes are disconnected in the main network, the standby network is switched to receive the data of the slave nodes, and other slave node data are still received on the main network, so that the complete receiving of the relevant slave node data is ensured, the good running of the whole train is ensured, and the redundancy effect of the train network is improved.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The foregoing and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a flowchart of a train network data transmission method based on a CANopen protocol according to a first embodiment of the present invention;
FIG. 2 is a schematic diagram of a train network architecture according to the prior art;
FIG. 3(a) is a schematic diagram of risk existence of train network structure data transmission according to the prior art;
fig. 3(b) is a schematic diagram of train network structure data transmission overcoming risk according to the present invention;
FIG. 4 is a schematic diagram of a train network architecture according to one embodiment of the present invention;
fig. 5 is a flowchart of a train network data transmission method based on the CANopen protocol according to a second embodiment of the present invention;
fig. 6 is a flowchart of a train network data transmission method based on a CANopen protocol according to a third embodiment of the present invention;
fig. 7 is a flowchart of a train network data transmission method based on the CANopen protocol according to a fourth embodiment of the present invention;
fig. 8 is a flowchart of a train network data transmission method based on a CANopen protocol according to a fifth embodiment of the present invention;
fig. 9 is a flowchart of a train network data transmission method based on a CANopen protocol according to a sixth embodiment of the present invention;
fig. 10 is a flowchart of a train network data transmission method based on a CANopen protocol according to a seventh embodiment of the present invention;
fig. 11 is a flowchart of a train network data transmission method based on a CANopen protocol according to an eighth embodiment of the present invention;
fig. 12 is a flowchart of a train network data transmission method based on a CANopen protocol according to a ninth embodiment of the present invention;
FIG. 13 is a schematic structural diagram of an active master node according to a first embodiment of the present invention;
FIG. 14 is a schematic structural diagram of an active master node according to a second embodiment of the present invention;
fig. 15 is a schematic structural diagram of an active master node according to a third embodiment of the present invention;
fig. 16 is a schematic structural diagram of an active master node according to a fourth embodiment of the present invention;
fig. 17 is a schematic structural diagram of an active master node according to a fifth embodiment of the present invention;
fig. 18 is a schematic structural diagram of an active master node according to a sixth embodiment of the present invention;
fig. 19 is a schematic structural diagram of an active master node according to a seventh embodiment of the present invention;
fig. 20 is a schematic structural diagram of an active master node according to an eighth embodiment of the present invention;
fig. 21 is a schematic structural diagram of an active master node according to a ninth embodiment of the present invention;
fig. 22 is a schematic configuration diagram of a slave node according to the first embodiment of the present invention;
fig. 23 is a schematic structural diagram of a slave node according to a second embodiment of the present invention;
fig. 24 is a schematic structural diagram of a slave node according to a third embodiment of the present invention;
fig. 25 is a schematic structural diagram of a slave node according to a fourth embodiment of the present invention;
fig. 26 is a schematic structural diagram of a slave node according to a fifth embodiment of the present invention;
fig. 27 is a schematic structural diagram of a slave node according to a sixth embodiment of the present invention;
fig. 28 is a schematic structural diagram of a slave node according to a seventh embodiment of the present invention;
fig. 29 is a schematic structural diagram of a train network data transmission system based on a CANopen protocol according to an embodiment of the present invention;
FIG. 30 is a diagram illustrating an active master node receiving data when a first CAN channel of node A fails, in accordance with one embodiment of the present invention;
fig. 31 is a schematic diagram illustrating data received by an active master node in the event of a failure of a first CAN channel of node a in accordance with another embodiment of the present invention;
fig. 32 is a schematic diagram illustrating data received by an active master node when a first CAN channel and a second CAN channel of node a fail according to an embodiment of the present invention; and
fig. 33 is a schematic diagram illustrating data received by an active master node when a first CAN channel and a second CAN channel of node a fail according to another embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
The following describes a train network data transmission method, system and device based on the CANopen protocol according to an embodiment of the present invention with reference to the accompanying drawings.
In order to more clearly describe the train network data transmission method based on the CANopen protocol of the present invention, the following description is given, with reference to specific embodiments, focusing on the application of the method to the active master node side, and the following description is given:
it should be emphasized that the train network data transmission method of the present invention is executed based on the CANopen protocol, wherein the CANopen protocol requires a node in the network to act as an active master node to manage the initialization, start, supervision, reset or stop of other slave nodes.
In order to better implement the train network data transmission method based on the CANopen protocol of the embodiment of the present invention, the active master node has certain design requirements, and as the active master node serves as a network administrator identity, the active master node has a function of network state control more than that of the slave node, that is, after being powered on, the active master node needs to simultaneously send network control instructions to the active network and the standby network, control two paths of CAN channels of the slave node to enter an operation mode, and simultaneously send messages such as a synchronization packet, a timestamp, an emergency object and the like to the active network and the standby network.
Fig. 1 is a flowchart of a train network data transmission method based on a CANopen protocol according to a first embodiment of the present invention, as shown in fig. 1, the method includes:
s101, monitoring heartbeat messages sent by all slave nodes related to the active master node through a first CAN channel on a heartbeat signal network according to a pre-configured network node list.
It CAN be understood that, in order to solve the problem in the prior art that, in the same network line, not only the heartbeat message but also the PDO message data (hereinafter referred to as data) are transmitted, which results in that the train network does not respond timely or cannot respond, for example, the heartbeat message and the data are transmitted at the same time, the data may be transmitted after a certain time delay, or the data may be "squeezed" by the heartbeat message, and the like.
Specifically, a heartbeat message sent by each slave node related to the active master node through a first CAN channel is monitored on a heartbeat signal network according to a pre-configured network node list.
It is to be understood that, in an embodiment of the present invention, a network node list corresponding to an active master node may be established according to a network topology, where the network node list includes: each slave node identification related to the active master node and a corresponding heartbeat timer, wherein the node identification can be data which uniquely identifies the node, such as an identity Identification (ID) of the slave node.
And further, sending a network control instruction to all the slave nodes, controlling the first CAN channel of the slave nodes to enter a heartbeat message operation mode, and starting a heartbeat timer corresponding to each slave node related to the active master node.
Specifically, after the active master node is in its own operation state, it executes a heartbeat message monitoring mechanism, the active master node can establish a list (configurable) of all network nodes according to a network topology map, that is, an object index in an object dictionary of the customized CANopen marks the identity of each node with a node identifier unique to each node, the node identifiers (such as node IDs) of all nodes are contained in the object storage space, the active master node will set a heartbeat timer for each node, after the active master node enters the operation state, each heartbeat timer will count down, the active master node will analyze the received heartbeat message to obtain the corresponding node identifier, such as node ID, then match with the node list in its own object dictionary, then set the heartbeat timer corresponding to the matched node, re-time, according to the requirement of the characteristic, all nodes including the active main node send heartbeat messages on the main network and the standby network circularly through a specific period by using respective node IDs.
In practical application, in a default state, the active master node first monitors the heartbeat message transmission condition of each slave node on the master network, that is, the heartbeat message transmitted by each slave node related to the active master node through the first CAN channel is monitored on the master network according to a preconfigured network node list.
And S102, judging whether the first CAN channel of each slave node has a fault according to the timing condition of the heartbeat timer corresponding to each slave node and the receiving condition of the heartbeat message.
Specifically, if the first CAN channel of the slave node is in good communication, the active master node may normally receive the heartbeat packet sent by the slave node within a certain time, otherwise, the first CAN channel of the slave node fails in communication.
Certainly, in some cases, the active master node may not normally receive the heartbeat message sent by the slave node due to some other reasons, for example, a network signal is suddenly interfered, and therefore, to avoid erroneous judgment, whether the first CAN channel of each slave node fails is accurately determined, and whether the first CAN channel of each slave node fails is determined by comprehensively considering the timing condition of the heartbeat timer correspondingly set by each slave node and the receiving condition of the heartbeat message.
For example, when there are three heartbeat cycles in which a heartbeat message of a certain node is not monitored, the active master node first resets the node through a network-controlled reset instruction, then monitors two heartbeat cycles, and CAN receive the heartbeat message of the node in the two heartbeat cycles, and the active master node maintains the master network to process the node, otherwise, it is determined that the first CAN channel of the slave node may fail.
It should be emphasized that the timing condition of the heartbeat timer in the above example is only an example, and according to different application requirements, a combination of other heartbeat cycles may also be adopted to determine whether the first CAN channel of each slave node fails, for example, when there are 5 heartbeat cycles where a heartbeat packet of a certain slave node is not detected, it is directly determined that the first CAN channel of the slave node fails.
And S103, if the heartbeat message sent by the first node is received on the heartbeat signal network in the preset first heartbeat period, analyzing the heartbeat message and checking the working states of the second CAN channel and the third CAN channel of the first node.
The first node is any slave node related to the active master node, and the preset first heartbeat cycle may be set according to a specific application scenario, which is not limited herein.
It should be understood that the heartbeat packet protocol is shown in table 1 below, and by analyzing the heartbeat packet, what state each node is currently operating in and the current state of each CAN channel of each node CAN be known.
TABLE 1
Figure BDA0001328254860000071
Figure BDA0001328254860000072
Figure BDA0001328254860000081
Therefore, if the heartbeat message sent by the first node is received on the heartbeat signal network in the preset first heartbeat period is judged and known, the first CAN channel of the first node is known to be normal, and therefore, in order to know whether the CAN channels of other channels are normal or not, the heartbeat message is analyzed to check the working states of the second CAN channel and the third CAN channel of the first node.
And S104, if the second CAN channel of the first node is normal, receiving the data sent by the first node on the main network.
And S105, if the second CAN channel of the first node is found to be in fault and the third CAN channel is normal through inquiry, receiving data sent by the first node on the standby network.
It should be understood that, in the embodiment of the present invention, data is transmitted through the second CAN channel or the third CAN channel, where a network in which the second CAN channel is located is an active network, and a network in which the third CAN channel is a standby network.
In particular, as CAN be seen from the design of redundant networks in the prior art, since the train using the CAN bus as the communication network is less in application, namely, the network architecture built by the CAN bus is simpler, even the train using the CAN bus at present does not properly consider the network redundancy design, even with this consideration, many vehicle manufacturers have limited technical conditions, and in order to make the network node software logic process simple, quickly satisfy the network construction, therefore, the existing relatively perfect strategy is that all nodes send data in the active network and the standby network at the same time, but only one network is selected to receive data, and no matter which node on the main network is disconnected, the nodes related to the node are uniformly switched to the standby network to receive and process the data of the disconnected node and the data of other related nodes.
For example, as shown in the example of fig. 2, the network node A, C needs to receive the data of node B, and the node D, E does not receive the data of node B, when the first CAN channel of node B fails, node a and node C switch to the standby network to receive the data, so as to ensure normal reception of the data of node B.
However, such a processing manner may have a risk, as shown in fig. 3(a), node a needs to receive data of node B and node C, but when the first CAN channel of node B fails and the second CAN channel of node C fails, node a CAN only take one network data according to the existing manner, so that data of node B or node C CAN only be selected to be discarded, but in an actual situation, data of node B and node C are important for node a, and only one network data CAN be received, which may affect the function of node a, and further affect the operation of the whole vehicle, and the redundancy effect is greatly reduced, and the meaning of redundancy is not reflected.
In order to solve the technical problem that partial node data cannot be normally received when different channels of a plurality of nodes fail in the prior art, the train network data transmission method provided by the invention provides a train redundant network data transmission design scheme on the basis of the existing train network redundant design structure, can effectively avoid some node data from being discarded when a partial node main network channel fails and a partial node standby network channel fails, simultaneously improves the actual effect of redundant design, well avoids the problem that the whole train operation is blocked due to some vehicle network failures, and can ensure that all nodes of the network can still normally communicate under some abnormal conditions.
It should be emphasized that, at this time, the active master node only monitors the data of the first node from the standby network, and still receives the heartbeat packet in the primary network for the nodes without failure in the other first CAN channels, so that, as shown in fig. 3(B), the node a needs to receive the data of the node B and the node C, and when the first CAN channel of the node B fails and the second CAN channel of the node C fails, according to the data transmission method of the present invention, the node a receives the data of the node C through the primary network and receives the data sent by the node B from the standby network, so that the data of the node B and the node C CAN be ensured, the normal function of the node a CAN be ensured, and further, the good operation of the entire vehicle CAN be ensured, and the redundancy effect is.
Therefore, according to the above description of the train network data transmission method based on the CANopen protocol, and referring to the design of the industry specification CIA302-6 for CAN redundancy and the mature field bus redundancy mechanism of the rail industry, the network architecture of the embodiment of the present invention is required to refer to fig. 4, the network sets two active master nodes, one is an active master node, and the other is a backup active master node, when the active master node fails, the backup active master node will perform the function of replacing the previous active master node, and perform the transmission of the heartbeat message through an additional heartbeat signal network.
In addition, all nodes on the network are connected by adopting A, B two pairs of CAN lines, the A line is defined as an active network, the B line is defined as a standby network, all nodes CAN simultaneously send information to the A line and the B line when in operation, but only CAN receive the information on the A line under the initial default condition, but the nodes must support the simultaneous information reception in the A line and the B line, therefore, when a second CAN channel of one slave node fails, the data of the node is received from the standby node, and the data sent by the slave node is still received from the active network aiming at the slave nodes of which the rest second CAN channels do not fail, so that the complete reception of the data of the relevant slave nodes is ensured, and the normal and good operation is ensured.
Of course, in the above description of the embodiments of the present invention, it is assumed that the communication between the active network and the standby network has no fault, and both the active network and the standby network may have faults in actual application, so that the bus fault determination mechanism is further executed after the active master node enters the operating state.
Specifically, according to the CAN bus characteristic requirements, all CAN controllers must include a transmission error counter and a reception error timer, in combination with an error detection mechanism defined by the data link layer, when a bus communication abnormality is detected, the error counter is enabled, and when the count is up to 255, the node enters a bus off state.
The active main node is required to monitor the states of the main network and the standby network, when the main network bus of the active main node has a fault (such as abnormal CAN line voltage, busoff caused by excessive error frames, etc.), the active main node first analyzes the heartbeat message of the standby active main node to determine whether to start the standby active main node, if the standby active main node CAN normally take the role of the active main node, the active main node stops running and enters a silent state, the standby node starts and takes the role of the active main node, if the standby active main node is in a fault state at present and cannot take the role of the active main node, the current active main node continues to operate and immediately switches to the standby network to process all slave node data, and meanwhile, the active main node notifies the meter or other devices that the main network is in a fault state at present, if the current standby network also has a fault, the communication network enters a paralyzed state, and all nodes enter a special operation state of the vehicle.
The number of times 255 accumulated by the error counter is merely an example, and according to different specific application requirements, when the active master node sends an error timer or receives the error timer and accumulates to any preset value meeting requirements, it knows that the active network fails, and switches to the standby network to communicate with other nodes.
Of course, in an embodiment of the present invention, it is also possible that the active master node fails, and in this case, if the active master node fails, the standby master node is switched to perform data interaction with other related slave nodes.
To sum up, in the train network data transmission method based on the CANopen protocol according to the embodiment of the present invention, a heartbeat message sent by each slave node related to an active master node through a first CAN channel is monitored on a heartbeat signal network according to a preconfigured network node list, whether the first CAN channel of each slave node fails is determined according to a timing condition of a heartbeat timer corresponding to each slave node and a receiving condition of the heartbeat message, if it is determined that the heartbeat message sent by the first node is received on the heartbeat signal network in a preset first heartbeat period, the heartbeat message is analyzed to check working states of a second CAN channel and a third CAN channel of the first node, if it is determined that the second CAN channel of the first node is normal by query, data sent by the first node is received on a master network, if it is determined that the second CAN channel of the first node is failed and the third CAN channel is normal by query, the data sent by the first node is received on the standby network. Therefore, the heartbeat messages and the data are transmitted on different lines, the data transmission efficiency and the response speed of the train network are improved, when one or some slave nodes are disconnected in the main network, the standby network is switched to receive the data of the slave nodes, and other slave node data are still received on the main network, so that the complete receiving of the relevant slave node data is ensured, the good running of the whole train is ensured, and the redundancy effect of the train network is improved.
In practical applications, it may be determined and known that the heartbeat packet of the first node is not received in the heartbeat signal network in the preset first heartbeat period, and therefore, in order to ensure normal reception of the heartbeat packet, a corresponding processing operation needs to be performed according to specific conditions.
Fig. 5 is a flowchart of a train network data transmission method based on the CANopen protocol according to a second embodiment of the present invention, and as shown in fig. 5, after the step S102, the method includes:
s201, if judging and knowing that the heartbeat message of the first node is not received by the heartbeat signal network in the preset first heartbeat period, sending a reset instruction to the first node from the main network.
In practical applications, it is possible that a failure occurring in the CAN channel is not a long-term failure, such as a suspension of operation due to a sudden change in network speed, and therefore, in order to avoid a waste of resources caused by unnecessary switching, in an embodiment of the present invention, if it is determined that the heartbeat message of the first node is not received in the heartbeat signal network within a preset first heartbeat period, a reset instruction is sent to the failed CAN channel, so as to determine whether a failure actually occurs at present according to a receiving condition of the heartbeat message after reset.
S202, continuously monitoring the heartbeat message sent by the first node on the heartbeat signal network, and if the heartbeat message of the first node is received on the heartbeat signal network in a preset second heartbeat period, analyzing the heartbeat message to check the working states of the second CAN channel and the third channel of the first node.
The preset second heartbeat cycle can be labeled according to a specific application scene, and can be the same as or different from the first heartbeat cycle.
Specifically, in an embodiment of the present invention, after determining that the heartbeat packet of the first node is not received in the preset first heartbeat cycle, the failure of the first CAN channel is not directly determined, but a reset instruction is sent from the active network to the first node, so that the first CAN channel enters an initial operating state.
And then, continuously monitoring the heartbeat message sent by the first node on the main network, and if the heartbeat message of the first node is received in a preset second heartbeat period, knowing that the fault of the first CAN channel of the first node is temporary and is eliminated through the reset action, monitoring the heartbeat message sent by the first node on the main network, analyzing the heartbeat message and checking the working states of the second CAN channel and the third channel of the first node.
And S203, if the second CAN channel of the first node is normal, receiving the data sent by the first node on the main network.
And S204, if the second CAN channel of the first node is found to be in fault and the third CAN channel is normal through inquiry, receiving data sent by the first node on the standby network.
Specifically, in order to realize normal transmission of data, if it is found that the second CAN channel of the first node is normal through inquiry, the data sent by the first node is received on the active network, and if it is found that the second CAN channel of the first node is failed through inquiry and the third CAN channel is normal, the data sent by the first node is received on the standby network.
S205, if the heartbeat packet of the first node is not received on the heartbeat signal network in the preset second heartbeat period, acquiring a failure of the first CAN channel of the first node, and switching to the active network to monitor the heartbeat packet sent by the first node.
Specifically, if the heartbeat message of the first node is not received on the heartbeat signal network within the preset second heartbeat period, the failure of the first CAN channel of the first node is known, and therefore, in order to ensure normal transmission of heartbeat message data, it is preferred to switch to the master network to monitor the heartbeat message sent by the first node.
S206, if the heartbeat packet sent by the first node is received on the active network in the preset first heartbeat cycle, receiving data sent by the first node on the active network.
Specifically, if a heartbeat message sent by the first node is received on the primary network within a preset first heartbeat cycle, it indicates that the second CAN channel is normal, and at this time, data sent by the first node is received on the primary network.
Based on the same principle, when the second CAN channel is switched to receive the heartbeat message sent by the first node, if the heartbeat message sent by the first node through the second CAN channel cannot be received in a preset first heartbeat period, the communication fault of the second CAN channel is not directly judged, but a reset instruction is sent to the first node from the main network, and the heartbeat message sent by the first node is continuously monitored in the main network.
Fig. 6 is a flowchart of a train network data transmission method based on the CANopen protocol according to a third embodiment of the present invention, and as shown in fig. 6, after the step S205, the method further includes:
s301, if the heartbeat packet sent by the first node is not received on the active network in a preset first heartbeat cycle, sending a reset instruction from the active network to the first node.
Specifically, if the heartbeat packet sent by the first node is not received on the active network within the preset first heartbeat period, similarly, the failure of the second CAN channel of the first node is not directly determined, but a reset instruction is sent from the active network to the first node.
S302, continuously monitoring the heartbeat packet sent by the first node on the active network, and if the heartbeat packet of the first node is received on the active network in a preset second heartbeat cycle, receiving the data sent by the first node on the active network.
Specifically, the heartbeat message sent by the first node is continuously monitored on the primary network, and if the heartbeat message of the first node is received on the primary network within a preset second heartbeat period, it indicates that the fault on the primary network can be automatically eliminated through resetting, and the data sent by the first node is received on the primary network.
And S303, if the heartbeat message of the first node is not received on the main network in a preset second heartbeat period, acquiring the fault of a second CAN channel of the first node, and switching to a standby network to monitor the heartbeat message sent by the first node.
Specifically, if the heartbeat message of the first node is not received on the main network within a preset second heartbeat period, the failure of the second CAN channel of the first node is known, so that in order to ensure normal reception of the heartbeat message, the standby network is switched to monitor the heartbeat message sent by the first node.
S304, if the heartbeat packet sent by the first node is received on the standby network in the preset first heartbeat period, receiving the data sent by the first node on the standby network.
Specifically, if a heartbeat message sent by the first node is received on the standby network within a preset first heartbeat period, it is indicated that the third CAN channel of the first node is normal, so that data sent by the first node is received on the standby network.
S305, if the heartbeat message sent by the first node is not received on the standby network within a preset first heartbeat period, a reset instruction is sent to the first node from the standby network.
Specifically, if the heartbeat message sent by the first node is not received on the standby network within a preset first heartbeat period, a reset instruction is sent to the first node from the standby network to determine whether the fault of the third CAN channel of the current first node CAN be automatically eliminated through resetting.
S306, continuously monitoring the heartbeat packet sent by the first node on the standby network, and if the heartbeat packet of the first node is received on the standby network in a preset second heartbeat period, receiving the data sent by the first node on the standby network.
Specifically, the heartbeat message sent by the first node is continuously monitored on the standby network, and if the heartbeat message of the first node is received on the standby network within a preset second heartbeat period, it is determined that the fault of the third CAN channel of the current first node is self-eliminable through resetting, so that the data sent by the first node is received on the standby network.
In summary, in the train network data transmission method based on the CANopen protocol according to the embodiments of the present invention, in order to avoid resource waste caused by unnecessary switching, a reset instruction is sent to the failed CAN channel, so as to determine whether a failure actually occurs at present according to the receiving condition of the heartbeat message after reset, and the switching of the CAN channel is performed only when a failure actually occurs, so that the stability and the practicability of the train network are improved.
Based on the above embodiment, in order to further improve the stability and reusability of the train network data transmission method based on the CANopen protocol, the fault information of the current train network is displayed in real time according to the condition of sending data, so that related operators can maintain the train network as soon as possible according to the fault information, and the like, thereby improving the stability of the train network data transmission.
Fig. 7 is a flowchart of a train network data transmission method based on the CANopen protocol according to a fourth embodiment of the present invention, and as shown in fig. 7, after step 206, the method further includes:
s401, after receiving a heartbeat message sent by a first node on a main network in a preset first heartbeat period, sending a current fault message of a first CAN channel of the first node to an operation monitoring node, and displaying the current fault message to an operator to prompt current fault maintenance.
The monitoring node may be different devices, such as an instrument display screen, an application interface of a terminal device, and the like, under the condition that specific application requirements are different, which is not limited herein.
Specifically, in an embodiment of the present invention, if a heartbeat message sent by a first node is received on a primary network in a preset first heartbeat cycle, and a heartbeat message sent by the first node on the primary network through a second CAN is received, the reason that the heartbeat data of the first node cannot be received on a heartbeat signal network is indicated to be a failure of a first CAN channel, so that a relevant operator CAN know a failure condition in time to perform failure processing, a current failure message of the first CAN channel of the first node is sent to an operation monitoring node, and is displayed to the operator, so as to prompt current failure maintenance.
For example, in this example, the preset second heartbeat cycle is five heartbeat cycles, and the operation monitoring node is a display screen, if the heartbeat message of the first node cannot be monitored in five consecutive heartbeat cycles on the heartbeat signal network, the active master node directly reports that the first CAN channel of the first node has a fault (the fault type is a current fault) to the meter display screen, and prompts to repair the heartbeat signal network of the node.
S402, continuously monitoring the heartbeat message sent by the first node on the heartbeat signal network, and if the heartbeat message of the first node is received in a preset first heartbeat period, knowing that the first CAN channel of the first node recovers communication, switching to the heartbeat signal network to receive the heartbeat message sent by the first node.
Specifically, when a communication fault occurs in the node heartbeat signal network, the active master node needs to continue to monitor the node heartbeat message on the node heartbeat signal network, and if the communication is recovered in the node heartbeat signal network with the fault midway, the node heartbeat message is communicated through the recovered network.
For example, if the heartbeat message sent by the first node through the first CAN channel is continuously monitored in the heartbeat signal network, if the first CAN channel of the node with the fault midway recovers communication, that is, the heartbeat message of the first node CAN be received by the active master node in five consecutive heartbeat cycles on the heartbeat signal network, the active master node receives and processes the data of the first node on the recovered network, but still notifies the first node that the network is a historical fault to an operation monitoring node (such as an instrument display screen).
Based on the same operation principle, fig. 8 is a flowchart of a train network data transmission method based on the CANopen protocol according to a fifth embodiment of the present invention, and as shown in fig. 8, after step S304, that is, after receiving a heartbeat message sent by a first node on a standby network within a preset first heartbeat period, the method further includes:
s501, after receiving a heartbeat message sent by a first node on a standby network in a preset first heartbeat period, sending current fault messages of a first CAN channel and a second CAN channel of the first node to an operation monitoring node, displaying the current fault messages to an operator, and prompting the current fault maintenance.
Specifically, if the heartbeat message sent by the first node is received on the standby network within a preset first heartbeat period, it is indicated that the reason why the heartbeat message of the first node cannot be received is that the first CAN channel and the second CAN channel are faulty, so that in order to prompt relevant maintenance personnel to perform maintenance as soon as possible, current fault messages of the first CAN channel and the second CAN channel of the first node are sent to the operation monitoring node and displayed to an operator to prompt current fault maintenance.
S502, continuously monitoring heartbeat messages sent by the first node on the heartbeat signal network and the main network, and if the heartbeat messages of the first node are received on the heartbeat signal network in a preset first heartbeat period, knowing that the first CAN channel of the first node recovers communication, switching to the heartbeat signal network to receive the heartbeat messages sent by the first node.
Specifically, when two paths of the nodes have communication faults, the active master node needs to continue to monitor the heartbeat messages sent by the first node on the heartbeat signal network and the master network, and if one of the master network and the heartbeat signal network recovers communication in midway of the faulty nodes, the active master node communicates through the recovered network.
For example, the heartbeat message sent by the first node is continuously monitored on the master network and the heartbeat signal network, if one of the master network and the heartbeat signal network recovers communication in midway fault nodes, for example, if an active master node can receive the heartbeat message of the first node in five consecutive heartbeat cycles on the heartbeat signal network, the active master node receives and processes data of the first node on the recovered network, but still notifies the running monitoring node (such as an instrument display screen and the like) that the network of the first node is a historical fault and the network of the other node is a current fault.
S503, continuously monitoring heartbeat messages sent by the first node on the heartbeat signal network and the main network, and if the heartbeat messages of the first node are received on the main network in a preset first heartbeat period, knowing that the second CAN channel of the first node recovers communication, switching to the main network to receive the heartbeat messages and data sent by the first node.
Specifically, when two paths of the nodes have communication faults, the active master node needs to continue to monitor the heartbeat messages sent by the first node on the heartbeat signal network and the master network, and if one of the master network and the heartbeat signal network recovers communication in midway of the faulty nodes, the active master node communicates through the recovered network.
For example, the heartbeat message sent by the first node is continuously monitored on the master network and the heartbeat signal network, if one of the master network and the heartbeat signal network recovers communication in midway fault nodes, for example, if an active master node can receive the heartbeat message of the first node in five consecutive heartbeat cycles on the master network, the active master node receives and processes data of the first node on the recovered network, but still notifies the running monitoring node (such as an instrument display screen and the like) that the network of the first node is a history fault and the network of the other path is a current fault.
S504, continuously monitoring the heartbeat message sent by the first node on the heartbeat signal network, and if the heartbeat message of the first node is received on the heartbeat signal network in a preset first heartbeat period, knowing that the first CAN channel of the first node recovers communication, switching to the heartbeat signal network to receive the heartbeat message sent by the first node.
Specifically, after the master network recovers communication, the master network continues to monitor a heartbeat message sent by the first node on the heartbeat signal network, and if the heartbeat message of the first node is received on the heartbeat signal network in a preset first heartbeat period, it is known that the first CAN channel of the first node recovers communication, so that in order to consider a sending mechanism of the heartbeat message and a sending mechanism of data, the master network is switched to the heartbeat signal network to receive the heartbeat message sent by the first node.
Based on the same operation principle, fig. 9 is a flowchart of a train network data transmission method based on the CANopen protocol according to a sixth embodiment of the present invention, as shown in fig. 9, after step S306, the method further includes:
s601, if the heartbeat message of the first node is not received on the standby network in a preset second heartbeat period, sending current fault messages of the first CAN channel, the second CAN channel and the third CAN channel of the first node to the operation monitoring node, and displaying the current fault messages to an operator to prompt the current fault maintenance.
Specifically, if the heartbeat message sent by the first node through the third CAN channel is not received in the standby network within the preset second heartbeat period, it indicates that the third CAN channel cannot normally provide data service, and thus, current fault messages of the first CAN channel, the second CAN channel and the third CAN channel of the first node are sent to the operation monitoring node and displayed to an operator to prompt current fault maintenance.
S602, continuously monitoring heartbeat messages sent by the first node on the heartbeat signal network, the active network, and the standby network, and if the heartbeat message of the first node is received on the heartbeat signal network in a preset first heartbeat cycle, knowing that the first CAN channel of the first node recovers communication, receiving the heartbeat message sent by the first node on the heartbeat signal network.
Specifically, in order to realize normal data transmission of the train network as soon as possible after communication is restored in one of the heartbeat signal network, the primary network and the standby network, heartbeat messages sent by the first node are continuously monitored in the heartbeat signal network, the primary network and the standby network, and if the heartbeat messages of the first node are received in the heartbeat signal network in a preset first heartbeat period, the first CAN channel of the first node is learned to restore communication at the moment, and the first CAN channel is only used for transmitting the heartbeat messages, so the heartbeat messages sent by the first node are received in the heartbeat signal network.
Of course, in some application scenarios, in order to maintain normal operation of the train network, the data sent by the first node may also be received on the heartbeat signal network, which is not limited herein.
S603, continuously monitoring heartbeat messages sent by the first node on the heartbeat signal network, the primary network, and the standby network, and if the heartbeat message of the first node is received on the primary network in a preset first heartbeat cycle, knowing that the second CAN channel of the first node recovers communication, receiving data sent by the first node on the primary network.
Specifically, heartbeat messages sent by the first node are continuously monitored on the heartbeat signal network, the main network and the standby network, if the heartbeat messages of the first node are received on the main network in a preset first heartbeat period, the second CAN channel of the first node is learned to recover communication, and in order to achieve normal operation of the tandem network as soon as possible, data sent by the first node is received on the main network.
S604, continuously monitoring the heartbeat message sent by the first node on the heartbeat signal network, and if the heartbeat message of the first node is received on the heartbeat signal network in a preset first heartbeat period, knowing that the first CAN channel of the first node recovers communication, receiving the heartbeat message sent by the first node on the heartbeat signal network.
Specifically, the heartbeat message sent by the first node is continuously monitored on the heartbeat signal network, and if the heartbeat message of the first node is received on the heartbeat signal network in a preset first heartbeat period, it is known that the first CAN channel of the first node recovers communication, and the heartbeat message sent by the first node is received on the heartbeat signal network in order to consider the transmission mechanism of the heartbeat message and data.
S605, continuously monitoring heartbeat messages sent by the first node on the heartbeat signal network, the main network and the standby network, and if the heartbeat messages of the first node are received on the standby network in a preset first heartbeat period, knowing that the third CAN channel of the first node recovers communication, and receiving data sent by the first node on the standby network.
Specifically, in order to recover the communication of the train network as soon as possible, the heartbeat message sent by the first node is continuously monitored on the heartbeat signal network, the main network and the standby network, and if the heartbeat message of the first node is received on the standby network in a preset first heartbeat period, it is known that the third CAN channel of the first node recovers the communication, so that the data sent by the first node is received on the standby network.
And S606, continuously monitoring heartbeat messages sent by the first node on the heartbeat signal network and the main network, and if the heartbeat messages of the first node are received on the heartbeat signal network in a preset first heartbeat period, knowing that the first CAN channel of the first node recovers communication, receiving the heartbeat messages sent by the first node on the heartbeat signal network.
Specifically, after the standby network recovers communication, the heartbeat messages sent by the first node are continuously monitored on the heartbeat signal network and the main network, if the heartbeat messages of the first node are received on the heartbeat signal network in a preset first heartbeat period, the first CAN channel of the first node is known to recover communication, and the heartbeat messages sent by the first node are received on the heartbeat signal network.
S607, continuously monitoring heartbeat messages sent by the first node on the heartbeat signal network and the master network, and if the heartbeat messages of the first node are received on the master network in a preset first heartbeat cycle, knowing that the second CAN channel of the first node recovers communication, switching to the master network to receive data sent by the first node.
Specifically, after the standby network recovers communication, the heartbeat messages sent by the first node continue to be monitored on the heartbeat signal network and the main network, and if the heartbeat messages of the first node are received on the main network in a preset first heartbeat period, the second CAN channel of the first node is known to recover communication, so that the standby network is switched to the main network to receive data sent by the first node.
S608, continuously monitoring the heartbeat message sent by the first node on the heartbeat signal network, and if the heartbeat message of the first node is received on the heartbeat signal network in a preset first heartbeat period, knowing that the first CAN channel of the first node recovers communication, receiving the heartbeat message sent by the first node on the heartbeat signal network.
Specifically, the heartbeat message sent by the first node is continuously monitored on the heartbeat signal network, and if the heartbeat message of the first node is received on the heartbeat signal network in a preset first heartbeat period, it is known that the first CAN channel of the first node resumes communication, and the heartbeat message sent by the first node is received on the heartbeat signal network in order to consider a communication mechanism for sending the heartbeat message and data.
It should be emphasized that, based on the description of the above embodiments, in the embodiment of the present invention, in the transmission mechanism of the heartbeat packet, the network is still switched for the node where the CAN channel fails, and for other nodes that normally transmit the heartbeat packet, the heartbeat packet CAN still be received in the original network, so that the redundancy effect of the train network of the present invention is further increased.
That is, when one or some slave nodes are disconnected in the heartbeat signal network, the slave nodes are switched to the main network to receive the heartbeat messages of the slave nodes, and other nodes are still received in the heartbeat signal network.
In summary, according to the train network data transmission method based on the CANopen protocol in the embodiment of the present invention, the heartbeat signal network, the primary network and the standby network are selected according to the real-time situation of the train network, and are correspondingly displayed to the relevant operating personnel at the monitoring node, so that the stability and the reusability of the train network data transmission method are improved.
In order to more clearly illustrate the train network data transmission method based on the CANopen protocol according to the embodiment of the present invention, the following description focuses on the slave node side with the method.
The design requirements for the slave nodes are as follows:
the slave nodes enter an operation state after receiving an active master node starting instruction after being electrified, and send PDO data according to self functions and combining the frequency of a synchronous packet of the active master node, the slave nodes are required to send data to a main network and a standby network at the same time, but only special object messages such as a synchronous packet, a timestamp and the like of the active master node are received from the main network under the default condition, the slave nodes are switched to the standby network to receive only when the special object messages of the active master node cannot be received in 5 continuous message periods on the main network, and if the special object messages of the active master node cannot be received in 5 continuous message periods on the standby network, each slave node enters a special condition processing mode at the moment.
Fig. 10 is a flowchart of a train network data transmission method based on a CANopen protocol according to a seventh embodiment of the present invention, and as shown in fig. 10, the train network data transmission method based on the CANopen protocol includes:
s701, monitoring heartbeat messages sent by all nodes related to the slave nodes through a first CAN channel on a heartbeat signal network according to a pre-configured network node list.
It is understood that the network node list corresponding to the slave node is established according to the network topology map, wherein the network node list comprises: each node identification associated with a slave node and a corresponding heartbeat timer.
And then, receiving a network control instruction sent by the active master node, starting the first CAN channel to enter a heartbeat message operation mode, and starting a heartbeat timer corresponding to each node related to the slave node.
Specifically, after the slave node is in its own operation state, the slave node executes a heartbeat message monitoring mechanism, establishes a node list (including active master nodes and configurable) associated with the slave node according to a topological graph, namely, node IDs of the relevant nodes are set in a specific object index storage space in an object dictionary of the slave node, the slave node sets a heartbeat timer for each node relevant to the slave node, each heartbeat timer counts down after the slave node enters the operation state, the slave node analyzes a corresponding node ID from a received heartbeat message, then matches the node ID with a node ID table in its own object dictionary, and then sets and times again the heartbeat timer corresponding to the matched node.
In practical application, each slave node in a default state monitors the heartbeat message sending condition of the relevant slave node on a heartbeat signal network according to a network node list.
S702, judging whether the first CAN channel of each slave node has a fault according to the timing condition of the heartbeat timer corresponding to each slave node and the receiving condition of the heartbeat message.
Specifically, if the first CAN channel communication of the slave node is good, the slave node may normally receive the heartbeat packet sent by the relevant slave node within a certain time, otherwise, the first CAN channel communication of the relevant slave node fails.
Certainly, in some cases, the slave node may not normally receive the heartbeat message sent by the relevant slave node due to some other reasons, for example, the network signal is suddenly interfered, and so on, so to avoid misjudgment, it is accurately determined whether the first CAN channel of each slave node fails, and whether the first CAN channel of the relevant slave node fails is determined by comprehensively considering the timing condition of the heartbeat timer correspondingly set by each slave node and the receiving condition of the heartbeat message.
For example, when the heartbeat message of a certain node is not monitored in 5 heartbeat cycles, it is determined that the first CAN channel of the slave node may fail.
And S703, if the heartbeat message of the second node is received on the heartbeat signal network in the preset heartbeat period is judged and known, analyzing the heartbeat message to check the working states of a second CAN channel and a third CAN channel of the second node.
The second node is any slave node or active master node related to the slave node.
It CAN be understood that, in actual application, if it is determined that the heartbeat message of the second node is received in the preset heartbeat period, it is determined that the first CAN channel of the second node is normal, and therefore, the heartbeat message of the second node is received on the heartbeat signal network.
Further, the node network status protocol shown in table 1 is continuously referred to, and the operating status of the corresponding CAN channel CAN be known by analyzing the signal value in the heartbeat message.
And S704, if the second CAN channel of the second node is found to be normal through inquiry, receiving data sent by the second node on the active network.
And S705, if the second CAN channel of the second node is found to be in fault and the third CAN channel is normal through inquiry, receiving data sent by the second node on the standby network.
Specifically, if it is found that the second CAN channel of the second node is normal through querying, for example, the heartbeat value corresponding to the second CAN channel is analyzed to be 0x0, the node network state protocol shown in table 1 is queried, it is known that the second CAN channel of the second node is normal, and it is known that the third CAN channel has a fault, for example, the heartbeat value corresponding to the third CAN channel is analyzed to be 0x1, the node network state protocol shown in table 1 is queried, it is known that the third CAN channel of the second node has a fault, and in order to normally receive data sent by the second node, data sent by the second node is received on the primary network.
If the second CAN channel fault of the second node is found through inquiry, for example, the corresponding heartbeat value in the second CAN channel is analyzed to be 0x1, the node network state protocol shown in table 1 is inquired, the second CAN channel fault of the second node is found, and the third CAN channel is found to be normal, for example, the corresponding heartbeat value in the third CAN channel is analyzed to be 0x0, the node network state protocol shown in table 1 is inquired, the third CAN channel of the second node is found to be normal, and in order to normally receive the data sent by the second node, the standby network is switched to receive the data sent by the second node.
Therefore, the heartbeat messages are transmitted on the heartbeat signal network, and the main network or the standby network is selected to transmit data according to the working states of the second CAN channel and the third CAN channel, so that the data and the heartbeat messages are separately transmitted, the competition of two information transmission processes on network lines is avoided, the heartbeat messages and the data have sufficient resources to transmit the data, the stability of the train network is maintained, and the response speed is improved.
In addition, it should be emphasized that, in the embodiment of the present invention, in the data transmission mechanism, the network is switched to the dropped node to receive data according to the specific working states of the active network and the standby network, and for other nodes that normally send data, the node is still located in the original network to receive data, so that the redundancy effect of the train network is increased.
Of course, in the above description of the embodiments of the present invention, it is assumed that the communication between the active network and the standby network has no fault, and both the active network and the standby network may have faults in actual application, so that after the slave node itself enters an operating state, a bus fault determination mechanism is further executed.
That is to say, the slave node monitors the bus states of the master network and the standby network in real time (realized by an error counter), when a second CAN channel of the slave node has a fault (such as busoff caused by abnormal CAN line voltage, excessive error frames and the like), the slave node immediately switches to the standby network to process all slave node data, meanwhile, the slave node records that the master network is currently in a bus communication abnormal fault state, if the current standby network also has a bus fault, the communication network enters a breakdown state, and all the nodes enter a vehicle special operation state.
Specifically, if the sending error counter or the receiving error counter in the slave node is accumulated to a preset value, the master network is informed of the fault, and the slave node is switched to the standby network to communicate with other nodes.
In summary, in the train network data transmission method based on the CANopen protocol according to the embodiment of the present invention, monitoring heartbeat messages sent by each node related to the slave node through a first CAN channel on a heartbeat signal network according to a pre-configured network node list, according to the timing condition of the heartbeat timer corresponding to each slave node and the receiving condition of the heartbeat message, judging whether the first CAN channel of each slave node has a fault, if judging that the heartbeat message of the second node is received on the heartbeat signal network in a preset heartbeat period, analyzing the heartbeat message to check the working states of the second CAN channel and the third CAN channel of the second node, if the second CAN channel of the second node is normal through inquiry, and receiving the data sent by the second node on the main network, and receiving the data sent by the second node on the standby network if the second CAN channel of the second node is found to be in fault and the third CAN channel is normal. Therefore, the heartbeat messages and the data are transmitted on different lines, the data transmission efficiency and the response speed of the train network are improved, when one or some slave nodes are disconnected in the main network, the standby network is switched to receive the data of the slave nodes, and other slave node data are still received on the main network, so that the complete receiving of the relevant slave node data is ensured, the good running of the whole train is ensured, and the redundancy effect of the train network is improved.
Based on the above embodiment, in order to further improve the stability and reusability of the train network data transmission method based on the CANopen protocol, the fault information of the current train network is displayed in real time by recording the data sending condition from the node, so that the relevant operating personnel can maintain as soon as possible according to the fault information.
Fig. 11 is a flowchart of a train network data transmission method based on a CANopen protocol according to an eighth embodiment of the present invention, and as shown in fig. 11, after the step S702, the train network data transmission method based on the CANopen protocol includes:
s801, if judging that the heartbeat message of the second node is not received on the heartbeat signal network in the preset heartbeat period, acquiring that the first CAN channel of the second node has a fault, and switching to the main network to monitor the heartbeat message sent by the second node.
Specifically, if it is determined that the heartbeat message of the second node is not received on the heartbeat signal network in a preset heartbeat cycle, for example, in five heartbeat cycles, it indicates that the first CAN channel of the second node has a fault, and thus, in order to maintain normal operation on the train network, the master network is switched to the master network to monitor the heartbeat message sent by the second node.
At this time, it is necessary to force that, for other nodes that can normally send heartbeat messages on the heartbeat signal network, the heartbeat messages are still sent on the heartbeat signal network.
S802, if the heartbeat packet sent by the second node is received on the active network in a preset heartbeat period, receiving data sent by the second node on the active network.
Specifically, if a heartbeat message sent by the second node is received on the active network within a preset heartbeat cycle, it indicates that although the CAN1 channel of the second node fails, the CAN2 channel of the second node is normal, and at this time, data sent by the second node is received on the active network.
And S803, recording the current fault message of the first CAN channel of the second node.
Specifically, the current fault message of the first CAN channel of the second node is recorded to stop requesting the relevant data from the second node in the heartbeat signal network, so that the waste of resources is avoided, and the network is conveniently switched in time to acquire the relevant data sent by the second node.
S804, continuously monitoring the heartbeat message sent by the second node on the heartbeat signal network, and if the heartbeat message of the second node is received on the heartbeat signal network in a preset heartbeat period, knowing that the first CAN channel of the second node recovers communication, switching to the signal heartbeat network to receive the heartbeat message sent by the second node.
Specifically, the heartbeat message sent by the second node is continuously monitored on the heartbeat signal network, and if the first CAN channel with the midway fault is recovered to be normal, that is, the heartbeat message of the second node is received on the heartbeat signal network in a preset heartbeat period, the first CAN channel of the second node is informed of recovering communication, and the first CAN channel is switched to the signal heartbeat network to receive the heartbeat message sent by the second node.
And S805, if the heartbeat message sent by the second node cannot be received on the main network in the preset heartbeat period, switching to the standby network to monitor the heartbeat message sent by the second node.
Specifically, in an embodiment of the present invention, if the heartbeat packet sent by the second node is not received on the active network in a preset heartbeat cycle, it indicates that both the first CAN channel and the second CAN channel of the second node have a fault, so as to acquire the related data of the second node, switch to the standby network to monitor the heartbeat packet sent by the second node.
S806, if the heartbeat packet sent by the second node is received on the standby network within a preset heartbeat period, receiving data sent by the second node on the standby network.
Specifically, if the heartbeat message sent by the second node is received on the standby network within a preset heartbeat period, it indicates that the third CAN channel of the second node is normal, and thus, the data sent by the second node is received on the standby network.
It should be noted that, for other slave nodes, the same switching mechanism as that of the second node is used to perform network switching, and for a node that can normally send a heartbeat packet on the heartbeat signal network, the node still maintains sending the heartbeat packet on the heartbeat signal network, and for the definition that data can be sent on the master network, data and the like are sent on the master network earlier.
S807, recording the current fault messages of the first CAN channel and the second CAN channel of the second node.
Specifically, if the second node CAN only normally send data in the third CAN channel, the current fault messages of the first CAN channel and the second CAN channel of the second node are recorded, so that relevant operators CAN conveniently overhaul the fault.
And S808, continuously monitoring heartbeat messages sent by the second node on the heartbeat signal network and the main network, and if the heartbeat messages of the second node are received on the heartbeat signal network in a preset heartbeat period, knowing that the first CAN channel of the second node recovers communication, switching to the signal heartbeat network to receive the heartbeat messages sent by the second node.
Specifically, the heartbeat messages sent by the second node are continuously monitored on the heartbeat signal network and the master network, so that if the first CAN channel of the second node recovers communication, that is, the heartbeat messages of the second node are received on the heartbeat signal network in a preset heartbeat period, the first CAN channel of the second node recovers communication, and the first CAN channel is switched to the signal heartbeat network to receive the heartbeat messages sent by the second node.
And S809, continuously monitoring heartbeat messages sent by the second node on the heartbeat signal network and the master network, and if the heartbeat messages of the second node are received on the master network in a preset heartbeat period, knowing that the second CAN channel of the second node recovers communication, switching to the master network to receive data sent by the second node.
Specifically, the heartbeat message sent by the second node is continuously monitored on the heartbeat signal network and the master network, and if it is known that the second CAN channel of the second node recovers communication, that is, the heartbeat message of the second node is received on the master network in a preset heartbeat period, it is known that the second CAN channel of the second node recovers communication, and the second CAN channel is switched to the master network to receive data sent by the second node.
And S810, continuously monitoring the heartbeat message sent by the second node on the heartbeat signal network, and if the heartbeat message of the second node is received on the heartbeat signal network in a preset heartbeat period, knowing that the first CAN channel of the second node recovers communication, switching to the heartbeat signal network to receive the heartbeat message sent by the second node.
Certainly, in the embodiment of the present invention, if the second CAN channel of the second node recovers communication, but the first CAN channel does not yet recover communication, the heartbeat message sent by the second node is monitored continuously on the heartbeat signal network, so that if the heartbeat message of the second node is received on the heartbeat signal network in a preset heartbeat period, the first CAN channel of the second node is known to recover communication, and the first CAN channel is switched to the heartbeat signal network to receive the heartbeat message sent by the second node.
In another embodiment of the present invention, after the heartbeat packet of the second node is not received on both the heartbeat signal network and the active network, the heartbeat packet of the second node may not be received on the standby network, and at this time, the communication network needs to be selected according to the specific condition of the network recovering communication.
Fig. 12 is a flowchart of a train network data transmission method based on a CANopen protocol according to a ninth embodiment of the present invention, and as shown in fig. 12, after the step S805, the train network data transmission method based on the CANopen protocol includes:
s901, if the heartbeat message sent by the second node cannot be received on the standby network in a preset heartbeat period, recording the current fault messages of the first CAN channel, the second CAN channel and the third CAN channel of the second node.
Specifically, if the heartbeat message sent by the second node cannot be received on the standby network within a preset heartbeat period, it indicates that the first CAN channel, the second CAN channel and the third CAN channel of the second node all have faults, so that for the convenience of timely maintenance of related operators and timely related processing of a train network, current fault messages of the first CAN channel, the second CAN channel and the third CAN channel of the second node are recorded.
And S902, continuously monitoring heartbeat messages sent by the second node on the heartbeat signal network, the main network and the standby network, and if the heartbeat messages of the second node are received on the heartbeat signal network in a preset first heartbeat period, knowing that the first CAN channel of the second node recovers communication, and receiving the heartbeat messages sent by the second node on the heartbeat signal network.
Specifically, in order to recover the normal operation of the train network in time, the heartbeat messages sent by the second node are continuously monitored on the heartbeat signal network, the main network and the standby network, so that if the heartbeat messages of the second node are received on the heartbeat signal network in a preset first heartbeat period, it is known that the first CAN channel of the second node recovers communication, and the heartbeat messages sent by the second node are received on the heartbeat signal network.
And S903, continuously monitoring heartbeat messages sent by the second node on the heartbeat signal network, the main network and the standby network, and if the heartbeat messages of the second node are received on the main network in a preset first heartbeat period, knowing that the second CAN channel of the second node recovers communication, receiving the heartbeat messages and data sent by the second node on the main network.
Specifically, in an embodiment of the present invention, it is possible that the second CAN channel of the second node first recovers communication, and continues to monitor the heartbeat packet sent by the second node on the heartbeat signal network, the active network, and the standby network, and if the heartbeat packet of the second node is received on the active network in a preset heartbeat cycle, it is known that the second CAN channel of the second node recovers communication, and then the heartbeat packet and data sent by the second node are received on the active network.
And S904, continuously monitoring the heartbeat message sent by the second node on the heartbeat signal network, and if the heartbeat message of the second node is received on the heartbeat signal network in a preset heartbeat period, knowing that the first CAN channel of the second node recovers communication, receiving the heartbeat message sent by the second node on the heartbeat signal network.
Specifically, even if the second CAN channel of the second node recovers communication, in order to recover the stability of the train network as soon as possible, the heartbeat message sent by the second node is monitored continuously on the heartbeat signal network, and if the heartbeat message of the second node is received on the heartbeat signal network in a preset heartbeat period, the first CAN channel of the second node recovers communication, and the heartbeat message sent by the second node is received on the heartbeat signal network.
S905, continuously monitors the heartbeat packet sent by the second node on the heartbeat signal network, the primary network, and the standby network, and if the heartbeat packet of the second node is received on the standby network in a preset heartbeat cycle, learns that the third CAN channel of the second node recovers communication, and receives data sent by the second node on the standby network.
Specifically, in an embodiment of the present invention, it is possible that the third CAN channel of the second node first recovers communication, that is, the heartbeat packet sent by the second node is continuously monitored on the heartbeat signal network, the active network, and the standby network, and if the heartbeat packet of the second node is received on the standby network in a preset heartbeat cycle, it is known that the third CAN channel of the second node recovers communication, and then the data sent by the second node is received on the standby network.
S906, continuously monitoring heartbeat messages sent by the second node on the heartbeat signal network and the main network, and if the heartbeat messages of the second node are received on the heartbeat signal network in a preset heartbeat period, knowing that the first CAN channel of the second node recovers communication, and receiving the heartbeat messages sent by the second node on the heartbeat signal network.
Specifically, even if the third CAN channel of the second node recovers communication, in order to recover the stability of the train network as soon as possible in the embodiment of the present invention, the heartbeat message sent by the second node is continuously monitored on the heartbeat signal network and the master network, and if the heartbeat message of the second node is received on the heartbeat signal network in a preset heartbeat cycle, it is known that the first CAN channel of the second node recovers communication, and the heartbeat message sent by the second node is received on the heartbeat signal network.
And S907, continuously monitoring heartbeat messages sent by the second node on the heartbeat signal network and the master network, and if the heartbeat messages of the second node are received on the master network in a preset heartbeat period, knowing that the second CAN channel of the second node recovers communication, switching to the master network to receive data sent by the second node.
Specifically, after the third CAN channel of the second node recovers communication, if the second CAN channel with higher priority recovers communication, the second CAN channel is switched to the active network to receive data sent by the second node.
And S908, continuously monitoring the heartbeat message sent by the second node on the heartbeat signal network, and if the heartbeat message of the second node is received on the heartbeat signal network in a preset heartbeat period, knowing that the first CAN channel of the second node recovers communication, receiving the heartbeat message sent by the second node on the heartbeat signal network.
Specifically, after the second CAN channel of the second node recovers communication, if the first CAN channel with higher priority recovers communication, the first CAN channel is switched to the heartbeat signal network to receive data sent by the second node.
It should be emphasized that, based on the description of the above embodiments, in the embodiment of the present invention, in the transmission mechanism of the heartbeat packet, the network is still switched for the node where the CAN channel fails, and for other nodes that normally transmit the heartbeat packet, the heartbeat packet CAN still be received in the original network, so that the redundancy effect of the train network of the present invention is further increased.
That is, when one or some slave nodes are disconnected in the heartbeat signal network, the slave nodes are switched to the main network to receive the heartbeat messages of the slave nodes, and other nodes are still received in the heartbeat signal network.
It should be emphasized that the train network data transmission method based on the CANopen protocol, which is described with a focus on the active master node side, corresponds to the train network data transmission method based on the CANopen protocol, which is described with a focus on the slave node side, and the implementation principle thereof is similar, and details which are not published in this embodiment are not described herein again.
In summary, according to the train network data transmission method based on the CANopen protocol in the embodiment of the present invention, the heartbeat signal network, the primary network and the standby network are selected according to the real-time situation of the train network, and are correspondingly displayed to the relevant operating personnel at the monitoring node, so that the stability and the reusability of the train network data transmission method are improved.
In order to realize the embodiment, the invention also provides an active master node. Fig. 13 is a schematic structural diagram of an active master node according to a first embodiment of the present invention, and as shown in fig. 13, the active master node includes: the device comprises a first monitoring module 101, a first judging module 102, a first analyzing module 103 and a first receiving module 104.
The first monitoring module 101 is configured to monitor, on the heartbeat signal network, a heartbeat packet sent by each slave node related to the active master node through the first CAN channel according to a preconfigured network node list.
Fig. 14 is a schematic structural diagram of an active master node according to a second embodiment of the present invention, as shown in fig. 14, and based on that shown in fig. 13, the active master node further includes:
a first building module 105 and a first processing module 106.
The first establishing module 105 is configured to establish a network node list corresponding to the active master node according to the network topology, where the network node list includes: each slave node identification associated with an active master node and a corresponding heartbeat timer.
The first processing module 106 is configured to send a network control instruction to all the slave nodes, control the first CAN channel of the slave node to enter a heartbeat message operation mode, and start a heartbeat timer corresponding to each slave node related to the active master node.
The first determining module 102 is configured to determine whether the first CAN channel of each slave node fails according to a timing condition of a heartbeat timer corresponding to each slave node and a receiving condition of a heartbeat packet.
The first analyzing module 103 is configured to, when it is determined that a heartbeat message sent by a first node is received on a heartbeat signal network in a preset first heartbeat period, analyze the heartbeat message to check working states of a second CAN channel and a third CAN channel of the first node, where the first node is any slave node related to the active master node.
The first receiving module 104 is configured to receive, on the active network, data sent by the first node when the second CAN channel of the first node is found to be normal.
In an embodiment of the present invention, the first receiving module 104 is further configured to receive data sent by the first node on the standby network when the second CAN channel of the first node is queried to be faulty and the third CAN channel is normal.
Fig. 15 is a schematic structural diagram of an active master node according to a third embodiment of the present invention, as shown in fig. 15, and based on that shown in fig. 13, the active master node further includes: a second learning module 107, a first switching module 108 and a second switching module 109.
The second learning module 107 is configured to learn about the primary network fault when the transmission error counter or the reception error counter in the active master node is incremented to a preset value.
And a first switching module 108 for switching to the standby network to communicate with other nodes.
And a second switching module 109, configured to switch to the standby master node to perform data interaction with other related slave nodes when detecting that the active master node fails.
In summary, the active master node in the embodiment of the present invention monitors the heartbeat message sent by each slave node related to the active master node through the first CAN channel on the heartbeat signal network according to the preconfigured network node list, according to the timing condition of the heartbeat timer corresponding to each slave node and the receiving condition of the heartbeat message, judging whether the first CAN channel of each slave node has a fault, if judging that the heartbeat message sent by the first node is received on the heartbeat signal network in a preset first heartbeat period, analyzing the heartbeat message to check the working states of the second CAN channel and the third CAN channel of the first node, if the second CAN channel of the first node is normal through inquiry, and receiving the data sent by the first node on the main network, and receiving the data sent by the first node on the standby network if the second CAN channel of the first node is found to be in fault and the third CAN channel is normal. Therefore, the heartbeat messages and the data are transmitted on different lines, the data transmission efficiency and the response speed of the train network are improved, when one or some slave nodes are disconnected in the main network, the standby network is switched to receive the data of the slave nodes, and other slave node data are still received on the main network, so that the complete receiving of the relevant slave node data is ensured, the good running of the whole train is ensured, and the redundancy effect of the train network is improved.
Fig. 16 is a schematic structural diagram of an active master node according to a fourth embodiment of the present invention, as shown in fig. 16, on the basis of fig. 13, the active master node further includes: a first sending module 110.
The first sending module 110 is configured to send a reset instruction from the active network to the first node when it is determined that the heartbeat packet of the first node is not received by the heartbeat signal network in the preset first heartbeat cycle.
The first monitoring module 101 is further configured to continue to monitor a heartbeat message sent by the first node on the heartbeat signal network;
the first analyzing module 103 is further configured to analyze the heartbeat message to check the working states of the second CAN channel and the third channel of the first node when the heartbeat message of the first node is received on the heartbeat signal network in a preset second heartbeat period.
The first receiving module 104 is further configured to receive, on the active network, data sent by the first node when the second CAN channel of the first node is found to be normal.
The first receiving module 104 is further configured to receive data sent by the first node on the standby network when the second CAN channel of the first node is queried to be faulty and the third CAN channel is normal.
Fig. 17 is a schematic structural diagram of an active master node according to a fifth embodiment of the present invention, as shown in fig. 17, on the basis of fig. 16, the active master node further includes: a first learning module 111.
The first learning module 111 is configured to learn that a first CAN channel of a first node fails when a heartbeat packet of the first node is not received on a heartbeat signal network in a preset second heartbeat cycle.
The first monitoring module 101 is further configured to switch to the active network to monitor a heartbeat packet sent by the first node.
The first receiving module 104 is further configured to receive, on the active network, data sent by the first node when the heartbeat packet sent by the first node is received on the active network in a preset first heartbeat cycle.
Fig. 18 is a schematic structural diagram of an active master node according to a sixth embodiment of the present invention, as shown in fig. 18, on the basis of fig. 17, the active master node further includes: and a third sending module 112.
The third sending module 112 is configured to send a reset instruction from the active network to the first node when the heartbeat packet sent by the first node is not received on the active network in a preset first heartbeat cycle.
The first monitoring module 101 is further configured to continue to monitor a heartbeat packet sent by the first node on the active network.
The first receiving module 104 is further configured to receive, on the active network, data sent by the first node when the heartbeat packet of the first node is received on the active network in a preset second heartbeat cycle.
In an embodiment of the present invention, the first obtaining module 112 is further configured to obtain a second CAN channel fault of the first node when the heartbeat packet of the first node is not received on the active network in a preset second heartbeat cycle.
The first monitoring module 101 is further configured to switch to a standby network to monitor a heartbeat packet sent by a first node.
The first receiving module 104 is further configured to receive, on the standby network, data sent by the first node when the heartbeat packet sent by the first node is received on the standby network within a preset first heartbeat period.
Fig. 19 is a schematic structural diagram of an active master node according to a seventh embodiment of the present invention, as shown in fig. 19, on the basis of fig. 17, the active master node further includes: a fourth sending module 113.
The fourth sending module 113 is configured to send a reset instruction to the first node from the standby network when the heartbeat packet sent by the first node is not received on the standby network in a preset first heartbeat period.
The first monitoring module 101 is further configured to continue to monitor the heartbeat packet sent by the first node on the standby network.
The first receiving module 104 is further configured to receive, on the standby network, data sent by the first node when the heartbeat packet of the first node is received on the standby network within a preset second heartbeat period.
In summary, in the active master node according to the embodiment of the present invention, in order to avoid resource waste caused by unnecessary switching, a reset instruction is sent to the failed CAN channel, so as to determine whether a failure actually occurs at present according to a receiving condition of the heartbeat message after reset, and the switching of the CAN channel is performed only when a failure actually occurs, so that stability and practicability of the rank network are improved.
Fig. 20 is a schematic structural diagram of an active master node according to an eighth embodiment of the present invention, as shown in fig. 20, on the basis of fig. 17, the active master node further includes: a second sending module 114.
The second sending module 114 is configured to send, to the operation monitoring node, a current fault message of the first CAN channel of the first node after receiving the heartbeat packet sent by the first node on the main network in a preset first heartbeat cycle, and display the current fault message to an operator to prompt current fault maintenance.
The first monitoring module 101 is configured to continue to monitor a heartbeat packet sent by a first node on the heartbeat signal network.
The first obtaining module 112 is further configured to obtain that the first CAN channel of the first node recovers communication when the heartbeat packet of the first node is received in a preset first heartbeat cycle.
The first receiving module 104 is further configured to switch to a heartbeat signal network to receive a heartbeat message sent by a first node.
Fig. 21 is a schematic structural diagram of an active master node according to a ninth embodiment of the present invention, as shown in fig. 21, on the basis of fig. 18, the active master node further includes: a first prompting module 115.
The first prompting module 115 is configured to send current fault messages of the first CAN channel and the second CAN channel of the first node to the operation monitoring node after receiving the heartbeat message sent by the first node on the standby network in a preset first heartbeat period, and display the current fault messages to an operator to prompt current fault maintenance.
In an embodiment of the present invention, the first monitoring module 101 is further configured to continue to monitor the heartbeat packet sent by the first node on the heartbeat signal network and the active network.
The first parsing module 103 is further configured to learn that the first CAN channel of the first node recovers communication when the heartbeat packet of the first node is received on the heartbeat signal network in a preset first heartbeat period.
The first receiving module 104 is further configured to switch to a heartbeat signal network to receive a heartbeat message sent by a first node.
In an embodiment of the present invention, the first monitoring module 101 is further configured to continue to monitor the heartbeat packet sent by the first node on the heartbeat signal network and the active network.
The first parsing module 103 is further configured to learn that the second CAN channel of the first node recovers communication when the heartbeat packet of the first node is received on the main network in a preset first heartbeat cycle.
The first receiving module 104 is further configured to switch to the active network to receive the heartbeat packet and the data sent by the first node.
The first monitoring module 101 is further configured to continue to monitor a heartbeat packet sent by the first node on the heartbeat signal network.
The first parsing module 103 is further configured to learn that the first CAN channel of the first node recovers communication when the heartbeat packet of the first node is received on the heartbeat signal network in a preset first heartbeat period.
The first receiving module 104 is further configured to switch to a heartbeat signal network to receive a heartbeat message sent by a first node.
It should be noted that the foregoing train network data transmission method based on the CANopen protocol, which is described with a focus on the active master node side, is also applicable to the active master node in the embodiments of the present invention, and the implementation principle thereof is similar.
In summary, the active master node according to the embodiment of the present invention selects the heartbeat signal network, the primary network, and the standby network according to the real-time situation of the train network, and correspondingly displays the heartbeat signal network, the primary network, and the standby network to the relevant operating personnel at the monitoring node, thereby improving the stability and the reusability of the train network data transmission method.
In order to implement the above embodiments, the present invention further provides a slave node, and fig. 22 is a schematic structural diagram of the slave node according to the first embodiment of the present invention. As shown in fig. 22, the slave node includes: a second monitoring module 201, a second judging module 202, a second parsing module 203 and a second receiving module 204.
The second monitoring module 201 is configured to monitor, on the heartbeat signal network, a heartbeat packet sent by each node related to the slave node through the first CAN channel according to a preconfigured network node list.
The second determining module 202 is configured to determine whether the first CAN channel of each slave node fails according to a timing condition of a heartbeat timer corresponding to each slave node and a receiving condition of a heartbeat packet.
The second analyzing module 203 is configured to analyze the heartbeat message to check the working states of a second CAN channel and a third CAN channel of the second node when judging and knowing that the heartbeat message of the second node is received on the heartbeat signal network in a preset heartbeat period, where the second node is any one of a slave node related to the slave node or a movable master node.
The second receiving module 204 is configured to receive, on the active network, data sent by the second node when the second CAN channel of the second node is found to be normal.
The second receiving module 204 is further configured to receive data sent by the second node on the standby network when the second CAN channel of the second node is queried to be faulty and the third CAN channel is normal.
Fig. 23 is a schematic structural diagram of a slave node according to a second embodiment of the present invention. As shown in fig. 23, the slave node further includes a second establishing module 205 and a second processing module 206 on the basis of that shown in fig. 22.
The second establishing module 205 is configured to establish a network node list corresponding to the slave node according to the network topology, where the network node list includes: each node identification associated with a slave node and a corresponding heartbeat timer.
The second processing module 206 is configured to receive a network control instruction sent by the active master node, start the first CAN channel to enter a heartbeat message operation mode, and start a heartbeat timer corresponding to each node related to the slave node.
Fig. 24 is a schematic structural diagram of a slave node according to a third embodiment of the present invention. As shown in fig. 24, the slave node further includes a third switching module 207 based on that shown in fig. 22.
The third switching module 207 is configured to, when the sending error counter or the receiving error counter in the slave node is incremented to a preset value, acquire a failure of the active network, and switch to the standby network to communicate with other nodes.
In summary, the slave node in the embodiment of the present invention monitors the heartbeat message sent by each node related to the slave node through the first CAN channel on the heartbeat signal network according to the preconfigured network node list, according to the timing condition of the heartbeat timer corresponding to each slave node and the receiving condition of the heartbeat message, judging whether the first CAN channel of each slave node has a fault, if judging that the heartbeat message of the second node is received on the heartbeat signal network in a preset heartbeat period, analyzing the heartbeat message to check the working states of the second CAN channel and the third CAN channel of the second node, if the second CAN channel of the second node is normal through inquiry, and receiving the data sent by the second node on the main network, and receiving the data sent by the second node on the standby network if the second CAN channel of the second node is found to be in fault and the third CAN channel is normal. Therefore, the heartbeat messages and the data are transmitted on different lines, the data transmission efficiency and the response speed of the train network are improved, when one or some slave nodes are disconnected in the main network, the standby network is switched to receive the data of the slave nodes, and other slave node data are still received on the main network, so that the complete receiving of the relevant slave node data is ensured, the good running of the whole train is ensured, and the redundancy effect of the train network is improved.
Fig. 25 is a schematic structural diagram of a slave node according to a fourth embodiment of the present invention. As shown in fig. 25, the slave node further includes a first recording module 208 on the basis of that shown in fig. 22.
In an embodiment of the present invention, the second monitoring module 201 is further configured to, when it is determined that the heartbeat packet of the second node is not received on the heartbeat signal network in a preset heartbeat cycle, obtain that the first CAN channel of the second node has a fault, and switch to the active network to monitor the heartbeat packet sent by the second node.
The second receiving module 204 is further configured to receive, on the active network, data sent by the second node when the heartbeat packet sent by the second node is received on the active network within a preset heartbeat period.
The first recording module 208 is configured to record a current fault message of the first CAN channel of the second node after receiving the heartbeat packet sent by the second node on the active network in a preset heartbeat cycle.
The second monitoring module 201 is further configured to continue to monitor the heartbeat packet sent by the second node on the heartbeat signal network.
The second receiving module 204 is further configured to, when receiving the heartbeat message of the second node on the heartbeat signal network in a preset heartbeat period, know that the first CAN channel of the second node recovers communication, and switch to the signal heartbeat network to receive the heartbeat message sent by the second node.
In an embodiment of the present invention, the second monitoring module 201 is further configured to switch to the standby network to monitor the heartbeat packet sent by the second node when the heartbeat packet sent by the second node is not received on the active network in a preset heartbeat period.
The second receiving module 204 is further configured to receive, in a preset heartbeat period, a heartbeat packet sent by the second node on the standby network, and receive, on the standby network, data sent by the second node.
Fig. 26 is a schematic structural diagram of a slave node according to a fifth embodiment of the present invention. As shown in fig. 26, the slave node further includes a second recording module 209 based on that shown in fig. 22.
The second recording module 209 is configured to record current fault messages of the first CAN channel and the second CAN channel of the second node.
The second monitoring module 201 is further configured to continue to monitor the heartbeat packet sent by the second node on the heartbeat signal network and the active network.
The second receiving module 204 is further configured to learn that the first CAN channel of the second node recovers communication when the heartbeat message of the second node is received on the heartbeat signal network in a preset heartbeat period, and switch to the signal heartbeat network to receive the heartbeat message sent by the second node.
Fig. 27 is a schematic structural diagram of a slave node according to a sixth embodiment of the present invention. As shown in fig. 27, the slave node further includes a third recording module 210 based on that shown in fig. 22.
The third recording module 210 is configured to record current fault messages of the first CAN channel and the second CAN channel of the second node.
The second monitoring module 201 is further configured to continue to monitor the heartbeat packet sent by the second node on the heartbeat signal network and the active network.
The second receiving module 204 is further configured to, when receiving the heartbeat packet of the second node on the active network in a preset heartbeat cycle, acquire that the second CAN channel of the second node recovers communication, and switch to the active network to receive data sent by the second node.
The second monitoring module 201 is further configured to continue to monitor the heartbeat packet sent by the second node on the heartbeat signal network.
The second receiving module 204 is further configured to learn that the first CAN channel of the second node recovers communication when the heartbeat message of the second node is received on the heartbeat signal network in a preset heartbeat period, and switch to the heartbeat signal network to receive the heartbeat message sent by the second node.
Fig. 28 is a schematic structural diagram of a slave node according to a seventh embodiment of the present invention. As shown in fig. 28, the slave node further includes a fourth recording module 211 based on that shown in fig. 22.
The fourth recording module 211 is configured to record current fault messages of the first CAN channel, the second CAN channel, and the third CAN channel of the second node when the heartbeat packet sent by the second node is not received on the standby network in a preset heartbeat period.
In an embodiment of the present invention, the second monitoring module 201 is further configured to continue to monitor the heartbeat packet sent by the second node on the heartbeat signal network, the active network, and the standby network.
The second receiving module 204 is further configured to learn that the first CAN channel of the second node recovers communication when the heartbeat message of the second node is received on the heartbeat signal network in a preset first heartbeat period, and receive the heartbeat message sent by the second node on the heartbeat signal network.
The second monitoring module 201 is further configured to continue to monitor the heartbeat packet sent by the second node on the heartbeat signal network, the active network, and the standby network.
The second receiving module 204 is further configured to learn that the second CAN channel of the second node recovers communication when the heartbeat message of the second node is received on the active network in the preset first heartbeat cycle, and receive the heartbeat message and the data sent by the second node on the active network.
The second monitoring module 201 is further configured to continue to monitor the heartbeat packet sent by the second node on the heartbeat signal network.
The second receiving module 204 is further configured to learn that the first CAN channel of the second node recovers communication when the heartbeat message of the second node is received on the heartbeat signal network in a preset heartbeat period, and receive the heartbeat message sent by the second node on the heartbeat signal network.
The second monitoring module 201 is further configured to continue to monitor the heartbeat packet sent by the second node on the heartbeat signal network, the active network, and the standby network.
The second receiving module 204 is further configured to learn that the third CAN channel of the second node recovers communication when the heartbeat packet of the second node is received on the standby network in a preset heartbeat period, and receive data sent by the second node on the standby network.
The second monitoring module 201 is further configured to continue to monitor the heartbeat packet sent by the second node on the heartbeat signal network and the active network.
The second receiving module 204 is further configured to learn that the first CAN channel of the second node recovers communication when the heartbeat message of the second node is received on the heartbeat signal network in a preset heartbeat period, and receive the heartbeat message sent by the second node on the heartbeat signal network.
The second monitoring module 201 is further configured to continue to monitor the heartbeat packet sent by the second node on the heartbeat signal network, the active network, and the standby network.
The second receiving module 204 is further configured to learn that the third CAN channel of the second node recovers communication when the heartbeat packet of the second node is received on the standby network in a preset heartbeat period, and receive data sent by the second node on the standby network.
The second monitoring module 201 is further configured to continue to monitor the heartbeat packet sent by the second node on the heartbeat signal network and the active network.
The second receiving module 204 is further configured to learn that the second CAN channel of the second node recovers communication when the heartbeat packet of the second node is received on the active network in a preset heartbeat cycle, and switch to the active network to receive data sent by the second node.
The second monitoring module 201 is further configured to continue to monitor the heartbeat packet sent by the second node on the heartbeat signal network.
The second receiving module 204 is further configured to learn that the first CAN channel of the second node recovers communication when the heartbeat message of the second node is received on the heartbeat signal network in a preset heartbeat period, and receive the heartbeat message sent by the second node on the heartbeat signal network.
It should be noted that the foregoing description focuses on the train network data transmission method based on the CANopen protocol described on the slave node side, and is also applicable to the slave node in the embodiment of the present invention, and the implementation principle thereof is similar.
In summary, according to the slave node in the embodiment of the present invention, the heartbeat signal network, the primary network and the standby network are selected according to the real-time situation of the train network, and are correspondingly displayed to the relevant operating personnel at the monitoring node, so that the stability and the reusability of the train network data transmission method are improved.
In order to implement the foregoing embodiment, the present invention further provides a train network data transmission system based on the CANopen protocol, and fig. 29 is a schematic structural diagram of the train network data transmission system based on the CANopen protocol according to an embodiment of the present invention, and as shown in fig. 29, the train network data transmission system based on the CANopen protocol includes an active master node 100, a slave node 200, an active network 300, a standby network 400, and a heartbeat signal network 500.
Each node performs heartbeat message interaction with the heartbeat signal network 500 through the first CAN channel, performs data interaction with the main network through the second CAN channel, and performs data interaction with the standby network through the third CAN channel.
For the description of the active master node 100 and the slave node 200, reference may be made to the above embodiments, which are not described herein again.
In order to more clearly illustrate the technical effects of the train network data transmission system based on the CANopen protocol according to the embodiment of the present invention, the following description is made in conjunction with the comparison with the prior art.
In the related technology, the failure modes of the design consideration of the redundant network used by the train using the CAN bus as the communication network are less, all nodes send data in the main network and the standby network at the same time, but only one network is selected to receive the data, and the nodes related to the nodes are uniformly switched to the standby network to receive and process the data of the disconnected nodes and the data of other related nodes no matter which node on the main network is disconnected, so that when different channels of a plurality of nodes fail to receive part of the node data normally, the whole train operation is influenced, the redundancy effect is greatly reduced, and the significance of redundancy is not realized. Moreover, because the communication mechanisms of the heartbeat message and the data are different, the heartbeat message and the data are transmitted in the same network, which may cause competition for transmission network resources and affect the response effect of the train network.
The invention optimizes the software implementation strategy on the basis of the original network redundancy design framework, defines the switching between the main network and the standby network according to the bus error detection mechanism, simultaneously respectively provides corresponding requirements for the active main node and the slave nodes, respectively establishes a network relationship list in respective object dictionaries so as to be compared with heartbeat messages of corresponding nodes on the bus, and further judges whether the nodes are disconnected, when one or some slave nodes are disconnected in the main network, the slave nodes are switched to the standby network to receive the data of the partial nodes, the data of other nodes are still received on the main network, and a set of communication recovery mechanism is further defined (refer to the description of the embodiment, and the description is not repeated here). Meanwhile, a heartbeat signal network is additionally arranged, and heartbeat messages are independently transmitted in the heartbeat signal network, so that the sufficiency of the heartbeat messages and data transmission network resources is ensured, and the response speed and the response accuracy of the train network are improved.
To more clearly illustrate the work flow of the train network data transmission system based on the CANopen protocol according to the embodiment of the present invention, the following examples illustrate that, in the following examples, a heartbeat packet is used to represent a heartbeat message:
wherein in this example, two active master nodes are set up in the network, one active master node and one backup active master node (default inactive), five slave nodes A, B, C, D, E, now defining that the active master node receives the slave node A, B, C heartbeat packet.
As shown in fig. 30, when the first CAN channel of the slave node a fails, if it is detected that the heartbeat packet of the slave node a CAN be received on the active network within a preset heartbeat period, the heartbeat packet of the slave node a is received on the active network, while the heartbeat packets of the slave nodes B and C are still maintained to be received on the heartbeat signal network.
In this embodiment, the master node cannot receive the heartbeat packet of the slave node a in three consecutive heartbeat cycles of the heartbeat signal network, first resets the node through a reset instruction controlled by the network, and then monitors two heartbeat cycles, at this time, the heartbeat packets of the slave node a in the two heartbeat cycles still cannot be recovered to be normal, and then the master node switches to the master network to monitor the heartbeat packet of the slave node a and sends the heartbeat packet on the master network.
As shown in fig. 31, the slave node B and the slave node C may not receive the heartbeat packet of the slave node a in five consecutive heartbeat cycles of the heartbeat signal network, and may switch to the master network to listen to the heartbeat packet of the slave node a, and send the heartbeat packet on the master network.
With continued reference to fig. 31, if it is defined that the active master node receives a slave node A, B, C heartbeat packet, the slave node a receives a slave node B, C, D heartbeat packet, the slave node B receives a slave node A, E heartbeat packet, and the slave node C receives a slave node A, D heartbeat packet, the slave node a receives the heartbeat packet of the slave node B, C, D on the master network, and the slave node B and the slave node C receive the heartbeat packet of the slave node a on the master network. The slave node B and the slave node C each receive the heartbeat packets of the slave node E and the slave node D, respectively, on the heartbeat signal network.
Continuing with the example of defining that the master node receives the heartbeat packet from the slave node A, B, C, the slave node a receives the heartbeat packet from the slave node B, C, D, the slave node B receives the heartbeat packet from the slave node A, E, and the slave node C receives the heartbeat packet from the slave node A, D, referring to fig. 32, two channels of the CAN1 and the CAN2 of the slave node a are damaged, the slave node a cannot send the heartbeat packet in the heartbeat signal network and cannot send the heartbeat packet in the master network, and at this time, the slave node a sends the heartbeat packet in the standby network through the CAN3 channel.
In this example, the master node does not receive the heartbeat packet of the slave node a in three consecutive heartbeat cycles of the heartbeat signal network, first resets the node through a reset instruction controlled by the network, and then monitors two heartbeat cycles, at this time, the heartbeat packets of the slave node a in the two heartbeat cycles still cannot be recovered to normal, the master node switches to the master network to monitor the heartbeat packet of the slave node a, and similarly, the master node also does not monitor the heartbeat packet of the slave node a in the master network and switches to the backup network to monitor the heartbeat packet of the slave node a, wherein the master node still receives the heartbeat packets of the slave node B and the slave node C from the heartbeat signal network, and receives data of the slave node B and the slave node C from the master network.
In this example, if the heartbeat packet of the slave node a cannot be received, the two slave nodes simultaneously go to the master network to monitor the heartbeat packet of the slave node a, the master network still cannot monitor the heartbeat packet of the slave node a, and then go to the backup network to monitor the heartbeat packet of the slave node a, and the slave node B and the slave node C can send the heartbeat packet on the backup network after monitoring the heartbeat packet of the slave node a. The slave node B still receives the heartbeat packet of the slave node E from the heartbeat signal network, receives the data of the slave node E from the master network, the slave node C still receives the heartbeat packet of the slave node D from the heartbeat signal network, and receives the data of the slave node D from the master network (not shown in the figure).
Meanwhile, referring to fig. 33, the active master node receives data transmitted from node a on the standby network and receives data transmitted from nodes B and C on the active network.
In summary, the train network data transmission system based on the CANopen protocol according to the embodiments of the present invention transmits the heartbeat messages and the data on different lines, so as to improve the data transmission efficiency and the response speed of the train network, and when one or some slave nodes drop in the active network, the slave node is switched to the standby network to receive the data of the slave node, and the other slave node data is still received on the active network, thereby ensuring complete reception of the data of the relevant slave nodes, ensuring good operation of the entire train, and improving the redundancy effect of the train network.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (67)

1. A train network data transmission method based on CANopen protocol is characterized in that the method is applied to an active master node and comprises the following steps:
monitoring heartbeat messages sent by all slave nodes related to the active master node through a first CAN channel on a heartbeat signal network according to a pre-configured network node list;
judging whether the first CAN channel of each slave node fails according to the timing condition of a heartbeat timer corresponding to each slave node and the receiving condition of the heartbeat message;
if judging and knowing that a heartbeat message sent by a first node is received on the heartbeat signal network in a preset first heartbeat period, analyzing the heartbeat message to check the working states of a second CAN channel and a third CAN channel of the first node, wherein the first node is any slave node related to the movable master node;
if the second CAN channel of the first node is found to be normal through inquiry, receiving data sent by the first node on the main network;
and if the second CAN channel of the first node is found to be in fault and the third CAN channel is normal through inquiry, receiving data sent by the first node on a standby network.
2. The method of claim 1, further comprising:
if judging and knowing that the heartbeat message of the first node is not received in the heartbeat signal network in a preset first heartbeat period, sending a reset instruction from the main network to the first node;
continuously monitoring heartbeat messages sent by the first node on the heartbeat signal network, and if the heartbeat messages of the first node are received on the heartbeat signal network in a preset second heartbeat period, analyzing the heartbeat messages to check the working states of a second CAN channel and a third channel of the first node;
if the second CAN channel of the first node is found to be normal through inquiry, receiving data sent by the first node on the main network;
and if the second CAN channel of the first node is found to be in fault and the third CAN channel is normal through inquiry, receiving data sent by the first node on a standby network.
3. The method of claim 2, further comprising:
if the heartbeat message of the first node is not received on the heartbeat signal network in a preset second heartbeat period, acquiring the fault of a first CAN channel of the first node, and switching to the main network to monitor the heartbeat message sent by the first node;
and if the heartbeat message sent by the first node is received on the main network within a preset first heartbeat period, receiving data sent by the first node on the main network.
4. The method according to claim 3, wherein after receiving the heartbeat packet sent by the first node on the active network within the preset first heartbeat cycle, the method further comprises:
sending a current fault message of a first CAN channel of the first node to an operation monitoring node, displaying the current fault message to an operator, and prompting current fault maintenance;
and continuously monitoring the heartbeat message sent by the first node on the heartbeat signal network, and if the heartbeat message of the first node is received in a preset first heartbeat period, knowing that the first CAN channel of the first node recovers communication, switching to the heartbeat signal network to receive the heartbeat message sent by the first node.
5. The method of claim 3, further comprising:
if the heartbeat message sent by the first node is not received on the main network within a preset first heartbeat period, sending a reset instruction from the main network to the first node;
and continuously monitoring the heartbeat message sent by the first node on the main network, and if the heartbeat message of the first node is received on the main network in a preset second heartbeat period, receiving the data sent by the first node on the main network.
6. The method of claim 5, further comprising:
if the heartbeat message of the first node is not received on the main network in a preset second heartbeat period, acquiring the fault of a second CAN channel of the first node, and switching to the standby network to monitor the heartbeat message sent by the first node;
and if the heartbeat message sent by the first node is received on the standby network within a preset first heartbeat period, receiving the data sent by the first node on the standby network.
7. The method of claim 6, wherein after receiving the heartbeat packet sent by the first node on the standby network within the preset first heartbeat period, the method further comprises:
and sending current fault messages of the first CAN channel and the second CAN channel of the first node to an operation monitoring node, and displaying the current fault messages to an operator to prompt the current fault maintenance.
8. The method of claim 7, further comprising:
and continuously monitoring heartbeat messages sent by the first node on the heartbeat signal network and the main network, and if the heartbeat messages of the first node are received on the heartbeat signal network in a preset first heartbeat period, acquiring that a first CAN channel of the first node recovers communication, and switching to the heartbeat signal network to receive the heartbeat messages sent by the first node.
9. The method of claim 7, further comprising:
continuously monitoring heartbeat messages sent by the first node on the heartbeat signal network and the main network, and if the heartbeat messages of the first node are received on the main network in a preset first heartbeat period, knowing that a second CAN channel of the first node recovers communication, switching to the main network to receive the heartbeat messages and data sent by the first node;
and continuously monitoring the heartbeat message sent by the first node on the heartbeat signal network, and if the heartbeat message of the first node is received on the heartbeat signal network in a preset first heartbeat period, knowing that the first CAN channel of the first node recovers communication, switching to the heartbeat signal network to receive the heartbeat message sent by the first node.
10. The method of claim 8, further comprising:
if the heartbeat message sent by the first node is not received on the standby network within a preset first heartbeat period, sending a reset instruction to the first node from the standby network;
and continuously monitoring the heartbeat message sent by the first node on the standby network, and if the heartbeat message of the first node is received on the standby network in a preset second heartbeat period, receiving the data sent by the first node on the standby network.
11. The method of claim 10, further comprising:
and if the heartbeat message of the first node is not received on the standby network in a preset second heartbeat period, sending current fault messages of the first CAN channel, the second CAN channel and the third CAN channel of the first node to an operation monitoring node, and displaying the current fault messages to an operator to prompt the current fault maintenance.
12. The method of claim 11, further comprising:
and continuously monitoring heartbeat messages sent by the first node on the heartbeat signal network, the main network and the standby network, and if the heartbeat messages of the first node are received on the heartbeat signal network in a preset first heartbeat period, acquiring that the first CAN channel of the first node recovers communication, and receiving the heartbeat messages sent by the first node on the heartbeat signal network.
13. The method of claim 11, further comprising:
continuously monitoring heartbeat messages sent by the first node on the heartbeat signal network, the main network and the standby network, and if the heartbeat messages of the first node are received on the main network in a preset first heartbeat period, acquiring that the second CAN channel of the first node recovers communication, and receiving data sent by the first node on the main network;
and continuously monitoring the heartbeat message sent by the first node on the heartbeat signal network, and if the heartbeat message of the first node is received on the heartbeat signal network in a preset first heartbeat period, knowing that the first CAN channel of the first node recovers communication, and receiving the heartbeat message sent by the first node on the heartbeat signal network.
14. The method of claim 11, further comprising:
continuously monitoring heartbeat messages sent by the first node on the heartbeat signal network, the main network and the standby network, and if the heartbeat messages of the first node are received on the standby network in a preset first heartbeat period, acquiring that a third CAN channel of the first node recovers communication, and receiving data sent by the first node on the standby network;
and continuously monitoring heartbeat messages sent by the first node on the heartbeat signal network and the main network, and if the heartbeat messages of the first node are received on the heartbeat signal network in a preset first heartbeat period, knowing that the first CAN channel of the first node recovers communication, and receiving the heartbeat messages sent by the first node on the heartbeat signal network.
15. The method of claim 11, further comprising:
continuously monitoring heartbeat messages sent by the first node on the heartbeat signal network, the main network and the standby network, and if the heartbeat messages of the first node are received on the standby network in a preset first heartbeat period, acquiring that a third CAN channel of the first node recovers communication, and receiving data sent by the first node on the standby network;
continuously monitoring heartbeat messages sent by the first node on the heartbeat signal network and the main network, and if the heartbeat messages of the first node are received on the main network in a preset first heartbeat period, acquiring that a second CAN channel of the first node recovers communication, and switching to the main network to receive data sent by the first node;
and continuously monitoring the heartbeat message sent by the first node on the heartbeat signal network, and if the heartbeat message of the first node is received on the heartbeat signal network in a preset first heartbeat period, knowing that the first CAN channel of the first node recovers communication, and receiving the heartbeat message sent by the first node on the heartbeat signal network.
16. The method of claim 1, wherein prior to said listening on a heartbeat signal network for heartbeat messages sent over a first CAN channel by each slave node associated with the active master node according to a preconfigured list of network nodes, further comprising:
establishing a network node list corresponding to the active master node according to a network topology map, wherein the network node list comprises: each slave node identification and corresponding heartbeat timer associated with the active master node;
and sending a network control instruction to all the slave nodes, controlling a first CAN channel of the slave node to enter a heartbeat message operation mode, and starting a heartbeat timer corresponding to each slave node related to the active master node.
17. The method of claim 1, further comprising:
and if the sending error counter or the receiving error counter in the active main node is accumulated to a preset value, acquiring the fault of the main network, and switching to the standby network to communicate with other nodes.
18. The method of any of claims 1-17, further comprising:
and if the active main node is detected to be in fault, switching to a standby main node to perform data interaction with other related slave nodes.
19. A train network data transmission method based on a CANopen protocol is applied to a slave node and comprises the following steps:
monitoring heartbeat messages sent by all nodes related to the slave nodes through a first CAN channel on a heartbeat signal network according to a pre-configured network node list;
judging whether the first CAN channel of each slave node fails according to the timing condition of a heartbeat timer corresponding to each slave node and the receiving condition of the heartbeat message;
if the heartbeat message of a second node is received on the heartbeat signal network in a preset heartbeat period is judged and known, analyzing the heartbeat message to check the working states of a second CAN channel and a third CAN channel of the second node, wherein the second node is any slave node or movable master node related to the slave node;
if the second CAN channel of the second node is found to be normal through inquiry, receiving data sent by the second node on the main network;
and if the second CAN channel of the second node is found to be in fault and the third CAN channel is normal through inquiry, receiving data sent by the second node on a standby network.
20. The method of claim 19, further comprising:
if the judgment result shows that the heartbeat message of the second node is not received on the heartbeat signal network in a preset heartbeat period, the judgment result shows that the first CAN channel of the second node has a fault, and the main network is switched to monitor the heartbeat message sent by the second node;
and if the heartbeat message sent by the second node is received on the main network within a preset heartbeat period, receiving data sent by the second node on the main network.
21. The method according to claim 20, wherein after receiving the heartbeat packet sent by the second node on the active network within the preset heartbeat period, the method further includes:
recording the current fault message of the first CAN channel of the second node;
and continuously monitoring the heartbeat message sent by the second node on the heartbeat signal network, and if the heartbeat message of the second node is received on the heartbeat signal network in a preset heartbeat period, knowing that the first CAN channel of the second node recovers communication, switching to the signal heartbeat network to receive the heartbeat message sent by the second node.
22. The method of claim 20, further comprising:
if the heartbeat message sent by the second node cannot be received on the main network within a preset heartbeat period, switching to a standby network to monitor the heartbeat message sent by the second node;
and if the heartbeat message sent by the second node is received on the standby network within a preset heartbeat period, receiving data sent by the second node on the standby network.
23. The method of claim 22, wherein after receiving the heartbeat packet sent by the second node on the standby network within the preset heartbeat period, the method further comprises:
recording current fault messages of a first CAN channel and a second CAN channel of the second node;
and continuously monitoring heartbeat messages sent by the second node on the heartbeat signal network and the main network, and if the heartbeat messages of the second node are received on the heartbeat signal network in a preset heartbeat period, acquiring that the first CAN channel of the second node recovers communication, and switching to the signal heartbeat network to receive the heartbeat messages sent by the second node.
24. The method of claim 22, wherein after receiving the heartbeat packet sent by the second node on the standby network within the preset heartbeat period, the method further comprises:
recording current fault messages of a first CAN channel and a second CAN channel of the second node;
continuously monitoring heartbeat messages sent by the second node on the heartbeat signal network and the main network, and if the heartbeat messages of the second node are received on the main network in a preset heartbeat period, acquiring that a second CAN channel of the second node recovers communication, and switching to the main network to receive data sent by the second node;
and continuously monitoring the heartbeat message sent by the second node on the heartbeat signal network, and if the heartbeat message of the second node is received on the heartbeat signal network in a preset heartbeat period, knowing that the first CAN channel of the second node recovers communication, switching to the heartbeat signal network to receive the heartbeat message sent by the second node.
25. The method of claim 22, further comprising:
and if the heartbeat message sent by the second node cannot be received on the standby network in a preset heartbeat period, recording current fault messages of a first CAN channel, a second CAN channel and a third CAN channel of the second node.
26. The method of claim 25, further comprising:
and continuously monitoring heartbeat messages sent by the second node on the heartbeat signal network, the main network and the standby network, and if the heartbeat messages of the second node are received on the heartbeat signal network in a preset first heartbeat period, knowing that the first CAN channel of the second node recovers communication, and receiving the heartbeat messages sent by the second node on the heartbeat signal network.
27. The method of claim 25, further comprising:
continuously monitoring heartbeat messages sent by the second node on the heartbeat signal network, the main network and the standby network, and if the heartbeat messages of the second node are received on the main network in a preset first heartbeat period, knowing that the second CAN channel of the second node recovers communication, receiving the heartbeat messages and data sent by the second node on the main network;
and continuously monitoring the heartbeat message sent by the second node on the heartbeat signal network, and if the heartbeat message of the second node is received on the heartbeat signal network in a preset heartbeat period, knowing that the first CAN channel of the second node recovers communication, and receiving the heartbeat message sent by the second node on the heartbeat signal network.
28. The method of claim 25, further comprising:
continuously monitoring heartbeat messages sent by the second node on the heartbeat signal network, the main network and the standby network, and if the heartbeat messages of the second node are received on the standby network in a preset heartbeat period, acquiring that a third CAN channel of the second node recovers communication, and receiving data sent by the second node on the standby network;
and continuously monitoring heartbeat messages sent by the second node on the heartbeat signal network and the main network, and if the heartbeat messages of the second node are received on the heartbeat signal network in a preset heartbeat period, acquiring that the first CAN channel of the second node recovers communication, and receiving the heartbeat messages sent by the second node on the heartbeat signal network.
29. The method of claim 25, further comprising:
continuously monitoring heartbeat messages sent by the second node on the heartbeat signal network, the main network and the standby network, and if the heartbeat messages of the second node are received on the standby network in a preset heartbeat period, acquiring that a third CAN channel of the second node recovers communication, and receiving data sent by the second node on the standby network;
continuously monitoring heartbeat messages sent by the second node on the heartbeat signal network and the main network, and if the heartbeat messages of the second node are received on the main network in a preset heartbeat period, acquiring that a second CAN channel of the second node recovers communication, and switching to the main network to receive data sent by the second node;
and continuously monitoring the heartbeat message sent by the second node on the heartbeat signal network, and if the heartbeat message of the second node is received on the heartbeat signal network in a preset heartbeat period, knowing that the first CAN channel of the second node recovers communication, and receiving the heartbeat message sent by the second node on the heartbeat signal network.
30. The method of claim 19, wherein prior to said listening on a heartbeat signal network for heartbeat messages sent over a first CAN channel by nodes associated with said slave node according to a preconfigured list of network nodes, further comprising:
establishing a network node list corresponding to the slave node according to a network topology map, wherein the network node list comprises: each node identification and corresponding heartbeat timer associated with the slave node;
and receiving a network control instruction sent by the active master node, starting the first CAN channel to enter a heartbeat message operation mode, and starting a heartbeat timer corresponding to each node related to the slave node.
31. The method of any of claims 19-30, further comprising:
and if the sending error counter or the receiving error counter in the slave node is accumulated to a preset value, acquiring the fault of the main network, and switching to the standby network to communicate with other nodes.
32. An active master node, comprising:
the first monitoring module is used for monitoring heartbeat messages sent by all slave nodes related to the active master node through a first CAN channel on a heartbeat signal network according to a pre-configured network node list;
the first judgment module is used for judging whether the first CAN channel of each slave node fails according to the timing condition of a heartbeat timer corresponding to each slave node and the receiving condition of the heartbeat message;
the first analysis module is used for analyzing the heartbeat message to check the working states of a second CAN channel and a third CAN channel of the first node when judging and knowing that the heartbeat message sent by the first node is received on the heartbeat signal network in a preset first heartbeat period, wherein the first node is any slave node related to the movable master node;
the first receiving module is used for receiving data sent by the first node on the main network when the second CAN channel of the first node is found to be normal through inquiry;
the first receiving module is further configured to receive data sent by the first node on a standby network when the second CAN channel of the first node is queried to be faulty and the third CAN channel is normal.
33. The active master node of claim 32, further comprising:
a first sending module, configured to send a reset instruction from the primary network to the first node when it is determined that the heartbeat packet of the first node is not received in the heartbeat signal network within a preset first heartbeat period;
the first monitoring module is further configured to continue to monitor a heartbeat message sent by the first node on the heartbeat signal network;
the first analysis module is further configured to analyze the heartbeat message to check working states of a second CAN channel and a third channel of the first node when the heartbeat message of the first node is received on the heartbeat signal network in a preset second heartbeat period;
the first receiving module is further configured to receive, on the active network, data sent by the first node when the second CAN channel of the first node is found to be normal by inquiry;
the first receiving module is further configured to receive data sent by the first node on a standby network when the second CAN channel of the first node is queried to be faulty and the third CAN channel is normal.
34. The active master node of claim 33, further comprising:
the first learning module is used for learning the fault of a first CAN channel of the first node when the heartbeat message of the first node is not received on the heartbeat signal network in a preset second heartbeat period;
the first monitoring module is further configured to switch to the master network to monitor a heartbeat packet sent by the first node;
the first receiving module is further configured to receive, on the active network, data sent by the first node when the heartbeat packet sent by the first node is received on the active network within a preset first heartbeat cycle.
35. The active master node of claim 34, further comprising:
the second sending module is used for sending a current fault message of a first CAN channel of the first node to the operation monitoring node after receiving the heartbeat message sent by the first node on the main network in a preset first heartbeat cycle, displaying the current fault message to an operator and prompting the current fault maintenance;
the first monitoring module is configured to continue to monitor the heartbeat packet sent by the first node on the heartbeat signal network;
the first learning module is further configured to learn that the first CAN channel of the first node recovers communication when receiving the heartbeat packet of the first node in a preset first heartbeat cycle;
the first receiving module is further configured to switch to the heartbeat signal network to receive the heartbeat packet sent by the first node.
36. The active master node of claim 34, further comprising:
a third sending module, configured to send a reset instruction from the primary network to the first node when a heartbeat packet sent by the first node is not received on the primary network within a preset first heartbeat cycle;
the first monitoring module is further configured to continue to monitor a heartbeat packet sent by the first node on the primary network;
the first receiving module is further configured to receive, on the active network, data sent by the first node when the heartbeat packet of the first node is received on the active network within a preset second heartbeat cycle.
37. The active master node of claim 36,
the first learning module is further configured to learn that a second CAN channel of the first node has a fault when the heartbeat packet of the first node is not received on the primary network within a preset second heartbeat cycle;
the first monitoring module is further configured to switch to the standby network to monitor a heartbeat message sent by the first node;
the first receiving module is further configured to receive, on the standby network, data sent by the first node when the heartbeat packet sent by the first node is received on the standby network within a preset first heartbeat period.
38. The active master node of claim 37, further comprising:
and the first prompting module is used for sending current fault messages of a first CAN channel and a second CAN channel of the first node to the operation monitoring node after receiving the heartbeat message sent by the first node on the standby network in a preset first heartbeat period, and displaying the current fault messages to an operator to prompt the current fault maintenance.
39. The active master node of claim 38,
the first monitoring module is further configured to continue to monitor the heartbeat packet sent by the first node on the heartbeat signal network and the active network;
the first analysis module is further configured to learn that the first CAN channel of the first node recovers communication when the heartbeat packet of the first node is received on the heartbeat signal network in a preset first heartbeat period;
the first receiving module is further configured to switch to the heartbeat signal network to receive the heartbeat packet sent by the first node.
40. The active master node of claim 38, wherein the first monitoring module is further configured to continue to monitor heartbeat messages sent by the first node on the heartbeat signal network and the active network;
the first analysis module is further configured to learn that the second CAN channel of the first node recovers communication when the heartbeat packet of the first node is received on the main network in a preset first heartbeat cycle;
the first receiving module is further configured to switch to the active network to receive the heartbeat packet and the data sent by the first node;
the first monitoring module is further configured to continue to monitor a heartbeat message sent by the first node on the heartbeat signal network;
the first analysis module is further configured to learn that the first CAN channel of the first node recovers communication when the heartbeat packet of the first node is received on the heartbeat signal network in a preset first heartbeat period;
the first receiving module is further configured to switch to the heartbeat signal network to receive the heartbeat packet sent by the first node.
41. The active master node of claim 39, further comprising:
a fourth sending module, configured to send a reset instruction to the first node from the standby network when the heartbeat packet sent by the first node is not received on the standby network within a preset first heartbeat period;
the first monitoring module is further configured to continue to monitor a heartbeat packet sent by the first node on the standby network;
the first receiving module is further configured to receive, on the standby network, data sent by the first node when the heartbeat packet of the first node is received on the standby network within a preset second heartbeat period.
42. The active master node of claim 41, further comprising:
and the second prompting module is used for sending current fault messages of the first CAN channel, the second CAN channel and the third CAN channel of the first node to the operation monitoring node when the heartbeat message of the first node is not received on the standby network in a preset second heartbeat period, and displaying the current fault messages to an operator to prompt the current fault maintenance.
43. The active master node of claim 42,
the first monitoring module is further configured to continue to monitor the heartbeat packet sent by the first node on the heartbeat signal network, the main network, and the standby network;
the first receiving module is further configured to, when receiving the heartbeat message of the first node on the heartbeat signal network in a preset first heartbeat period, learn that the first CAN channel of the first node recovers communication, and then receive the heartbeat message sent by the first node on the heartbeat signal network.
44. The active master node of claim 42,
the first monitoring module is further configured to continue to monitor the heartbeat packet sent by the first node on the heartbeat signal network, the main network, and the standby network;
the first receiving module is further configured to, when receiving a heartbeat packet of the first node on the master network in a preset first heartbeat cycle, acquire that the second CAN channel of the first node recovers communication, and receive data sent by the first node on the master network;
the first monitoring module is further configured to continue to monitor a heartbeat message sent by the first node on the heartbeat signal network;
the first receiving module is further configured to, when receiving the heartbeat message of the first node on the heartbeat signal network in a preset first heartbeat period, learn that the first CAN channel of the first node recovers communication, and then receive the heartbeat message sent by the first node on the heartbeat signal network.
45. The active master node of claim 42,
the first monitoring module is further configured to continue to monitor the heartbeat packet sent by the first node on the heartbeat signal network, the main network, and the standby network;
the first receiving module is further configured to learn that a third CAN channel of the first node recovers communication when the heartbeat packet of the first node is received on the standby network in a preset first heartbeat period, and receive data sent by the first node on the standby network;
the first monitoring module is further configured to continue to monitor the heartbeat packet sent by the first node on the heartbeat signal network and the active network;
the first receiving module is further configured to, when receiving the heartbeat message of the first node on the heartbeat signal network in a preset first heartbeat period, learn that the first CAN channel of the first node recovers communication, and then receive the heartbeat message sent by the first node on the heartbeat signal network.
46. The active master node of claim 42,
the first monitoring module is further configured to continue to monitor the heartbeat packet sent by the first node on the heartbeat signal network, the main network, and the standby network;
the first receiving module is further configured to, when receiving the heartbeat packet of the first node on the standby network within a preset first heartbeat period, acquire that the third CAN channel of the first node recovers communication, and receive data sent by the first node on the standby network;
the first monitoring module is further configured to continue to monitor the heartbeat packet sent by the first node on the heartbeat signal network and the active network;
the first receiving module is further configured to learn that a second CAN channel of the first node recovers communication when the heartbeat packet of the first node is received on the main network in a preset first heartbeat cycle, and switch to the main network to receive data sent by the first node;
the first monitoring module is further configured to continue to monitor a heartbeat message sent by the first node on the heartbeat signal network;
the first receiving module is further configured to learn that the first CAN channel of the first node recovers communication when the heartbeat message of the first node is received on the heartbeat signal network in a preset first heartbeat period, and receive the heartbeat message sent by the first node on the heartbeat signal network.
47. The active master node of claim 32, further comprising:
a first establishing module, configured to establish a network node list corresponding to the active master node according to a network topology map, where the network node list includes: each slave node identification and corresponding heartbeat timer associated with the active master node;
and the first processing module is used for sending a network control instruction to all the slave nodes, controlling the first CAN channel of the slave node to enter a heartbeat message operation mode, and starting a heartbeat timer corresponding to each slave node related to the active master node.
48. The active master node of claim 32, further comprising:
a second learning module, configured to learn that the master network has a fault when a sending error counter or a receiving error counter in the active master node is incremented to a preset value;
and the first switching module is used for switching to the standby network to communicate with other nodes.
49. The active master node of any one of claims 32-48, further comprising:
and the second switching module is used for switching to the standby main node to perform data interaction with other related slave nodes when the active main node is detected to be in fault.
50. A slave node, comprising:
the second monitoring module is used for monitoring heartbeat messages sent by all nodes related to the slave nodes through a first CAN channel on a heartbeat signal network according to a pre-configured network node list;
the second judging module is used for judging whether the first CAN channel of each slave node fails according to the timing condition of a heartbeat timer corresponding to each slave node and the receiving condition of the heartbeat message;
the second analysis module is used for analyzing the heartbeat message to check the working states of a second CAN channel and a third CAN channel of a second node when judging and knowing that the heartbeat message of the second node is received on the heartbeat signal network in a preset heartbeat period, wherein the second node is any slave node or movable master node related to the slave node;
the second receiving module is used for receiving data sent by the second node on the main network when the second CAN channel of the second node is found to be normal through inquiry;
the second receiving module is further configured to receive data sent by the second node on a standby network when the second CAN channel of the second node is found to be faulty and the third CAN channel is normal.
51. The slave node of claim 50, further comprising:
the second monitoring module is further configured to, when it is determined that the heartbeat packet of the second node is not received on the heartbeat signal network in a preset heartbeat period, determine that a first CAN channel of the second node has a fault, and switch to the master network to monitor the heartbeat packet sent by the second node;
the second receiving module is further configured to receive, on the active network, data sent by the second node when the heartbeat packet sent by the second node is received on the active network within a preset heartbeat period.
52. The slave node of claim 51, further comprising:
the first recording module is configured to record a current fault message of a first CAN channel of the second node after receiving a heartbeat message sent by the second node on the master network in a preset heartbeat cycle;
the second monitoring module is further configured to continue to monitor the heartbeat packet sent by the second node on the heartbeat signal network;
the second receiving module is further configured to learn that the first CAN channel of the second node recovers communication when the heartbeat message of the second node is received on the heartbeat signal network in a preset heartbeat period, and then switch to the signal heartbeat network to receive the heartbeat message sent by the second node.
53. The slave node of claim 51,
the second monitoring module is further configured to switch to a standby network to monitor the heartbeat packet sent by the second node when the heartbeat packet sent by the second node is not received on the main network within a preset heartbeat period;
the second receiving module is further configured to receive, in a preset heartbeat period, a heartbeat packet sent by the second node on the standby network, and receive, on the standby network, data sent by the second node.
54. The slave node of claim 53, further comprising:
the second recording module is used for recording the current fault messages of the first CAN channel and the second CAN channel of the second node;
the second monitoring module is further configured to continue to monitor the heartbeat packet sent by the second node on the heartbeat signal network and the master network;
the second receiving module is further configured to learn that the first CAN channel of the second node recovers communication when the heartbeat message of the second node is received on the heartbeat signal network in a preset heartbeat period, and switch to the signal heartbeat network to receive the heartbeat message sent by the second node.
55. The slave node of claim 53, further comprising:
the third recording module is used for recording the current fault messages of the first CAN channel and the second CAN channel of the second node;
the second monitoring module is further configured to continue to monitor the heartbeat packet sent by the second node on the heartbeat signal network and the master network;
the second receiving module is further configured to, when receiving the heartbeat packet of the second node on the master network in a preset heartbeat cycle, acquire that a second CAN channel of the second node recovers communication, and switch to the master network to receive data sent by the second node;
the second monitoring module is further configured to continue to monitor the heartbeat packet sent by the second node on the heartbeat signal network;
the second receiving module is further configured to learn that the first CAN channel of the second node recovers communication when the heartbeat message of the second node is received on the heartbeat signal network in a preset heartbeat period, and switch to the heartbeat signal network to receive the heartbeat message sent by the second node.
56. The slave node of claim 53, further comprising:
and the fourth recording module is used for recording the current fault messages of the first CAN channel, the second CAN channel and the third CAN channel of the second node when the heartbeat message sent by the second node cannot be received on the standby network in a preset heartbeat period.
57. The slave node of claim 53,
the second monitoring module is further configured to continue to monitor the heartbeat packet sent by the second node on the heartbeat signal network, the active network, and the standby network;
the second receiving module is further configured to learn that the first CAN channel of the second node recovers communication when the heartbeat message of the second node is received on the heartbeat signal network in a preset first heartbeat period, and receive the heartbeat message sent by the second node on the heartbeat signal network.
58. The slave node of claim 56,
the second monitoring module is further configured to continue to monitor the heartbeat packet sent by the second node on the heartbeat signal network, the active network, and the standby network;
the second receiving module is further configured to learn that the second CAN channel of the second node recovers communication when the heartbeat packet of the second node is received on the primary network within a preset first heartbeat cycle, and receive the heartbeat packet and data sent by the second node on the primary network;
the second monitoring module is further configured to continue to monitor the heartbeat packet sent by the second node on the heartbeat signal network;
the second receiving module is further configured to learn that the first CAN channel of the second node recovers communication when the heartbeat message of the second node is received on the heartbeat signal network in a preset heartbeat period, and receive the heartbeat message sent by the second node on the heartbeat signal network.
59. The slave node of claim 56,
the second monitoring module is further configured to continue to monitor the heartbeat packet sent by the second node on the heartbeat signal network, the active network, and the standby network;
the second receiving module is further configured to learn that a third CAN channel of the second node recovers communication when the heartbeat packet of the second node is received on the standby network within a preset heartbeat period, and receive data sent by the second node on the standby network;
the second monitoring module is further configured to continue to monitor the heartbeat packet sent by the second node on the heartbeat signal network and the active network;
the second receiving module is further configured to learn that the first CAN channel of the second node recovers communication when the heartbeat message of the second node is received on the heartbeat signal network in a preset heartbeat period, and receive the heartbeat message sent by the second node on the heartbeat signal network.
60. The slave node of claim 56,
the second monitoring module is further configured to continue to monitor the heartbeat packet sent by the second node on the heartbeat signal network, the active network, and the standby network;
the second receiving module is further configured to learn that a third CAN channel of the second node recovers communication when the heartbeat packet of the second node is received on the standby network within a preset heartbeat period, and receive data sent by the second node on the standby network;
the second monitoring module is further configured to continue to monitor the heartbeat packet sent by the second node on the heartbeat signal network and the active network;
the second receiving module is further configured to learn that a second CAN channel of the second node recovers communication when the heartbeat packet of the second node is received on the primary network in a preset heartbeat cycle, and switch to the primary network to receive data sent by the second node;
the second monitoring module is further configured to continue to monitor the heartbeat packet sent by the second node on the heartbeat signal network;
the second receiving module is further configured to learn that the first CAN channel of the second node recovers communication when the heartbeat message of the second node is received on the heartbeat signal network in a preset heartbeat period, and receive the heartbeat message sent by the second node on the heartbeat signal network.
61. The slave node of claim 50, further comprising:
a second establishing module, configured to establish a network node list corresponding to the slave node according to a network topology map, where the network node list includes: each node identification and corresponding heartbeat timer associated with the slave node;
and the second processing module is used for receiving a network control instruction sent by the active master node, starting the first CAN channel to enter a heartbeat message operation mode, and starting a heartbeat timer corresponding to each node related to the slave node.
62. The slave node of any of claims 50-61, further comprising:
and a third switching module, configured to learn the failure of the active network when the transmission error counter or the reception error counter in the slave node is incremented to a preset value, and switch to the standby network to communicate with other nodes.
63. A train network data transmission system based on CANopen protocol is characterized by comprising:
heartbeat signal network, primary network, backup network, and
the active master node of any of claims 32-49;
the slave node of any one of claims 50-62;
and each node performs heartbeat message interaction with the heartbeat signal network through a first CAN channel, performs data interaction with the main network through a second CAN channel, and performs data interaction with the standby network through a third CAN channel.
64. A computer device comprising a memory, a processor and a computer program stored on the memory and operable on the processor, wherein the processor when executing the computer program implements the CANopen protocol-based train network data transmission method according to any one of claims 1 to 18.
65. A computer device comprising a memory, a processor and a computer program stored on the memory and operable on the processor, wherein the processor when executing the computer program implements the CANopen protocol-based train network data transmission method according to any one of claims 19 to 31.
66. A storage medium for storing an application program for executing the CANopen protocol-based train network data transmission method according to any one of claims 1 to 18.
67. A storage medium for storing an application program for executing the CANopen protocol-based train network data transmission method according to any one of claims 19 to 31.
CN201710475924.0A 2017-06-21 2017-06-21 Train network data transmission method, system and device based on CANopen protocol Active CN109104346B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710475924.0A CN109104346B (en) 2017-06-21 2017-06-21 Train network data transmission method, system and device based on CANopen protocol

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710475924.0A CN109104346B (en) 2017-06-21 2017-06-21 Train network data transmission method, system and device based on CANopen protocol

Publications (2)

Publication Number Publication Date
CN109104346A CN109104346A (en) 2018-12-28
CN109104346B true CN109104346B (en) 2020-10-23

Family

ID=64796378

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710475924.0A Active CN109104346B (en) 2017-06-21 2017-06-21 Train network data transmission method, system and device based on CANopen protocol

Country Status (1)

Country Link
CN (1) CN109104346B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110502342B (en) * 2019-08-16 2023-07-18 中科边缘智慧信息科技(苏州)有限公司 Maneuvering edge information service network in intermittent network environment
CN112804085B (en) * 2020-12-29 2022-07-08 杭州和利时自动化有限公司 Backup network detection method, device and equipment for master-slave structure
CN113132367B (en) * 2021-04-09 2024-02-23 国网电力科学研究院有限公司 Engineering monitoring-oriented data transmission self-adaptive method and device for Internet of things acquisition terminal
CN113726573B (en) * 2021-08-31 2024-01-05 通号城市轨道交通技术有限公司 Redundant network communication method, device, electronic equipment and storage medium
CN115567395B (en) * 2022-11-10 2023-03-07 苏州浪潮智能科技有限公司 Master-slave node determination method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102724065A (en) * 2012-05-22 2012-10-10 长沙中联消防机械有限公司 Network communication system and engineering mechanical equipment comprising same
CN102947813A (en) * 2010-03-31 2013-02-27 施奈德电气自动控制有限责任公司 Method for transmitting data via canopen bus
CN103516571A (en) * 2013-07-22 2014-01-15 浙江中控研究院有限公司 System architecture and method for ensuring data communication reliability by means of double CAN buses
CN106452870A (en) * 2016-10-13 2017-02-22 中车株洲电力机车研究所有限公司 Redundancy control method for primary device of CANopen network

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009070898A1 (en) * 2007-12-07 2009-06-11 Scl Elements Inc. Auto-configuring multi-layer network

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102947813A (en) * 2010-03-31 2013-02-27 施奈德电气自动控制有限责任公司 Method for transmitting data via canopen bus
CN102724065A (en) * 2012-05-22 2012-10-10 长沙中联消防机械有限公司 Network communication system and engineering mechanical equipment comprising same
CN103516571A (en) * 2013-07-22 2014-01-15 浙江中控研究院有限公司 System architecture and method for ensuring data communication reliability by means of double CAN buses
CN106452870A (en) * 2016-10-13 2017-02-22 中车株洲电力机车研究所有限公司 Redundancy control method for primary device of CANopen network

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
CANopen在主机遥控系统中的应用;陈迪秋;《上海船舶运输科学研究所学报》;20160330;全文 *

Also Published As

Publication number Publication date
CN109104346A (en) 2018-12-28

Similar Documents

Publication Publication Date Title
CN109104349B (en) Train network data transmission method, system and device based on CANopen protocol
CN109104346B (en) Train network data transmission method, system and device based on CANopen protocol
CN109104351B (en) Train network node and train network node monitoring method based on CANopen protocol
CN109104348B (en) Train network data transmission method, system and device based on CANopen protocol
CN110474943B (en) Vehicle network redundancy system and gateway switching method based on MVB and Ethernet
EP1982447B1 (en) System and method for detecting and recovering from virtual switch link failures
CN101217402B (en) A method to enhance the reliability of the cluster and a high reliability communication node
US9106523B2 (en) Communication device and method of controlling the same
US10277454B2 (en) Handling failure of stacking system
CN109104325B (en) Train network data transmission method, system and device based on CANopen protocol
JP6007849B2 (en) Network relay device
CN105634848B (en) A kind of virtual router monitoring method and device
JP2014116767A (en) Communication system and network relay device
CN109104347B (en) Gateway rotation method, system and device for transmitting data based on CANopen protocol
CN102231674A (en) Processing method and apparatus of far-end fault of Ethernet
KR101574900B1 (en) Control system for steel plant
CN112218321B (en) Master-slave link switching method, device, communication equipment and storage medium
KR20110046897A (en) Method to elect master nodes from nodes of a subnet
US20170070410A1 (en) System and method for providing redundant ethernet network connections
CN113438105B (en) Method, device and equipment for assisting multi-IRF (inter-range radio frequency) splitting detection by MAD (multi-object detection)
CN104901880A (en) Service running method and device
JP6359914B2 (en) Relay system and relay device
US20160315839A1 (en) Transmission method, transmission system, and transmission device
JP6204397B2 (en) COMMUNICATION DEVICE, COMMUNICATION SYSTEM, COMMUNICATION METHOD, AND PROGRAM
CN113395188B (en) Method and system for determining working state of server

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
GR01 Patent grant
GR01 Patent grant