WO2018233644A1 - 基于CANopen协议传输数据的网关轮换方法、系统及其装置 - Google Patents

基于CANopen协议传输数据的网关轮换方法、系统及其装置 Download PDF

Info

Publication number
WO2018233644A1
WO2018233644A1 PCT/CN2018/092049 CN2018092049W WO2018233644A1 WO 2018233644 A1 WO2018233644 A1 WO 2018233644A1 CN 2018092049 W CN2018092049 W CN 2018092049W WO 2018233644 A1 WO2018233644 A1 WO 2018233644A1
Authority
WO
WIPO (PCT)
Prior art keywords
host
backup machine
communication network
network
vehicle
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.)
Ceased
Application number
PCT/CN2018/092049
Other languages
English (en)
French (fr)
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 BR112019027650-5A priority Critical patent/BR112019027650A2/pt
Priority to US16/625,348 priority patent/US11316712B2/en
Publication of WO2018233644A1 publication Critical patent/WO2018233644A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/40052High-speed IEEE 1394 serial bus
    • H04L12/40071Packet processing; Packet format
    • 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
    • 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/40097Interconnection with other 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/46Interconnection of networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0663Performing the actions predefined by failover planning, e.g. switching to standby network elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0668Management of faults, events, alarms or notifications using network fault recovery by dynamic selection of recovery network elements, e.g. replacement by the most appropriate element after failure
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0817Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning
    • 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
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40267Bus for use in transportation systems
    • H04L2012/40273Bus for use in transportation systems the transportation system being a vehicle

