CN109104325B - 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
CN109104325B
CN109104325B CN201710477075.2A CN201710477075A CN109104325B CN 109104325 B CN109104325 B CN 109104325B CN 201710477075 A CN201710477075 A CN 201710477075A CN 109104325 B CN109104325 B CN 109104325B
Authority
CN
China
Prior art keywords
node
network
pdo
channel
slave
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
CN201710477075.2A
Other languages
Chinese (zh)
Other versions
CN109104325A (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 CN201710477075.2A priority Critical patent/CN109104325B/en
Publication of CN109104325A publication Critical patent/CN109104325A/en
Application granted granted Critical
Publication of CN109104325B publication Critical patent/CN109104325B/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/40052High-speed IEEE 1394 serial bus
    • H04L12/40078Bus configuration
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/40169Flexible bus arrangements
    • H04L12/40176Flexible bus arrangements involving redundancy
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • 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)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Medical Informatics (AREA)
  • Cardiology (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Small-Scale Networks (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 train network data transmission method, the train network data transmission system and the train network data transmission device are applied to an active main node and comprise the following steps: monitoring PDO messages sent by each slave node related to the active master node through a first CAN channel on the main network according to a pre-configured network node list; judging whether the first CAN channel of each slave node has a fault; if the fault occurs, switching to a standby network to monitor a PDO message sent by a first node through a second CAN channel, wherein the first node is any slave node related to the active master node; if the standby network receives the PDO message sent by the first node through the second CAN channel in a preset first heartbeat cycle corresponding to the first node, receiving data sent by the first node on the standby network, and meanwhile, receiving data sent by other slave nodes which normally send the PDO message on the main network. Therefore, 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.
In general, if a CAN bus is used for data interaction in train communication network design, most of the cases are designed based on a CAN open (a high-level communication protocol based on the CAN bus, which is a field bus commonly used in industrial control at present), the definition of the CAN open is a standardized application layer protocol based on the CAN bus design, and the CAN open protocol supports a set of complete network management mechanism for the traditional CAN to support redundant network design. The current CANopen-based redundant network design requires two ways of simultaneously transmitting data by all network nodes, but by default all nodes only get data from the active network, when one or some slave nodes drop in the active network, switching to the standby network to receive the data of the part of the nodes, receiving the data of the part of the nodes, switching to the standby network to receive the data uniformly, however, if the paths in which multiple nodes fail are not in the same network, the policy has hidden troubles, for example, if one of the plurality of failed nodes is in the active network, the other node is in the standby network, in the above manner, no matter which network is uniformly switched to receive data, a part of the node data is not received, and therefore, due to the incompleteness of the received data, the realization of partial functions is influenced, and further the running of the whole vehicle is influenced.
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 ensures the good running of the whole train and improves 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 invention is to propose a computer readable medium.
A ninth object of the invention is to propose another computer-readable 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: the method is applied to an active main node and comprises the following steps: monitoring PDO messages sent by each slave node related to the active master node through a first CAN channel on a main network according to a pre-configured network node list; judging whether the first CAN channel of each slave node fails according to the receiving condition of the PDO message sent by each slave node and the timing condition of a heartbeat timer correspondingly set for each slave node according to the production prohibition time in the PDO message; if the PDO message of the first node is not received in the main network within a preset first heartbeat period corresponding to the first node, acquiring the fault of a first CAN channel of the first node, and switching to a standby network to monitor the PDO message sent by the first node through a second CAN channel, wherein the first node is any slave node related to the active main node; if the standby network receives the PDO message sent by the first node through the second CAN channel in a preset first heartbeat cycle corresponding to the first node, receiving data sent by the first node on the standby network, and simultaneously receiving data sent by other slave nodes which normally send the PDO message on the main 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 is applied to a slave node, and includes the following steps: monitoring PDO messages sent by each node related to the slave node through a first CAN channel on the main network according to a pre-configured network node list: judging whether the first CAN channel of each node fails according to the receiving condition of the PDO message sent by each node and the timing condition of a heartbeat timer correspondingly set for each node according to the production prohibition time in the PDO message; if the PDO message of the second node is not received on the primary network in a preset heartbeat period corresponding to the second node, acquiring the fault of a first CAN channel of the second node, and switching to a standby network to monitor the PDO message sent by the second node through the second CAN channel, wherein the second node is any slave node or active master node related to the slave node; if the standby network receives the PDO message sent by the second node through the second CAN channel in a preset heartbeat period corresponding to the second node, receiving data sent by the second node on the standby network, and simultaneously receiving data sent by other nodes which normally send the PDO message on the main 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 PDO messages sent by each slave node related to the active master node through a first CAN channel on the main 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 receiving condition of the PDO message sent by each slave node and the timing condition of a heartbeat timer correspondingly set for each slave node according to the production prohibition time in the PDO message; the first obtaining module is used for obtaining a first CAN channel fault of a first node when a PDO message of the first node is not received in the primary network in a preset first heartbeat cycle corresponding to the first node; the first monitoring module is further configured to switch to a standby network to monitor a PDO packet sent by the first node through a second CAN channel, where the first node is any slave node related to the active master node; the first receiving module is configured to receive, in a preset first heartbeat cycle corresponding to a first node, data sent by the first node on the standby network when the standby network receives a PDO packet sent by the first node through a second CAN channel, and receive, on the active network, data sent by other slave nodes that normally send the PDO packet at the same time.
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 PDO messages sent by all nodes related to the slave nodes through the first CAN channel on the main network according to a pre-configured network node list; the second judgment module is used for judging whether the first CAN channel of each node fails according to the receiving condition of the PDO message sent by each node and the timing condition of a heartbeat timer correspondingly set for each node according to the production prohibition time in the PDO message; the second learning module is configured to learn that a first CAN channel of a second node fails when a PDO packet of the second node is not received on the primary network within a preset heartbeat period corresponding to the second node; the second monitoring module is further configured to switch to a standby network to monitor a PDO packet sent by the second node through a second CAN channel, where the second node is any one of a slave node or an active master node related to the slave node; and the second receiving module is configured to receive, in a preset heartbeat cycle corresponding to the second node, data sent by the second node on the standby network when the standby network receives the PDO packet sent by the second node through the second CAN channel, and receive, on the primary network, data sent by other nodes that normally send the PDO packet at the same time.
In order to achieve the above object, a train network data transmission system based on the CANopen protocol according to a fifth embodiment of the present invention includes the active master node according to the third embodiment of the present invention; a slave node according to the fourth aspect, an active network; a standby network.
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 computer-readable medium for storing a computer program, where the computer program is executed by a processor to implement 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 ninth aspect of the present invention provides a computer-readable medium for storing a computer program, where the computer program is executed by a processor to implement 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 effects:
monitoring PDO messages sent by each slave node related to an active master node through a first CAN channel on a master network according to a pre-configured network node list, judging whether the first CAN channel of each slave node has a fault according to the receiving condition of the PDO messages sent by each slave node and the timing condition of a heartbeat timer which is correspondingly arranged for each slave node according to the production prohibition time in the PDO messages, if the PDO messages of the first node are not received by the master network in a preset first heartbeat period corresponding to the first node, knowing the fault of the first CAN channel of the first node, switching to a standby network to monitor the PDO messages sent by the first node through a second CAN channel, and if the PDO messages sent by the first node through the second CAN channel are received by the standby network in the preset first heartbeat period corresponding to the first node, receiving data sent by the first node on the standby network, meanwhile, data sent by other slave nodes which normally send PDO messages is received on the main network. Therefore, 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 the data of other slave nodes are still received in the main network, so that the complete receiving of the data of the relevant slave nodes 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 schematic diagram of a train network architecture according to the prior art;
FIG. 2(a) is a schematic diagram of risk existence of train network structure data transmission according to the prior art;
fig. 2(b) is a schematic diagram of train network structure data transmission overcoming risk according to the present invention;
fig. 3 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. 4 is an exemplary topology diagram of a train redundancy network data transmission method according to an embodiment of the present invention;
FIG. 5 is an exemplary diagram illustrating data received by each node when a bus of the active network fails according to the present invention;
fig. 6 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. 7 is a flowchart of a train network data transmission method based on the CANopen protocol according to a third 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 fourth embodiment of the present invention;
FIG. 9 is a schematic structural diagram of an active master node according to a first embodiment of the present invention;
fig. 10 is a schematic structural diagram of a master node according to a second embodiment of the present invention;
fig. 11 is a schematic structural diagram of a master node according to a third embodiment of the present invention;
fig. 12 is a schematic structural diagram of a master node according to a fourth embodiment of the present invention;
fig. 13 is a schematic structural diagram of an active master node according to a fifth embodiment of the present invention;
fig. 14 is a schematic structural diagram of an active master node according to a sixth embodiment of the present invention;
fig. 15 is a schematic structural diagram of an active master node according to a seventh embodiment of the present invention;
fig. 16 is a schematic structural diagram of a slave node according to the first embodiment of the present invention;
fig. 17 is a schematic structural diagram of a slave node according to a second embodiment of the present invention;
fig. 18 is a schematic structural diagram of a slave node according to a third embodiment of the present invention;
fig. 19 is a schematic structural diagram of a slave node according to a fourth embodiment of the present invention;
fig. 20 is a schematic structural diagram of a train network data transmission system based on the CANopen protocol according to an embodiment of the present invention;
FIG. 21 is a schematic diagram of a master node receiving data when a first CAN channel of an enumerated node fails in accordance with the present invention; and
FIG. 22 is a diagram illustrating exemplary nodes receiving data from a node in the event of a first CAN channel failure in accordance with 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 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. 1, 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. 2(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 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 a master node to manage the initialization, start, supervision, reset or stop of other slave nodes.
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:
in order to better implement the train network data transmission method based on the CANopen protocol of the embodiment of the invention, certain design requirements are provided for the master node, and the master node is used as a network administrator identity, so that the master node has a network state control function more than that of the slave node, namely after being powered on, the master node needs to simultaneously send network control instructions to the master 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 master network and the standby network.
Fig. 3 is a flowchart of a train network data transmission method based on the CANopen protocol according to a first embodiment of the present invention, as shown in fig. 3, the method includes:
s101, monitoring PDO messages sent by each slave node related to the active master node through a first CAN channel on the main network according to a pre-configured network node list.
Among them, PD0(Process Data Object) is used to transmit real-time Data, provides a direct access channel to device application objects, and is used to transmit real-time short frame Data, and has higher priority.
In the PDO message monitoring mechanism, the production prohibition time related to the communication parameter index in the PDO object dictionary is used as a key judgment condition for defining whether a node is disconnected or not. The PDO communication parameter structure is shown in table 1 below.
TABLE 1
Figure GDA0002585999240000071
It will be appreciated that the present invention requires the master node to build a (configurable) list of all network nodes from the topology map, wherein the list of network nodes comprises: and the heartbeat timers corresponding to the slave nodes simultaneously send network control instructions to all the slave nodes from the main network and the standby network according to the production prohibition time setting in the PDO message, control the first CAN channel and the second CAN channel of the slave nodes to enter a PDO message operation mode, and start the heartbeat timers corresponding to the slave nodes related to the active master node.
In the CANopen object dictionary, one representative PDO is selected for each node according to the actual call disconnection time limit judgment requirement in the RPDO object index (1400h to 15FFh), and a heartbeat counter is set for each node according to the production prohibition time parameters in the PDO indexes.
Furthermore, after the master node enters the operating state, the master node CAN continuously detect the PDO transmission condition of each node, and since the master network is defaulted to work, the PDO message sent by each slave node related to the active master node through the first CAN channel is monitored on the master network according to a pre-configured network node list, so that whether each slave node is disconnected or not CAN be judged according to the message receiving condition.
And S102, judging whether the first CAN channel of each slave node fails according to the receiving condition of the PDO message sent by each slave node and the timing condition of a heartbeat timer correspondingly set for each slave node according to the production prohibition time in the PDO message.
It should be understood that, with continued reference to table 1 above, in the PDO message sending mechanism, the production prohibition time of the sub-index 03h indicates that a piece of PDO data is received and processed within a preset time, if a corresponding piece of PDO data is not received within the preset time, the node may record a lost frame of the PDO message, when a piece of PDO data is not received within a production prohibition time, the heartbeat counter starts to count, and when the heartbeat counter accumulates to a preset value, the master node may determine that the node is disconnected. Therefore, in the embodiment of the present invention, the timing condition of the heartbeat timer is set for the production prohibited time, so that whether the first CAN channel of each slave node fails is determined according to the receiving condition of the PDO message sent by each slave node and the timing condition of the heartbeat timer correspondingly set for each slave node according to the production prohibited time in the PDO message.
If the first CAN channel of the slave node has good communication, the master node CAN normally receive the PDO message sent by the slave node within a certain time, otherwise, the first CAN channel of the slave node has a communication fault.
And S103, if the PDO message of the first node is not received in the primary network in a preset first heartbeat cycle corresponding to the first node, acquiring the fault of the first CAN channel of the first node, and switching to a standby network to monitor the PDO message sent by the first node through the second CAN channel.
Wherein the first node is any slave node related to the active master node.
Specifically, in a preset first heartbeat cycle corresponding to the first node, if the PDO message of the first node is not received on the primary network, it indicates that the reason why the active host node cannot receive the PDO message sent by the first node is caused by the failure of the first CAN channel, so as to ensure that the active host node CAN normally receive the PDO message of the first node, maintain the normal operation of the entire vehicle, and switch to the standby network to monitor the PDO message sent by the first node through the second CAN channel.
It should be emphasized that, at this time, the active master node may only monitor the PDO packet of the first node from the standby network, and still receive the PDO packet in the active network for the slave nodes without failure in the other first CAN channels, so that, as shown in fig. 2(B), the node a needs to receive 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 active 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 received, and the normal function of the node a CAN be ensured, thereby ensuring good operation of the entire vehicle, and enhancing the redundancy effect.
In another embodiment of the present invention, if the PDO packet of the first node is received within the preset first heartbeat cycle, it indicates that the data transmission failure of the slave node can be repaired by itself through resetting, so as to continue to receive the data sent by the first node from the active network.
And S104, if the standby network receives the PDO message sent by the first node through the second CAN channel in a preset first heartbeat cycle corresponding to the first node, receiving the data sent by the first node on the standby network, and simultaneously receiving the data sent by other slave nodes which normally send the PDO message on the main network.
Specifically, if a PDO packet sent by the first node through the second CAN channel is received in the first heartbeat cycle corresponding to the first node, it indicates that the second CAN channel is normal in function, so that data sent by the first node is received on the standby network, and meanwhile, data sent by other slave nodes that normally send PDO packets is received on the active network.
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, a network establishes two master nodes, one is an active master node, and the other is a backup master node, and when the active master node fails, the backup master node will replace the function of the previous active master node.
That is, in one embodiment of the present invention, if the active master node is detected to fail, the standby master node is switched to perform data interaction with other related slave nodes.
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 first 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 of the first 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. That is, if the sending error counter or the receiving error counter in the active master node is accumulated to a preset value, the master node knows the fault of the master network and switches to the standby network to communicate with other nodes.
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 a busoff caused by abnormal line voltage of a CAN, excessive error frames and the like), the active main node firstly analyzes a standby main node message to judge whether to start the standby main node, if the standby main node CAN normally play the role of the active main node, the active main node stops running and enters a silent state, the standby main node starts and plays the role of the active main node, if the standby main node is in the fault state at present and CAN not play the role of the active main node, the current active main node continues to run and immediately switches to the standby network to process all slave node data, meanwhile, the active main node informs an instrument or other equipment that the main network is in the fault state at present, and if the current standby network also has a, the communication network enters a state of paralysis and all nodes enter a state of special operation 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.
For example, as shown in fig. 5, when a short-circuit fault occurs on the main network bus, that is, all nodes on the main network cannot communicate normally, the error counters of all nodes are continuously accumulated, and when each node determines that the main network channel enters the busoff state, the node is automatically switched to the standby network to receive the required data.
It should be emphasized that, based on the above description, 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, a reset instruction is sent to the failed CAN channel to determine whether a failure actually occurs currently according to a receiving condition of the PDO message after reset.
Specifically, in an embodiment of the present invention, after determining that the PDO 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 the initial operating state.
And then, continuously monitoring the PDO message sent by the first node on the active network, if the PDO message of the first node is not received in a preset second heartbeat cycle corresponding to the first node, acquiring the fault of the first CAN channel of the first node, and switching to a standby network to monitor the PDO message sent by the first node.
If the PDO message of the first node is received in the preset second heartbeat cycle, the fact that the first CAN channel fault of the first node is temporary and is eliminated through the reset action is known, and therefore the PDO message sent by the first node is monitored in the main network.
Based on the same principle, when the second CAN channel is switched to receive the PDO message sent by the first node, if the PDO message sent by the first node through the second CAN channel cannot be received in a preset first heartbeat period corresponding to the first node, the communication fault of the second CAN channel is not directly judged, but a reset instruction is sent to the first node from the standby network, and the PDO message sent by the first node is continuously monitored in the standby network.
If a PDO message sent by the first node through the second CAN channel is received in a second heartbeat cycle corresponding to the first node, the fact that the second CAN channel fault of the first node is temporary and has been eliminated through the reset action is known, so that data sent by the first node is received on the standby network, and meanwhile, data sent by other slave nodes which normally send the PDO message is received on the main network.
And if the PDO message sent by the first node through the second CAN channel is not received in a second heartbeat period corresponding to the first node, acquiring the second CAN channel fault of the first node.
It should be emphasized that the durations of the first heartbeat cycle and the second heartbeat cycle can be calibrated according to the needs of a common scene, and the first heartbeat cycle and the second heartbeat cycle may be the same or different.
To sum up, in the train network data transmission method based on the CANopen protocol according to the embodiment of the present invention, a PDO packet sent by each slave node related to an active master node through a first CAN channel is monitored on a master network according to a preconfigured network node list, whether a first CAN channel of each slave node fails is determined according to a receiving condition of the PDO packet sent by each slave node and a timing condition of a heartbeat timer correspondingly set for each slave node according to a production prohibition time in the PDO packet, if the PDO packet of the first node is not received in the master network in a preset first heartbeat period corresponding to the first node, the failure of the first CAN channel of the first node is known, and the first CAN channel is switched to a standby network to monitor the PDO packet sent by the first node through a second CAN channel, and if the PDO packet sent by the first node through the second CAN channel is received in the standby network in the preset first heartbeat period corresponding to the first node, the data sent by the first node is received on the standby network, and meanwhile, the data sent by other slave nodes which normally send the PDO message is received on the active network. Therefore, 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 the data of other slave nodes are still received in the main network, so that the complete receiving of the data of the relevant slave nodes 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 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. 6 is a flowchart of a train network data transmission method based on the CANopen protocol according to a second embodiment of the present invention, as shown in fig. 6, after the step S104, further including:
s201, if the PDO message sent by the first node is not received on the standby network in a preset second heartbeat cycle corresponding to the first node, sending current fault messages of the first CAN channel and the second CAN channel of the first node to the operation monitoring node, displaying the current fault messages to an operator, and prompting the current fault maintenance.
In addition, the monitoring node may be a different device, 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, without limitation.
Specifically, if the PDO message sent by the first node through the second CAN channel is not received within the preset second heartbeat period, it indicates that the second CAN channel is also failed, so that, in order to facilitate relevant operators to know the failure condition in time to perform failure processing, current failure 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 the operator, and current failure maintenance is prompted.
For example, in this example, the preset second heartbeat cycle is a heartbeat cycle, and the operation monitoring node is a display screen, if the PDO packet of the first node is still not monitored in the a heartbeat cycles on the standby network, the active master node directly notifies the meter display screen that both the active network and the standby network of the first node have a fault (the fault type is a current fault), and prompts to repair the active network and the standby network of the node.
S202, continuously monitoring PDO messages sent by a first node on the primary network and the standby network, if receiving the PDO messages of the first node from the primary network in a preset first heartbeat cycle corresponding to the first node, knowing that a first CAN channel of the first node recovers communication, switching to the primary network to receive data sent by the first node, sending a current fault message of a second CAN channel of the first node to the operation monitoring node, displaying the current fault message to an operator, and prompting the current fault maintenance.
Specifically, when both paths of the node have communication failures, the active master node needs to continue to monitor data sent by the node in the active network and the standby network, and if one of the active network and the standby network recovers communication in midway of the failed node, the active master node communicates through the recovered network.
For example, the PDO packet sent by the first node through the first CAN channel is continuously monitored on the primary network and the backup network, if the midway failed node recovers communication with one of the primary network and the backup network, that is, the primary node CAN receive the PDO packet of the first node in a heartbeat cycle on the primary network, the primary node receives and processes the data of the first node on the recovered network, but still notifies the operation monitoring node (such as an instrument display screen) that the network of the first node is a historical failure and the network of the other network is a current failure.
And S203, continuously monitoring the PDO message sent by the first node on the standby network, and if the PDO message of the first node is received from the standby network in a preset first heartbeat cycle corresponding to the first node, sending historical fault messages of the first CAN channel and the second CAN channel of the first node to the operation monitoring node and displaying the historical fault messages to an operator to prompt fault hidden trouble maintenance.
For example, if the communication between the main network and the standby network is recovered in the midway fault node, the active master node only needs to process related slave node data on the main network, but still reports that historical faults occur in the main network and the standby network of the first node to the operation monitoring node (such as an instrument display screen) so that related operators CAN eliminate potential safety hazards and the safety and stability of the train network are improved.
And S204, continuously monitoring PDO messages sent by the first node on the main network and the standby network, if the PDO messages of the first node are received from the standby network in a preset first heartbeat cycle corresponding to the first node, knowing that the second CAN channel of the first node recovers communication, receiving data sent by the first node from the standby network, sending a current fault message of the first CAN channel of the first node to the operation monitoring node, displaying the current fault message to an operator, and prompting the current fault maintenance.
Specifically, if the second CAN channel recovers communication first relative to the first CAN channel, the data sent by the first node is received from the standby network, the current fault message of the first CAN channel of the first node is sent to the operation monitoring node, and the current fault message is displayed to an operator to prompt current fault maintenance.
S205, continuously monitoring the PDO message sent by the first node through the first CAN channel on the primary network, if the PDO message of the first node is received from the primary network in a preset first heartbeat cycle corresponding to the first node, switching to the primary network to receive the data sent by the first node, sending historical fault messages of the first CAN channel and the second CAN channel of the first node to the operation monitoring node, displaying the historical fault messages to an operator, and prompting fault hidden trouble maintenance.
Specifically, when data sent by the second CAN channel is received through the standby network, whether the first CAN channel of the first node recovers communication or not is judged according to the condition of the message, if the communication is recovered, the first CAN channel of the first node is switched to the main network to receive the data sent by the first node, historical 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, and fault hidden trouble overhauling is prompted.
And S206, if the PDO message sent by the first node is received on the standby network in a preset second heartbeat period corresponding to the first node, sending the current fault message of the first CAN channel of the first node to the operation monitoring node, and displaying the current fault message to an operator to prompt the current fault maintenance.
Specifically, if a PDO message sent by the first node through the second CAN channel is received within a preset second heartbeat cycle, it indicates that the second CAN channel CAN provide data services normally, so that the master node may receive and process data related to the node on the standby network, and data of other nodes may still be received and processed from the primary network, and at the same time, the master node may notify the operation monitoring node (such as an instrument display screen, etc.) that the first CAN channel of the first node has a fault (the fault type is a current fault), and prompt to overhaul the primary network of the first node.
And S207, continuously monitoring the PDO message sent by the first node through the first CAN channel on the primary network, and if the PDO message of the first node is received in a preset first heartbeat cycle corresponding to the first node, knowing that the first CAN channel of the first node recovers communication, switching to the primary network to receive data sent by the first node.
And S208, sending the historical fault message of the first CAN channel of the first node to the operation monitoring node, displaying the historical fault message to an operator, and prompting the potential fault hazard maintenance.
Specifically, after the related operator is prompted to overhaul the primary network of the first node, the PDO message sent by the first node through the first CAN channel is monitored continuously on the primary network, if the first node fails halfway, the primary network recovers communication, for example, the primary node CAN receive the PDO message of the first node in a heartbeat cycle on the primary network, the primary node recovers to the primary network to receive the data of the first node, and stops processing from the standby network, but the primary node still notifies the operation monitoring node (for example, an instrument display screen or the like) that the primary network of the first node fails (the failure type is a historical failure), and the primary network of the first node is also prompted to be overhauled to confirm whether a failure hidden danger exists.
In summary, according to the train network data transmission method based on the CANopen protocol in the embodiment of the present invention, the selection of the primary network and the backup network is performed according to the real-time situation of the train network, and the corresponding display is performed on the monitoring node to the relevant operator, 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 are powered on and then enter an operation state after receiving a master node starting instruction, PDO data is sent according to self functions and the master node synchronous packet frequency, the slave nodes are required to send data to a main network and a standby network at the same time, under the default condition, only special object messages such as synchronous packets, time stamps and the like of the master nodes are received from the main network, the slave nodes are switched to the standby network to receive only when a message periods on the main network do not receive the master node special object messages, and if the standby network still does not receive the active master node special object messages in the a message periods, the slave nodes enter a special condition processing mode.
Fig. 7 is a flowchart of a train network data transmission method based on the CANopen protocol according to a third embodiment of the present invention, as shown in fig. 7, the method includes:
s301, monitoring PDO messages sent by each node related to the slave node through a first CAN channel on the master network according to a preconfigured 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: and each node identifier related to the slave node and a corresponding heartbeat timer, wherein the heartbeat timer corresponding to each node is set according to the production prohibition time in the PDO message.
And then, receiving a network control instruction sent by the active master node from the master network, starting the first CAN channel and the second CAN channel to enter a PDO message operation mode, and starting a heartbeat timer corresponding to each node related to the slave node.
Specifically, in the actual execution process, the PDO packet sent by each node related to the slave node through the first CAN channel is monitored according to the preconfigured network node list, and in the actual application, each slave node monitors the PDO packet sending condition of the related slave node on the active network according to the network node list in a default state.
S302, judging whether the first CAN channel of each node has a fault according to the receiving condition of the PDO message sent by each node and the timing condition of a heartbeat timer correspondingly set for each node according to the production prohibition time in the PDO message.
It should be understood that, in the PDO packet sending mechanism, the production prohibited time of the sub-index 03h indicates that a piece of PDO data is received and processed within a preset time, if the corresponding PDO data is not received within the preset time, the node may record a frame loss of the PDO packet, when the PDO data is not received within the production prohibited time, the heartbeat counter starts to count, and when the heartbeat counter accumulates to a preset value, the master node may determine that the node is disconnected. Therefore, in the embodiment of the present invention, the timing condition of the heartbeat timer is set for the production prohibited time, so that whether the first CAN channel of each slave node fails is determined according to the receiving condition of the PDO message sent by each slave node and the timing condition of the heartbeat timer correspondingly set for each slave node according to the production prohibited time in the PDO message.
If the first CAN channel of the slave node has good communication, the active master node CAN normally receive the PDO message sent by the slave node within a certain time, otherwise, the first CAN channel of the slave node has a communication fault.
And S303, if the PDO message of the second node is not received on the primary network in a preset heartbeat period corresponding to the second node, acquiring the fault of the first CAN channel of the second node, and switching to a standby network to monitor the PDO message sent by the second node through the second CAN channel.
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 PDO packet of the second node is not received in the heartbeat period corresponding to the second node, the failure of the first CAN channel of the second node is obtained, so that the standby network is switched to monitor the PDO packet sent by the second node through the second CAN channel in order to maintain the normal operation of the train network.
And S304, if the standby network receives the PDO message sent by the second node through the second CAN channel in a preset heartbeat cycle corresponding to the second node, receiving data sent by the second node on the standby network, and simultaneously receiving data sent by other nodes which normally send the PDO message on the main network.
Specifically, if a PDO message sent by the second node through the second CAN channel is received in a heartbeat cycle corresponding to the second node, it indicates that the second CAN channel is normal in function, so that data sent by the second node is received on the standby network.
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 nodes will monitor the bus states of the master network and the standby network in real time (realized by an error counter), when a first CAN channel of the slave nodes has a fault (such as busoff caused by abnormal CAN line voltage, excessive error frames and the like), the slave nodes will immediately switch to the standby network to process all slave node data, and meanwhile, the slave nodes will record 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.
To sum up, in the train network data transmission method based on the CANopen protocol according to the embodiment of the present invention, a PDO packet sent by each node related to a slave node through a first CAN channel is monitored on a primary network according to a preconfigured network node list, whether the first CAN channel of each node fails is determined according to a receiving condition of the PDO packet sent by each node and a timing condition of a heartbeat timer correspondingly set for each node according to a production prohibition time in the PDO packet, if the PDO packet of the second node is not received on the primary network in a preset heartbeat period corresponding to the second node, the failure of the first CAN channel of the second node is known, and the primary network is switched to a standby network to monitor the PDO packet sent by the second node through the second CAN channel, if the PDO packet sent by the second node through the second CAN channel is received by the standby network in the preset heartbeat period corresponding to the second node, and receiving the data sent by the second node on the standby network, and receiving the data sent by other nodes which normally send the PDO message on the main network. Therefore, 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 the data of other slave nodes are still received in the main network, so that the complete receiving of the data of the relevant slave nodes 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. 8 is a flowchart of a train network data transmission method based on the CANopen protocol according to a fourth embodiment of the present invention, as shown in fig. 8, after the step S304, the method further includes:
s401, if a PDO message sent by a second node through a second CAN channel is received in a standby network, recording the current fault message of the first CAN channel of the second node.
Specifically, if the slave node can receive data sent by the second node with the dropped active network, the slave node will receive and process the data related to the node on the standby network, and the data of other slave nodes will still be received and processed from the active network, and record the communication failure of the active network of the second node.
S402, continuously monitoring a PDO message sent by a second node through a first CAN channel on the primary network, and if the PDO message of the second node is received in a preset heartbeat cycle corresponding to the second node, knowing that the first CAN channel of the second node recovers communication, switching to the primary network to receive data sent by the second node.
Specifically, if the second node that has failed in the middle of the communication is recovered by the active network, for example, the slave node may receive the PDO packet of the second node in b consecutive heartbeat cycles on the active network, the slave node recovers to the active network to receive the data of the second node, and stops processing of the slave network.
And S403, if the PDO message sent by the second node through the second CAN channel cannot be received in the preset heartbeat period, recording the current fault messages of the first CAN channel and the second CAN channel of the second node.
Specifically, if a PDO packet sent by the second node through the second CAN channel is not received in a preset heartbeat cycle, for example, the PDO packet of the second node is still not monitored in b consecutive heartbeat cycles on the standby network, the slave node looks that the second node has dropped, and records a communication fault between the active network and the standby network of the second node.
S404, continuously monitoring PDO messages of the second node on the main network and the standby network, and if the main network receives the PDO messages of the second node in a preset heartbeat cycle corresponding to the second node, knowing that the first CAN channel of the second node recovers communication, switching to the main network to receive data sent by the second node.
Specifically, when two paths of the second node have communication failures, the second node needs to continue to monitor the PDO packet of the second node in the active network and the standby network, and if the midway failed node recovers communication in one of the active network and the standby network, for example, the PDO packet of the second node can be received by the second node in c consecutive heartbeat cycles on the active network, the slave node receives and processes the data of the second node on the recovered active network, but still records that the path of the active network of the second node is a historical failure and the other path of the network is a current failure.
S405, continuously monitoring PDO messages sent by the second node on the primary network and the standby network, and if receiving the PDO messages of the first slave node from the standby network in a preset heartbeat cycle corresponding to the second node, knowing that the second CAN channel of the second node recovers communication, and receiving data sent by the second node from the standby network.
For example, if the PDO packet of the second node can be received by the second node for c consecutive heartbeat cycles on the standby network, the slave node receives and processes the data of the second node on the recovered standby network, but still records that the one way of standby network of the second node is a historical failure and the other way of network is a current failure.
S406, the PDO message sent by the second node is monitored continuously on the active network, and if the PDO message of the second node is received from the active network in a preset heartbeat cycle corresponding to the second node, the PDO message is switched to the active network to receive the data sent by the second node.
Specifically, if the node in the midway fails and both the primary network and the standby network recover communication, the slave node only needs to process the node data on the primary network, but still records that both the primary network and the standby network of the node have historical failures.
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 selection of the primary network and the backup network is performed according to the real-time situation of the train network, and the corresponding display is performed on the monitoring node to the relevant operator, so that the stability and the reusability of the train network data transmission method are improved.
In order to implement the above embodiments, the present invention provides an active master node. Fig. 9 is a schematic structural diagram of an active master node according to a first embodiment of the present invention, and as shown in fig. 9, the active master node includes: the device comprises a first monitoring module 101, a first judging module 102, a first learning module 103 and a first receiving module 104.
The first monitoring module 101 is configured to monitor, on the active network, a PDO 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. 10 is a schematic structural diagram of an active master node according to a second embodiment of the present invention, as shown in fig. 10, and based on fig. 9, the active master node further includes: a first setup module 105 and a first control 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: and each slave node identifier related to the active master node and a corresponding heartbeat timer, wherein the heartbeat timer corresponding to each slave node is set according to the production prohibition time in the PDO message.
The first control module 106 is configured to send a network control instruction to all slave nodes from the active network and the standby network at the same time, control the first CAN channel and the second CAN channel of the slave nodes to enter a PDO packet 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 receiving condition of the PDO packet sent by each slave node and a timing condition of a heartbeat timer correspondingly set for each slave node according to the production prohibition time in the PDO packet.
The first obtaining module 103 is configured to obtain a first CAN channel fault of a first node when a PDO packet of the first node is not received in the active network in a preset first heartbeat cycle corresponding to the first node.
In an embodiment of the present invention, the first monitoring module 101 is further configured to switch to a standby network to monitor a PDO packet sent by a first node through a second CAN channel, where the first node is any slave node related to an active master node.
The first receiving module 104 is configured to receive, when the standby network receives the PDO packet sent by the first node through the second CAN channel in a preset first heartbeat cycle corresponding to the first node, data sent by the first node on the standby network, and receive, on the active network, data sent by other slave nodes that normally send the PDO packet at the same time.
Fig. 11 is a schematic structural diagram of an active master node according to a third embodiment of the present invention, as shown in fig. 11, and based on fig. 9, the active master node further includes: a first transmitting module 107.
The first sending module 107 is configured to send a reset instruction from the active network to the first node after the PDO packet of the first node is not received in the active network within a preset first heartbeat cycle corresponding to the first node.
The first monitoring module 101 is further configured to continue to monitor a PDO packet sent by the first node on the active network.
The first determining module 102 is further configured to detect whether a PDO packet of the first node is received in the active network within a preset second heartbeat cycle corresponding to the first node.
The first obtaining module 103 is further configured to obtain a first CAN channel fault of the first node when the PDO packet of the first node is not received in the active network in a preset second heartbeat cycle corresponding to the first node.
Fig. 12 is a schematic structural diagram of an active master node according to a fourth embodiment of the present invention, as shown in fig. 13, on the basis of fig. 9, the active master node further includes: and a second sending module 108.
In this embodiment, the second sending module 108 is configured to send a reset instruction to the first node from the standby network when the PDO packet of the first node is not received in the standby network in a preset first heartbeat cycle corresponding to the first node.
The first monitoring module 101 is further configured to continue to monitor the PDO packet sent by the first node in the standby network.
The first receiving module 104 is further configured to receive, when receiving the PDO packet sent by the first node on the standby network in a preset second heartbeat cycle corresponding to the first node, data sent by the first node on the standby network, and receive, on the active network, data sent by other slave nodes that normally send the PDO packet at the same time.
In an embodiment of the present invention, fig. 13 is a schematic structural diagram of an active master node according to a fifth embodiment of the present invention, as shown in fig. 13, on the basis of fig. 9, the active master node further includes: a first switching module 109.
The first switching module 109 is configured to, when a sending error counter or a receiving error counter in the active master node is accumulated to a preset value, acquire a failure of the primary network, and switch to the standby network to communicate with other nodes.
Fig. 14 is a schematic structural diagram of an active master node according to a sixth embodiment of the present invention, as shown in fig. 15, and based on the configuration shown in fig. 9, the active master node further includes: a second switching module 110.
The second switching module 110 is 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.
To sum up, the master node in the embodiment of the present invention monitors PDO packets sent by each slave node related to the active master node through the first CAN channel on the master network according to the preconfigured network node list, determines whether the first CAN channel of each slave node fails according to the receiving condition of the PDO packet sent by each slave node and the timing condition of the heartbeat timer correspondingly set for each slave node according to the production prohibited time in the PDO packet, if the PDO packet of the first node is not received by the master network in the preset first heartbeat period corresponding to the first node, knows that the first CAN channel of the first node fails, and switches to the standby network to monitor the PDO packet sent by the first node through the second CAN channel, if the PDO packet sent by the first node through the second CAN channel is received by the standby network in the preset first heartbeat period corresponding to the first node, the data sent by the first node is received on the standby network, and meanwhile, the data sent by other slave nodes which normally send the PDO message is received on the active network. Therefore, 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 the data of other slave nodes are still received in the main network, so that the complete receiving of the data of the relevant slave nodes is ensured, the good running of the whole train is ensured, and the redundancy effect of the train network is improved.
Fig. 15 is a schematic structural diagram of an active master node according to a seventh embodiment of the present invention, as shown in fig. 15, and based on fig. 9, the active master node further includes: a first prompting module 111 and a second prompting module 112.
The first prompting module 111 is configured to send a current fault message of the first CAN channel of the first node to the operation monitoring node after receiving the PDO message sent by the first node through the second CAN channel, and display the current fault message to an operator to prompt current fault maintenance.
In this embodiment, the first monitoring module 101 is further configured to continue to monitor, on the active network, a PDO packet sent by the first node through the first CAN channel.
The first learning module 103 is further configured to learn that the first CAN channel of the first node resumes communication when the PDO packet of the first node is received in a preset first heartbeat cycle corresponding to the first node.
The first receiving module 104 is further configured to switch to the active network to receive the data sent by the first node.
In an embodiment of the present invention, the first prompting module 111 is further configured to send a historical fault message of the first CAN channel of the first node to the operation monitoring node and display the historical fault message to an operator to prompt troubleshooting of a fault hidden trouble after the data sent by the first node is received by switching to the active network.
And a second prompt module 112, 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 when the PDO message sent by the first node is not received on the standby network in a preset second heartbeat cycle corresponding to the first node, and display the current fault messages to an operator to prompt current fault maintenance.
In this embodiment, the first monitoring module 101 is further configured to continue to monitor PDO packets sent by the first node on the active network and the standby network.
The first obtaining module 103 is further configured to obtain that the first CAN channel of the first node recovers communication when the PDO packet of the first node is received from the active network in a preset first heartbeat cycle corresponding to the first node.
The first receiving module 104 is further configured to switch to the active network to receive the data sent by the first node.
In an embodiment of the present invention, the second prompting module 112 is further configured to send a current fault message of the second CAN channel of the first node to the operation monitoring node, and display the current fault message to an operator to prompt current troubleshooting.
The first monitoring module 101 is further configured to continue to monitor the PDO packet sent by the first node on the standby network.
The second prompting module 112 is further configured to send historical failure messages of the first CAN channel and the second CAN channel of the first node to the operation monitoring node and display the historical failure messages to an operator to prompt an operator to troubleshoot a failure hidden trouble when the PDO message of the first node is received from the standby network in a preset first heartbeat period corresponding to the first node.
In an embodiment of the present invention, the first monitoring module 101 is further configured to continue to monitor PDO packets sent by the first node on the active network and the standby network.
The first learning module 103 is further configured to learn that the second CAN channel of the first node resumes communication when the PDO packet of the first node is received from the standby network in a preset first heartbeat cycle corresponding to the first node.
The first receiving module 104 is further configured to receive data sent by the first node from the standby network.
The second prompting module 112 is further configured to send a current fault message of the first CAN channel of the first node to the operation monitoring node, and display the current fault message to an operator to prompt current troubleshooting.
The first monitoring module 101 is further configured to continue to monitor, on the active network, a PDO packet sent by the first node through the first CAN channel.
The first receiving module 104 is further configured to switch to the active network to receive data sent by the first node when the PDO packet of the first node is received from the active network in a preset first heartbeat cycle corresponding to the first node.
The second prompting module 112 is further configured to send historical fault messages of the first CAN channel and the second CAN channel of the first node to the operation monitoring node and display the historical fault messages to an operator to prompt an operator to repair a fault hidden trouble.
It should be noted that the train network data transmission method based on the CANopen protocol, which is described above by focusing on the active master node side, is also applicable to the master node in the embodiment of the present invention, and the implementation principle thereof is similar.
In summary, the master node in the embodiment of the present invention selects the primary network and the backup network according to the real-time situation of the train network, and correspondingly displays the selected primary network and backup network to the relevant operating personnel at the monitoring node, thereby improving the stability and 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. 16 is a schematic structural diagram of the slave node according to the first embodiment of the present invention, as shown in fig. 16, the slave node includes: a second monitoring module 201, a second judging module 202, a second learning module 203 and a second receiving module 204.
The second monitoring module 201 is configured to monitor, on the active network, a PDO packet sent by each node related to the slave node through the first CAN channel according to a preconfigured network node list.
Fig. 17 is a schematic structural diagram of a slave node according to a second embodiment of the present invention, as shown in fig. 17, and on the basis of fig. 16, the slave node includes: a second setup module 205 and a second control module 206.
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: and each node identifier related to the slave node and a corresponding heartbeat timer, wherein the heartbeat timer corresponding to each node is set according to the production prohibition time in the PDO message.
The second control module 206 is configured to receive a network control instruction sent by an active master node from the master network, start the first CAN channel and the second CAN channel to enter a PDO packet operation mode, and start a heartbeat timer corresponding to each node related to the slave node.
The second determining module 202 is configured to determine whether the first CAN channel of each node fails according to a receiving condition of the PDO packet sent by each node and a timing condition of a heartbeat timer correspondingly set for each node according to the production prohibition time in the PDO packet.
The second obtaining module 203 is configured to obtain a fault of the first CAN channel of the second node when the PDO packet of the second node is not received on the active network in a preset heartbeat cycle corresponding to the second node.
The second monitoring module 201 is further configured to switch to a standby network to monitor a PDO packet sent by a second node through a second CAN channel, where the second node is any one of a slave node related to the slave node or an active master node.
The second receiving module 204 is configured to receive, in a preset heartbeat cycle corresponding to the second node, data sent by the second node on the standby network when the PDO packet sent by the second node through the second CAN channel is received by the standby network, and receive, on the main network, data sent by other nodes that normally send the PDO packet at the same time.
Fig. 18 is a schematic structural diagram of a slave node according to a third embodiment of the present invention, as shown in fig. 18, and on the basis of fig. 16, the slave node includes: a third switching module 208.
The third switching module 208 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.
To sum up, the slave node in the embodiment of the present invention monitors PDO packets sent by each node related to the slave node through a first CAN channel on the master network according to a preconfigured network node list, determines whether the first CAN channel of each node fails according to the receiving condition of the PDO packet sent by each node and the timing condition of a heartbeat timer correspondingly set for each node according to the production prohibited time in the PDO packet, if the PDO packet of the second node is not received on the master network in a preset heartbeat period corresponding to the second node, knows that the first CAN channel of the second node fails, and switches to the standby network to monitor the PDO packet sent by the second node through the second CAN channel, and if the PDO packet sent by the second node through the second CAN channel is received by the standby network in the preset heartbeat period corresponding to the second node, receives data sent by the second node on the standby network, meanwhile, data sent by other nodes which normally send PDO messages is received on the main network. Therefore, 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 the data of other slave nodes are still received in the main network, so that the complete receiving of the data of the relevant slave nodes is ensured, the good running of the whole train is ensured, and the redundancy effect of the train network is improved.
Fig. 19 is a schematic structural diagram of a slave node according to a fourth embodiment of the present invention, as shown in fig. 16, and on the basis of fig. 16, the slave node further includes: a first recording module 209 and a second recording module 210.
The first recording module 209 is configured to record a current fault message of the first CAN channel of the second node.
The second monitoring module 201 is further configured to continue to monitor, on the active network, a PDO packet sent by the second node through the first CAN channel.
The second learning module 203 is further configured to learn that the first CAN channel of the second node resumes communication when the PDO packet of the second node is received in a preset heartbeat cycle corresponding to the second node.
The second receiving module 204 is further configured to switch to the active network to receive the data sent by the second node.
The second recording module 210 is configured to record current fault messages of the first CAN channel and the second CAN channel of the second node when the PDO message sent by the second node through the second CAN channel cannot be received within a preset heartbeat period after the PDO message sent by the second node through the second CAN channel is monitored by switching to a standby network.
In this embodiment, the second monitoring module 201 is further configured to continue to monitor PDO packets of the second node on the active network and the standby network.
The second obtaining module 203 is further configured to obtain that the first CAN channel of the second node recovers communication when the primary network receives the PDO packet of the second node in a preset heartbeat cycle corresponding to the second node.
The second receiving module 204 is further configured to switch to the active network to receive the data sent by the second node.
The second monitoring module 201 is further configured to continue to monitor PDO packets sent by the second node on the active network and the standby network.
The second learning module 203 is further configured to learn that the second CAN channel of the second node recovers communication when the PDO packet of the first slave node is received from the standby network in a preset heartbeat period corresponding to the second node.
The second receiving module 204 is further configured to receive data sent by the second node from the standby network.
Furthermore, in an embodiment of the present invention, the second monitoring module 201 is further configured to continue to monitor, on the active network, a PDO packet sent by the second node.
The second receiving module 204 is further configured to switch to the active network to receive data sent by the second node when receiving the PDO packet of the second node from the active network in a preset heartbeat cycle corresponding to the second node.
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, the slave node in the embodiment of the present invention selects the primary network and the backup network according to the real-time situation of the train network, and correspondingly displays the selected 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 foregoing embodiment, the present invention further provides a train network data transmission system based on the CANopen protocol, and fig. 20 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. 20, 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, and a standby network 400.
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.
The invention optimizes the software implementation strategy on the basis of the original network redundancy design framework, defines the switching between the primary network and the standby network according to the bus error detection mechanism, simultaneously respectively provides corresponding requirements for the active master node and the slave nodes, respectively establishes a network relation list in respective object dictionaries so as to compare with PDO 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 primary 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 primary 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).
In order 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 description illustrates:
wherein in this example two master nodes are set up in the network, one as the active master node and one as the backup master node (default inactive), five slave nodes A, B, C, D, E, now defined master node receiving slave node A, B, C data, slave node a receiving slave node B, C, D data, slave node B receiving slave node A, E data, slave node C receiving slave node B, D data.
When the first CAN channel of the slave node B fails, the master node, the slave node A and the slave node C are required to receive the data of the slave node B according to the definition, and the three nodes respectively store the node IDs of the slave node B in respective object dictionaries. Because the first CAN channel of the slave node B has a fault, the master node, the slave node A and the slave node C CAN not receive the PDO message of the slave node B in the master network.
Furthermore, when the master node does not monitor the PDO packet of the slave node within the preset period, the master node first resets the slave node through a reset instruction controlled by the network, and then monitors a certain heartbeat period, at this time, the slave node B still cannot recover to normal in the certain heartbeat period, the master node, the slave node a, and the slave node C all switch to the second CAN channel to monitor whether the PDO packet of the slave node B is received in the standby network, and the second CAN channel of the slave node B normally transmits data, so that the situation of receiving data by the master node is shown in fig. 21, that is, the master node receives and processes data from the master network A, C, the slave node B, and the slave node a and the slave node C receive and processes data from the master network, that is, the slave node a receives and processes data from the master network C, D, and the slave node B receives and processes data from the standby network, respectively, the slave node C receives data from the active network to process the slave node D, and receives data from the standby network to process the slave node B.
In summary, the train network data transmission system based on the CANopen protocol according to the embodiment of the present invention solves the problem in the prior art that part of node data cannot be received normally when different channels of multiple nodes fail, effectively avoids that part of node data needs to be discarded when a main network channel of part of nodes fails and a standby network channel of part of nodes fails, and simultaneously improves the actual effect of redundancy design, thereby well avoiding the problem that the operation of the whole train is blocked due to a network failure of some trains, and ensuring that each node of the network can still communicate normally under some abnormal conditions.
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 (41)

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 a Process Data Object (PDO) message sent by each slave node related to the active master node through a first CAN channel on a main network according to a pre-configured network node list; the pre-configured network node list is a list which is established according to a network topology map and corresponds to an active master node or a slave node;
judging whether the first CAN channel of each slave node fails according to the receiving condition of the PDO message sent by each slave node and the timing condition of a heartbeat timer correspondingly set for each slave node according to the production prohibition time in the PDO message;
if the PDO message of the first node is not received in the main network within a preset first heartbeat period corresponding to the first node, acquiring the fault of a first CAN channel of the first node, and switching to a standby network to monitor the PDO message sent by the first node through a second CAN channel, wherein the first node is any slave node related to the active main node;
if the standby network receives the PDO message sent by the first node through the second CAN channel in a preset first heartbeat cycle corresponding to the first node, receiving data sent by the first node on the standby network, and simultaneously receiving data sent by other slave nodes which normally send the PDO message on the main network.
2. The method of claim 1, wherein after the if the PDO packet of the first node is not received in the active network within a preset first heartbeat cycle corresponding to the first node, the method further comprises:
sending a reset instruction from the active network to the first node;
continuously monitoring a PDO message sent by the first node on the main network, and detecting whether the PDO message of the first node is received in the main network in a preset second heartbeat cycle corresponding to the first node;
the acquiring of the first CAN channel fault of the first node includes:
and if the PDO message of the first node is not received in the primary network in a preset second heartbeat cycle corresponding to the first node, acquiring the first CAN channel fault of the first node.
3. The method of claim 1, wherein after said receiving a PDO message sent by said first node over a second CAN channel, further comprising:
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 PDO message sent by the first node through the first CAN channel on the primary network, and if the PDO message of the first node is received in a preset first heartbeat cycle corresponding to the first node, knowing that the first CAN channel of the first node recovers communication, switching to the primary network to receive the data sent by the first node.
4. The method of claim 3, wherein after the switching to the active network to receive the data sent by the first node, further comprising:
and sending the historical fault message of the first CAN channel of the first node to the operation monitoring node and displaying the historical fault message to an operator to prompt the potential fault hazard to be repaired.
5. The method of claim 1, wherein after the switching to the standby network listens for a PDO message sent by the first node over a second CAN channel, further comprising:
if the PDO message of the first node is not received in the standby network in a preset first heartbeat period corresponding to the first node, sending a reset instruction to the first node from the standby network, and continuously monitoring the PDO message sent by the first node in the standby network;
if the PDO message sent by the first node is received on the standby network in a preset second heartbeat cycle corresponding to the first node, receiving data sent by the first node on the standby network, and meanwhile, receiving data sent by other slave nodes which normally send the PDO message on the main network.
6. The method of claim 5, further comprising:
and if the PDO message sent by the first node is not received on the standby network in a preset second heartbeat period corresponding to the first node, sending current fault messages of a first CAN channel and a 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.
7. The method of claim 6, further comprising:
continuously monitoring PDO messages sent by the first node on the main network and the standby network, if receiving the PDO messages of the first node from the main network in a preset first heartbeat cycle corresponding to the first node, knowing that the first CAN channel of the first node recovers communication, switching to the main network to receive data sent by the first node, sending a current fault message of a second CAN channel of the first node to the operation monitoring node, displaying the current fault message to an operator, and prompting the current fault maintenance;
and continuously monitoring the PDO message sent by the first node on the standby network, and if the PDO message of the first node is received from the standby network in a preset first heartbeat cycle corresponding to the first node, sending historical fault messages of a first CAN channel and a second CAN channel of the first node to the operation monitoring node and displaying the historical fault messages to an operator to prompt fault hidden trouble maintenance.
8. The method of claim 6, further comprising:
continuously monitoring PDO messages sent by the first node on the main network and the standby network, if receiving the PDO messages of the first node from the standby network in a preset first heartbeat cycle corresponding to the first node, knowing that the second CAN channel of the first node recovers communication, receiving data sent by the first node from the standby network, sending a current fault message of the first CAN channel of the first node to the operation monitoring node, displaying the current fault message to an operator, and prompting current fault maintenance;
and continuously monitoring PDO messages sent by the first node through a first CAN channel on the main network, if the PDO messages of the first node are received from the main network in a preset first heartbeat cycle corresponding to the first node, switching to the main network to receive data sent by the first node, sending historical fault messages of the first CAN channel and a second CAN channel of the first node to the operation monitoring node, and displaying the historical fault messages to an operator to prompt fault hidden trouble maintenance.
9. The method of claim 1, wherein before the monitoring PDO packets sent by each slave node associated with the active master node through the first CAN channel on the active network according to the preconfigured list of network nodes, the method further comprises:
establishing a network node list corresponding to the active master node according to a network topology map, wherein the network node list comprises: the slave node identifiers and the corresponding heartbeat timers are related to the active master node, wherein the heartbeat timers corresponding to the slave nodes are set according to the production prohibition time in the PDO message;
and simultaneously sending network control instructions to all the slave nodes from the main network and the standby network, controlling a first CAN channel and a second CAN channel of the slave nodes to enter a PDO message operation mode, and starting a heartbeat timer corresponding to each slave node related to the active master node.
10. 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.
11. The method of any of claims 1-10, 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.
12. A train network data transmission method based on a CANopen protocol is applied to a slave node and comprises the following steps:
monitoring PDO messages sent by each node related to the slave node through a first CAN channel on a main network according to a pre-configured network node list; the pre-configured network node list is a list which is established according to a network topology map and corresponds to an active master node or a slave node;
judging whether the first CAN channel of each node fails according to the receiving condition of the PDO message sent by each node and the timing condition of a heartbeat timer correspondingly set for each node according to the production prohibition time in the PDO message;
if the PDO message of the second node is not received on the primary network in a preset heartbeat period corresponding to the second node, acquiring the fault of a first CAN channel of the second node, and switching to a standby network to monitor the PDO message sent by the second node through the second CAN channel, wherein the second node is any slave node or active master node related to the slave node;
if the standby network receives the PDO message sent by the second node through the second CAN channel in a preset heartbeat period corresponding to the second node, receiving data sent by the second node on the standby network, and simultaneously receiving data sent by other nodes which normally send the PDO message on the main network.
13. The method of claim 12, wherein after the backup network receives the PDO message sent by the second node over the second CAN channel, further comprising:
recording the current fault message of the first CAN channel of the second node;
and continuously monitoring the PDO message sent by the second node through the first CAN channel on the main network, and if the PDO message of the second node is received in a preset heartbeat cycle corresponding to the second node, knowing that the first CAN channel of the second node recovers communication, switching to the main network to receive the data sent by the second node.
14. The method of claim 12, wherein after the switching to the standby network listens for PDO messages sent by the second node over the second CAN channel, further comprising:
and if the PDO message sent by the second node through the second CAN channel cannot be received in a preset heartbeat period, recording the current fault messages of the first CAN channel and the second CAN channel of the second node.
15. The method of claim 14, further comprising:
and continuously monitoring PDO messages of the second node on the main network and the standby network, and if the main network receives the PDO messages of the second node in a preset heartbeat cycle corresponding to the second node, knowing that the first CAN channel of the second node recovers communication, switching to the main network to receive data sent by the second node.
16. The method of claim 14, further comprising:
continuously monitoring PDO messages sent by the second node on the main network and the standby network, and if receiving the PDO messages of the first slave node from the standby network in a preset heartbeat cycle corresponding to the second node, acquiring that a second CAN channel of the second node recovers communication, and receiving data sent by the second node from the standby network;
and continuously monitoring the PDO message sent by the second node on the main network, and if the PDO message of the second node is received from the main network in a preset heartbeat period corresponding to the second node, switching to the main network to receive the data sent by the second node.
17. The method of claim 12, wherein before the monitoring PDO packets sent by nodes associated with the slave node through the first CAN channel on the active network according to the preconfigured list of network nodes, the method further comprises:
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 related to the slave node and a corresponding heartbeat timer, wherein the heartbeat timer corresponding to each node is set according to the production prohibition time in the PDO message;
and receiving a network control command sent by an active master node from the master network, starting a first CAN channel and a second CAN channel to enter a PDO message operation mode, and starting a heartbeat timer corresponding to each node related to the slave node.
18. The method of any of claims 12-17, 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.
19. An active master node, comprising:
the first monitoring module is used for monitoring PDO messages sent by each slave node related to the active master node through a first CAN channel on the main network according to a pre-configured network node list; the pre-configured network node list is a list which is established according to a network topology map and corresponds to an active master node or a slave node;
the first judgment module is used for judging whether the first CAN channel of each slave node fails according to the receiving condition of the PDO message sent by each slave node and the timing condition of a heartbeat timer correspondingly set for each slave node according to the production prohibition time in the PDO message;
the first obtaining module is used for obtaining a first CAN channel fault of a first node when a PDO message of the first node is not received in the primary network in a preset first heartbeat cycle corresponding to the first node;
the first monitoring module is further configured to switch to a standby network to monitor a PDO packet sent by the first node through a second CAN channel, where the first node is any slave node related to the active master node;
the first receiving module is configured to receive, in a preset first heartbeat cycle corresponding to a first node, data sent by the first node on the standby network when the standby network receives a PDO packet sent by the first node through a second CAN channel, and receive, on the active network, data sent by other slave nodes that normally send the PDO packet at the same time.
20. The active master node of claim 19, further comprising:
a first sending module, configured to send a reset instruction from the primary network to a first node after a PDO packet of the first node is not received by the primary network in a preset first heartbeat cycle corresponding to the first node;
the first monitoring module is further configured to continue to monitor, on the active network, a PDO packet sent by the first node;
the first judging module is further configured to detect whether a PDO packet of the first node is received in the primary network within a preset second heartbeat cycle corresponding to the first node;
the first learning module is further configured to learn that a first CAN channel of the first node has a fault when the PDO packet of the first node is not received in the active network in a preset second heartbeat cycle corresponding to the first node.
21. The active master node of claim 19, further comprising:
the first prompting module is used for sending a current fault message of the first CAN channel of the first node to the operation monitoring node after receiving a PDO message sent by the first node through the second CAN channel, displaying the current fault message to an operator and prompting current fault maintenance;
the first monitoring module is further configured to continue to monitor, on the primary network, a PDO packet sent by the first node through the first CAN channel;
the first learning module is further configured to learn that the first CAN channel of the first node resumes communication when receiving the PDO packet of the first node in a preset first heartbeat cycle corresponding to the first node;
the first receiving module is further configured to switch to the active network to receive the data sent by the first node.
22. The active master node of claim 21,
the first prompting module is further configured to send a historical fault message of the first CAN channel of the first node to the operation monitoring node and display the historical fault message to an operator after the data sent by the first node is received by switching to the active network, so as to prompt troubleshooting of a potential fault hazard.
23. The active master node of claim 19, further comprising:
the second sending module is used for sending a reset instruction to the first node from the standby network when the PDO message of the first node is not received by the standby network in a preset first heartbeat cycle corresponding to the first node;
the first monitoring module is further configured to continue to monitor the PDO packet sent by the first node in the standby network;
the first receiving module is further configured to receive, when receiving the PDO packet sent by the first node on the standby network in a preset second heartbeat cycle corresponding to the first node, data sent by the first node on the standby network, and receive, on the active network, data sent by other slave nodes that normally send PDO packets at the same time.
24. The active master node of claim 23, further comprising:
and the second prompting module is used for sending current fault messages of the first CAN channel and the second CAN channel of the first node to the operation monitoring node when the PDO message sent by the first node is not received on the standby network in a preset second heartbeat cycle corresponding to the first node, displaying the current fault messages to an operator and prompting the current fault maintenance.
25. The active master node of claim 24,
the first monitoring module is further configured to continue to monitor PDO packets sent by the first node on the active network and the standby network;
the first learning module is further configured to learn that the first CAN channel of the first node recovers communication when the PDO packet of the first node is received from the primary network within a preset first heartbeat cycle corresponding to the first node;
the first receiving module is further configured to switch to the active network to receive data sent by the first node;
the second prompting module is further used for sending a current fault message of a second CAN channel of the first node to the operation monitoring node, displaying the current fault message to an operator and prompting current fault maintenance;
the first monitoring module is further configured to continue to monitor a PDO packet sent by the first node on the standby network;
and the second prompting module is further used for sending historical fault messages of the first CAN channel and the second CAN channel of the first node to the operation monitoring node and displaying the historical fault messages to an operator when the PDO message of the first node is received from the standby network in a preset first heartbeat period corresponding to the first node, so as to prompt fault hidden trouble maintenance.
26. The active master node of claim 24,
the first monitoring module is further configured to continue to monitor PDO packets sent by the first node on the active network and the standby network;
the first learning module is further configured to learn that a second CAN channel of the first node recovers communication when a PDO packet of the first node is received from the standby network in a preset first heartbeat cycle corresponding to the first node;
the first receiving module is further configured to receive data sent by the first node from the standby network;
the second prompting module is further used for sending a current fault message of the first CAN channel of the first node to the operation monitoring node, displaying the current fault message to an operator and prompting current fault maintenance;
the first monitoring module is further configured to continue to monitor, on the primary network, a PDO packet sent by the first node through the first CAN channel;
the first receiving module is further configured to switch to the active network to receive data sent by the first node when a PDO packet of the first node is received from the active network within a preset first heartbeat cycle corresponding to the first node;
and the second prompting module is also used for sending historical fault messages of the first CAN channel and the second CAN channel of the first node to the operation monitoring node and displaying the historical fault messages to an operator to prompt fault hidden trouble repair.
27. The active master node of claim 19, 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: the slave node identifiers and the corresponding heartbeat timers are related to the active master node, wherein the heartbeat timers corresponding to the slave nodes are set according to the production prohibition time in the PDO message;
and the first control module is used for sending network control instructions to all the slave nodes from the main network and the standby network simultaneously, controlling a first CAN channel and a second CAN channel of the slave nodes to enter a PDO message operation mode, and starting a heartbeat timer corresponding to each slave node related to the active master node.
28. The active master node of claim 19, further comprising:
and the first switching module is used for acquiring the fault of the active network and switching to the standby network to communicate with other nodes when the transmitting error counter or the receiving error counter in the active main node is accumulated to a preset value.
29. The active master node of claim 19, 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.
30. A slave node, comprising:
the second monitoring module is used for monitoring PDO messages sent by all nodes related to the slave nodes through the first CAN channel on the main network according to a pre-configured network node list; the pre-configured network node list is a list which is established according to a network topology map and corresponds to an active master node or a slave node;
the second judgment module is used for judging whether the first CAN channel of each node fails according to the receiving condition of the PDO message sent by each node and the timing condition of a heartbeat timer correspondingly set for each node according to the production prohibition time in the PDO message;
the second learning module is configured to learn that a first CAN channel of a second node fails when a PDO packet of the second node is not received on the primary network within a preset heartbeat period corresponding to the second node;
the second monitoring module is further configured to switch to a standby network to monitor a PDO packet sent by the second node through a second CAN channel, where the second node is any one of a slave node or an active master node related to the slave node;
and the second receiving module is configured to receive, in a preset heartbeat cycle corresponding to the second node, data sent by the second node on the standby network when the standby network receives the PDO packet sent by the second node through the second CAN channel, and receive, on the primary network, data sent by other nodes that normally send the PDO packet at the same time.
31. The slave node of claim 30, further comprising:
the first recording module is used for recording the current fault message of the first CAN channel of the second node;
the second monitoring module is further configured to continue to monitor, on the primary network, a PDO packet sent by the second node through the first CAN channel;
the second learning module is further configured to learn that the first CAN channel of the second node recovers communication when receiving the PDO packet of the second node in a preset heartbeat period corresponding to the second node;
the second receiving module is further configured to switch to the active network to receive the data sent by the second node.
32. The slave node of claim 30, further comprising:
and the second recording module is used for recording current fault messages of the first CAN channel and the second CAN channel of the second node when the PDO message sent by the second node through the second CAN channel cannot be received in a preset heartbeat period after the PDO message sent by the second node through the second CAN channel is monitored by switching to a standby network.
33. The slave node of claim 32,
the second monitoring module is further configured to continue to monitor PDO packets of the second node on the active network and the standby network;
the second learning module is further configured to learn that the first CAN channel of the second node recovers communication when the primary network receives the PDO packet of the second node in a preset heartbeat cycle corresponding to the second node;
the second receiving module is further configured to switch to the active network to receive the data sent by the second node.
34. The slave node of claim 32,
the second monitoring module is further configured to continue to monitor PDO packets sent by the second node on the active network and the standby network;
the second learning module is further configured to learn that a second CAN channel of a second node resumes communication when receiving the PDO packet of the first slave node from the standby network within a preset heartbeat period corresponding to the second node;
the second receiving module is further configured to receive data sent by the second node from the standby network;
the second monitoring module is further configured to continue to monitor, on the active network, a PDO packet sent by the second node;
the second receiving module is further configured to switch to the active network to receive data sent by the second node when the PDO packet of the second node is received from the active network within a preset heartbeat period corresponding to the second node.
35. The slave node of claim 30, 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 related to the slave node and a corresponding heartbeat timer, wherein the heartbeat timer corresponding to each node is set according to the production prohibition time in the PDO message;
and the second control module is used for receiving a network control instruction sent by the active master node from the master network, starting the first CAN channel and the second CAN channel to enter a PDO message operation mode, and starting the heartbeat timers corresponding to the nodes related to the slave node.
36. The slave node according to any of claims 30-35, 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.
37. A train network data transmission system based on CANopen protocol is characterized by comprising:
the active master node of any of claims 19-29;
the slave node of any one of claims 30-36;
a primary network;
a standby network.
38. 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 11.
39. 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 12 to 18.
40. A computer-readable medium, characterized by storing a computer program, which is executed by a processor to implement the CANopen protocol-based train network data transmission method according to any one of claims 1 to 11.
41. A computer-readable medium, characterized by storing a computer program which is executed by a processor to implement the CANopen protocol-based train network data transmission method according to any one of claims 12 to 18.
CN201710477075.2A 2017-06-21 2017-06-21 Train network data transmission method, system and device based on CANopen protocol Active CN109104325B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710477075.2A CN109104325B (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
CN201710477075.2A CN109104325B (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
CN109104325A CN109104325A (en) 2018-12-28
CN109104325B true CN109104325B (en) 2020-10-23

Family

ID=64796222

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710477075.2A Active CN109104325B (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) CN109104325B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110488597B (en) * 2019-08-18 2021-06-22 中车永济电机有限公司 Dual-redundancy control method for main processing unit of locomotive
CN112600740B (en) * 2021-01-08 2022-06-07 重庆长安汽车股份有限公司 Automatic detection method for Internet of vehicles CAN data uploading frame leakage rate
CN112859713B (en) * 2021-02-08 2022-04-19 航天科工空间工程发展有限公司 Autonomous error correction management method for CAN bus of spacecraft
CN114760650A (en) * 2022-03-15 2022-07-15 南京市德赛西威汽车电子有限公司 Vehicle-mounted radar network group control method and system, automobile and storage medium
CN117768380B (en) * 2023-12-20 2024-06-07 昆易电子科技(上海)有限公司 Data processing method, device, system, electronic equipment and readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106302064A (en) * 2016-08-16 2017-01-04 新誉集团有限公司 The data transfer optimization method and system of binary-channel redundancy CAN used for electric vehicle
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
DE102008049126B3 (en) * 2008-09-26 2010-04-08 Raytheon Anschütz Gmbh Ship rudder control / autopilot with a CAN bus

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106302064A (en) * 2016-08-16 2017-01-04 新誉集团有限公司 The data transfer optimization method and system of binary-channel redundancy CAN used for electric vehicle
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架构的管轨列控系统》;李泽荣,王磊,杜会卿,邱瑞昌;《电测与仪表》;20140110;第51卷(第1期);全文 *

Also Published As

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

Similar Documents

Publication Publication Date Title
CN109104349B (en) Train network data transmission method, system and device based on CANopen protocol
CN109104325B (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
CN109104346B (en) Train network data transmission method, system and device based on CANopen protocol
CN102394787B (en) Based on the Dual-link redundancy control method of EPA switch
EP2372952B1 (en) Connectivity fault management traffic indication extension
EP2798782B1 (en) Technique for handling a status change in an interconnect node
EP2458797A1 (en) Method, device and system for updating ring network topology information
CN112637368B (en) Distributed industrial data acquisition system and method
JP5170001B2 (en) Node device, processing unit, and control frame processing method
EP2698948A1 (en) Method and device for determining failure elimination based on oam protocol
CN105634848B (en) A kind of virtual router monitoring method and device
CN112218321B (en) Master-slave link switching method, device, communication equipment and storage medium
JP2016536906A (en) Network protection method, network protection device, off-ring node, and system
CN102231674A (en) Processing method and apparatus of far-end fault of Ethernet
CN106941424B (en) Redundancy switching method and device based on TTDP protocol
CN107431655B (en) Method and apparatus for fault propagation in segment protection
US11646909B2 (en) Method for data transmission in a redundantly operable communications network and coupling communication device
CN101980478B (en) Method and device for detecting and processing equipment failures and network equipment
CN101854263A (en) Method, system and management server for analysis processing of network topology
US20170070410A1 (en) System and method for providing redundant ethernet network connections
CN103840965B (en) Method for enhancing quick fault convergence in RSTP
CN103441793A (en) Method for realizing reliable communication between optical links
CN110460042B (en) Wide area information-based out-of-step separation control method and system and readable storage medium

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