Definitions

  • the present disclosure relates to the field of vehicle communication technologies, and in particular, to a gateway rotation method, system, and apparatus for transmitting data based on a CANopen protocol.
  • the train communication network is widely used in the train communication network TCN (Train Communication Network) bus technology
  • TCN covers MVB (Multifunction Vehicle Bus), WTB (Wire Train Bus) Bus, Ethernet, CAN (Controller Area Network).
  • MVB Multifunction Vehicle Bus
  • WTB Wire Train Bus
  • Ethernet Ethernet
  • CAN Controller Area Network
  • the so-called network redundancy refers to the establishment of a standby network for each communication network, that is, each node on the network will adopt the A-line and B-line two-wire connection. When the network fails, it can be used for backup.
  • the network realizes communication, ensures the smooth interaction of the products of the products on the network, and makes the running environment of the train communication network highly available.
  • CANopen a high-level communication protocol based on CAN bus, which is a kind of field bus commonly used in industrial control.
  • the definition of CANopen is based on CAN bus design.
  • the standardized application layer protocol, CANopen protocol supports a complete network management mechanism for traditional CAN to support redundant network design.
  • the redundant network design based on CANopen requires two gateways in the network, one host of the network management, and one backup machine as the gateway. When the host of the gateway runs normally, the backup machine is in a silent state, that is, there is only one active owner in the network. node.
  • the switch between the host and the backup machine is implemented by determining whether the heartbeat packet of the host is dropped.
  • the host stops sending the host heartbeat packet.
  • the backup machine starts working when it receives the heartbeat packet of the host of the gateway.
  • the purpose of the present disclosure is to solve at least one of the above technical problems to some extent.
  • the first object of the present disclosure is to provide a gateway rotation method for transmitting data based on the CANopen protocol, in which the coordination work is performed according to different operating states of the gateway host and the backup machine, thereby effectively ensuring that the network is in an abnormal state. It can also maintain communication normally, avoiding network communication anomalies caused by network failures in the active and standby nodes.
  • a second object of the present disclosure is to propose another gateway rotation method for transmitting data based on the CANopen protocol.
  • a third object of the present disclosure is to propose a host of a gateway.
  • a fourth object of the present disclosure is to propose a gateway backup machine.
  • a fifth object of the present disclosure is to propose a gateway rotation system for transmitting data based on the CANopen protocol.
  • a sixth object of the present disclosure is to propose a computer device.
  • a seventh object of the present disclosure is to propose another computer device.
  • An eighth object of the present disclosure is to propose a storage medium.
  • a ninth object of the present disclosure is to propose another storage medium.
  • a gateway rotation method for transmitting data based on the CANopen protocol includes the following steps: the host power-on operation of the gateway enters an online state, and is backed up by the primary backup machine communication network and the gateway.
  • the machine monitors the state of the heartbeat packet with each other; if the heartbeat packet of the backup machine is not detected within a preset heartbeat period, and the heartbeat packet of the host is successfully sent on the active/standby communication network, the host remains online.
  • the backup machine is offline; if the heartbeat packet of the host fails to be sent on the primary backup communication network, the host requests the backup machine to go online through any one of the in-vehicle communication networks; If the first communication network does not receive the response request of the backup machine, the host stops requesting the backup machine of the first communication network in the vehicle to go online, and requests the backup machine to go online through another in-vehicle communication network; If the second communication network in the vehicle still cannot receive the response request of the backup machine, the host remains online, and records the The backup machine is offline.
  • another gateway rotation method for transmitting data based on the CANopen protocol includes the following steps: the backup machine of the gateway is powered on, and the primary and backup communication networks are in a preset heartbeat. If the host heartbeat packet is not monitored during the period, it is determined whether the backup machine heartbeat packet of the active/standby communication network can be successfully sent; if the transmission succeeds, the backup machine remains online; if the transmission is unsuccessful, but is in the vehicle.
  • the first communication network and the second communication network in the vehicle monitor the host heartbeat packet, or can normally receive the backup machine heartbeat packet, and determine the backup machine response state in the host heartbeat packet to determine the current backup machine state.
  • a host of a gateway includes: a monitoring module, configured to: when a host of a gateway is powered on and enters an online state, the primary backup communication network and the gateway backup machine communicate with each other. Monitoring the state of the heartbeat packet; the first processing module is configured to not monitor the heartbeat packet of the backup machine in a preset heartbeat period, and the heartbeat packet of the host is kept online when the primary and secondary device communication network is successfully sent.
  • the requesting module is configured to request the backup machine to go online through any one of the in-vehicle communication networks when the heartbeat packet of the host fails to be sent on the main standby communication network; the request module And when the first communication network in the vehicle does not receive the response request of the backup machine, stop requesting the backup machine of the first communication network in the vehicle to go online, and request the backup through another in-vehicle communication network.
  • the first processing module is further configured to: when the second communication network in the vehicle still cannot receive the response request from the backup machine, Online, and record that the backup machine is offline.
  • the backup machine of the gateway includes: a seventh determining module, configured to: when the backup machine of the gateway is powered on, if the primary and backup communication networks are in a preset heartbeat period
  • the host heartbeat packet is not monitored internally, and the backup machine heartbeat packet of the master/slave communication network can be successfully sent.
  • the second processing module is configured to control the backup machine to remain online when the transmission can be successful; For unsuccessful transmission, but when the first communication network in the vehicle and the second communication network in the vehicle monitor the host heartbeat packet, or can normally receive the backup machine heartbeat packet, determine the response state of the backup machine requested in the host heartbeat packet. Current backup machine status.
  • a gateway rotation system for transmitting data based on the CANopen protocol includes: a host of a gateway according to the third embodiment of the present disclosure, which is described in the fourth embodiment of the present disclosure.
  • Gateway backup machine main standby communication network and inter-vehicle communication network.
  • a computer apparatus includes a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer
  • the gateway rotation method based on the CANopen protocol according to the first aspect of the present disclosure is implemented in the program.
  • a computer apparatus includes a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer
  • the gateway rotation method based on the CANopen protocol according to the second aspect of the present disclosure is implemented in the program.
  • a storage medium for storing an application for executing a gateway for transmitting data based on the CANopen protocol according to the first aspect of the present disclosure. Rotation method.
  • a storage medium for storing an application for executing a gateway for transmitting data based on a CANopen protocol according to an embodiment of the second aspect of the present disclosure. Rotation method.
  • Coordination work is performed according to the different running states of the host and the backup machine of the gateway, so as to ensure that the network can maintain communication normally under abnormal conditions, and avoid network communication abnormalities caused by network failures in the active and standby nodes.
  • FIG. 1 is a block diagram showing the architecture of a train network according to an embodiment of the present disclosure
  • FIG. 2 is a flowchart of a gateway rotation method for transmitting data based on a CANopen protocol according to a first embodiment of the present disclosure
  • FIG. 3 is a process flow diagram of all network communication normal according to an embodiment of the present disclosure.
  • FIG. 4 is a flowchart of a gateway rotation method for transmitting data based on a CANopen protocol according to a second embodiment of the present disclosure
  • FIG. 5(a) is a flowchart of processing only receiving no Ethernet data according to an embodiment of the present disclosure
  • Figure 5 (b) is a process flow diagram of branch A of Figure 5 (a), in accordance with one embodiment of the present disclosure
  • FIG. 6 is a flowchart of a gateway rotation method for transmitting data based on a CANopen protocol according to a third embodiment of the present disclosure
  • FIG. 7(a) is a flowchart of a process of receiving only traction braking data according to an embodiment of the present disclosure
  • Figure 7 (b) is a process flow diagram of branch A of Figure 7 (a), in accordance with one embodiment of the present disclosure
  • FIG. 8 is a flowchart of a gateway rotation method for transmitting data based on a CANopen protocol according to a fourth embodiment of the present disclosure
  • 9(a) is a flow chart showing the processing of receiving Ethernet and traction braking data according to an embodiment of the present disclosure
  • Figure 9(b) is a process flow diagram of branch A in Figure 9(a), in accordance with one embodiment of the present disclosure
  • FIG. 10 is a flowchart of a gateway rotation method for transmitting data based on a CANopen protocol according to a fifth embodiment of the present disclosure
  • Figure 11 (a) is a flow chart showing the processing of receiving only the comfort net data according to an embodiment of the present disclosure
  • Figure 11 (b) is a process flow diagram of branch A of Figure 11 (a), in accordance with one embodiment of the present disclosure
  • Figure 11 (c) is a process flow diagram of branch B in Figure 11 (a), in accordance with one embodiment of the present disclosure
  • FIG. 12 is a flowchart of a gateway rotation method for transmitting data based on a CANopen protocol according to a sixth embodiment of the present disclosure
  • Figure 13 (a) is a flow chart showing the processing of receiving Ethernet and comfort network data according to an embodiment of the present disclosure
  • Figure 13 (b) is a process flow diagram of branch A in Figure 13 (a), in accordance with one embodiment of the present disclosure
  • Figure 13 (c) is a process flow diagram of branch B in Figure 13 (a), in accordance with one embodiment of the present disclosure
  • FIG. 14 is a flowchart of a gateway rotation method for transmitting data based on a CANopen protocol according to a seventh embodiment of the present disclosure
  • Figure 15 (a) is a flow chart showing the processing of receiving no traction brake net and comfort net data according to an embodiment of the present disclosure
  • Figure 15 (b) is a process flow diagram of branch A in Figure 15 (a), in accordance with one embodiment of the present disclosure
  • Figure 15 (c) is a process flow diagram of branch B in Figure 15 (a), in accordance with one embodiment of the present disclosure
  • FIG. 16 is a flowchart of a gateway rotation method for transmitting data based on a CANopen protocol according to an eighth embodiment of the present disclosure
  • 17 is a data processing flowchart of all data not received according to an embodiment of the present disclosure.
  • FIG. 18 is a flowchart of a gateway rotation method for transmitting data based on a CANopen protocol according to a ninth embodiment of the present disclosure
  • FIG. 19 is a flowchart of an operation strategy of a backup machine according to an embodiment of the present disclosure.
  • FIG. 20 is a schematic structural diagram of a host of a gateway according to a first embodiment of the present disclosure
  • 21 is a schematic structural diagram of a host of a gateway according to a second embodiment of the present disclosure.
  • FIG. 22 is a schematic structural diagram of a host of a gateway according to a third embodiment of the present disclosure.
  • FIG. 23 is a schematic structural diagram of a host of a gateway according to a fourth embodiment of the present disclosure.
  • FIG. 24 is a schematic structural diagram of a host of a gateway according to a fifth embodiment of the present disclosure.
  • 25 is a schematic structural diagram of a host of a gateway according to a sixth embodiment of the present disclosure.
  • 26 is a schematic structural diagram of a host of a gateway according to a seventh embodiment of the present disclosure.
  • FIG. 27 is a schematic structural diagram of a backup machine of a gateway according to an embodiment of the present disclosure.
  • FIG. 28 is a schematic structural diagram of a gateway rotation system for transmitting data based on a CANopen protocol according to an embodiment of the present disclosure.
  • a gateway rotation method, system and apparatus for transmitting data based on the CANopen protocol will be described below with reference to the accompanying drawings.
  • the prior art strategy is to set up a gateway host and a backup machine in the network. All network data sends data at both the host and the backup machine, but there is only one active master node in the network, that is, when the host is running normally, the backup machine In a silent state.
  • the switch between the host and the backup machine is only implemented by determining whether the heartbeat packet of the host is dropped. When the host detects that there is a problem with its own network, it stops sending the host heartbeat packet. The backup machine starts working when it does not receive the host heartbeat packet.
  • the present disclosure solves the technical problem that the host and the backup machine of the gateway in the prior art have network anomalies and cannot communicate normally.
  • the design scheme of the train host rotation mechanism is provided.
  • the gateway host and the backup machine are required to coordinate according to different operating states, so as to ensure that the network can maintain normal communication under abnormal conditions, thereby effectively avoiding network failures caused by network failures in the gateway host and the backup machine.
  • the abnormal problem also improves the practical effect of the redundant design, and well avoids the problem that some vehicle network failures cause the whole vehicle to be blocked, and can ensure that the nodes in the network can still communicate normally under some abnormal conditions.
  • train network data transmission method of the present disclosure is implemented based on the CANopen protocol, wherein the CANopen protocol requires a node in the network to act as an active master node to manage the initialization, startup, and supervision of other slave nodes. , reset or stop work.
  • the gateway rotation method of the data transmission based on the CANopen protocol of the present disclosure is applied to the host side of the gateway in the following embodiments.
  • the alive indicates the online state, and the stop is described. Indicates stop, as explained below:
  • FIG. 2 is a flow chart of a gateway rotation method for transmitting data based on the CANopen protocol according to the first embodiment of the present disclosure. As shown in FIG. 2, the method includes:
  • S101 The host of the gateway is powered on and enters an online state, and monitors the state of the heartbeat packet through the backup machine of the active and standby communication networks and the gateway.
  • the backup machines of the primary and secondary communication networks and the gateway monitor the state of the heartbeat packets, regardless of whether the heartbeat packets of the backup machine can be received. , will remain alive.
  • the host stops requesting the backup machine of the first communication network in the vehicle to go online, and requests the backup machine to go online through another in-vehicle communication network.
  • the preset heartbeat period can be calibrated according to the requirements of the specific application scenario, and no limitation is imposed here.
  • the in-vehicle communication network in the embodiment of the present disclosure may include a first communication network in the vehicle and a second communication network in the vehicle, wherein the first in-vehicle communication network may be a traction brake network or the like, and the second communication The network may be a comfort network or the like.
  • the first communication network in the first vehicle is a traction brake network or the like
  • the second communication network is a comfort network.
  • the host if the heartbeat packet of the backup machine is not detected in the preset heartbeat period, and the heartbeat packet of the host is successfully sent on the communication network of the master and backup machine, the host remains online, and the backup machine is recorded as being dropped. If the host heartbeat packet transmission on the primary and backup communication network is unsuccessful, the host requests the backup machine to go online through the traction brake network. If the backup brake network does not receive the backup machine response request, the host will stop requesting the backup of the traction brake network. The machine is on the line, and the backup machine is requested to go online through the comfort network. If the backup machine does not receive the response request from the comfort network, the host remains alive and the backup machine is dropped.
  • the preset heartbeat period is 500 ms
  • the backup machine heartbeat packet is not monitored continuously for 500 ms on the main standby communication network
  • the host heartbeat packet on the main standby communication network is successfully sent, The host keeps alive (online) and records that the backup machine is offline. If the host heartbeat packet transmission on the primary and backup communication network is unsuccessful, the host requests the backup machine to go online through the traction brake network. If the backup brake network does not receive the backup machine response request, the host will stop requesting the backup of the traction brake network. The machine is on the line, and the backup machine is requested to go online through the comfort network. If the backup machine does not receive the response request from the comfort network, the host remains alive and the backup machine is dropped.
  • the host power-on operation of the gateway enters an online state, and the monitoring gateway and the backup machine monitor the state of the heartbeat packet through the active/standby communication network. If the heartbeat packet of the backup machine is not detected in the preset heartbeat period, and the heartbeat packet of the host is successfully sent on the communication network of the primary and backup machines, the host remains online, and the backup machine is disconnected. If the heartbeat packet of the host is in the communication between the primary and backup devices. If the online transmission fails, the host requests the backup machine to go online through any intra-vehicle communication network.
  • the host stops requesting the backup machine in the first communication network in the vehicle to go online.
  • the backup machine is requested to go online through another in-vehicle communication network. If the communication network in the second vehicle still cannot receive the response request from the backup machine, the host remains online and records that the backup machine is offline. Therefore, the coordination work is performed according to different operating states of the host and the backup machine of the gateway, thereby effectively ensuring that the network can maintain communication normally under abnormal conditions, thereby avoiding network communication abnormality caused by network failures in the active and standby nodes.
  • the in-vehicle communication network in the embodiments of the present disclosure may include a first communication network in the vehicle and a second communication network in the vehicle, wherein the first in-vehicle communication network may be a traction brake.
  • the second communication network may be a comfort network or the like, and the in-vehicle communication network may be an Ethernet.
  • the first in-vehicle communication network is a traction brake network, etc.
  • the second communication network is a comfort network, and the communication network inside the vehicle is Ethernet.
  • FIG. 4 is a flowchart of a gateway rotation method for transmitting data based on a CANopen protocol according to a second embodiment of the present disclosure. As shown in FIG. 4, the method further includes:
  • S201 When the host does not receive the communication network data in the vehicle or the communication network port failure in the vehicle, monitor the heartbeat packet status of the backup machine through the communication network of the primary backup machine.
  • the host determines that the backup machine currently receives the status of each network data, and performs corresponding processing according to the receiving status.
  • the host stops, and the host requests the backup machine to be online through the primary and secondary communication networks. If the external network data reception abnormality is detected, the host remains online, if only It is detected that the traction brake network receives abnormal data, and the host requests the backup machine to go online through the main standby communication network. The backup machine is online and attempts to perform redundant network switching. If the handover is successful, the host stops, and the host requests the backup machine to go online through the primary and secondary communication networks. If the handover is unsuccessful, the backup machine switches to the abnromity-2 state and requests the host abnromity-2 state through the primary and secondary communication networks.
  • the host stops, and the host requests the backup machine to go online through the primary and backup networks. If the handover is unsuccessful, it is determined whether the traction brake network and the comfort network are successfully switched. If the traction brake network is successfully switched, the backup machine switches to the abnromity-1 state and requests the host abnromity-1 state through the primary and secondary communication networks. If the comfort network is successfully switched, the backup machine switches to the abnromity-2 state and requests the host abnromity-2 status through the primary and secondary communication networks. If both networks fail to switch, the host remains online and requests the backup machine to stop through the primary and backup communication networks.
  • the status of the backup machine gateway heartbeat packet is monitored through the active/standby communication network. For example, if the heartbeat packet of the backup machine of the gateway is not monitored for 500 ms, the judgment is performed. Whether the heartbeat packet of the master/slave communication network host can be successfully sent. S203. If the sending succeeds, the host remains online, and the backup machine is recorded as being dropped.
  • the host If the sending fails, the host requests the backup machine to remain online through the second communication network in the vehicle.
  • the host if the transmission is successful, the host remains online and the backup machine is dropped. If the transmission is unsuccessful, the host requests the backup machine to go online through the comfort network. At this time, if the backup machine responds to the online request on the comfort network, it determines whether the backup machine of the current gateway receives the status of each network data.
  • the host stops, and the host sends the host to stop the heartbeat packet through the traction brake network. If only the abnormal data reception of the external network of the vehicle is detected, the host remains online, and the traction brake network is adopted.
  • the backup machine is requested to stop. If only the comfort network data reception abnormality is detected, the backup machine is online, and attempts to perform redundant network switching, and uses the comfort network to back up network communication. If the switch is successful and the host stops, the host sends a host to stop the heartbeat packet through the primary backup machine network. If the handover is unsuccessful, the backup machine switches to the abnromity-1 state as shown in Table 3, and requests the host abnromity-1 state through the traction brake network. If it is detected that the car external network and the comfort net data reception are abnormal, the host remains online, and the backup machine is requested to stop by the traction brake network.
  • the host stops requesting the backup machine of the first communication network in the vehicle to be online, and then requests the backup machine to be online through the second communication network in the vehicle.
  • the host stops requesting the traction brake network backup machine to be online, and requests the backup machine to be online through the comfort network. If the backup machine does not receive an online request, the host remains online and requests the backup machine to stop via the comfort network. If the backup machine responds to the online request, it determines whether the backup machine of the current gateway receives the status of each network data.
  • the host stops, and the host sends a host to stop the heartbeat packet through the comfort network. If only the data reception abnormality of the external network of the vehicle is monitored, the host keeps the sub-line and requests backup through the comfort network. The machine stops. If only the traction brake network data reception abnormality is detected, the backup machine is online, and attempts to perform redundant network switching, using the traction brake network. If the switch is successful and the host stops, the host sends a host to stop the heartbeat packet through the comfort network. If the handover is unsuccessful, the backup machine switches to the abnromity-2 state and requests the host abnromity-2 state through the comfort network. If it is detected that the data reception of the external network of the train compartment and the traction brake network is abnormal, the host remains online, and the backup machine is requested to stop through the comfort network.
  • Fig. 5(b) is a flow chart of the branch A shown in Fig. 5(a).
  • FIG. 6 is a flowchart of a gateway rotation method for transmitting data based on a CANopen protocol according to a third embodiment of the present disclosure. As shown in FIG. 6, the method further includes:
  • the host determines whether the first communication network in the current vehicle has switched to the backup machine to work.
  • the host of the gateway when the host of the gateway does not receive the traction brake network data or the traction brake network port failure, the host of the gateway first determines whether the current traction brake network has switched to the backup network.
  • S302 Perform redundant network switching if there is no handover, and if the handover is successful, the host remains online.
  • the redundant network handover is performed, and if the handover is successful, the host of the gateway remains online. If the data of the traction brake network is still not received after switching to the backup network, the heartbeat packet status of the backup machine of the gateway is monitored through the communication network of the master and backup machines.
  • the host determines the current state of the network data reception by the backup machine, and performs corresponding processing according to each network data receiving state.
  • the host determines the current state of the backup data of the backup machine for each network, and the different states determine which operating state the host and the backup machine of the gateway are in.
  • the host if the heartbeat packet of the backup machine is not monitored for 500 ms, if the host heartbeat packet can be successfully sent on the primary and backup communication networks, the host remains online. If the transmission is unsuccessful, the host sends the host heartbeat packet 071:02 01 02 through the comfort network, requesting the backup machine to be online. At this time, if the response request from the comfort net backup machine is not received, the host remains online. If the response request 072: **01 00 can be received, the backup machine of the monitoring gateway monitors the status of each network data reception, and the different states determine which operating state the gateway host and the backup machine are in.
  • the host stops the host requests the backup machine to go online through the main and backup machine communication network, the backup machine is online, and attempts to perform redundant network switching, and uses the traction brake network to back up network communication. If the handover is successful, the host stops, and the host sends a host to stop the heartbeat packet through the primary and backup communication networks. If the handover is unsuccessful, the backup machine switches to the backup machine to switch to the abnromity-2 state, and requests the host abnromity-2 state through the primary and secondary communication networks.
  • the host requests the backup machine to go online through the main standby communication network, the backup machine is online, and attempts to perform redundant network switching, and uses the comfort network to back up the network communication. If the handover is successful, the host stops, and the host sends a host to stop the heartbeat packet through the primary and backup communication networks. If the handover is unsuccessful, the backup switch switches to the abnromity-3 state and requests the host abnromity-3 state through the primary and backup communication networks.
  • the host switches to the abnromity-4 state, and requests the backup machine abnromity-4 status through the primary and secondary communication networks.
  • the second communication network in the vehicle can receive the response request of the backup machine, monitor the backup status of the backup data for each network data, and perform corresponding processing according to each network data receiving status.
  • the host remains online. If the sending is unsuccessful, the host requests the backup machine to go online through the comfort network. If the response request from the comfort net backup machine is not received, the host remains online. If the backup machine responds to the request, the backup gateway of the monitoring gateway monitors the status of each network data reception, and the different states determine which operating state the active and standby gateways are in.
  • the host stops, and the host sends a host to stop the heartbeat packet through the comfort network.
  • the host switches to the abnormity-8 state, and requests the backup machine to enter the abnormity-8 state through the comfort network.
  • the backup machine If only the traction brake network data reception abnormality is detected, the backup machine is online, and attempts to perform redundant network switching, and uses the traction brake network to back up network communication. If the handover is successful, the host stops, and the host sends a host to stop the heartbeat packet through the comfort network. If the handover is unsuccessful, the backup switch switches to the abnormity-2 state and requests the host to enter the abnormity-2 state through the comfort network.
  • FIG. 7(b) is a flowchart of the branch A shown in FIG. 7(a).
  • FIG. 8 is a flowchart of a gateway rotation method for transmitting data based on a CANopen protocol according to a fourth embodiment of the present disclosure. As shown in FIG. 8, the method further includes:
  • the host determines whether the first communication network in the current vehicle has been switched to The backup network works. If the switch is not switched, the redundant network switchover is performed. If the switchover is successful, the preset process is performed.
  • the host of the gateway first determines whether the current traction brake network has switched to the backup. If the network is working, if the switchover is successful, the process of Figure 9(b) is successful. If the data of the traction brake network is still not received after switching to the backup network, the master and the backup are available.
  • the machine communication network monitors the heartbeat packet status of the backup machine of the gateway.
  • the host determines the current state of the data received by the backup machine for each network, and performs corresponding processing according to each network data receiving state.
  • the host of the gateway determines the current state of the backup data of the backup machine for each network, and the different states determine which operating state the gateway of the gateway and the backup machine of the gateway are in.
  • the host stops, and the host requests the backup machine to go online through the communication network of the primary and secondary machines.
  • the host requests the backup machine to be online through the primary and secondary machine communication network, the backup machine is online, and attempts to perform redundant network switching, and uses the comfort network to back up the network communication. If the handover is successful, the host stops, and the host sends a host to stop the heartbeat packet through the primary and backup communication networks. If the handover is unsuccessful, the backup switch switches to the abnormity-5 state and requests the host to enter the abnormity-5 state through the primary and backup communication networks.
  • the host switches to the abnormity-6 state, and requests the backup machine to enter the abnormity-6 state through the primary and secondary communication networks.
  • the host switches to the abnormity-7 state and requests the backup machine to enter the abnormity-7 state through the primary and secondary communication networks.
  • the host remains online. If the sending is unsuccessful, the host requests the backup machine to go online through the comfort network. At this time, if the backup machine does not receive the response request, the host remains online. If the backup machine response request is received, the backup machine monitors the status of each network data reception.
  • Fig. 9(b) is a flow chart of the branch A shown in Fig. 9(a).
  • FIG. 10 is a flowchart of a gateway rotation method for transmitting data based on a CANopen protocol according to a fifth embodiment of the present disclosure. As shown in FIG. 10, the method further includes:
  • the host determines whether the second communication network in the current vehicle has switched to the backup network, and performs a redundant network if not switched. Switching, if the switch is successful, the host remains online.
  • the host determines the current backup state of the current backup machine for each network data, and performs corresponding processing according to each network data receiving state.
  • the host of the gateway when the host of the gateway does not receive the data of the comfort network or the fault of the comfort network port, the host of the gateway first determines whether the current comfort network has switched to the backup network, and performs the redundant network handover if the handover is not performed. If the switchover succeeds, the host of the gateway remains online. If the data of the comfort network is still not received after switching to the backup network, the heartbeat packet status of the backup machine is monitored through the communication network of the primary and backup machines.
  • the host determines the current state of the backup data for each network, and the different states determine which operating state the primary and backup machines of the gateway are in.
  • the host switches to the abnormity-9 state, and requests the standby machine to enter the abnormity-9 state through the primary and secondary communication networks.
  • the host switches to the abnormity-11 state, and requests the standby machine to enter the abnormity-11 state through the primary and secondary communication networks.
  • the host stops, the host requests the backup machine to go online through the primary backup machine network, the backup machine is online, and attempts to perform redundant network switching. If the handover is successful, the host sends a host to stop the heartbeat packet through the primary and backup communication networks, and the host stops. If the handover is unsuccessful, the backup machine switches to the stop state, and sends the backup machine to stop the heartbeat packet through the primary and backup communication networks.
  • the first communication network in the vehicle receives the response request of the backup machine, monitor the backup status of the backup data for each network data, and perform corresponding processing according to each network data receiving status.
  • the host keeps alive. If the transmission is unsuccessful, the host requests the backup machine to be online through the traction brake network. If the backup brake network receives the backup machine response online request, the backup machine of the monitoring gateway monitors the status of each network data reception.
  • the host stops, and the host sends a host to stop the heartbeat packet through the comfort network.
  • the host switches to the abnormity-9 state, and requests the backup machine to enter the abnormity-9 state through the traction brake network.
  • the host sends the host stop through the comfort network, and at the same time judges whether the comfortable backup network is successfully switched. If the handover succeeds, the host stops, and the host sends the host stop heartbeat packet through the traction brake network. If the handover is unsuccessful, the backup machine switches to the stop state and requests the host to be online through the traction brake network.
  • the switch between the host of the gateway and the backup machine is only implemented by determining whether the heartbeat packet of the host of the gateway is dropped.
  • the host of the gateway detects that there is a problem in the network, the host stops. Send a host heartbeat packet.
  • the backup machine starts working when it receives the heartbeat packet of the host of the gateway.
  • FIG. 11(a), FIG. 11(b) and FIG. 11(c) Data processing flowchart, wherein FIG. 11(b) is a flowchart of the branch A shown in FIG. 11(a), and FIG. 11(c) is a flowchart of the branch B shown in FIG. 11(a) .
  • FIG. 12 is a flowchart of a gateway rotation method for transmitting data based on a CANopen protocol according to a sixth embodiment of the present disclosure. As shown in FIG. 12, the method further includes:
  • the host determines whether the second communication network in the current vehicle has switched to the backup. The machine works, and if it is not switched, the redundant network switching is performed. If the switching is successful, the preset processing is performed.
  • the heartbeat packet status of the backup machine is monitored by the primary and secondary communication network.
  • the host determines the current state of the data received by the backup machine for each network, and performs corresponding processing according to each network data receiving state.
  • the host of the gateway when the host of the gateway does not receive the comfort network and the Ethernet data or the comfort network and the Ethernet port are faulty at the same time, the host of the gateway first determines whether the current comfort network has switched to the backup network, and Switching performs redundant network switching. If the switching is successful, the process shown in Figure 13(b) or Figure 13(c) is entered. If the backup network is switched to work, the comfort network data is still not received. The heartbeat packet status of the backup machine of the gateway is monitored through the primary and secondary communication networks.
  • the host of the gateway determines the status of the backup data of the current gateway for each network data, and the different states determine which operating state the gateway host and the backup machine are in.
  • the host If the sending is unsuccessful, the host requests the backup machine to be online through the first communication network in the vehicle.
  • the host determines the current state of the data received by the backup machine for each network, and performs corresponding processing according to each network data receiving state.
  • the host of the gateway monitors the network status of the backup machine of the gateway.
  • the host stops, the host sends the host to stop the heartbeat packet through the traction brake network, the backup machine remains online, and attempts to perform redundant network switching, and uses the comfort network to back up the network communication.
  • FIG. 13(b) is a flow chart of the branch A shown in FIG. 13(a)
  • FIG. 13(c) is a branch B shown in FIG. 13(a). flow chart.
  • FIG. 14 is a flowchart of a gateway rotation method for transmitting data based on a CANopen protocol according to a seventh embodiment of the present disclosure. As shown in FIG. 14, the method further includes:
  • the host fails to receive the first communication network in the vehicle and the second communication network data in the vehicle or the first communication network in the vehicle and the second communication network port in the vehicle are faulty, the host determines the first communication network in the current vehicle. Whether the second communication network in the vehicle has been switched to the backup machine, and the non-switching performs redundant network switching. If both networks can be successfully switched, the host remains online.
  • S705 If the heartbeat packet of the backup machine is normally received, the host determines the current state of the data received by the backup machine for each network, and performs corresponding processing according to each network data receiving state.
  • the host of the gateway when the host of the gateway does not receive the traction brake network and the comfort network data or the traction brake network and the comfort network port fault at the same time, the host of the gateway first determines whether the current traction brake network and the comfort network have been switched to The backup network works. If the two networks are successfully switched, the host of the gateway remains online. If only the traction brake network is successfully switched, it enters as shown in Figure 15(c). If the comfort network is successfully switched, the process shown in Figure 15(b) is entered. If the current traction brake network and the comfort network have switched to the backup network and still receive no data, the main The standby communication network monitors the heartbeat packet status of the backup machine of the gateway.
  • the host of the gateway determines the status of the backup of the current gateway for each network data, and the state of the gateway determines the host of the gateway. And which operating state the backup machine is in.
  • the host switches to the abnormity-13 state, and requests the backup machine to enter the abnormity-13 state through the primary and secondary communication networks.
  • the host switches to the abnormity-14 state, and requests the backup machine to enter the abnormity-14 state through the primary and secondary communication networks.
  • the host requests the backup machine to go online through the primary and secondary machine communication network, the backup machine is online, and attempts to perform redundant network switching, and uses the comfort network to back up the network communication.
  • the host switches to the abnormity-15 state, and requests the backup machine to enter the abnormity-15 state through the primary and secondary communication networks.
  • FIG. 15(a), FIG. 15(b) and FIG. 15(c) can be combined.
  • Net and comfort net data processing flow chart wherein Fig. 15(b) is a flow chart of branch A shown in Fig. 15(a), and Fig. 15(c) is a branch shown in Fig. 15(a) B's flow chart.
  • FIG. 16 is a flowchart of a gateway rotation method for transmitting data based on the CANopen protocol according to the eighth embodiment of the present disclosure. As shown in FIG. 16, the method further includes:
  • the host determines the current backup state of the backup data for each network, and performs corresponding processing according to each network data receiving state.
  • the host monitors the heartbeat packet receiving status of the backup machine on the master and backup machine. If the heartbeat packet of the backup machine is not monitored for 500 ms, the host remains online. If the heartbeat packet of the backup machine of the gateway can be received normally, the host of the gateway determines the status of the data backup of the current gateway for each network, and the different states determine which operating state the gateway host and the backup machine are in.
  • the host If it is detected that all three network data are abnormal, the host remains online. Otherwise, the host stops, and the host requests the backup machine to go online through the primary and backup communication networks.
  • the gateway rotation method based on the CANopen protocol for transmitting data in the embodiment of the present disclosure optimizes the software implementation strategy on the original network redundancy design architecture.
  • the gateway host and the backup machine both have network anomalies, the reception does not occur.
  • the host and the backup machine of the gateway can work in coordination according to different operating states, so as to ensure that the network can maintain communication normally under abnormal conditions, and avoid network communication abnormalities caused by network faults in the active and standby nodes.
  • the problem is to improve the redundancy of the train network.
  • the gateway rotation method for transmitting data based on the CANopen protocol of the embodiment of the present disclosure the following method is focused on the backup machine side of the gateway.
  • FIG. 18 is a flowchart of a gateway rotation method for transmitting data based on a CANopen protocol according to a ninth embodiment of the present disclosure. As shown in FIG. 18, the method includes:
  • S901 The backup machine of the gateway is powered on. If the host's communication network does not monitor the host heartbeat packet within the preset heartbeat period, it can determine whether the backup machine heartbeat packet of the master and backup machine communication network can be successfully sent.
  • the backup machine if the backup machine is powered on, if the host's communication network fails to monitor the host heartbeat packet for 500ms, it can determine whether the heartbeat packet of the master/slave communication network backup machine can be sent successfully. If the transmission is successful, the backup machine is online. If the transmission is unsuccessful, but the host heartbeat packet is monitored on the traction brake network and the comfort network, or the backup machine heartbeat packet can be received normally, it is determined that the host heartbeat packet byte3 requests the backup machine response state to determine the current backup machine state.
  • the backup machine If the host heartbeat packet is detected to request the backup machine to be online, the backup machine is online, and it is judged whether the host needs cooperation according to the data of the receiving Ethernet, the traction brake network and the comfort network. If the host needs to cooperate, the backup machine is online and is in the processing of the abnormal state of the first to the 15th. If you do not need the host to cooperate, the backup machine is online.
  • the gateway rotation method based on the CANopen protocol for transmitting data in the embodiment of the present disclosure optimizes the software implementation strategy on the original network redundancy design architecture.
  • the gateway host and the backup machine both have network anomalies, the reception does not occur.
  • the host and the backup machine of the gateway can work in coordination according to different operating states, so as to ensure that the network can maintain communication normally under abnormal conditions, and avoid network communication abnormalities caused by network faults in the active and standby nodes.
  • the problem is to improve the redundancy of the train network.
  • FIG. 20 is a schematic structural diagram of a host of a gateway according to the first embodiment of the present disclosure. As shown in FIG. 20, the host of the gateway includes a monitoring module. 101. The first processing module 102 and the request module 103.
  • the monitoring module 101 is configured to monitor the state of the heartbeat packet through the backup machine of the primary and secondary communication networks and the gateway when the host of the gateway is powered on and enters the online state.
  • the first processing module 102 is configured to not monitor the heartbeat packet of the backup machine in the preset heartbeat period, and the heartbeat packet of the host is kept online when the heartbeat packet of the host is successfully sent on the communication network of the master and backup machine, and the backup machine is disconnected;
  • the requesting module 103 is configured to request the backup machine to go online through any one of the in-vehicle communication networks when the heartbeat packet of the host fails to be sent on the main standby communication network;
  • the requesting module 103 is further configured to stop requesting the backup machine of the first communication network in the vehicle to go online while the first communication network in the vehicle does not receive the response request of the backup machine, and simultaneously pass another The in-vehicle communication network requests the backup machine to go online.
  • the first processing module 102 is further configured to keep online while the second communication network in the vehicle still receives the response request from the backup machine, and record that the backup machine is offline.
  • the host of the gateway is powered on and enters the online state, and monitors the heartbeat packet state of the backup machine of the gateway through the primary and secondary communication network, if the monitoring is performed within a preset heartbeat period. If the heartbeat packet of the backup machine is not successfully transmitted on the primary and backup communication networks, the host remains online and the backup machine is disconnected. If the heartbeat packet of the host fails to be sent on the primary and backup communication networks, the host passes the failure.
  • the first communication network in the vehicle requests the backup machine to go online. If the first communication network in the vehicle does not receive the response request from the backup machine, the host stops requesting the backup machine of the first communication network in the vehicle to go online, and simultaneously passes the second communication in the vehicle.
  • the network requests the backup machine to go online. If the second communication network in the vehicle still cannot receive the response request from the backup machine, the host remains online and records that the backup machine is offline. Therefore, the coordination work is performed according to different operating states of the host and the backup machine of the gateway, thereby effectively ensuring that the network can maintain communication normally under abnormal conditions, thereby avoiding network communication abnormality caused by network failures in the active and standby nodes.
  • FIG. 21 is a schematic structural diagram of a host of a gateway according to a second embodiment of the present disclosure.
  • the host of the gateway further includes a first determining module 104.
  • the monitoring module 101 is further configured to monitor the state of the heartbeat packet of the backup machine through the active/standby communication network when the host does not receive the Ethernet data or the Ethernet port is faulty.
  • the first judging module 104 is configured to determine whether the heartbeat packet of the host can be successfully sent on the main standby communication network when the heartbeat packet of the backup machine is not detected in the preset heartbeat period.
  • the first processing module 102 is further configured to: when the sending succeeds, control the host to remain online, and record that the backup machine is offline.
  • the requesting module 103 is further configured to request the backup machine to remain online through the second communication network in the vehicle when the transmission fails.
  • the first processing module 102 is configured to determine, when the second communication network in the vehicle receives the response request from the backup machine, the current status of the data received by the backup machine, and perform corresponding processing according to the received status.
  • the requesting module 103 is further configured to stop requesting the backup machine of the first communication network in the vehicle to be online when the response request of the backup machine is not received on the second communication network in the vehicle, and then pass the The second communication network within the vehicle requests the backup machine to be online.
  • the first processing module 102 is configured to: when the response request of the backup machine is not received, the control host remains online, and requests the backup machine to stop through the second communication network in the vehicle.
  • the first processing module 102 is configured to determine, when receiving the response request of the backup machine, the current receiving status of the network data by the backup machine, and perform corresponding processing according to the receiving status.
  • the first processing module 102 is configured to determine, when the heartbeat packet of the backup machine is received normally, that the backup machine is currently receiving data status of each network, and perform corresponding according to the receiving status. deal with.
  • FIG. 22 is a schematic structural diagram of a host of a gateway according to a third embodiment of the present disclosure. As shown in FIG. 22, the host of the gateway further includes a second determining module 105.
  • the second determining module 105 is configured to determine whether the first communication network in the current vehicle has been switched to the backup machine when the host fails to receive the first communication network data in the vehicle or the first communication network port in the vehicle is faulty.
  • the first processing module 102 is configured to perform redundant network switching when there is no handover, and if the handover is successful, the control host remains online.
  • the monitoring module 101 is configured to monitor the heartbeat packet status of the backup machine through the active/standby communication network when the data has been switched to the backup machine and the data of the second communication network in the vehicle is still not received.
  • the first processing module 102 is configured to determine, when the heartbeat packet of the backup machine is received normally, the current backup data of the current backup machine for each network, and perform corresponding processing according to each network data receiving state.
  • the first processing module 102 is configured to: when the heartbeat packet of the backup machine is not detected in the preset heartbeat period, if the host heartbeat packet on the main standby communication network can be successfully sent, The control panel remains online.
  • FIG. 23 is a schematic structural diagram of a host of a gateway according to a fourth embodiment of the present disclosure. As shown in FIG. 23, the host of the gateway further includes a third determining module 106.
  • the third determining module 106 is configured to determine, when the host does not receive the data of the first communication network and the inter-vehicle communication network in the vehicle or the first communication network and the inter-vehicle communication network port in the vehicle, Whether a communication network has switched to the backup network to work.
  • the first processing module 102 is configured to perform a redundant network handover when the handover is not performed, and perform a preset process when the handover succeeds.
  • the monitoring module 101 is configured to monitor the heartbeat packet status of the backup machine through the active/standby communication network when the data has been switched to the backup machine and the data of the first communication network in the vehicle is still not received.
  • the first processing module 102 is configured to determine, when the heartbeat packet of the backup machine is received normally, the current backup status of the current backup machine for each network, and perform corresponding processing according to each network data receiving status.
  • the first processing module 102 is configured to not monitor the heartbeat packet of the backup machine within a preset heartbeat period, and the control host keeps the master host communication network host heartbeat packet successfully sent. Online, if the transmission is unsuccessful, request the backup machine to be online through the second communication network in the vehicle.
  • the first processing module 102 is configured to keep online when the response request of the backup machine is not received.
  • the first processing module 102 is configured to monitor the receiving status of the backup network for each network data when receiving the response request of the backup machine, and perform corresponding processing according to each network data receiving status.
  • FIG. 24 is a schematic structural diagram of a host of a gateway according to a fifth embodiment of the present disclosure. As shown in FIG. 24, the host of the gateway further includes a fourth determining module 107.
  • the fourth determining module 107 is configured to determine whether the second communication network in the current vehicle has been switched to the backup network when the host does not receive the data of the second communication network or the comfort network port in the vehicle. jobs.
  • the first processing module 102 is configured to perform a redundant network handover when the handover is not performed, and when the handover is successful, the control host remains online.
  • the monitoring module 101 is configured to monitor the heartbeat packet status of the backup machine through the active/standby communication network when the data has been switched to the backup machine and the data of the second communication network in the vehicle is still not received.
  • the first processing module 102 is configured to determine, when the backup machine heartbeat packet is normally received, the current backup data of the current backup machine for each network, and perform corresponding processing according to each network data receiving state.
  • the first processing module 102 is configured to not monitor the heartbeat packet of the backup machine within a preset heartbeat period, and the control host keeps the master host communication network host heartbeat packet successfully sent. Online.
  • the requesting module 103 is configured to request the backup machine to be online through the first communication network in the vehicle when the sending is unsuccessful.
  • the first processing module 102 is configured to monitor, when the first communication network in the vehicle receives the response request from the backup machine, the backup machine to receive data status of each network, and perform corresponding processing according to each network data receiving status.
  • FIG. 25 is a schematic structural diagram of a host of a gateway according to a sixth embodiment of the present disclosure. As shown in FIG. 25, the host of the gateway further includes a fifth determining module 108.
  • the fifth determining module 108 is configured to determine, when the host does not receive the second communication network and the inter-vehicle communication network data in the vehicle or the second communication network and the inter-vehicle communication network port in the vehicle, determine the second in the current vehicle. Whether the communication network has been switched to the backup machine to work.
  • the first processing module 102 is configured to perform redundant network switching when not switching, and perform preset processing when the switchable is successful.
  • the monitoring module 101 is configured to monitor the heartbeat packet status of the backup machine through the active/standby communication network when the second communication network data in the vehicle is still not received when the operation has been switched to the backup machine.
  • the first processing module 102 is configured to determine, when the heartbeat packet of the backup machine is received normally, the current backup status of the current backup machine for each network, and perform corresponding processing according to each network data receiving status.
  • the first processing module 102 is configured to not monitor the heartbeat packet of the backup machine within a preset heartbeat period, and when the host heartbeat packet of the active and standby communication network can be successfully sent, the control host is controlled. Stay online.
  • the requesting module 103 is configured to request the backup machine to be online through the first communication network in the vehicle when the sending is unsuccessful.
  • the first processing module 102 is configured to determine, according to the response request of the backup machine, the current backup status of the current backup machine for each network, and perform corresponding processing according to each network data receiving status.
  • FIG. 26 is a schematic structural diagram of a host of a gateway according to a seventh embodiment of the present disclosure. As shown in FIG. 26, the host of the gateway further includes a sixth determining module 109.
  • the sixth determining module 109 is configured to determine, when the host does not receive the first communication network in the vehicle and the second communication network data in the vehicle or the first communication network in the vehicle and the second communication network port in the vehicle. Whether the first communication network in the vehicle and the second communication network in the vehicle have switched to the backup machine to work.
  • the first processing module 102 is configured to perform a redundant network handover when the handover is not performed, and the control host remains online when both networks are successfully switched.
  • the first processing module 102 is configured to perform preset processing when only the first communication network in the vehicle or the second communication network in the vehicle is successfully switched.
  • the monitoring module 101 is configured to monitor, in the current vehicle, the first communication network and the second communication network in the vehicle to switch to the backup network. When the data is still not received, the backup device is monitored by the primary and secondary communication networks.
  • the first processing module 102 is configured to keep the online host when the heartbeat packet of the backup machine is not received.
  • the first processing module 102 is configured to determine, when the heartbeat packet of the backup machine is received normally, the current backup machine for each network data receiving state, and perform corresponding processing according to each network data receiving state. .
  • the monitoring module 101 is configured to monitor a backup machine heartbeat packet receiving state of the primary and backup machine communication networks when all networks cannot receive data.
  • the first processing module 102 is configured to: when the backup heartbeat packet is not detected in the preset heartbeat period, the control host remains online.
  • the first processing module 102 is configured to determine, when the backup machine heartbeat packet is normally received, the current backup machine for each network data receiving state, and perform corresponding processing according to each network data receiving state.
  • the first processing module 102 is configured to: when it is detected that all network data receives an abnormality, the control host remains online; otherwise, the control host stops, and the backup machine is requested to be online through the primary and secondary communication networks.
  • the host of the gateway of the embodiment of the present disclosure optimizes the software implementation strategy on the original network redundancy design architecture.
  • the host can be made.
  • the host and the backup machine of the gateway coordinate work according to different operating states, effectively ensuring that the network can maintain communication normally under abnormal conditions, avoiding network communication abnormalities caused by network failures in the active and standby nodes, and improving the train network. Redundancy effect.
  • the present disclosure also proposes a gateway backup machine.
  • FIG. 27 is a schematic structural diagram of a backup machine of a gateway according to an embodiment of the present disclosure. As shown in FIG. 27, the backup machine of the gateway includes: a seventh determining module 201, a second processing module 202, and a determining module 203.
  • the seventh judging module 201 is configured to: when the backup machine of the gateway is powered on, if the main standby communication network does not monitor the host heartbeat packet within the preset heartbeat period, determine the backup machine heartbeat of the main backup machine communication network. Whether the package can be sent successfully.
  • the second processing module 202 is configured to control the backup machine to remain online when the transmission can be successful.
  • the determining module 203 is configured to: when the sending is unsuccessful, but when the first communication network in the vehicle and the second communication network in the vehicle monitor the host heartbeat packet, or can normally receive the backup machine heartbeat packet, determine the backup request in the host heartbeat packet The machine response status determines the current backup machine status.
  • the gateway backup machine of the embodiment of the present disclosure optimizes the software implementation strategy on the original network redundancy design architecture.
  • the host and the backup machine of the gateway are coordinated according to different operating states, so as to ensure that the network can maintain communication normally under abnormal conditions, avoiding network communication abnormalities caused by network failures in the active and standby nodes, and improving the train.
  • the redundancy effect of the network is not limited to, but not limited to, but not limited to, but not limited to the network.
  • FIG. 28 is a schematic structural diagram of a gateway rotation system for transmitting data based on the CANopen protocol according to an embodiment of the present disclosure, as shown in FIG.
  • the gateway rotation system for transmitting data based on the CANopen protocol includes a host 100 and a backup machine 200 of the gateway, a master-slave communication network 300, and an Ethernet 400.
  • the following example illustrates that in this example, only the second communication network (traction brake network) data in the vehicle is not received:
  • the functional identity of the two primary nodes is a gateway, a host acting as a gateway, and a backup machine acting as a gateway.
  • the backup machine When the host is running normally, the backup machine is in a silent state, that is, in the network. There is only one active master node.
  • the host does not receive the traction brake network data or the traction brake network port failure, the host first determines whether the current traction brake network has switched to the backup network. If the handover is not performed, the redundant network handover is performed. If the handover is successful, the host remains. Online. If the data of the traction brake network is still not received after switching to the backup network, the heartbeat packet status of the backup machine is monitored through the machine communication network.
  • the backup heartbeat packet is not monitored for 500ms in a row, if the host heartbeat packet can be successfully sent on the active/standby communication network, the host remains online. If the transmission is unsuccessful, the host sends the host heartbeat packet 071:02 01 02 through the comfort network, requesting the backup machine to be online. At this time, if the response request from the comfort net backup machine is not received, the host remains online. If the response request 072: **01 00 can be received, the backup machine is monitored for each network data receiving state, and the different states determine which operating state the gateway host and the backup machine are in.
  • the host determines the current backup status of the backup network for each network. Different states determine which operating state the active and standby gateways are in.
  • the backup machine is online and attempts to perform redundant network switching, using the traction brake network to back up network traffic. If the handover is successful, the host stops, and the host sends the host to stop the heartbeat packet 071:02 02 00 through the primary and secondary communication networks. If the handover is unsuccessful, the backup machine switches to the backup machine to switch to the abnromity-2 state, and sends the standby heartbeat packet 072:02 04 04 through the primary and secondary communication networks to request the host abnromity-2 state.
  • the host sends the host heartbeat packet 071:02 01 01 through the master-slave communication network to request the backup machine to be online.
  • the backup machine is online and attempts to perform redundant network switching, using the comfort network to back up network traffic. If the handover is successful, the host stops, and the host sends the host to stop the heartbeat packet 071:02 02 00 through the primary and secondary communication networks. If the handover is unsuccessful, the backup machine switches to the abnromity-3 state, and sends the backup machine heartbeat packet 072:02 05 05 through the primary and secondary communication network, requesting the host abnromity-3 state.
  • the gateway rotation system for transmitting data based on the CANopen protocol performs coordination work according to different operating states of the host and the backup machine of the gateway, thereby effectively ensuring that the network can normally maintain communication under abnormal conditions, thereby avoiding The network communication is abnormal due to a network failure in the active and standby nodes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Environmental & Geological Engineering (AREA)
  • Small-Scale Networks (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本公开公开了一种基于CANopen协议传输数据的网关轮换方法、系统及其装置,方法包括:网关的主机进入在线状态,通过主备机通信网与网关备份机互相监测心跳包状态;如果在预设的心跳周期内监测不到备份机的心跳包,且主机的心跳包在主备机通信网上发送成功,则主机保持在线,记录备份机掉线;若主机的心跳包在主备机通信网上发送失败,则主机通过任意一个车辆内通信网络请求备份机上线;若接收不到备份机的响应请求,则主机停止请求车辆内第一通信网络的备份机上线,通过另一个车辆内通信网络请求备份机上线;若仍然接收不到备份机的响应请求,则主机保持在线,并记录备份机掉线。由此,保证了整车的良好运行,提高了列车网络的冗余效果。

Description

基于CANopen协议传输数据的网关轮换方法、系统及其装置
相关申请的交叉引用
本申请要求比亚迪股份有限公司于2017年06月21日提交的、公开名称为“基于CANopen协议传输数据的网关轮换方法、系统及其装置”的、中国专利申请号“201710475925.5”的优先权。
技术领域
本公开涉及车辆通信技术领域,尤其涉及一种基于CANopen协议传输数据的网关轮换方法、系统及其装置。
背景技术
目前列车通信网络应用比较广泛的是列车通信网络TCN(Train Communication Network,列车通信网络)总线技术,TCN涵盖了MVB(Multifunction Vehicle Bus,多功能车辆总线)、WTB(Wire Train Bus,绞线式列车总线)、以太网、CAN(Controller Area Network,现场总线)这四种总线。在对于MVB、WTB、以太网、CAN这四种总线的设计要求中,一个共同的要求是网络冗余设计。所谓的网络冗余,指的是为每个通信网络都应再设立一个备用网络,即网络上每个节点都会采用A线和B线的双线连接方式,当网络出现故障时,可以通过备用网络实现通信,确保网络上各产品数据交互畅通,使列车通信网络的运行环境具备高可用性。
通常列车通信网络设计如果应用CAN总线进行数据交互,多数情况都会基于CANopen(一种基于CAN总线的高层通信协议,是目前工业控制常用的一种现场总线)设计,CANopen的定义是基于CAN总线设计的标准化应用层协议,CANopen协议为传统CAN支援了一套完善的网络管理机制,以支撑冗余网络设计。目前基于CANopen的冗余网络设计都是要求网络中设立两个网关,一个网管的主机,一个作为网关的备份机,网关的主机正常运行时,备份机处于静默状态,即网络中只有一个活动主节点。主机和备份机之间的切换是依靠判断主机的心跳包有没有掉线来实现的,当主机检测到自身网络有问题时,停止发送主机心跳包。备份机接收不到网关的主机的心跳包时开始工作。
发明内容
本公开的目的旨在至少在一定程度上解决上述的技术问题之一。
为此,本公开的第一个目的在于提出一种基于CANopen协议传输数据的网关轮换方法,该方法中根据网关的主机和备份机的不同的运行状态进行协调工作,有效保证网络在异常状态下还能正常保持通信,避免因主备节点中都有网络故障而导致的网络通信异常问题。
本公开的第二个目的在于提出另一种基于CANopen协议传输数据的网关轮换方法。
本公开的第三个目的在于提出一种网关的主机。
本公开的第四个目的在于提出一种网关的备份机。
本公开的第五个目的在于提出一种基于CANopen协议传输数据的网关轮换系统。
本公开的第六个目的在于提出一种计算机设备。
本公开的第七个目的在于提出另一种计算机设备。
本公开的第八个目的在于提出一种存储介质。
本公开的第九个目的在于提出另一种存储介质。
为了实现上述目的,本公开第一方面实施例提出的一种基于CANopen协议传输数据的网关轮换方法,包括以下步骤:网关的主机上电运行进入在线状态,并通过主备机通信网与网关备份机互相监测心跳包状态;如果在预设的心跳周期内监测不到所述备份机的心跳包,且所述主机的心跳包在所述主备机通信网上发送成功,则所述主机保持在线,记录所述备份机掉线;若所述主机的心跳包在所述主备机通信网上发送失败,则所述主机通过任意一个车辆内通信网络请求所述备份机上线;若在所述车辆内第一通信网络接收不到所述备份机的响应请求,则所述主机停止请求车辆内第一通信网络的备份机上线,同时通过另一个车辆内通信网络请求所述备份机上线;若在所述车辆内第二通信网络仍然接收不到所述备份机的响应请求,则所述主机保持在线,并记录所述备份机掉线。
为了实现上述目的,本公开第二方面实施例提出的另一种基于CANopen协议传输数据的网关轮换方法,包括以下步骤:网关的备份机上电处于停止状态,如果主备机通信网上在预设心跳周期内监测不到主机心跳包,则判断所述主备机通信网上的备份机心跳包能否发送成功;若能发送成功,则所述备份机保持在线;若发送不成功,但在车辆内第一通信网络和车辆内第二通信网络监测到主机心跳包,或能正常接收到备份机心跳包,则判断主机心跳包中请求备份机响应状态确定当前备份机状态。
为了实现上述目的,本公开第三方面实施例提出的一种网关的主机,包括:监测模块,用于在网关的主机上电运行进入在线状态时,通过主备机通信网与网关备份机互相监测心跳包状态;第一处理模块,用于在预设的心跳周期内监测不到所述备份机的心跳包,且主机的心跳包在所述主备机通信网上发送成功时,保持在线,记录所述备份机掉线;请求模块,用于在所述主机的心跳包在所述主备机通信网上发送失败时,通过任意一个车辆内通 信网络请求所述备份机上线;所述请求模块,还用于在所述车辆内第一通信网络接收不到所述备份机的响应请求时,停止请求车辆内第一通信网络的备份机上线,同时通过另一个车辆内通信网络请求所述备份机上线;所述第一处理模块,还用于在所述车辆内第二通信网络仍然接收不到所述备份机的响应请求时,保持在线,并记录所述备份机掉线。
为了实现上述目的,本公开第四方面实施例提出的网关的备份机,包括:第七判断模块,用于在网关的备份机上电处于停止状态时,如果主备机通信网上在预设心跳周期内监测不到主机心跳包,判断所述主备机通信网上的备份机心跳包能否发送成功;第二处理模块,用于在能发送成功时,控制所述备份机保持在线;确定模块,用于在发送不成功,但在车辆内第一通信网络和车辆内第二通信网络监测到主机心跳包,或能正常接收到备份机心跳包时,判断主机心跳包中请求备份机响应状态确定当前备份机状态。
为了实现上述目的,本公开第五方面实施例提出的基于CANopen协议传输数据的网关轮换系统,包括:本公开第三方面实施例所述的网关的主机,本公开第四方面实施例所述的网关的备份机,主备机通信网和车辆间通信网络。
为了实现上述目的,本公开第六方面实施例提出的一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,所述处理器执行所述计算机程序时实现本公开第一方面实施例所述的基于CANopen协议传输数据的网关轮换方法。
为了实现上述目的,本公开第七方面实施例提出的一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,所述处理器执行所述计算机程序时实现本公开第二方面实施例所述的基于CANopen协议传输数据的网关轮换方法。
为了实现上述目的,本公开第八方面实施例提出的一种存储介质,用于存储应用程序,所述应用程序用于执行如本公开第一方面实施例所述的基于CANopen协议传输数据的网关轮换方法。
为了实现上述目的,本公开第九方面实施例提出的一种存储介质,用于存储应用程序,所述应用程序用于执行如本公开第二方面实施例所述的基于CANopen协议传输数据的网关轮换方法。
本公开实施例提供的技术方案,具有如下有益技术效果:
根据网关的主机和备份机的不同的运行状态进行协调工作,有效保证网络在异常状态下还能正常保持通信,避免因主备节点中都有网络故障而导致的网络通信异常问题。
本公开附加的方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本公开的实践了解到。
附图说明
本公开上述的和/或附加的方面和优点从下面结合附图对实施例的描述中将变得明显和容易理解,其中:
图1是根据本公开一个实施例的列车网络的架构示意图;
图2是根据本公开第一个实施例的基于CANopen协议传输数据的网关轮换方法的流程图;
图3是根据本公开一个实施例的所有的网络通信正常的处理流程图;
图4是根据本公开第二个实施例的基于CANopen协议传输数据的网关轮换方法的流程图;
图5(a)是根据本公开一个实施例的只接收不到以太网数据处理流程图;
图5(b)是根据本公开一个实施例的图5(a)中分支A的处理流程图;
图6是根据本公开第三个实施例的基于CANopen协议传输数据的网关轮换方法的流程图;
图7(a)是根据本公开一个实施例的只接收不到牵引制动数据处理流程图;
图7(b)是根据本公开一个实施例的图7(a)中分支A的处理流程图;
图8是根据本公开第四个实施例的基于CANopen协议传输数据的网关轮换方法的流程图;
图9(a)根据本公开一个实施例的接收不到以太网和牵引制动数据处理流程图;
图9(b)是根据本公开一个实施例的图9(a)中分支A的处理流程图;
图10是根据本公开第五个实施例的基于CANopen协议传输数据的网关轮换方法的流程图;
图11(a)是根据本公开一个实施例的只接收不到舒适网数据处理流程图;
图11(b)是根据本公开一个实施例的图11(a)中分支A的处理流程图;
图11(c)是根据本公开一个实施例的图11(a)中分支B的处理流程图;
图12是根据本公开第六个实施例的基于CANopen协议传输数据的网关轮换方法的流程图;
图13(a)是根据本公开一个实施例的接收不到以太网和舒适网数据处理流程图;
图13(b)是根据本公开一个实施例的图13(a)中分支A的处理流程图;
图13(c)是根据本公开一个实施例的图13(a)中分支B的处理流程图;
图14是根据本公开第七个实施例的基于CANopen协议传输数据的网关轮换方法的流程图;
图15(a)是根据本公开一个实施例的接收不到牵引制动网和舒适网数据处理流程图;
图15(b)是根据本公开一个实施例的图15(a)中分支A的处理流程图;
图15(c)是根据本公开一个实施例的图15(a)中分支B的处理流程图;
图16是根据本公开第八个实施例的基于CANopen协议传输数据的网关轮换方法的流程图;
图17是根据本公开一个实施例的所有数据都接收不到的数据处理流程图;
图18是根据本公开第九个实施例的基于CANopen协议传输数据的网关轮换方法的流程图;
图19是根据本公开一个实施例的备份机的运行策略流程图;
图20是根据本公开第一个实施例的网关的主机的结构示意图;
图21是根据本公开第二个实施例的网关的主机的结构示意图;
图22是根据本公开第三个实施例的网关的主机的结构示意图;
图23是根据本公开第四个实施例的网关的主机的结构示意图;
图24是根据本公开第五个实施例的网关的主机的结构示意图;
图25是根据本公开第六个实施例的网关的主机的结构示意图;
图26是根据本公开第七个实施例的网关的主机的结构示意图;
图27是根据本公开一个实施例的网关的备份机的结构示意图;以及
图28是根据本公开一个实施例的基于CANopen协议传输数据的网关轮换系统的结构示意图。
具体实施方式
下面详细描述本公开的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,旨在用于解释本公开,而不能理解为对本公开的限制。
下面参考附图描述本公开实施例的基于CANopen协议传输数据的网关轮换方法、系统及其装置。
可以理解的是,现有技术策略是网络中设立网关的主机和备份机,所有网络数据同时在主机和备份机都发送数据,但是网络中只有一个活动主节点,即主机正常运行时,备份机处于静默状态。主机和备份机之间的切换仅是依靠判断主机的心跳包有没有掉线来实现的,当主机检测到自身网络有问题时,停止发送主机心跳包。备份机接收不到主机心跳包时开始工作。
然而,这个方案只适用于网络中有一个主节点自身网络有异常的情况,通过网管的主 机切换至网关的备份机来维持网络正常通信。这个方案存在很大的缺陷,没有考虑到当网管的主机和备份机都存在网络异常问题的情况,存在一定的局限性。如附图1,当网关的主机舒适网有问题,备份机的牵引制动网有问题,如果只是单纯靠主机和备份机的切换,而主机和备份机只能有一个工作,这样是无法维持网络正常通信的,这将导致整车的运行受阻,冗余效果就大打折扣,没有体现出冗余主旨意义。
本公开为解决现有技术中网关的主机和备份机中均有网络异常而无法正常通信的技术问题,在现有列车网络冗余设计结构的基础上,提供一种列车主机轮换机制的设计方案,要求网关的主机和备份机根据不同的运行状态进行协调工作,有效保证网络在异常的情况下还能保持正常通信,从而可有效避免网关的主机和备份机中都有网络故障而导致网络通信异常问题,同时也提升了冗余设计的实际效果,很好地规避了一些车辆网络故障导致整车运行受阻的问题,能保证在一些异常情况下,网络各个节点依然可以正常通信。
其中,需要强调的是,本公开的列车网络数据传输方法是基于CANopen协议执行的,其中,CANopen协议要求网络中有一个节点充当活动主节点的角色,以管理其他从节点的初始化、启动、监管、复位或停止等工作。
为了更加清楚的对本公开的基于CANopen协议传输数据的网关轮换方法进行说明,下面结合具体实施例,集中在该方法应用在网关的主机侧进行描述,在以下实施例中,alive表示在线状态,stop表示停止,说明如下:
图2是根据本公开第一个实施例的基于CANopen协议传输数据的网关轮换方法的流程图,如图2所示,该方法包括:
S101,网关的主机上电运行进入在线状态,并通过主备机通信网与网关的备份机互相监测心跳包状态。
需要说明的是,本公开实施例中涉及的网关的主机的各种运行状态的,可以参照下表1所示的表格,网关的备份机的各种运行状态,可以参照下表2所示的表格,网关的主机和备份机的运行状态,参照表3所示的表格,在以下实施例中,对网关的主机和备份机的运行状态的表述,均可参照表1-表3表示出的信息。
表1
Figure PCTCN2018092049-appb-000001
Figure PCTCN2018092049-appb-000002
Figure PCTCN2018092049-appb-000003
表2
Figure PCTCN2018092049-appb-000004
Figure PCTCN2018092049-appb-000005
表3
Figure PCTCN2018092049-appb-000006
Figure PCTCN2018092049-appb-000007
Figure PCTCN2018092049-appb-000008
Figure PCTCN2018092049-appb-000009
具体地,如果网关的主机上电运行进入在线状态,即表3中表述的alive状态,则主备机通信网和网关的备份机互相监测心跳包状态,不管能不能接收到备份机的心跳包,都会保持alive状态。
S102,如果在预设的心跳周期内监测不到备份机的心跳包,且主机的心跳包在主备机 通信网上发送成功,则主机保持在线,记录备份机掉线。
S103,若主机的心跳包在主备机通信网上发送失败,则主机通过任意一个车辆内通信网络请求备份机上线。
S104,若在车辆内第一通信网络接收不到备份机的响应请求,则主机停止请求车辆内第一通信网络的备份机上线,同时通过另一个车辆内通信网络请求备份机上线。
S105,若在车辆内第二通信网络仍然接收不到备份机的响应请求,则主机保持在线,并记录备份机掉线。
其中,预设的心跳周期可根据具体应用场景的需求进行标定,在此不做限制。
需要强调的是,本公开实施例中的车辆内通信网络可以包括车辆内第一通信网络和车辆内第二通信网络,其中,第一车辆内通信网络可以是牵引制动网等,第二通信网络可以是舒适网等,为了说明的方便,在本公开实施例中,主要以第一车辆内通信网络是牵引制动网等,第二通信网络是舒适网进行说明。
具体地,如果在预设的心跳周期内监测不到备份机的心跳包,且主机的心跳包在主备机通信网上发送成功,则主机保持在线,记录备份机掉线。若主备机通信网上的主机心跳包发送不成功,则主机通过牵引制动网请求备份机上线,若在牵引制动网接收不到备份机响应请求,主机将停止请求牵引制动网的备份机上线,同时通过舒适网请求备份机上线,若在舒适网也接收不到备份机响应请求,则主机保持alive,记录备份机掉线。
举例而言,如图3所示,当预设的心跳周期是500ms时,如果主备机通信网上连续500ms监测不到备份机心跳包,若主备机通信网上的主机心跳包发送成功,则主机保持alive(在线),记录备份机掉线。若主备机通信网上的主机心跳包发送不成功,则主机通过牵引制动网请求备份机上线,若在牵引制动网接收不到备份机响应请求,主机将停止请求牵引制动网的备份机上线,同时通过舒适网请求备份机上线,若在舒适网也接收不到备份机响应请求,则主机保持alive,记录备份机掉线。
综上所述,本公开实施例的基于CANopen协议传输数据的网关轮换方法,网关的主机上电运行进入在线状态,并通过主备机通信网监测网关和备份机互相监测心跳包状态,如果在预设的心跳周期内监测不到备份机的心跳包,且主机的心跳包在主备机通信网上发送成功,则主机保持在线,记录备份机掉线,若主机的心跳包在主备机通信网上发送失败,则主机通过任意一个车辆内通信网络请求备份机上线,若在车辆内第一通信网络接收不到备份机的响应请求,则主机停止请求车辆内第一通信网络内的备份机上线,同时通过另一个车辆内通信网络请求备份机上线,若在第二车辆内通信网络仍然接收不到备份机的响应请求,则主机保持在线,并记录备份机掉线。由此,根据网关的主机和备份机的不同的运行状态进行协调工作,有效保证网络在异常状态下还能正常保持通信,避免因主备节点中 都有网络故障而导致的网络通信异常问题。
应当理解的是,上述实施例仅仅是一种车辆内通信网络和车辆间通信网络均通信正常(071 byte1=00)的场景,在实际应用中,还具有各种各样的场景,为了更加清楚的描述本公开实施例中的基于CANopen协议传输数据的网关轮换方法,下面集合多种不同的场景下的实施过程进行描述。
需要强调的是,正如以上提到的,本公开实施例中的车辆内通信网络可以包括车辆内第一通信网络和车辆内第二通信网络,其中,第一车辆内通信网络可以是牵引制动网等,第二通信网络可以是舒适网等,车辆内通信网络可以是以太网,为了说明的方便,在本公开实施例中,主要以第一车辆内通信网络是牵引制动网等,第二通信网络是舒适网,车辆内通信网络是以太网进行说明。
场景一,只接收不到车辆内通信网络(以太网)数据(071 byte1=01):
图4是根据本公开第二个实施例的基于CANopen协议传输数据的网关轮换方法的流程图,如图4所示,该方法还包括:
S201,当主机接收不到车辆内通信网络数据或车辆内通信网络端口故障时,通过主备机通信网监测备份机的心跳包状态。
在本公开的一个实施例中,如果正常接收到备份机的心跳包,则主机判断备份机当前对各个网络数据接收状态,并根据接收状态进行相应的处理。
在本实施例中,若监测到3个网络数据接收都正常,则主机停止,主机通过主备机通信网请求备份机在线,若监测到车厢外部网络数据接收异常,主机都保持在线,若只监测到牵引制动网接收数据异常,主机通过主备机通信网请求备份机在线。备份机在线,并尝试执行冗余网络切换,若切换成功,则主机停止,主机通过主备机通信网请求备份机在线。若切换不成功,备份机切换至abnromity-2状态,并通过主备机通信网请求主机abnromity-2状态。
若只监测到舒适网接收数据异常,主机停止,备份机在线,并尝试执行冗余网络切换。若切换成功,则主机停止,主机通过主备机通信网请求备份机在线。若切换不成功,则备份机切换至abnromity-1状态,并通过主备机通信网请求主机abnromity-1状态。若监测到牵引制动网和舒适网数据接收都异常,备份机在线,并尝试执行冗余网络切换,通过判断两组备份网络是否切换成功,判断当前主备网关状态。
进而,若切换成功,主机停止,主机通过主备网络请求备份机在线。若切换不成功,则相继判断牵引制动网和舒适网是否切换成功。若牵引制动网切换成功,备份机切换至abnromity-1状态,并通过主备机通信网请求主机abnromity-1状态。若舒适网切换成功,则备份机切换至abnromity-2状态,并通过主备机通信网请求主机abnromity-2状态。若两个 网络都切换不成功,则主机保持在线,通过主备机通信网请求备份机停止。
S202,如果在预设的心跳周期内监测不到备份机的心跳包,则判断主机的心跳包在主备机通信网上能否发送成功。
具体地,当主机接收不到以太网数据或以太网端口故障时,通过主备机通信网监测备份机网关心跳包状态,比如,如果连续500ms监测不到网关的备份机的心跳包,则判断主备机通信网上主机的心跳包能否发送成功。S203,若发送成功,则主机保持在线状态,记录备份机掉线。
S204,若发送失败,则主机通过车辆内第二通信网络请求备份机保持在线。
具体地,若发送成功,则主机保持在线,记录备份机掉线。若发送不成功,则主机通过舒适网请求备份机在线。此时若在舒适网上收到备份机响应在线请求,则判断当前网关的备份机对于各个网络数据接收状态。
S205,若在车辆内第二通信网络上收到备份机的响应请求,则判断备份机当前对各个网络数据接收状态,并根据接收状态进行相应的处理。
在本示例中,若3个网络数据接收正常,则主机停止,主机通过牵引制动网发送主机停止心跳包,若只监测到车厢外部网数据接收异常,则主机保持在线,通过牵引制动网请求备份机停止,若只监测到舒适网数据接收异常,则备份机在线,并尝试执行冗余网络切换,使用舒适网备份网络通信。若切换成功,主机停止,则主机通过主备份机网络发送主机停止心跳包。若切换不成功,则备份机切换至如表3所示的abnromity-1状态,并通过牵引制动网请求主机abnromity-1状态。若监测到车厢外部网和舒适网数据接收都异常,则主机保持在线,通过牵引制动网请求备份机停止。
S206,若在车辆内第二通信网络上接收不到备份机的响应请求,则主机停止请求车辆内第一通信网络的备份机在线,进而通过车辆内第二通信网络请求备份机在线。
S207,若接收不到备份机的响应请求,则主机保持在线,并通过车辆内第二通信网络请求备份机停止。
S208,若接收到备份机的响应请求,则判断备份机当前对各个网络数据的接收状态,并根据接收状态进行相应的处理。
若在舒适网上接收不到备份机响应在线请求,则主机停止请求牵引制动网备份机在线,而通过舒适网请求备份机在线。若接收不到备份机响应在线请求,则主机保持在线,并通过舒适网请求备份机停止。若接收到备份机响应在线请求,则判断当前网关的备份机对于各个网络数据接收状态。
在本示例中,若3个网络数据接收都正常,则主机stop,主机通过舒适网发送主机停止心跳包,若只监测到车厢外部网数据接收异常,则主机保持子线,通过舒适网请求备份 机停止,若只监测到牵引制动网数据接收异常,则备份机在线,并尝试执行冗余网络切换,使用牵引制动网。若切换成功,主机停止,则主机通过舒适网发送主机停止心跳包。若切换不成功,则备份机切换至abnromity-2状态,并通过舒适网请求主机abnromity-2状态。若监测到车厢外部网和牵引制动网数据接收异常,则主机保持在线,通过舒适网请求备份机停止。
其中,为了使得本领域的技术人员更加清楚的了解在场景1中的实施例流程,可以结合图5(a)和图5(b)所示的只接收不到以太网数据处理流程图,其中,图5(b)为图5(a)中所示出的分支A的流程图。
场景2,只接收不到车辆内第一通信网络(牵引制动网数据)(071 byte1=02):
图6是根据本公开第三个实施例的基于CANopen协议传输数据的网关轮换方法的流程图,如图6所示,该方法还包括:
S301,当主机接收不到车辆内第一通信网络数据或车辆内第一通信网络端口故障时,主机判断当前车辆内第一通信网络是否已切换到备份机上工作。
具体地,当网关的主机接收不到牵引制动网数据或牵引制动网端口故障时,网关的主机首先判断当前牵引制动网是否已切换到备份网络工作。
S302,若没有切换则执行冗余网络切换,若切换成功,则主机保持在线。
S303,若已切换到备份机工作,且仍然接收不到车辆内第一通信网络的数据,则通过主备机通信网监测备份机的心跳包状态。
具体地,如果未切换则执行冗余网络切换,若切换成功,网关的主机保持在线。若已切换到备份网络工作,依然接收不到牵引制动网的数据,则通过主备机通信网监测网关的备份机的心跳包状态。
S304,如果正常接收到备份机的心跳包,则主机判断当前备份机对各个网络数据接收状态,并根据各个网络数据接收状态进行相应的处理。
具体地,如果正常接收到备份机的心跳包,则主机会判断当前备份机对于各个网络数据接收状态,不同状态决定网关的主机和备份机处于哪一种运行状态。
举例而言,在本示例中,如果连续500ms监测不到备份机的心跳包,若主机心跳包在主备机通信网上能发送成功,则主机保持在线状态。若发送不成功,则主机通过舒适网发送主机心跳包071:02 01 02,请求备份机在线。此时若接收不到舒适网备份机的响应请求,主机保持在线。若能接收到响应请求072:**01 00,则监测网关的备份机对于各个网络数据接收状态,不同状态决定网关的主机和备份机处于哪一种运行状态。
其中,(1)若监测到3个网络数据接收正常,主机停止,主机通过主备机通信网请求备份机在线。
(2)若只监测到车厢外部网数据接收异常,主机切换至abnormity-8状态。
(3)若只监测到牵引制动网数据异常,主机停止,主机通过主备机通信网请求备份机在线,备份机在线,并尝试执行冗余网络切换,使用牵引制动网备份网络通信。若切换成功,主机停止,主机通过主备机通信网发送主机停止心跳包。若切换不成功,备份机切换至备份机切换至abnromity-2状态,并通过主备机通信网请求主机abnromity-2状态。
(4)若监测到车厢外部网和牵引制动网络或舒适网和牵引制动网数据接收都异常,主机都保持在线。
(5)若只监测到舒适网数据接收异常,主机通过主备机通信网请求备份机在线,备份机在线,并尝试执行冗余网络切换,使用舒适网备份网络通信。若切换成功,主机停止,主机通过主备机通信网发送主机停止心跳包。若切换不成功,备份机切换至abnromity-3状态,并通过主备机通信网请求主机abnromity-3状态。
(6)若监测到车厢外部网和舒适网数据接收异常,主机切换至abnromity-4状态,并通过主备机通信网请求备份机abnromity-4状态。
(7)若监测到三个网络数据接收都异常,主机保持在线。
S305,如果在预设的心跳周期内监测不到备份机的心跳包,若在主备机通信网上的主机心跳包能发送成功,则主机保持在线。
S306,若在主备机通信网上的主机心跳包能发送失败,则主机通过车辆内第二通信网络请求备份机在线。
S307,若接收不到车辆内第二通信网络的备份机的响应请求,主机保持在线。
S308,若在车辆内第二通信网络能接收到备份机的响应请求,则监测备份机对于各个网络数据接收状态,并根据各个网络数据接收状态进行相应的处理。
具体地,如果连续500ms监测不到备份机的心跳包,若主备机通信网上的主机心跳包能发送成功,则主机保持在线状态。若发送不成功,则主机通过舒适网请求备份机在线,此时若接收不到舒适网备份机的响应请求,主机保持在线。若在舒适网接能接收到备份机响应请求,则监测网关的备份机对于各个网络数据接收状态,不同状态决定主备网关处于哪一种运行状态。
其中,(1)若监测到3个网络数据接收都正常,则主机停止,主机通过舒适网发送主机停止心跳包。
(2)若只监测到车厢外部网数据接收异常,主机切换至abnormity-8状态,并通过舒适网请求备份机进入abnormity-8状态。
(3)若只监测到牵引制动网数据接收异常,则备份机在线,并尝试执行冗余网络切换,使用牵引制动网备份网络通信。若切换成功,主机停止,主机通过舒适网发送主机停止心 跳包。若切换不成功,备份机切换至abnormity-2状态,并通过舒适网请求主机进入abnormity-2状态。
(4)若监测到车厢外部网和牵引制动网数据接收异常,则主机保持在线,主机通过舒适网请求备份机停止。
其中,为了使得本领域的技术人员更加清楚的了解在场景2中的实施例流程,可以结合图7(a)和图7(b)所示的只接收不到牵引制动数据处理流程图,其中,图7(b)为图7(a)中所示出的分支A的流程图。
场景3,接收不到车辆间通信网络(以太网)和车辆内第一通信网络(牵引制动网)数据(071 byte1=03):
图8是根据本公开第四个实施例的基于CANopen协议传输数据的网关轮换方法的流程图,如图8所示,该方法还包括:
S401,当主机同时接收不到车辆内第一通信网络和车辆间通信网络的数据或车辆内第一通信网络和车辆间通信网络端口故障时,主机判断当前车辆内第一通信网络是否已切换到备份网络工作,未切换则执行冗余网络切换,若可切换成功则进行预设的处理。
S402,若已切换到备份机工作,依然收不到车辆内第一通信网络的数据,则通过主备机通信网监测备份机的心跳包状态。
具体地,当网关的主机和备份机同时接收不到牵引制动网和以太网的数据或牵引制动网和以太网端口故障时,网关的主机首先判断当前牵引制动网是否已切换到备份网络工作,未切换则执行冗余网络切换,若可切换成功,进入图9(b)的处理过程;若已切换到备份网络工作,依然收不到牵引制动网的数据,则通过主备机通信网监测网关的备份机的心跳包状态。
S403,如果正常接收到备份机的心跳包,则主机判断当前备份机对于各个网络数据接收状态,并根据各个网络数据接收状态进行相应的处理。
具体地,如果正常接收到网关的备份机的心跳包,则网关的主机会判断当前备份机对于各个网络数据接收状态,不同状态决定网关的主机与网关的备份机处于哪一种运行状态。
其中,(1)若监测到3个网络数据接收正常,或只监测到车厢外部网或牵引制动网数据接收异常,主机停止,主机通过主备机通信网请求备份机在线。
(2)若监测到车厢外部网和牵引制动网数据接收异常,或监测到3个网络数据接收都异常,主机保持在线。
(3)若只监测到舒适网数据接收异常,则主机通过主备机通信网请求备份机在线,备份机在线,并尝试执行冗余网络切换,使用舒适网备份网络通信。若切换成功,主机停止,主机通过主备机通信网发送主机停止心跳包。若切换不成功,备份机切换至abnormity-5状 态,并通过主备机通信网请求主机进入abnormity-5状态。
(4)若监测到车厢外部网和舒适网数据接收异常,主机切换至abnormity-6状态,并通过主备机通信网请求备份机进入abnormity-6状态。
(5)若监测到牵引制动网和舒适网数据接收异常,主机切换至abnormity-7状态,并通过主备机通信网请求备份机进入abnormity-7状态。
S404,若在预设的心跳周期内监测不到备份机的心跳包,且主备机通信网上主机心跳包能发送成功,则主机保持在线,若发送不成功,主机通过车辆内第二通信网络请求备份机在线。
S405,若接收不到备份机的响应请求,则主机保持在线。
S406,若能接收到备份机的响应请求,则监测备份机对于各个网络数据接收状态,并根据各个网络数据接收状态进行相应的处理。
在本公开的实施例中,举例而言,如果连续500ms监测不到备份机的心跳包,此时若主备机通信网上主机的心跳包能发送成功,主机保持在线。若发送不成功,主机通过舒适网请求备份机在线,此时若接收不到备份机响应请求,主机保持在线。若能接收到备份机响应请求,则监测备份机对于各个网络数据接收状态。
其中,(1)若监测到3个网络数据接收状态都正常,则主机在线,主机通过舒适网发送主机的在线心跳包。
(2)若只监测到车厢外部网数据接收异常,则主机保持在线,主机通过舒适网请求备份机停止。
(3)若只监测到牵引制动网数据接收异常,则主机停止,主机通过舒适网发送主机停止心跳包,备份机保持在线,并尝试执行冗余网络切换,使用牵引备份网络通信。
(4)若监测到车厢外部网和牵引制动网数据接收异常,主机保持在线,主机通过舒适网请求备份机停止。
其中,为了使得本领域的技术人员更加清楚的了解在场景3中的实施例流程,可以结合图9(a)和图9(b)所示的接收不到以太网和牵引制动数据处理流程图,其中,图9(b)为图9(a)中所示出的分支A的流程图。
场景4,只接收不到车辆内第二通信网络(舒适网)数据(071 byte1=04):
图10是根据本公开第五个实施例的基于CANopen协议传输数据的网关轮换方法的流程图,如图10所示,该方法还包括:
S501,当主机接收不到车辆内第二通信网络的数据或车辆内第二通信网络端口故障时,主机判断当前车辆内第二通信网络是否已切换到备份网络工作,未切换则执行冗余网络切换,若切换成功,则主机保持在线。
S502,若已切换到备份机工作,依然接收不到车辆内第二通信网络的数据,则通过主备机通信网监测备份机的心跳包状态。
S503,如果正常接收到备份机心跳包,则主机判断当前备份机对于各个网络数据接收状态,并根据各个网络数据接收状态进行相应的处理。
在本实施例中,当网关的主机接收不到舒适网的数据或舒适网端口故障时,网关的主机首先判断当前舒适网是否已切换到备份网络工作,未切换则执行冗余网络切换,若可切换成功,则网关的主机保持在线状态;若已切换到备份网络工作,依然接收不到舒适网的数据,则通过主备机通信网监测备份机的心跳包状态。
如果正常接收到备份机的心跳包,则主机会判断当前备份机对于各个网络数据接收状态,不同状态决定网关的主备机处于哪一种运行状态。
其中,(1)若监测到3个网络数据接收都正常,则主机停止,主机通过主备机通信网请求备份机在线。
(2)若只监测到车厢外部网数据接收异常,则主机切换至abnormity-9状态,并通过主备机通信网请求备机进入abnormity-9状态。
(3)若只监测到牵引制动网数据接收异常,则主机切换至abnormity-10状态,并通过主备机通信网请求备机进入abnormity-10状态。
(4)若监测到车厢外部网和牵引制动网数据接收异常,主机切换至abnormity-11状态,并通过主备机通信网请求备机进入abnormity-11状态。
(5)若只监测到舒适网数据接收异常,则主机停止,主机通过主备份机网络请求备份机在线,备份机在线,并尝试执行冗余网络切换。若切换成功,主机通过主备机通信网发送主机停止心跳包,主机停止。若切换不成功,备份机切换至停止状态,并通过主备机通信网发送备份机停止心跳包。
(6)若监测到车厢外部网和舒适网或牵引制动网和舒适网或3个网络数据接收都异常,则主机保持在线。
S504,若在预设的心跳周期内监测不到备份机的心跳包,且主备机通信网上主机心跳包能发送成功,则主机保持在线。
S505,若发送不成功,则主机通过车辆内第一通信网络请求备份机在线。
S506,若在车辆内第一通信网络接收到备份机的响应请求,则监测备份机对于各个网络数据接收状态,并根据各个网络数据接收状态进行相应的处理。
在本实施例中,如果连续500ms监测不到备份机的心跳包,此时若主备机通信网上主机心跳包能发送成功,主机保持alive。若发送不成功,主机通过牵引制动网请求备份机在线,若在牵引制动网接收到备份机响应在线请求,则监测网关的备份机对于各个网络数据 接收状态。
其中,(1)若监测到3个网络数据接收都正常,则主机停止,主机通过舒适网发送主机停止心跳包。
(2)若只监测到车厢外部网数据接收异常,主机切换至abnormity-9状态,并通过牵引制动网请求备份机进入abnormity-9状态。
(3)若只监测到舒适网数据接收异常,主机通过舒适网发送主机停止,同时判断舒适备份网络是否切换成功,若切换成功,主机停止,主机通过牵引制动网发送主机的停止心跳包。若切换不成功,备份机切换至停止状态,并通过牵引制动网请求主机在线状态。
(4)若监测到车厢外部网和舒适网数据接收异常,主机保持在线,主机通过舒适网请求备份机停止。
由此,针对现有技术中,网关的主机和备份机之间的切换仅是依靠判断网关的主机的心跳包有没有掉线来实现的,当网关的主机检测到自身网络有问题时,停止发送主机心跳包。备份机接收不到网关的主机的心跳包时开始工作。但如果网关的主机和备份机都存在网络有异常的情况,单纯的主备网关切换很难维持网络正常通信的,从而影响整车运行。
其中,为了使得本领域的技术人员更加清楚的了解在场景4中的实施例流程,可以结合图11(a)、图11(b)和图11(c)所示的只接收不到舒适网数据处理流程图,其中,图11(b)为图11(a)中所示出的分支A的流程图,图11(c)为图11(a)中所示出的分支B的流程图。
场景5,接收不到车辆间通信网络(以太网)和车辆内第二通信网络(舒适网)数据(071 byte1=05):
图12是根据本公开第六个实施例的基于CANopen协议传输数据的网关轮换方法的流程图,如图12所示,该方法还包括:
S601,当主机同时接收不到车辆内第二通信网络和车辆间通信网络数据或车辆内第二通信网络和车辆间通信网络端口故障时,主机判断当前车辆内第二通信网络是否已切换至备份机工作,未切换则执行冗余网络切换,若可切换成功则进行预设的处理。
S602,若已切换至备份机工作,仍然接收不到车辆内第二通信网络数据,则通过主备机通信网监测备份机的心跳包状态。
S603,如果正常接收到备份机的心跳包,则主机判断当前备份机对于各个网络数据接收状态,并根据各个网络数据接收状态进行相应的处理。
具体地,在本实施例中,当网关的主机同时接收不到舒适网和以太网数据或舒适网和以太网端口故障时,网关的主机首先判断当前舒适网是否已切换至备份网络工作,未切换则执行冗余网络切换,若可切换成功,则进入图13(b)或图13(c)图所示的处理过程, 若已切换至备份网络工作,依然接收不到舒适网数据,则通过主备机通信网监测网关的备份机的心跳包状态。
如果正常接收到备网关的备份机心跳包,则网关的主机会判断当前网关的备份机对于各个网络数据接收状态,不同状态决定网关的主机和备份机处于哪一种运行状态。
S604,若在预设的心跳周期内监测不到备份机的心跳包,且主备机通信网上的主机心跳包能发送成功,则主机保持在线。
S605,若发送不成功,则主机通过车辆内第一通信网络请求备份机在线。
S606,若能接收到备份机的响应请求,则主机判断当前备份机对于各个网络数据接收状态,并根据各个网络数据接收状态进行相应的处理。
举例而言,如果连续500ms监测不到备份机的心跳包,此时若主备机通信网上主机心跳包能发送成功,则主机保持在线状态。若发送不成功,则主机通过牵引制动网请求备份机在线。若能接收到备份机响应在线请求,则网关的主机监测网关的备份机的各个网络状态。
其中,(1)若监测到3个网关或只监测到车厢外部网数据接收异常,则主机停止,主机通过牵引制动网发送主机停止心跳包。
(2)若只监测到舒适网数据接收异常,则主机停止,主机通过牵引制动网发送主机停止心跳包,备份机保持在线,并尝试执行冗余网络切换,使用舒适网备份网络通信。
(3)若监测到车厢外部网和舒适网数据接收异常,则主机保持在线,主机通过牵引制动网请求备份机停止。
其中,为了使得本领域的技术人员更加清楚的了解在场景5中的实施例流程,可以结合图13(a)、图13(b)和图13(c)所示的接收不到以太网和舒适网数据处理流程图,其中,图13(b)为图13(a)中所示出的分支A的流程图,图13(c)为图13(a)中所示出的分支B的流程图。
场景6,接收不到车辆内第一通信网络(牵引制动网)和车辆内第二通信网络(舒适网)数据(071 byte1=06):
图14是根据本公开第七个实施例的基于CANopen协议传输数据的网关轮换方法的流程图,如图14所示,该方法还包括:
S701,当主机同时接收不到车辆内第一通信网络和车辆内第二通信网络数据或车辆内第一通信网络和车辆内第二通信网络端口故障时,主机分别判断当前车辆内第一通信网络与车辆内第二通信网络是否已切换至备份机工作,未切换则执行冗余网络切换,若两个网络都可切换成功,则主机依然保持在线状态。
S702,若只是车辆内第一通信网络或车辆内第二通信网络切换成功,则进行预设的处 理。
S703,若当前车辆内第一通信网络与车辆内第二通信网络都已切换到备份网络工作,依然接收不到数据,则通过主备机通信网监测备份机的跳包状态。
S704,如果接收不到备份机的心跳包,则主机保持在线。
S705,如果正常接收到备份机的心跳包,则主机判断当前备份机对于各个网络数据接收状态,并根据各个网络数据接收状态进行相应的处理。
具体地,当网关的主机同时接收不到牵引制动网和舒适网数据或牵引制动网和舒适网端口故障时,网关的主机会分别先判断当前牵引制动网与舒适网是否已切换至备份网络工作,未切换则执行冗余网络切换,若两个网络都可切换成功,则网关的主机依然保持在线状态;若只是牵引制动网切换成功,则进入如图15(c)示出的处理过程;若只是舒适网切换成功,则进入如图15(b)示出处理过程,若当前牵引制动网与舒适网都已切换到备份网络工作,依然接收不到数据,则通过主备机通信网监测网关的备份机的心跳包状态。
从而,如果接收不到备份机的心跳包,主机保持在线,如果正常接收到备份机的心跳包,则网关的主机会判断当前网关的备份机对于各个网络数据接收状态,不同状态决定网关的主机和备份机处于哪一种运行状态。
其中,(1)若监测到3个网络数据接收都正常,则主机停止,主机通过主备机通信网请求备份机在线。
(2)若只监测到车厢外部网数据接收异常,则主机切换至abnormity-13状态,并通过主备机通信网请求备份机进入abnormity-13状态。
(3)若只监测到牵引制动网数据接收异常,主机通过主备机通信网请求备份机在线。
(4)若监测到车厢外部网和牵引制动网数据接收异常,则主机切换至abnormity-14状态,并通过主备机通信网请求备份机进入abnormity-14状态。
(5)若只监测到舒适网数据接收异常,则主机通过主备机通信网请求备份机在线,备份机在线,并尝试执行冗余网络切换,使用舒适网备份网络通信。
(6)若监测到车厢外部网和舒适网数据接收异常,则主机切换至abnormity-15状态,并通过主备机通信网请求备份机进入abnormity-15状态。
(7)若监测到牵引制动网和舒适网或3个网络数据接收异常,主机保持在线。
其中,为了使得本领域的技术人员更加清楚的了解在场景6中的实施例流程,可以结合图15(a)、图15(b)和图15(c)所示的接收不到牵引制动网和舒适网数据处理流程图,其中,图15(b)为图15(a)中所示出的分支A的流程图,图15(c)为图15(a)中所示出的分支B的流程图。
场景7,所有数据都接收不到(071 byte1=07):
图16是根据本公开第八个实施例的基于CANopen协议传输数据的网关轮换方法的流程图,如图16所示,该方法还包括:
S801,当所有网络都接收不到数据时,主机监测主备机通信网上的备份机心跳包接收状态。
S802,如在预设心跳周期内监测不到备份机心跳包,则主机保持在线。
S803,如果能正常接收到备份机心跳包,则主机判断当前备份机对于各个网络数据接收状态,并根据各个网络数据接收状态进行相应的处理。
S804,若监测到所有网络数据都接收异常,则主机保持在线,否则主机停止,并通过主备机通信网请求备份机在线。
在本实施例中,当所有网络都接收不到数据时,主机会监测主备机通信网上备份机心跳包接收状态,如果连续500ms监测不到备份机心跳包,则主机保持在线。如果能正常接收到网关的备份机的心跳包,则网关的主机会判断当前网关的备份机对于各个网络数据接收状态,不同状态决定网关的主机和备份机处于哪一种运行状态。
若监测到3个网络数据都接收异常,则主机保持在线。否则主机停止,主机通过主备机通信网请求备份机在线。
其中,为了使得本领域的技术人员更加清楚的了解在场景7中的实施例流程,可以结合图17所示的所有数据都接收不到的数据处理流程图。
综上所述,本公开实施例的基于CANopen协议传输数据的网关轮换方法,在原有网络冗余设计架构上,优化了软件实现策略,当网关的主机和备份机均存在网络异常问题而接收不到数据时,可使得网关的主机和备份机根据不同的运行状态进行协调工作,有效保证网络在异常状态下还能正常保持通信,避免因主备节点中都有网络故障而导致的网络通信异常问题,提高了列车网络的冗余效果。
为了更加清楚的说明本公开实施例的基于CANopen协议传输数据的网关轮换方法,下面以该方法集中在网关的备份机侧描述。
图18是根据本公开第九个实施例的基于CANopen协议传输数据的网关轮换方法的流程图,如图18所示,该方法包括:
S901,网关的备份机上电处于停止状态,如果主备机通信网上在预设心跳周期内监测不到主机心跳包,则判断主备机通信网上的备份机心跳包能否发送成功。
S902,若能发送成功,则备份机保持在线。
S903,若发送不成功,但在车辆内第一通信网络和车辆内第二通信网络监测到主机心跳包,或能正常接收到备份机心跳包,则判断主机心跳包中请求备份机响应状态确定当前备份机状态。
举例而言,备份机上电处于停止状态,如果主备机通信网上连续500ms监测不到主机心跳包,则判断主备机通信网上备份机心跳包能否发送成功。若能发送成功,则备份机在线。若发送不成功,但在牵引制动网和舒适网监测到主机心跳包,或能正常接收到备份机心跳包,则判断主机心跳包byte3请求备份机响应状态来决定当前备份机状态。
(1)若监测到主机心跳包请求备份机无效,则备份机停止。
(2)若监测到主机心跳包请求备份机在线,则备份机在线,根据自身接收以太网、牵引制动网、舒适网的数据情况判断是否需要主机配合。若需主机配合,则备份机在线,处于对应第1~15类异常状态处理中。若不需主机配合,备份机在线。
(3)若监测到主机心跳包请求备份机停止,则备份机保持停止。
(4)若监测到主机心跳包请求备份机abnormity-3~abnormity-11,则备份机在线,处于对应第1~15类异常状态处理过程中。
其中,为了使得本领域的技术人员更加清楚的了解本公开的实施例流程,可以结合图19备份机的运行策略流程图。
综上所述,本公开实施例的基于CANopen协议传输数据的网关轮换方法,在原有网络冗余设计架构上,优化了软件实现策略,当网关的主机和备份机均存在网络异常问题而接收不到数据时,可使得网关的主机和备份机根据不同的运行状态进行协调工作,有效保证网络在异常状态下还能正常保持通信,避免因主备节点中都有网络故障而导致的网络通信异常问题,提高了列车网络的冗余效果。
为了实现上述实施例,本公开还提出了一种网关的主机,图20是根据本公开第一个实施例的网关的主机的结构示意图,如图20所示,该网关的主机包括,监测模块101、第一处理模块102和请求模块103。
其中,监测模块101,用于在网关的主机上电运行进入在线状态时,通过主备机通信网与网关的备份机互相监测心跳包状态。
第一处理模块102,用于在预设的心跳周期内监测不到备份机的心跳包,且主机的心跳包在主备机通信网上发送成功时,保持在线,记录备份机掉线;
请求模块103,用于在主机的心跳包在主备机通信网上发送失败时,通过任意一个车辆内通信网络请求备份机上线;
在本公开的一个实施例中,请求模块103,还用于在车辆内第一通信网络接收不到备份机的响应请求时,停止请求车辆内第一通信网络的备份机上线,同时通过另一个车辆内通信网络请求备份机上线。
在本公开的一个实施例中,第一处理模块102,还用于在车辆内第二通信网络仍然接收 不到备份机的响应请求时,保持在线,并记录备份机掉线。
需要说明的是,前述集中在网关的主机侧描述的基于CANopen协议传输数据的网关轮换方法,也适用于本公开实施例的网关的主机,其实现原理类似,在此不再赘述。
综上所述,本公开实施例的网关的主机,网关的主机上电运行进入在线状态,并通过主备机通信网监测网关的备份机的心跳包状态,如果在预设的心跳周期内监测不到备份机的心跳包,且主机的心跳包在主备机通信网上发送成功,则主机保持在线,记录备份机掉线,若主机的心跳包在主备机通信网上发送失败,则主机通过车辆内第一通信网络请求备份机上线,若在车辆内第一通信网络接收不到备份机的响应请求,则主机停止请求车辆内第一通信网络的备份机上线,同时通过车辆内第二通信网络请求备份机上线,若在车辆内第二通信网络仍然接收不到备份机的响应请求,则主机保持在线,并记录备份机掉线。由此,根据网关的主机和备份机的不同的运行状态进行协调工作,有效保证网络在异常状态下还能正常保持通信,避免因主备节点中都有网络故障而导致的网络通信异常问题。
图21是根据本公开第二个实施例的网关的主机的结构示意图,如图21所示,在如图20所示的基础上,该网关的主机还包括第一判断模块104。其中,监测模块101,还用于当主机接收不到以太网数据或以太网端口故障时,通过主备机通信网监测备份机的心跳包状态。
第一判断模块104,用于在预设的心跳周期内监测不到备份机的心跳包时,判断主机的心跳包在主备机通信网上能否发送成功。
第一处理模块102,还用于在发送成功时,控制主机保持在线状态,记录备份机掉线。
请求模块103,还用于在发送失败时,通过车辆内第二通信网络请求备份机保持在线。
第一处理模块102,用于在车辆内第二通信网络上收到备份机的响应请求时,判断备份机当前对各个网络数据接收状态,并根据接收状态进行相应的处理。
在本公开的另一个实施例中,请求模块103,还用于在车辆内第二通信网络上接收不到备份机的响应请求时,停止请求车辆内第一通信网络的备份机在线,进而通过车辆内第二通信网络请求备份机在线。
第一处理模块102,用于在接收不到备份机的响应请求时,控制主机保持在线,并通过车辆内第二通信网络请求备份机停止。
第一处理模块102,用于在接收到备份机的响应请求时,判断备份机当前对各个网络数据的接收状态,并根据接收状态进行相应的处理。
在本公开的一个实施例中,第一处理模块102,用于在正常接收到所述备份机的心跳包时,判断所述备份机当前对各个网络数据接收状态,并根据接收状态进行相应的处理。
图22是根据本公开第三个实施例的网关的主机的结构示意图,如图22所示,在如图 20所示的基础上,该网关的主机还包括第二判断模块105。
其中,第二判断模块105,用于在主机接收不到车辆内第一通信网络数据或车辆内第一通信网络端口故障时,判断当前车辆内第一通信网络是否已切换到备份机上工作。
第一处理模块102,用于在没有切换时执行冗余网络切换,若切换成功,则控制主机保持在线。
监测模块101,用于在已切换到备份机工作,且仍然接收不到车辆内第二通信网络的数据时,通过主备机通信网监测备份机的心跳包状态。
第一处理模块102,用于在正常接收到备份机的心跳包时,判断当前备份机对各个网络数据接收状态,并根据各个网络数据接收状态进行相应的处理。
在本公开的一个实施例中,第一处理模块102,用于在预设的心跳周期内监测不到备份机的心跳包时,若在主备机通信网上的主机心跳包能发送成功,则控制主机保持在线。
图23是根据本公开第四个实施例的网关的主机的结构示意图,如图23所示,在如图20所示的基础上,该网关的主机还包括第三判断模块106。
其中,第三判断模块106,用于当主机同时接收不到车辆内第一通信网络和车辆间通信网络的数据或车辆内第一通信网络和车辆间通信网络端口故障时,判断当前车辆内第一通信网络是否已切换到备份网络工作。
第一处理模块102,用于在未切换时执行冗余网络切换,在切换成功时则进行预设的处理。
监测模块101,用于在已切换到备份机工作,依然收不到车辆内第一通信网络的数据时,通过主备机通信网监测备份机的心跳包状态。
第一处理模块102,用于在正常接收到备份机的心跳包时,判断当前备份机对于各个网络数据接收状态,并根据各个网络数据接收状态进行相应的处理。
在本公开的一个实施例中,第一处理模块102,用于在预设的心跳周期内监测不到备份机的心跳包,且主备机通信网上主机心跳包能发送成功时,控制主机保持在线,若发送不成功,通过车辆内第二通信网络请求备份机在线。
第一处理模块102,用于在接收不到备份机的响应请求时,保持在线。
第一处理模块102,用于在能接收到备份机的响应请求时,监测备份机对于各个网络数据接收状态,并根据各个网络数据接收状态进行相应的处理。
图24是根据本公开第五个实施例的网关的主机的结构示意图,如图24所示,在如图20所示的基础上,该网关的主机还包括第四判断模块107。
其中,在本实施例中,第四判断模块107,用于在主机接收不到车辆内第二通信网络的数据或舒适网端口故障时,判断当前车辆内第二通信网络是否已切换到备份网络工作。
第一处理模块102,用于在未切换时执行冗余网络切换,在切换成功时,控制主机保持在线。
监测模块101,用于在已切换到备份机工作,依然接收不到车辆内第二通信网络的数据时,通过主备机通信网监测备份机的心跳包状态。
第一处理模块102,用于在正常接收到备份机心跳包时,判断当前备份机对于各个网络数据接收状态,并根据各个网络数据接收状态进行相应的处理。
在本公开的一个实施例中,第一处理模块102,用于在预设的心跳周期内监测不到备份机的心跳包,且主备机通信网上主机心跳包能发送成功时,控制主机保持在线。
所说请求模块103,用于在发送不成功时,通过车辆内第一通信网络请求备份机在线。
第一处理模块102,用于在车辆内第一通信网络接收到备份机的响应请求时,监测备份机对于各个网络数据接收状态,并根据各个网络数据接收状态进行相应的处理。
图25是根据本公开第六个实施例的网关的主机的结构示意图,如图25所示,在如图20所示的基础上,该网关的主机还包括第五判断模块108。
其中,第五判断模块108,用于当主机同时接收不到车辆内第二通信网络和车辆间通信网络数据或车辆内第二通信网络和车辆间通信网络端口故障时,判断当前车辆内第二通信网络是否已切换至备份机工作。
第一处理模块102,用于在未切换时执行冗余网络切换,在可切换成功时进行预设的处理。
监测模块101,用于在已切换至备份机工作,仍然接收不到车辆内第二通信网络数据时,通过主备机通信网监测备份机的心跳包状态。
第一处理模块102,用于在正常接收到备份机的心跳包时,判断当前备份机对于各个网络数据接收状态,并根据各个网络数据接收状态进行相应的处理。
在本公开的一个实施例中,第一处理模块102,用于在预设的心跳周期内监测不到备份机的心跳包,且主备机通信网上的主机心跳包能发送成功时,控制主机保持在线。
请求模块103,用于在发送不成功时,通过车辆内第一通信网络请求备份机在线。
第一处理模块102,用于在能接收到备份机的响应请求时,判断当前备份机对于各个网络数据接收状态,并根据各个网络数据接收状态进行相应的处理。
图26是根据本公开第七个实施例的网关的主机的结构示意图,如图26所示,在如图20所示的基础上,该网关的主机还包括第六判断模块109。
其中,第六判断模块109,用于当主机同时接收不到车辆内第一通信网络和车辆内第二通信网络数据或车辆内第一通信网络和车辆内第二通信网络端口故障时,判断当前车辆内第一通信网络与车辆内第二通信网络是否已切换至备份机工作。
第一处理模块102,用于在未切换时,执行冗余网络切换,在两个网络都可切换成功时,控制主机依然保持在线状态。
第一处理模块102,用于在只是车辆内第一通信网络或车辆内第二通信网络切换成功时,进行预设的处理。
监测模块101,用于在当前车辆内第一通信网络与车辆内第二通信网络都已切换到备份网络工作,依然接收不到数据时,通过主备机通信网监测备份机的跳包状态。
第一处理模块102,用于接收不到备份机的心跳包时,控制主机保持在线。
在本公开的一个实施例中,第一处理模块102,用于在正常接收到备份机的心跳包时,判断当前备份机对于各个网络数据接收状态,并根据各个网络数据接收状态进行相应的处理。
在本公开的一个实施例中,监测模块101,用于在所有网络都接收不到数据时,监测主备机通信网上的备份机心跳包接收状态。
第一处理模块102,用于在预设心跳周期内监测不到备份机心跳包时,控制主机保持在线。
第一处理模块102,用于在能正常接收到备份机心跳包时,判断当前备份机对于各个网络数据接收状态,并根据各个网络数据接收状态进行相应的处理。
第一处理模块102,用于在监测到所有网络数据都接收异常时,控制主机保持在线,否则控制主机停止,并通过主备机通信网请求备份机在线。
综上所述,本公开实施例的网关的主机,在原有网络冗余设计架构上,优化了软件实现策略,当网关的主机和备份机均存在网络异常问题而接收不到数据时,可使得网关的主机和备份机根据不同的运行状态进行协调工作,有效保证网络在异常状态下还能正常保持通信,避免因主备节点中都有网络故障而导致的网络通信异常问题,提高了列车网络的冗余效果。
为了实现上述实施例,本公开还提出了一种网关的备份机。
图27是根据本公开一个实施例的网关的备份机的结构示意图,如图27所示,该网关的备份机包括:第七判断模块201、第二处理模块202和确定模块203。
其中,第七判断模块201,用于在网关的备份机上电处于停止状态时,如果主备机通信网上在预设心跳周期内监测不到主机心跳包,判断主备机通信网上的备份机心跳包能否发送成功。
第二处理模块202,用于在能发送成功时,控制备份机保持在线。
确定模块203,用于在发送不成功,但在车辆内第一通信网络和车辆内第二通信网络监测到主机心跳包,或能正常接收到备份机心跳包时,判断主机心跳包中请求备份机响应状 态确定当前备份机状态。
需要说明的是,前述集中在网关的备份机侧描述的基于CANopen协议传输数据的网关轮换方法,也适用于本公开实施例的网关的备份机,其实现原理类似,在此不再赘述。
综上所述,本公开实施例的网关的备份机,在原有网络冗余设计架构上,优化了软件实现策略,当网关的主机和备份机均存在网络异常问题而接收不到数据时,可使得网关的主机和备份机根据不同的运行状态进行协调工作,有效保证网络在异常状态下还能正常保持通信,避免因主备节点中都有网络故障而导致的网络通信异常问题,提高了列车网络的冗余效果。
为了实现上述实施例,本公开还提出了一种基于CANopen协议传输数据的网关轮换系统,图28是根据本公开一个实施例的基于CANopen协议传输数据的网关轮换系统的结构示意图,如图28所示,该基于CANopen协议传输数据的网关轮换系统包括网关的主机100和备份机200、主备机通信网300和以太网400。
其中,对网关的主机100的描述,参照上述对网关的主机的描述,对网关的备份机200的描述,参照上述对网关的备份机的描述,其实现原理类似,在此不再赘述。
为了更加清楚的说明本公开实施例的基于CANopen协议传输数据的网关轮换系统的工作流程,下面举例说明,在本示例中,只接收不到车辆内第二通信网络(牵引制动网)数据:
举例而言,网络中有两个主节点,两个主节点的功能身份都是网关,一个作为网关的主机,一个作为网关的备份机,主机正常运行时,备份机处于静默状态,即网络中只有一个活动主节点。当主机接收不到牵引制动网数据或牵引制动网端口故障时,主机首先判断当前牵引制动网是否已切换到备份网络工作,未切换则执行冗余网络切换,若切换成功,主机保持在线。若已切换到备份网络工作,依然接收不到牵引制动网的数据,则通过机通信网络监测备份机的心跳包状态。
如果连续500ms监测不到备份机心跳包,若主机心跳包在主备机通信网上能发送成功,则主机保持在线。若发送不成功,则主机通过舒适网发送主机心跳包071:02 01 02,请求备份机在线。此时若接收不到舒适网备份机的响应请求,主机保持在线。若能接收到响应请求072:**01 00,则监测备份机对于各个网络数据接收状态,不同状态决定网关的主机和备份机处于哪一种运行状态。
(1)若监测到备份机心跳包072 byte1=00,说明当前3个网络数据接收都正常,则主机停止,主机通过舒适网发送主机停止心跳包071:02 02 00。
(2)若监测到备份机心跳包072 byte1=01,说明当前只有车厢外部网数据接收异常,主机切换至abnormity-8状态,并通过舒适网发送主机心跳包071:02 0A 0A,请求备份机进 入abnormity-8状态。
(3)若监测到备份机心跳包072 byte1=02,说明当前只有牵引制动网数据接收异常,则备份机在线,并尝试执行冗余网络切换,使用牵引制动网备份网络通信。若切换成功,主机停止,主机通过舒适网发送主机停止心跳包071:02 02 00。若切换不成功,备份机切换至abnormity-2状态,并通过舒适网发送备份机心跳包072:02 04 04,请求主机进入abnormity-2状态。
(4)若监测到备份机心跳包072 byte1=03,说明当前车厢外部网和牵引制动网数据接收都异常,则主机保持在线,主机通过舒适网发送主机心跳包071:02 01 02,请求备份机停止。
如果正常接收到备份机心跳包,则主机会判断当前备份机对于各个网络数据接收状态,不同状态决定主备网关处于哪一种运行状态。
(1)若监测到备份机心跳包072 byte1=00,说明当前3个网络数据接收都正常,则主机停止,主机通过主备机通信网发送主机心跳包071:01 02 01,请求备份机在线。
(2)若监测到备份机心跳包072 byte1=01,说明当前只有车厢外部网数据接收异常,主机切换至abnormity-8状态。
(3)若监测到备份机心跳包072 byte1=02,说明当前只有牵引制动网数据异常,则主机停止,主机通过主备机通信网发送主机心跳包071:02 02 01,请求备份机在线。备份机在线,并尝试执行冗余网络切换,使用牵引制动网备份网络通信。若切换成功,则主机停止,主机通过主备机通信网发送主机停止心跳包071:02 02 00。若切换不成功,备份机切换至备份机切换至abnromity-2状态,并通过主备机通信网发送备机心跳包072:02 04 04,请求主机abnromity-2状态。
(4)若监测到备份机心跳包072 byte1=03/06,说明当前车厢外部网和牵引制动网或舒适网和牵引制动网的数据接收异常,则主机都保持在线。
(5)若监测到备份机心跳包072 byte1=04,说明当前舒适网数据接收异常,主机通过主备机通信网发送主机心跳包071:02 01 01,请求备份机在线。备份机在线,并尝试执行冗余网络切换,使用舒适网备份网络通信。若切换成功,则主机停止,主机通过主备机通信网发送主机停止心跳包071:02 02 00。若切换不成功,备份机切换至abnromity-3状态,并通过主备机通信网发送备份机心跳包072:02 05 05,请求主机abnromity-3状态。
(6)若监测到备份机心跳包072 byte1=05,说明当前车厢外部网和舒适网数据接收都异常,主机切换至abnromity-4状态,并通过主备机通信网发送主机心跳包071:02 06 06,请求备份机abnromity-4状态。
(7)若监测到备份机心跳包072 byte1=07,说明当前三个网络数据接收都异常,则主机 都保持在线。
综上所述,本公开实施例的基于CANopen协议传输数据的网关轮换系统,根据网关的主机和备份机的不同的运行状态进行协调工作,有效保证网络在异常状态下还能正常保持通信,避免因主备节点中都有网络故障而导致的网络通信异常问题。
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本公开的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。
尽管上面已经示出和描述了本公开的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本公开的限制,本领域的普通技术人员在本公开的范围内可以对上述实施例进行变化、修改、替换和变型。

Claims (20)

  1. 一种基于CANopen协议传输数据的网关轮换方法,其特征在于,包括:
    网关的主机上电运行进入在线状态,并通过主备机通信网与网关的备份机互相监测心跳包状态;
    如果在预设的心跳周期内监测不到所述备份机的心跳包,且所述主机的心跳包在所述主备机通信网上发送成功,则所述主机保持在线,记录所述备份机掉线;
    若所述主机的心跳包在所述主备机通信网上发送失败,则所述主机通过任意一个车辆内通信网络请求所述备份机上线;
    若在所述车辆内第一通信网络接收不到所述备份机的响应请求,则所述主机停止请求车辆内第一通信网络的备份机上线,同时通过另一个车辆内通信网络请求所述备份机上线;
    若在所述车辆内第二通信网络仍然接收不到所述备份机的响应请求,则所述主机保持在线,并记录所述备份机掉线。
  2. 如权利要求1所述的方法,其特征在于,还包括:
    当所述主机接收不到车辆间通信网络数据或车辆间通信网络端口故障时,通过所述主备机通信网监测所述备份机的心跳包状态;
    如果在预设的心跳周期内监测不到所述备份机的心跳包,则判断所述主机的心跳包在所述主备机通信网上能否发送成功;
    若发送成功,则所述主机保持在线状态,记录所述备份机掉线;
    若发送失败,则所述主机通过车辆内第二通信网络请求所述备份机保持在线;
    若在所述车辆内第二通信网络上收到所述备份机的响应请求,则判断所述备份机当前对各个网络数据接收状态,并根据接收状态进行相应的处理。
  3. 如权利要求2所述的方法,其特征在于,还包括:
    若在车辆内第二通信网络上接收不到所述备份机的响应请求,则所述主机停止请求车辆内第一通信网络的备份机在线,进而通过车辆内第二通信网络请求备份机在线;
    若接收不到所述备份机的响应请求,则主机保持在线,并通过车辆内第二通信网络请求所述备份机停止;
    若接收到所述备份机的响应请求,则判断所述备份机当前对各个网络数据的接收状态,并根据接收状态进行相应的处理。
  4. 如权利要求2或3所述的方法,其特征在于,还包括:
    如果正常接收到所述备份机的心跳包,则所述主机判断所述备份机当前对各个网络数据接收状态,并根据接收状态进行相应的处理。
  5. 如权利要求1-4任一所述的方法,其特征在于,还包括:
    当所述主机接收不到车辆内第一通信网络数据或车辆内第一通信网络端口故障时,所述主机判断当前车辆内第一通信网络是否已切换到所述备份机上工作;
    若没有切换则执行冗余网络切换,若切换成功,则所述主机保持在线;
    若已切换到所述备份机工作,且仍然接收不到车辆内第一通信网络的数据,则通过主备机通信网监测所述备份机的心跳包状态;
    如果正常接收到所述备份机的心跳包,则所述主机判断当前所述备份机对各个网络数据接收状态,并根据各个网络数据接收状态进行相应的处理。
  6. 如权利要求5所述的方法,其特征在于,还包括:
    如果在预设的心跳周期内监测不到所述备份机的心跳包,若在所述主备机通信网上的主机心跳包能发送成功,则所述主机保持在线;
    若在所述主备机通信网上的主机心跳包能发送失败,则所述主机通过车辆内第二通信网络请求所述备份机在线;
    若接收不到所述车辆内第二通信网络的备份机的响应请求,所述主机保持在线;
    若在所述车辆内第二通信网络能接收到所述备份机的响应请求,则监测所述备份机对于各个网络数据接收状态,并根据各个网络数据接收状态进行相应的处理。
  7. 如权利要求1-6任一所述的方法,其特征在于,还包括:
    当所述主机同时接收不到车辆内第一通信网络和车辆间通信网络的数据或车辆内第一通信网络和车辆间通信网络端口故障时,所述主机判断当前车辆内第一通信网络是否已切换到备份网络工作,未切换则执行冗余网络切换,若可切换成功则进行预设的处理;
    若已切换到所述备份机工作,依然收不到所述车辆内第一通信网络的数据,则通过所述主备机通信网监测所述备份机的心跳包状态;
    如果正常接收到所述备份机的心跳包,则所述主机判断当前所述备份机对于各个网络数据接收状态,并根据各个网络数据接收状态进行相应的处理。
  8. 如权利要求7所述的方法,其特征在于,还包括:
    若在预设的心跳周期内监测不到所述备份机的心跳包,且所述主备机通信网上主机心跳包能发送成功,则主机保持在线,若发送不成功,主机通过车辆内第二通信网络请求所述备份机在线;
    若接收不到所述备份机的响应请求,则所述主机保持在线;
    若能接收到所述备份机的响应请求,则监测所述备份机对于各个网络数据接收状态,并根据各个网络数据接收状态进行相应的处理。
  9. 如权利要求1-8任一所述的方法,其特征在于,还包括:
    当所述主机接收不到车辆内第二通信网络的数据或车辆内第二通信网络端口故障时,所述主机判断当前车辆内第二通信网络是否已切换到备份网络工作,未切换则执行冗余网络切换,若切换成功,则所述主机保持在线;
    若已切换到所述备份机工作,依然接收不到所述车辆内第二通信网络的数据,则通过所述主备机通信网监测所述备份机的心跳包状态;
    如果正常接收到所述备份机心跳包,则所述主机判断当前所述备份机对于各个网络数据接收状态,并根据各个网络数据接收状态进行相应的处理。
  10. 如权利要求9所述的方法,其特征在于,还包括:
    若在预设的心跳周期内监测不到所述备份机的心跳包,且所述主备机通信网上主机心跳包能发送成功,则所述主机保持在线;
    若发送不成功,则所述主机通过车辆内第一通信网络请求所述备份机在线;
    若在所述车辆内第一通信网络接收到所述备份机的响应请求,则监测所述备份机对于各个网络数据接收状态,并根据各个网络数据接收状态进行相应的处理。
  11. 如权利要求1-10任一所述的方法,其特征在于,还包括:
    当所述主机同时接收不到车辆内第二通信网络和车辆间通信网络数据或车辆内第二通信网络和车辆间通信网络端口故障时,所述主机判断当前车辆内第二通信网络是否已切换至所述备份机工作,未切换则执行冗余网络切换,若可切换成功则进行预设的处理;
    若已切换至所述备份机工作,仍然接收不到所述车辆内第二通信网络数据,则通过所述主备机通信网监测所述备份机的心跳包状态;
    如果正常接收到所述备份机的心跳包,则所述主机判断当前所述备份机对于各个网络数据接收状态,并根据各个网络数据接收状态进行相应的处理。
  12. 如权利要求11所述的方法,其特征在于,还包括:
    若在预设的心跳周期内监测不到所述备份机的心跳包,且所述主备机通信网上的主机心跳包能发送成功,则所述主机保持在线;
    若发送不成功,则所述主机通过车辆内第一通信网络请求所述备份机在线;
    若能接收到所述备份机的响应请求,则所述主机判断当前所述备份机对于各个网络数据接收状态,并根据各个网络数据接收状态进行相应的处理。
  13. 一种网关的主机,其特征在于,包括:
    监测模块,用于在网关的主机上电运行进入在线状态时,通过主备机通信网与网关备份机互相监测心跳包状态;
    第一处理模块,用于在预设的心跳周期内监测不到所述备份机的心跳包,且主机的心跳包在所述主备机通信网上发送成功时,保持在线,记录所述备份机掉线;
    请求模块,用于在所述主机的心跳包在所述主备机通信网上发送失败时,通过任意一个车辆内通信网络请求所述备份机上线;
    所述请求模块,还用于在所述车辆内第一通信网络接收不到所述备份机的响应请求时,停止请求车辆内第一通信网络的备份机上线,同时通过另一个车辆内通信网络请求所述备份机上线;
    所述第一处理模块,还用于在所述车辆内第二通信网络仍然接收不到所述备份机的响应请求时,保持在线,并记录所述备份机掉线。
  14. 如权利要求13所述的网关的主机,其特征在于:
    所述监测模块,还用于当所述主机接收不到车辆间通信网络数据或车辆间通信网络端口故障时,通过所述主备机通信网监测所述备份机的心跳包状态;
    第一判断模块,用于在预设的心跳周期内监测不到所述备份机的心跳包时,判断所述主机的心跳包在所述主备机通信网上能否发送成功;
    所述第一处理模块,还用于在发送成功时,控制所述主机保持在线状态,记录所述备份机掉线;
    所述请求模块,还用于在发送失败时,通过车辆内第二通信网络请求所述备份机保持在线;
    所述第一处理模块,用于在所述车辆内第二通信网络上收到所述备份机的响应请求时,判断所述备份机当前对各个网络数据接收状态,并根据接收状态进行相应的处理。
  15. 如权利要求14所述的网关的主机,其特征在于:
    所述请求模块,还用于在车辆内第二通信网络上接收不到所述备份机的响应请求时,停止请求车辆内第一通信网络的备份机在线,进而通过车辆内第二通信网络请求备份机在线;
    所述第一处理模块,用于在接收不到所述备份机的响应请求时,控制所述主机保持在线,并通过车辆内第二通信网络请求所述备份机停止;
    所述第一处理模块,用于在接收到所述备份机的响应请求时,判断所述备份机当前对各个网络数据的接收状态,并根据接收状态进行相应的处理。
  16. 如权利要求14或15所述的网关的主机,其特征在于:
    所述第一处理模块,用于在正常接收到所述备份机的心跳包时,判断所述备份机当前对各个网络数据接收状态,并根据接收状态进行相应的处理。
  17. 如权利要求13-16任一所述的网关的主机,其特征在于,还包括:
    第二判断模块,用于在所述主机接收不到车辆内第一通信网络数据或车辆内第一通信网络端口故障时,判断当前车辆内第一通信网络是否已切换到所述备份机上工作;
    所述第一处理模块,用于在没有切换时执行冗余网络切换,若切换成功,则控制所述主机保持在线;
    所述监测模块,用于在已切换到所述备份机工作,且仍然接收不到车辆内第一通信网络的数据时,通过主备机通信网监测所述备份机的心跳包状态;
    所述第一处理模块,用于在正常接收到所述备份机的心跳包时,判断当前所述备份机对各个网络数据接收状态,并根据各个网络数据接收状态进行相应的处理。
  18. 如权利要求17所述的网关的主机,其特征在于,
    所述第一处理模块,用于在预设的心跳周期内监测不到所述备份机的心跳包时,若在所述主备机通信网上的主机心跳包能发送成功,则控制所述主机保持在线;
    所说请求模块,用于在在所述主备机通信网上的主机心跳包能发送失败时,通过车辆内第二通信网络请求所述备份机在线;
    所述第一处理模块,用于在接收不到所述车辆内第二通信网络的备份机的响应请求时,控制所述主机保持在线;
    所述第一处理模块,用于在所述车辆内第二通信网络能接收到所述备份机的响应请求时,监测所述备份机对于各个网络数据接收状态,并根据各个网络数据接收状态进行相应的处理。
  19. 如权利要求13-18任一所述的网关的主机,其特征在于,还包括:
    第三判断模块,用于当所述主机同时接收不到车辆内第一通信网络和车辆间通信网络的数据或车辆内第一通信网络和车辆间通信网络端口故障时,判断当前车辆内第一通信网络是否已切换到备份网络工作;
    所述第一处理模块,用于在未切换时执行冗余网络切换,在切换成功时则进行预设的处理;
    所述监测模块,用于在已切换到所述备份机工作,依然收不到所述车辆内第一通信网络的数据时,通过所述主备机通信网监测所述备份机的心跳包状态;
    所述第一处理模块,用于在正常接收到所述备份机的心跳包时,判断当前所述备份机对于各个网络数据接收状态,并根据各个网络数据接收状态进行相应的处理。
  20. 一种基于CANopen协议传输数据的网关轮换系统,其特征在于,包括:
    如权利要求17或18所述的网关的主机;
    网关的备份机,所述网关的备份机包括第七判断模块,用于在网关的备份机上电处于停止状态时,如果主备机通信网上在预设心跳周期内监测不到主机心跳包,判断所述主备机通信网上的备份机心跳包能否发送成功;第二处理模块,用于在能发送成功时,控制所述备份机保持在线;确定模块,用于在发送不成功,但在车辆内第一通信网络和车辆内第 二通信网络监测到主机心跳包,或能正常接收到备份机心跳包时,判断主机心跳包中请求备份机响应状态确定当前备份机状态;
    主备机通信网;以及
    车辆间通信网络。
PCT/CN2018/092049 2017-06-21 2018-06-20 基于CANopen协议传输数据的网关轮换方法、系统及其装置 Ceased WO2018233644A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
BR112019027650-5A BR112019027650A2 (pt) 2017-06-21 2018-06-20 método de transição de porta de comunicação de transmissão de dados com base em canopen, sistema e aparelhos para o mesmo
US16/625,348 US11316712B2 (en) 2017-06-21 2018-06-20 Canopen-based data transmission gateway changeover method, system and apparatus thereof

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710475925.5A CN109104347B (zh) 2017-06-21 2017-06-21 基于CANopen协议传输数据的网关轮换方法、系统及其装置
CN201710475925.5 2017-06-21

Publications (1)

Publication Number Publication Date
WO2018233644A1 true WO2018233644A1 (zh) 2018-12-27

Family

ID=64735902

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/092049 Ceased WO2018233644A1 (zh) 2017-06-21 2018-06-20 基于CANopen协议传输数据的网关轮换方法、系统及其装置

Country Status (4)

Country Link
US (1) US11316712B2 (zh)
CN (1) CN109104347B (zh)
BR (1) BR112019027650A2 (zh)
WO (1) WO2018233644A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11398944B2 (en) * 2018-08-30 2022-07-26 Apollo Intelligent Driving Technology (Beijing) Co., Ltd. Vehicle fault handling method, apparatus, device and storage medium
CN116743551A (zh) * 2022-09-30 2023-09-12 腾讯云计算(北京)有限责任公司 设备网关的主备切换方法、装置及计算机可读存储介质

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114726782A (zh) * 2019-05-13 2022-07-08 华为技术有限公司 车内通信系统、车内通信的方法及设备
CN112070926A (zh) * 2020-07-16 2020-12-11 苏州华启智能科技有限公司 一种具有高标准防护的数据加密及存储系统及设备
WO2022209345A1 (ja) * 2021-03-30 2022-10-06 住友電気工業株式会社 車載通信システム、スイッチ装置、異常検知方法および異常検知プログラム
CN113923630A (zh) * 2021-10-25 2022-01-11 摩拜(北京)信息技术有限公司 车辆自组网的方法及车辆
CN115384579A (zh) * 2022-09-16 2022-11-25 清华大学 一种用于电子导向胶轮车的双机热备冗余控制系统及方法
US12513071B2 (en) * 2022-12-05 2025-12-30 Getac Technology Corporation Operational state management of connected user devices
CN116319883A (zh) * 2023-03-20 2023-06-23 阿波罗智能技术(北京)有限公司 车辆控制方法、装置、设备及存储介质
CN119902485A (zh) * 2023-10-26 2025-04-29 施耐德电气(中国)有限公司 控制设备、控制方法和存储介质
US20250201031A1 (en) * 2023-12-14 2025-06-19 Motive Technologies, Inc. Vehicle gateway with power management system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1085721A2 (en) * 1999-09-15 2001-03-21 Koninklijke Philips Electronics N.V. A transmit pre-arbitration scheme for a CAN device
EP1085722A2 (en) * 1999-09-15 2001-03-21 Koninklijke Philips Electronics N.V. End-of-message handling and interrupt generation in a CAN module providing hardware assembly of multi-frame CAN messages
CN102724065A (zh) * 2012-05-22 2012-10-10 长沙中联消防机械有限公司 一种网络通信系统及包括该系统的工程机械设备
CN106452870A (zh) * 2016-10-13 2017-02-22 中车株洲电力机车研究所有限公司 一种CANopen网络主设备冗余控制方法

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6625750B1 (en) * 1999-11-16 2003-09-23 Emc Corporation Hardware and software failover services for a file server
US6973229B1 (en) 2001-02-28 2005-12-06 Lambda Opticalsystems Corporation Node architecture for modularized and reconfigurable optical networks, and methods and apparatus therefor
CN101102365A (zh) * 2007-08-24 2008-01-09 华为技术有限公司 一种业务放通方法、系统及装置
CN101150430B (zh) * 2007-09-17 2010-09-01 中兴通讯股份有限公司 一种通过心跳机制实现网络接口板倒换的方法
EP2282452B1 (en) 2009-07-31 2012-04-04 ABB Research Ltd. Data transmission in a ring-type communication network
JP2011211485A (ja) 2010-03-30 2011-10-20 Renesas Electronics Corp 通信ノード、バックアップノード、通信システム、及び通信ノードのバックアップ方法
US10061664B2 (en) * 2015-01-15 2018-08-28 Cisco Technology, Inc. High availability and failover
CN105991325B (zh) * 2015-02-10 2019-06-21 华为技术有限公司 处理至少一个分布式集群中的故障的方法、设备和系统
CN105471652B (zh) * 2015-12-07 2018-10-30 中国电子科技集团公司第三十二研究所 大数据一体机及其冗余管理单元

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1085721A2 (en) * 1999-09-15 2001-03-21 Koninklijke Philips Electronics N.V. A transmit pre-arbitration scheme for a CAN device
EP1085722A2 (en) * 1999-09-15 2001-03-21 Koninklijke Philips Electronics N.V. End-of-message handling and interrupt generation in a CAN module providing hardware assembly of multi-frame CAN messages
CN102724065A (zh) * 2012-05-22 2012-10-10 长沙中联消防机械有限公司 一种网络通信系统及包括该系统的工程机械设备
CN106452870A (zh) * 2016-10-13 2017-02-22 中车株洲电力机车研究所有限公司 一种CANopen网络主设备冗余控制方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LI, LIGONG ET AL.: "(non-official translation) Design and implementation of urban rail vehicle network control system based on CANopen protocol", RAILWAY LOCOMOTIVE AND MOTOR CAR, no. 3, 31 March 2014 (2014-03-31) *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11398944B2 (en) * 2018-08-30 2022-07-26 Apollo Intelligent Driving Technology (Beijing) Co., Ltd. Vehicle fault handling method, apparatus, device and storage medium
CN116743551A (zh) * 2022-09-30 2023-09-12 腾讯云计算(北京)有限责任公司 设备网关的主备切换方法、装置及计算机可读存储介质

Also Published As

Publication number Publication date
CN109104347B (zh) 2020-09-15
BR112019027650A2 (pt) 2020-07-21
US20210367808A1 (en) 2021-11-25
CN109104347A (zh) 2018-12-28
US11316712B2 (en) 2022-04-26

Similar Documents

Publication Publication Date Title
WO2018233644A1 (zh) 基于CANopen协议传输数据的网关轮换方法、系统及其装置
CN109104348B (zh) 基于CANopen协议的列车网络数据传输方法、系统及其装置
US20070288585A1 (en) Cluster system
JP4413965B2 (ja) 負荷分散用通信装置及び負荷分散管理装置
CN113328894B (zh) 基于cu分离的双机热备的方法及设备
JP5703201B2 (ja) 冗長制御装置およびネットワークシステム
WO2018233645A1 (zh) 基于CANopen协议的列车网络数据传输方法、系统及其装置
CN107276839B (zh) 一种云平台的自监控方法和系统
CN109787795B (zh) 列车网络主节点故障的处理方法、节点及电子设备
CN114095341B (zh) 网络恢复方法、装置、计算机设备和存储介质
CN105471653A (zh) 一种机载双通道无缝切换方法及系统
WO2020088278A1 (zh) 一种通信方法、装置及相关设备
WO2023276657A1 (ja) 中継装置、中継システム、中継方法及びコンピュータプログラム
CN118018523A (zh) 一种mlag环境下的dhcp服务器工作方法、设备及介质
CN106828356B (zh) 电动汽车动力系统双路can通讯方法和模块
CN101262479A (zh) 一种网络文件共享的方法、服务器和网络文件共享的系统
JP2019129336A (ja) 電子制御装置、監視方法、及びプログラム
WO2026045441A1 (zh) 环网通信冗余控制方法、装置、电子设备及可读存储介质
WO2023007209A1 (en) Fault-tolerant distributed computing for vehicular systems
CN115494721B (zh) 控制器的冗余控制方法、装置、控制器及系统
JP6134720B2 (ja) 接続方法
CN117014248A (zh) 一种应用于电动车的rs485总线的多设备通讯方法
CN116373946A (zh) 一种设备冗余方法、装置、列车网络控制系统及产品
KR101417402B1 (ko) 차량 네트워크에서의 게이트웨이 오류 대처 장치 및 그 방법
JP2017114406A (ja) ネットワークシステム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18819694

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

REG Reference to national code

Ref country code: BR

Ref legal event code: B01A

Ref document number: 112019027650

Country of ref document: BR

REG Reference to national code

Ref country code: BR

Ref legal event code: B01E

Ref document number: 112019027650

Country of ref document: BR

Free format text: APRESENTE A TRADUCAO SIMPLES DA FOLHA DE ROSTO DA CERTIDAO DE DEPOSITO DA PRIORIDADE CN 201710475925.5; OU DECLARACAO DE QUE OS DADOS DO PEDIDO INTERNACIONAL ESTAO FIELMENTE CONTIDOS NA PRIORIDADE REIVINDICADA, CONTENDO TODOS OS DADOS IDENTIFICADORES DESTA (TITULARES, NUMERO DE REGISTRO, DATA E TITULO), CONFORME O PARAGRAFO UNICO DO ART. 25 DA RESOLUCAO 77/2013. CABE SALIENTAR NAO FOI POSSIVEL INDIVIDUALIZAR OS TITULARES DA CITADA PRIORIDADE, INFORMACAO NECESSARIA PARA O EXAME DA CESSAO DO DOCUMENTO DE PRIORIDADE.

ENP Entry into the national phase

Ref document number: 112019027650

Country of ref document: BR

Kind code of ref document: A2

Effective date: 20191223

122 Ep: pct application non-entry in european phase

Ref document number: 18819694

Country of ref document: EP

Kind code of ref document: A1