WO2022242314A1 - Can communication redundancy method and communication apparatus - Google Patents

Can communication redundancy method and communication apparatus Download PDF

Info

Publication number
WO2022242314A1
WO2022242314A1 PCT/CN2022/083411 CN2022083411W WO2022242314A1 WO 2022242314 A1 WO2022242314 A1 WO 2022242314A1 CN 2022083411 W CN2022083411 W CN 2022083411W WO 2022242314 A1 WO2022242314 A1 WO 2022242314A1
Authority
WO
WIPO (PCT)
Prior art keywords
channel
network node
backup
channels
priority
Prior art date
Application number
PCT/CN2022/083411
Other languages
French (fr)
Chinese (zh)
Inventor
裴建龙
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2022242314A1 publication Critical patent/WO2022242314A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/40169Flexible bus arrangements
    • H04L12/40176Flexible bus arrangements involving redundancy
    • H04L12/40182Flexible bus arrangements involving redundancy by using a plurality of communication lines
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/22Arrangements for detecting or preventing errors in the information received using redundant apparatus to increase reliability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • 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
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/40Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass for recovering from a failure of a protocol instance or entity, e.g. service redundancy protocols, protocol state redundancy or protocol service redirection
    • 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

Definitions

  • a backup channel is designed for multiple CAN channels.
  • the multiplexer can be controlled to switch the CAN channel connected to the first network node to the first backup CAN channel.
  • the technical solution can realize the backup of multiple CAN channels through a backup CAN channel, which not only ensures the reliability of in-vehicle communication, but also reduces the cost of the in-vehicle communication system and the complexity of the structure of the in-vehicle wiring harness.
  • the multiplexer includes a plurality of bidirectional switches, and the plurality of bidirectional switches correspond to the plurality of network nodes one by one, and when detecting When the first CAN channel in the multiple CAN channels fails, controlling the multiplexer to switch the CAN channel connected to the first network node to the first backup CAN channel includes: controlling the multiplexer to switch the first CAN channel to the first backup CAN channel.
  • a bidirectional switch corresponding to a network node is disconnected from the first CAN channel and connected to the first backup CAN channel.
  • the controlling the multiplexer disconnects the bidirectional switch corresponding to the first network node from the first backup CAN channel, and disconnects the second
  • the switch disconnects the connection with the second CAN channel, and connects the bidirectional switch corresponding to the second network node to the first backup CAN channel.
  • the method further includes: when it is detected that the third CAN channel in the multiple CAN channels fails, controlling the multiplexer to communicate with The CAN channel connected to the third network node is switched from the third CAN channel to a second backup CAN channel, and the second backup CAN channel is a different CAN channel from the first backup CAN channel.
  • the first CAN channel includes at least two CAN channels, and the priority of the CAN channel connected to the first network node is higher than that connected to the third network node.
  • the priority of the CAN channel, the CAN channel connected to the third network node is a channel other than the CAN channel connected to the first network node among the at least two CAN channels.
  • the communication device when the instruction is executed by the processor, the communication device is made to perform the following steps: when the fourth CAN channel in the multiple CAN channels is detected When the CAN channel fails, determine the priority of the first CAN channel, the third CAN channel and the fourth CAN channel; when the priority of the fourth CAN channel is greater than the priority of the first CAN channel level, and the priority of the first CAN channel is greater than the priority of the third channel, control the multiplexer to disconnect the third network node from the second backup CAN channel, and the second The CAN channels connected by four network nodes are switched from the fourth CAN channel to the second backup CAN channel; or when the priority of the fourth CAN channel is greater than the priority of the first CAN channel, and the first CAN channel When the priority of a CAN channel is less than the priority of the third channel, control the multiplexer to disconnect the first network node from the first backup CAN channel, and connect the fourth network node to the CAN A channel is switched from the fourth
  • a chip includes a processor and a communication interface, the communication interface is used to receive a signal, and transmit the signal to the processor, and the processor processes the signal so that The method of CAN communication redundancy as described in the second aspect above is performed.
  • a computer program product including computer instructions, and when the computer instructions are run on a computer, the CAN communication redundancy method described in the second aspect above is executed.
  • FIG. 3 is a schematic diagram of another CAN communication system architecture provided by an embodiment of the present application.
  • one CAN channel may include a CAN transceiver and a CAN controller.
  • an external network node 110a is connected to a CAN channel through a bus 101a, and the CAN channel includes a CAN transceiver 102a and a CAN controller 103a.
  • the CAN transceiver 102a receives data from the bus and transmits the data to the CAN controller 103a; when sending data, the CAN transceiver 102a receives the coded signal sent by the CAN controller 103a, and converts the coded signal is a differential signal and sent to the network node 100a via the bus 101a.
  • the communication device 200 may include an MCU 210, multiple CAN transceivers, and a multiplexer 230, the MCU 210 may include multiple CAN controllers, and the multiplexer 230 may include a selector 231 and a multiplexer 230.
  • the external network node A is connected to the bidirectional switch A0 through the bus, and A0 is connected to the access point A1 of the CAN transceiver 221 , so that the external network node A is connected to the CAN channel through the bidirectional switch A0 .
  • the bidirectional switch A0 disconnects the connection with A1, and is connected to the access point A2 of the CAN transceiver 225 in the backup channel, so that the external network node can connect to the CAN backup channel.
  • the MCU210 when the MCU210 detects that the CAN transceiver 221 or the CAN controller 211 fails, the MCU210 will initialize the backup channel, and set the reception and transmission of the backup channel data as a complete mirror image of the CAN channel A connected to the external network node A; After the backup channel is completed, the MCU 210 sends switching instruction information to the selector 231 in the multiplexer 230; after the selector 231 receives the switching instruction information, it controls the bidirectional switch A0 to disconnect the CAN transceiver in the CAN channel A 221 access point A1, and connect A0 to the access point A2 of the CAN transceiver 225 of the backup channel, thereby completing the switch from the faulty channel to the backup channel.
  • the MCU210 when the MCU210 detects that the CAN transceiver 222 or the CAN controller 214 fails, the MCU210 will initialize the backup channel, and set the receiving and sending of the backup channel data as a complete image of the CAN channel B connected to the external network node B; After the backup channel is completed, the MCU 210 sends switching instruction information to the selector 231 in the multiplexer 230; after the selector 231 receives the switching instruction information, it controls the bidirectional switch B0 to disconnect the CAN transceiver in the CAN channel B. 222 access point B1, and connect B0 to the access point B2 of the CAN transceiver 225 of the backup channel, thereby completing the switch from the faulty channel to the backup channel.
  • the MACU 210 sends switching instruction information to the multiplexer, controls the bidirectional switch A0 to disconnect from A1, and connects A0 to A2, At this time, the external network node A has been connected to the backup channel. In this case, the MCU 210 detects that the CAN transceiver 222 fails again.
  • the priority of the CAN channel corresponding to the network node currently connected to the backup channel is greater than the priority of the CAN channel corresponding to another network node detected later, then continue to maintain the current state; if the CAN channel corresponding to the network node currently connected to the backup channel If the priority is lower than the priority of the CAN channel corresponding to another network node detected later, the network node currently connected to the backup channel will be disconnected from the backup channel, and another network node detected later will be connected to the backup channel. aisle.
  • the external network node corresponding to the CAN channel with the highest priority among the multiple faulty CAN channels can be connected to the backup channel to complete the switching from the faulty CAN channel to the backup channel.
  • multiple external network nodes are respectively connected to multiple CAN channels through bidirectional switches in the multiplexer, and a backup channel is designed.
  • the switch from the faulty CAN channel to the backup channel can be realized by controlling the disconnection and connection of the bidirectional switch.
  • the technical solution can not only ensure the reliability of the in-vehicle communication, but also reduce the cost of the in-vehicle communication system and the complexity of the structure of the in-vehicle wiring harness.
  • backup channel a including CAN controller 213, CAN transceiver 225, and backup channel b, including CAN controller 216, CAN transceiver 226 .
  • a fault has been detected on two CAN channels.
  • the order in which the two backup channels are used can be set in the system.
  • the order in which the two backup channels are used is not limited, and one of them is randomly selected during use.
  • the switch A0 disconnects the connection with A1 and connects to A2, then the CAN channel connected to the external network node is the backup channel a.
  • the determining the priority of the first CAN channel and the second CAN channel includes:
  • the technical solution switches the CAN channel with high priority to the backup channel, thereby helping to ensure the communication reliability of important data.
  • the first CAN channel may include multiple CAN channels.
  • the first CAN channel includes two CAN channels, that is, if two CAN channels are detected to be faulty at the same time, then the CAN channel connected to the first network node with high priority is switched to the first backup channel, which is beneficial to ensure Communication reliability of important data.
  • the fourth CAN channel in the multiple CAN channels fails, determine the priorities of the first CAN channel, the third CAN channel, and the fourth CAN channel;
  • control the multiplexer When the priority of the fourth CAN channel is greater than the priority of the first CAN channel, and the priority of the first CAN channel is less than or equal to the priority of the third channel, control the multiplexer to turn off Opening the connection between the first network node and the first backup CAN channel, and switching the CAN channel connected to the fourth network node from the fourth CAN channel to the first backup CAN channel.
  • the disclosed systems, devices and methods may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.

Abstract

The present application provides a CAN communication redundancy method and a communication apparatus, the method comprising: establishing a connection between multiple CAN channels and multiple network nodes, respectively; and when detected that a first CAN channel among the multiple CAN channels is faulty, controlling a multiplexer to switch a CAN channel connected to a first network node to a first backup CAN channel, the first CAN channel comprising a CAN channel connected to the first network node. Said technical solution may reduce the costs of a communication system and the complexity of a communication device while ensuring the reliability of in-vehicle network communication.

Description

CAN通信冗余的方法和通信装置CAN communication redundancy method and communication device
本申请要求于2021年05月21日提交中国专利局、申请号为202110557716.1、申请名称为“CAN通信冗余的方法和通信装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202110557716.1 and the application name "CAN communication redundancy method and communication device" submitted to the China Patent Office on May 21, 2021, the entire contents of which are incorporated herein by reference Applying.
技术领域technical field
本申请涉及通信领域,并且更具体地,涉及一种CAN通信冗余的方法和通信装置。The present application relates to the communication field, and more specifically, relates to a CAN communication redundancy method and communication device.
背景技术Background technique
在设计汽车车内网络通信时,为了保证通信的可靠性,一般会进行控制器局域网络(controller area network,CAN)通信的冗余设计。但是在冗余设计时,虽然提升了网络通信系统的可靠性,但也无可避免地带来了成本提升、车内线束结构复杂等问题。When designing the network communication in the car, in order to ensure the reliability of the communication, the redundant design of the controller area network (controller area network, CAN) communication is generally carried out. However, in the redundant design, although the reliability of the network communication system is improved, it inevitably brings about problems such as cost increase and complex wiring harness structure in the vehicle.
因此,如何在保证通信可靠的情况下,降低车内CAN通信系统的成本和车内线束结构的复杂度,成为需要解决的技术问题。Therefore, how to reduce the cost of the in-vehicle CAN communication system and the complexity of the in-vehicle wiring harness structure while ensuring reliable communication has become a technical problem to be solved.
发明内容Contents of the invention
本申请提供一种CAN通信冗余的方法和通信装置,该技术方案在保证车内通信可靠的同时,能够降低车内通信系统的成本和车内线束结构的复杂度。The present application provides a CAN communication redundancy method and communication device. The technical solution can reduce the cost of the in-vehicle communication system and the complexity of the in-vehicle wiring harness structure while ensuring the reliability of the in-vehicle communication.
第一方面,提供了一种CAN通信冗余的方法,该方法包括:多路CAN通道分别与多个网络节点建立连接;当检测到所述多路CAN通道中的第一CAN通道出现故障时,控制多路选择器将与第一网络节点连接的CAN通道切换至第一备份CAN通道,所述第一CAN通道包括与所述第一网络节点连接的CAN通道。In the first aspect, a method for CAN communication redundancy is provided, the method comprising: multiple CAN channels respectively establish connections with a plurality of network nodes; when it is detected that the first CAN channel in the multiple CAN channels fails and controlling the multiplexer to switch the CAN channel connected to the first network node to a first backup CAN channel, where the first CAN channel includes the CAN channel connected to the first network node.
基于本申请实施例,为多个CAN通道设计了一个备份通道,当第一网络节点连接的CAN通道出现故障时,可以控制多路选择器将第一网络节点连接的CAN通道切换至第一备份CAN通道。该技术方案可以实现通过一个备份CAN通道为多路CAN通道备份,不仅能够保证车内通信的可靠性,又能够降低车内通信系统的成本和车内线束结构的复杂度。Based on the embodiment of this application, a backup channel is designed for multiple CAN channels. When the CAN channel connected to the first network node fails, the multiplexer can be controlled to switch the CAN channel connected to the first network node to the first backup CAN channel. The technical solution can realize the backup of multiple CAN channels through a backup CAN channel, which not only ensures the reliability of in-vehicle communication, but also reduces the cost of the in-vehicle communication system and the complexity of the structure of the in-vehicle wiring harness.
结合第一方面,在第一方面的某些实现方式中,所述多路选择器包括多个双向开关,所述多个双向开关与所述多个网络节点一一对应,所述当检测到多路CAN通道中的第一CAN通道出现故障时,控制多路选择器将与第一网络节点连接的CAN通道切换至第一备份CAN通道,包括:控制所述多路选择器将所述第一网络节点对应的双向开关断开与所述第一CAN通道的连接,并连接至所述第一备份CAN通道。With reference to the first aspect, in some implementation manners of the first aspect, the multiplexer includes a plurality of bidirectional switches, and the plurality of bidirectional switches correspond to the plurality of network nodes one by one, and when detecting When the first CAN channel in the multiple CAN channels fails, controlling the multiplexer to switch the CAN channel connected to the first network node to the first backup CAN channel includes: controlling the multiplexer to switch the first CAN channel to the first backup CAN channel. A bidirectional switch corresponding to a network node is disconnected from the first CAN channel and connected to the first backup CAN channel.
基于本申请实施例,多路选择器包括多个双向开关,当检测到其中一个外部网络节点对应的CAN通道出现故障时,可通过控制双向开关的断开与连接实现故障CAN通道至备份通道的切换。Based on the embodiment of the present application, the multiplexer includes a plurality of bidirectional switches. When it is detected that the CAN channel corresponding to one of the external network nodes fails, the faulty CAN channel can be connected to the backup channel by controlling the disconnection and connection of the bidirectional switch. switch.
结合第一方面,在第一方面的某些实现方式中,所述控制所述多路选择器将所述第一 网络节点对应的双向开关断开与所述第一CAN通道的连接,并连接至所述第一备份CAN通道,包括:向所述多路选择器发送第一切换指示信息,所述第一切换指示信息用于指示所述多路选择器将所述第一网络节点对应的双向开关断开与所述第一CAN通道的连接,并连接至所述第一备份CAN通道。With reference to the first aspect, in some implementation manners of the first aspect, the controlling the multiplexer disconnects the bidirectional switch corresponding to the first network node from the first CAN channel, and connects To the first backup CAN channel, including: sending first switching instruction information to the multiplexer, the first switching instruction information is used to instruct the multiplexer to switch the first network node corresponding to The bidirectional switch is disconnected from the first CAN channel and connected to the first backup CAN channel.
基于本申请实施例,在需要切换CAN通道时,通过向多路选择器发送切换指示信息,指示其从故障通道切换至备份通道。Based on the embodiment of the present application, when the CAN channel needs to be switched, the multiplexer is instructed to switch from the faulty channel to the backup channel by sending switching instruction information.
结合第一方面,在第一方面的某些实现方式中,所述方法还包括:当检测到所述多路CAN通道中的第二CAN通道出现故障时,确定所述第一CAN通道与所述第二CAN通道的优先级;当所述第二CAN通道的优先级大于所述第一CAN通道的优先级时,控制所述多路选择器将所述第一网络节点对应的双向开关断开与所述第一备份CAN通道的连接,将第二网络节点对应的双向开关断开与所述第二CAN通道的连接,并将所述第二网络节点对应的双向开关连接至所述第一备份CAN通道。With reference to the first aspect, in some implementations of the first aspect, the method further includes: when it is detected that the second CAN channel in the multiple CAN channels fails, determining the relationship between the first CAN channel and the multiple CAN channels the priority of the second CAN channel; when the priority of the second CAN channel is greater than the priority of the first CAN channel, control the multiplexer to switch off the bidirectional switch corresponding to the first network node Open the connection with the first backup CAN channel, disconnect the bidirectional switch corresponding to the second network node from the second CAN channel, and connect the bidirectional switch corresponding to the second network node to the first A backup CAN channel.
基于本申请实施例,当检测两路CAN通道出现故障时,将优先级高的CAN通道切换至备份通道,从而有利于保证重要数据的通信可靠性。Based on the embodiment of the present application, when the failure of two CAN channels is detected, the CAN channel with higher priority is switched to the backup channel, which is beneficial to ensure the communication reliability of important data.
结合第一方面,在第一方面的某些实现方式中,所述确定所述第一CAN通道与所述第二CAN通道的优先级,包括:根据所述第一CAN通道与所述第二CAN通道传输的数据确定所述第一CAN通道与所述第二CAN通道的优先级。With reference to the first aspect, in some implementation manners of the first aspect, the determining the priority of the first CAN channel and the second CAN channel includes: according to the first CAN channel and the second CAN channel The data transmitted by the CAN channel determines the priority of the first CAN channel and the second CAN channel.
基于本申请实施例,可通过CAN通道内传输的数据判断CAN通道的优先级,从而有利于保证重要数据的通信可靠性。Based on the embodiment of the present application, the priority of the CAN channel can be judged by the data transmitted in the CAN channel, which is beneficial to ensure the communication reliability of important data.
结合第一方面,在第一方面的某些实现方式中,所述控制所述多路选择器将所述第一网络节点对应的双向开关与所述第一备份CAN通道断开,将第二网络节点对应的双向开关与所述第二CAN通道断开,并将所述第二网络节点对应的双向开关连接至所述第一备份CAN通道,包括:向多路选择器发送第二切换指示信息,所述第二切换指示信息用于指示所述多路选择器将所述第一网络节点对应的双向开关断开与所述第一备份CAN通道的连接,将第二网络节点对应的双向开关断开与所述第二CAN通道的连接,并将所述第二网络节点对应的双向开关连接至所述第一备份CAN通道。With reference to the first aspect, in some implementation manners of the first aspect, the controlling the multiplexer disconnects the bidirectional switch corresponding to the first network node from the first backup CAN channel, and disconnects the second The bidirectional switch corresponding to the network node is disconnected from the second CAN channel, and connecting the bidirectional switch corresponding to the second network node to the first backup CAN channel includes: sending a second switching instruction to the multiplexer information, the second switching indication information is used to instruct the multiplexer to disconnect the bidirectional switch corresponding to the first network node from the first backup CAN channel, and to disconnect the bidirectional switch corresponding to the second network node The switch disconnects the connection with the second CAN channel, and connects the bidirectional switch corresponding to the second network node to the first backup CAN channel.
结合第一方面,在第一方面的某些实现方式中,所述第一CAN通道包括至少两路CAN通道,与所述第一网络节点连接的CAN通道的优先级大于与第三网络节点连接的CAN通道的优先级,与所述第三网络节点连接的CAN通道为所述至少两个CAN通道中除与所述第一网络节点连接的CAN通道之外的通道。With reference to the first aspect, in some implementations of the first aspect, the first CAN channel includes at least two CAN channels, and the priority of the CAN channel connected to the first network node is higher than that connected to the third network node. The priority of the CAN channel, the CAN channel connected to the third network node is a channel other than the CAN channel connected to the first network node among the at least two CAN channels.
基于本申请实施例,当第一CAN通道包括多路CAN通道时,第一网络节点连接的CAN通道的优先级更高,从而有利于保证重要数据的通信可靠性。Based on the embodiment of the present application, when the first CAN channel includes multiple CAN channels, the priority of the CAN channel connected to the first network node is higher, which is beneficial to ensure communication reliability of important data.
结合第一方面,在第一方面的某些实现方式中,所述方法还包括:当检测到所述多路CAN通道中的第三CAN通道出现故障时,控制所述多路选择器将与第三网络节点连接的CAN通道从所述第三CAN通道切换至第二备份CAN通道,所述第二备份CAN通道与所述第一备份CAN通道为不同的CAN通道。With reference to the first aspect, in some implementations of the first aspect, the method further includes: when it is detected that the third CAN channel in the multiple CAN channels fails, controlling the multiplexer to communicate with The CAN channel connected to the third network node is switched from the third CAN channel to a second backup CAN channel, and the second backup CAN channel is a different CAN channel from the first backup CAN channel.
基于本申请实施例,该技术方案设计了两路备份通道,从而可以提升车内通信的可靠性。Based on the embodiment of the present application, the technical solution designs two backup channels, thereby improving the reliability of in-vehicle communication.
结合第一方面,在第一方面的某些实现方式中,所述方法还包括:当检测到所述多路 CAN通道中的第四CAN通道出现故障时,确定所述第一CAN通道、所述第三CAN通道和所述第四CAN通道的优先级;当所述第四CAN通道的优先级大于所述第一CAN通道的优先级,且所述第一CAN通道的优先级大于第三通道的优先级时,控制所述多路选择器断开所述第三网络节点与所述第二备份CAN通道的连接,并将第四网络节点连接的CAN通道从所述第四CAN通道切换至所述第二备份CAN通道;或者当所述第四CAN通道的优先级大于所述第一CAN通道的优先级,且所述第一CAN通道的优先级小于第三通道的优先级时,控制所述多路选择器断开所述第一网络节点与所述第一备份CAN通道的连接,并将第四网络节点连接的CAN通道从所述第四CAN通道切换至所述第一备份CAN通道。With reference to the first aspect, in some implementations of the first aspect, the method further includes: when it is detected that the fourth CAN channel in the multiple CAN channels fails, determine the first CAN channel, the The priority of the third CAN channel and the fourth CAN channel; when the priority of the fourth CAN channel is greater than the priority of the first CAN channel, and the priority of the first CAN channel is greater than the third When the priority of the channel is selected, the multiplexer is controlled to disconnect the connection between the third network node and the second backup CAN channel, and the CAN channel connected to the fourth network node is switched from the fourth CAN channel to the second backup CAN channel; or when the priority of the fourth CAN channel is greater than the priority of the first CAN channel, and the priority of the first CAN channel is less than the priority of the third channel, controlling the multiplexer to disconnect the first network node from the first backup CAN channel, and switching the CAN channel connected to the fourth network node from the fourth CAN channel to the first backup CAN channel.
基于本申请实施例,在有两路备份通道的情况下,将优先级高的两路CAN通道切换至该两路备份通道,从而有利于保证车内重要数据的通信可靠性。Based on the embodiment of the present application, when there are two backup channels, the two CAN channels with high priority are switched to the two backup channels, which is beneficial to ensure the communication reliability of important data in the vehicle.
第二方面,提供了一种CAN通信冗余的方法,该方法包括:多路CAN通道分别与多个网络节点建立连接;当同时检测到所述多路CAN通道中的至少两路CAN通道出现故障时,确定所述至少两路CAN通道的优先级;控制多路选择器将所述至少两路CAN通道中优先级高的两路CAN通道分别切换至两路备份CAN通道。In a second aspect, a method for CAN communication redundancy is provided, the method comprising: multiple CAN channels respectively establish connections with a plurality of network nodes; when at least two CAN channels in the multiple CAN channels are simultaneously detected to appear In case of failure, determine the priority of the at least two CAN channels; control the multiplexer to switch the two CAN channels with higher priority among the at least two CAN channels to the two backup CAN channels respectively.
本申请实施例中,为通信系统设计了两路备份CAN通道,在有多路CAN通道同时出现故障时,可以将优先级高的两路CAN通道分别切换至两路备份通道中。In the embodiment of the present application, two backup CAN channels are designed for the communication system. When multiple CAN channels fail at the same time, the two CAN channels with higher priority can be switched to the two backup channels respectively.
由于各个CAN通道传输的数据的重要程度可能是不同的,因此,该技术方案有利于保证重要数据的通信可靠性。Since the importance of data transmitted by each CAN channel may be different, this technical solution is beneficial to ensure the communication reliability of important data.
第三方面,提供一种通信装置,其特征在于,包括:存储器,用于存储指令;处理器,用于读取所述指令,当所述指令被所述处理器执行时,使得所述通信装置执行以下步骤:多路CAN通道分别与多个网络节点建立连接;当检测到所述多路CAN通道中的第一CAN通道出现故障时,控制多路选择器将与第一网络节点连接的CAN通道切换至第一备份CAN通道,所述第一CAN通道包括与所述第一网络节点连接的CAN通道。In a third aspect, there is provided a communication device, which is characterized in that it includes: a memory for storing instructions; a processor for reading the instructions, and when the instructions are executed by the processor, the communication The device performs the following steps: multiple CAN channels respectively establish connections with multiple network nodes; when it is detected that the first CAN channel in the multiple CAN channels fails, the control multiplexer will The CAN channel is switched to a first backup CAN channel, and the first CAN channel includes a CAN channel connected to the first network node.
结合第三方面,在第三方面的某些实现方式中,所述多路选择器包括多个双向开关,所述多个双向开关与所述多个网络节点一一对应,当所述指令被所述处理器执行时,使得所述通信装置执行以下步骤:控制所述多路选择器将所述第一网络节点对应的双向开关断开与所述第一CAN通道的连接,并连接至所述第一备份CAN通道。With reference to the third aspect, in some implementation manners of the third aspect, the multiplexer includes a plurality of bidirectional switches, and the plurality of bidirectional switches correspond to the plurality of network nodes one by one, and when the instruction is When the processor is executed, the communication device performs the following steps: control the multiplexer to disconnect the bidirectional switch corresponding to the first network node from the first CAN channel and connect it to the Describe the first backup CAN channel.
结合第三方面,在第三方面的某些实现方式中,当所述指令被所述处理器执行时,使得所述通信装置执行以下步骤:向所述多路选择器发送第一切换指示信息,所述第一切换指示信息用于指示所述多路选择器将所述第一网络节点对应的双向开关断开与所述第一CAN通道的连接,并连接至所述第一备份CAN通道。With reference to the third aspect, in some implementation manners of the third aspect, when the instruction is executed by the processor, the communication device is caused to perform the following step: sending the first switching indication information to the multiplexer , the first switching instruction information is used to instruct the multiplexer to disconnect the bidirectional switch corresponding to the first network node from the first CAN channel and connect it to the first backup CAN channel .
结合第三方面,在第三方面的某些实现方式中,当所述指令被所述处理器执行时,使得所述通信装置执行以下步骤:当检测到所述多路CAN通道中的第二CAN通道出现故障时,确定所述第一CAN通道与所述第二CAN通道的优先级;当所述第二CAN通道的优先级大于所述第一CAN通道的优先级时,控制所述多路选择器将所述第一网络节点对应的双向开关断开与所述第一备份CAN通道的连接,将第二网络节点对应的双向开关断开与所述第二CAN通道的连接,并将所述第二网络节点对应的双向开关连接至所述第一备份CAN通道。With reference to the third aspect, in some implementation manners of the third aspect, when the instruction is executed by the processor, the communication device is made to perform the following steps: when the second CAN channel in the multiple CAN channels is detected When the CAN channel fails, determine the priority of the first CAN channel and the second CAN channel; when the priority of the second CAN channel is greater than the priority of the first CAN channel, control the multiple The road selector disconnects the bidirectional switch corresponding to the first network node from the first backup CAN channel, disconnects the bidirectional switch corresponding to the second network node from the second CAN channel, and The bidirectional switch corresponding to the second network node is connected to the first backup CAN channel.
结合第三方面,在第三方面的某些实现方式中,当所述指令被所述处理器执行时,使得所述通信装置执行以下步骤:根据所述第一CAN通道与所述第二CAN通道传输的数据确定所述第一CAN通道与所述第二CAN通道的优先级。With reference to the third aspect, in some implementation manners of the third aspect, when the instruction is executed by the processor, the communication device is made to perform the following steps: according to the first CAN channel and the second CAN channel, The data transmitted by the channel determines the priority of the first CAN channel and the second CAN channel.
结合第三方面,在第三方面的某些实现方式中,当所述指令被所述处理器执行时,使得所述通信装置执行以下步骤:向多路选择器发送第二切换指示信息,所述第二切换指示信息用于指示所述多路选择器将所述第一网络节点对应的双向开关断开与所述第一备份CAN通道的连接,将第二网络节点对应的双向开关断开与所述第二CAN通道的连接,并将所述第二网络节点对应的双向开关连接至所述第一备份CAN通道。With reference to the third aspect, in some implementation manners of the third aspect, when the instruction is executed by the processor, the communication device is caused to perform the following step: sending the second switching indication information to the multiplexer, so that The second switching instruction information is used to instruct the multiplexer to disconnect the bidirectional switch corresponding to the first network node from the first backup CAN channel, and to disconnect the bidirectional switch corresponding to the second network node connection with the second CAN channel, and connect the bidirectional switch corresponding to the second network node to the first backup CAN channel.
结合第三方面,在第三方面的某些实现方式中,所述第一CAN通道包括至少两路CAN通道,与所述第一网络节点连接的CAN通道的优先级大于与第三网络节点连接的CAN通道的优先级,与所述第三网络节点连接的CAN通道为所述至少两个CAN通道中除与所述第一网络节点连接的CAN通道之外的通道。With reference to the third aspect, in some implementation manners of the third aspect, the first CAN channel includes at least two CAN channels, and the priority of the CAN channel connected to the first network node is higher than that connected to the third network node. The priority of the CAN channel, the CAN channel connected to the third network node is a channel other than the CAN channel connected to the first network node among the at least two CAN channels.
结合第三方面,在第三方面的某些实现方式中,当所述指令被所述处理器执行时,使得所述通信装置执行以下步骤:当检测到所述多路CAN通道中的第三CAN通道出现故障时,控制所述多路选择器将与第三网络节点连接的CAN通道从所述第三CAN通道切换至第二备份CAN通道,所述第二备份CAN通道与所述第一备份CAN通道为不同的CAN通道。With reference to the third aspect, in some implementation manners of the third aspect, when the instruction is executed by the processor, the communication device is made to perform the following steps: when the third CAN channel in the multiple CAN channels is detected When the CAN channel fails, the multiplexer is controlled to switch the CAN channel connected to the third network node from the third CAN channel to the second backup CAN channel, and the second backup CAN channel is connected to the first The backup CAN channel is a different CAN channel.
结合第三方面,在第三方面的某些实现方式中,当所述指令被所述处理器执行时,使得所述通信装置执行以下步骤:当检测到所述多路CAN通道中的第四CAN通道出现故障时,确定所述第一CAN通道、所述第三CAN通道和所述第四CAN通道的优先级;当所述第四CAN通道的优先级大于所述第一CAN通道的优先级,且所述第一CAN通道的优先级大于第三通道的优先级时,控制所述多路选择器断开所述第三网络节点与所述第二备份CAN通道的连接,并将第四网络节点连接的CAN通道从所述第四CAN通道切换至所述第二备份CAN通道;或者当所述第四CAN通道的优先级大于所述第一CAN通道的优先级,且所述第一CAN通道的优先级小于第三通道的优先级时,控制所述多路选择器断开所述第一网络节点与所述第一备份CAN通道的连接,并将第四网络节点连接的CAN通道从所述第四CAN通道切换至所述第一备份CAN通道。With reference to the third aspect, in some implementation manners of the third aspect, when the instruction is executed by the processor, the communication device is made to perform the following steps: when the fourth CAN channel in the multiple CAN channels is detected When the CAN channel fails, determine the priority of the first CAN channel, the third CAN channel and the fourth CAN channel; when the priority of the fourth CAN channel is greater than the priority of the first CAN channel level, and the priority of the first CAN channel is greater than the priority of the third channel, control the multiplexer to disconnect the third network node from the second backup CAN channel, and the second The CAN channels connected by four network nodes are switched from the fourth CAN channel to the second backup CAN channel; or when the priority of the fourth CAN channel is greater than the priority of the first CAN channel, and the first CAN channel When the priority of a CAN channel is less than the priority of the third channel, control the multiplexer to disconnect the first network node from the first backup CAN channel, and connect the fourth network node to the CAN A channel is switched from the fourth CAN channel to the first backup CAN channel.
第四方面,提供一种通信装置,包括:存储器,用于存储指令;处理器,用于读取所述指令,当所述指令被所述处理器执行时,使得所述通信装置执行以下步骤:多路CAN通道分别与多个网络节点建立连接;当同时检测到所述多路CAN通道中的至少两路CAN通道出现故障时,确定所述至少两路CAN通道的优先级;控制多路选择器将所述至少两路CAN通道中优先级高的两路CAN通道分别切换至两路备份CAN通道。In a fourth aspect, a communication device is provided, including: a memory for storing instructions; a processor for reading the instructions, and when the instructions are executed by the processor, the communication device performs the following steps : Multiple CAN channels respectively establish connections with multiple network nodes; when at least two CAN channels in the multiple CAN channels are detected to be faulty, determine the priority of the at least two CAN channels; control multiple CAN channels The selector switches the two CAN channels with higher priority among the at least two CAN channels to the two backup CAN channels respectively.
第五方面,提供一种芯片,所述芯片包括处理器和通信接口,所述通信接口用于接收信号,并将所述信号传输至所述处理器,所述处理器处理所述信号,使得如上述第一方面及其任一种可能的实现方式中所述的CAN通信冗余的方法被执行。In a fifth aspect, there is provided a chip, the chip includes a processor and a communication interface, the communication interface is used to receive a signal, and transmit the signal to the processor, and the processor processes the signal so that The method for CAN communication redundancy as described in the above first aspect and any possible implementation thereof is executed.
第六方面,提供一种芯片,所述芯片包括处理器和通信接口,所述通信接口用于接收信号,并将所述信号传输至所述处理器,所述处理器处理所述信号,使得如上述第二方面中所述的CAN通信冗余的方法被执行。According to a sixth aspect, a chip is provided, the chip includes a processor and a communication interface, the communication interface is used to receive a signal, and transmit the signal to the processor, and the processor processes the signal so that The method of CAN communication redundancy as described in the second aspect above is performed.
第七方面,提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机 指令,当所述计算机指令在计算机上运行时,使得如上述第一方面及其任一种可能的实现方式中所述的CAN通信冗余的方法被执行。In a seventh aspect, a computer-readable storage medium is provided. Computer instructions are stored in the computer-readable storage medium. When the computer instructions are run on a computer, the above-mentioned first aspect and any possible The method for implementing CAN communication redundancy described in the manner is implemented.
第八方面,提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机指令,当所述计算机指令在计算机上运行时,使得如上述第二方面中所述的CAN通信冗余的方法被执行。In an eighth aspect, a computer-readable storage medium is provided, wherein computer instructions are stored in the computer-readable storage medium, and when the computer instructions are run on a computer, the CAN communication as described in the second aspect above can be redundantly The rest of the methods are executed.
第九方面,提供一种计算机程序产品,包括计算机指令,当所述计算机指令在计算机上运行时,使得如上述第一方面及其任一种可能的实现方式中所述的CAN通信冗余的方法被执行。In the ninth aspect, there is provided a computer program product, including computer instructions, when the computer instructions are run on a computer, the CAN communication as described in the above first aspect and any possible implementation thereof is redundant. method is executed.
第十方面,提供一种计算机程序产品,包括计算机指令,当所述计算机指令在计算机上运行时,使得如上述第二方面中所述的CAN通信冗余的方法被执行。In a tenth aspect, a computer program product is provided, including computer instructions, and when the computer instructions are run on a computer, the CAN communication redundancy method described in the second aspect above is executed.
附图说明Description of drawings
图1是本申请实施例提供的一种CAN通信系统架构的示意图。FIG. 1 is a schematic diagram of a CAN communication system architecture provided by an embodiment of the present application.
图2是本申请实施例提供的另一种CAN通信系统架构的示意图。FIG. 2 is a schematic diagram of another CAN communication system architecture provided by an embodiment of the present application.
图3是本申请实施例提供的另一种CAN通信系统架构的示意图。FIG. 3 is a schematic diagram of another CAN communication system architecture provided by an embodiment of the present application.
图4是本申请实施例提供的一种CAN通信冗余的方法的示意性流程图。Fig. 4 is a schematic flowchart of a CAN communication redundancy method provided by an embodiment of the present application.
图5是本申请实施例提供的另一种CAN通信冗余的方法的示意性流程图。Fig. 5 is a schematic flowchart of another CAN communication redundancy method provided by the embodiment of the present application.
具体实施方式Detailed ways
下面将结合附图,对本申请中的技术方案进行描述。The technical solution in this application will be described below with reference to the accompanying drawings.
本申请实施例的技术方案可以应用于汽车车内通信系统中。The technical solutions of the embodiments of the present application can be applied to an in-vehicle communication system of an automobile.
图1是本申请实施例提供的一种CAN通信系统架构的示意图。FIG. 1 is a schematic diagram of a CAN communication system architecture provided by an embodiment of the present application.
如图1所示,外部网络节点100a、网络节点100b与通信装置100进行通信,该通信装置100可以包括微控制单元(micro control unit,MCU)110,该微控制单元110中可以包括多个CAN控制器,该通信装置100还可以包括多个CAN收发器。As shown in Figure 1, the external network node 100a, the network node 100b communicate with the communication device 100, and the communication device 100 may include a micro control unit (micro control unit, MCU) 110, which may include a plurality of CAN A controller, the communication device 100 may also include multiple CAN transceivers.
其中,一路CAN通道可以包括一个CAN收发器和一个CAN控制器。参见图1,外部网络节点110a通过总线101a连接至一路CAN通道,该CAN通道包括CAN收发器102a和CAN控制器103a。接收数据时,该CAN收发器102a从总线接收数据,并将该数据传输到CAN控制器103a;发送数据时,该CAN收发器102a接收CAN控制器103a发送的编码信号,并将该编码信号转化为差分信号并通过总线101a发送至网络节点100a。Wherein, one CAN channel may include a CAN transceiver and a CAN controller. Referring to Fig. 1, an external network node 110a is connected to a CAN channel through a bus 101a, and the CAN channel includes a CAN transceiver 102a and a CAN controller 103a. When receiving data, the CAN transceiver 102a receives data from the bus and transmits the data to the CAN controller 103a; when sending data, the CAN transceiver 102a receives the coded signal sent by the CAN controller 103a, and converts the coded signal is a differential signal and sent to the network node 100a via the bus 101a.
例如,该外部网络节点100a、100b可以是发动机控制单元、电动助力转向控制单元、空调控制单元等任何可以通过CAN总线接入的功能单元或设备。For example, the external network nodes 100a, 100b may be any functional units or devices that can be accessed through the CAN bus, such as an engine control unit, an electric power steering control unit, and an air conditioning control unit.
为保证CAN通信系统的稳定性,一般会对CAN通信进行冗余设计,参见图1,该通信装置100为外部网络节点100a设计了备份通道a,该备份通道a包括CAN收发器104a和CAN控制器105a,该外部网络节点100a通过总线106a连接至该备份通道a,当外部网络节点100a正常情况下连接的CAN通道出现故障时,可以将该外部网络节点100a切切换至备份通道a。In order to ensure the stability of the CAN communication system, CAN communication is generally designed redundantly. Referring to FIG. The external network node 100a is connected to the backup channel a through the bus 106a. When the CAN channel normally connected to the external network node 100a fails, the external network node 100a can be switched to the backup channel a.
应理解,本申请实施例中,一个CAN控制器对应一个CAN收发器。It should be understood that, in the embodiment of the present application, one CAN controller corresponds to one CAN transceiver.
可选地,一个CAN控制器可以对应多个CAN收发器,当CAN通道出现故障时,有 可能是CAN收发器发生故障,也有可能是CAN控制器发生故障,还有可能是总线发生故障等等。Optionally, one CAN controller can correspond to multiple CAN transceivers. When the CAN channel fails, it may be that the CAN transceiver fails, or the CAN controller fails, or the bus fails, etc. .
对于外部网络节点B来说,同样进行了备份通道b的设计,当其接入的CAN通道出现故障时,可以切换至备份通道b,从而能够提高车内网络通信的可靠性。For the external network node B, the design of the backup channel b is also carried out. When the CAN channel connected to it fails, it can be switched to the backup channel b, thereby improving the reliability of the in-vehicle network communication.
图1中的外部网络节点通过两条总线分别接入两路CAN通道,在一些实施例中,外部网络节点也可以通过一条总线接入两路CAN通道中,该方案尽管节省了一条总线,但整体上仍较为复杂。The external network node in Fig. 1 is respectively connected to two CAN channels through two buses. In some embodiments, the external network node can also be connected to two CAN channels through one bus. Although this solution saves one bus, the Overall it is still complex.
可以看出,对于每个外部网络节点来说,通信装置100均对其CAN通道进行了备份设计,尽管能够提升车内网络通信的可靠性,但是车内的外部网络节点较多时,车内网络拓扑会变得复杂,其线束部署也十分繁琐,此外,对于每个网络节点均进行备份通道的设计,进一步增加了通信的成本。It can be seen that for each external network node, the communication device 100 has a backup design for its CAN channel. Although it can improve the reliability of in-vehicle network communication, when there are many external network nodes in the vehicle, the in-vehicle network The topology will become complicated, and the deployment of its wiring harness is also very cumbersome. In addition, a backup channel is designed for each network node, which further increases the cost of communication.
有鉴于此,本申请实施例提供一种CAN通信冗余的方法和通信装置,该技术方案在保证车内通信可靠的同时,能够降低车内通信系统的成本和车内线束结构的复杂度。In view of this, the embodiments of the present application provide a CAN communication redundancy method and communication device. The technical solution can reduce the cost of the in-vehicle communication system and the complexity of the in-vehicle wiring harness structure while ensuring the reliability of the in-vehicle communication.
下面将结合图2至图5,介绍本申请实施例中的CAN通信冗余的方法和通信装置。The CAN communication redundancy method and communication device in the embodiments of the present application will be introduced below with reference to FIG. 2 to FIG. 5 .
图2是本申请实施例提供的另一种CAN通信系统架构的示意图。FIG. 2 is a schematic diagram of another CAN communication system architecture provided by an embodiment of the present application.
如图2所示,该通信装置200可以包括MCU210、多个CAN收发器和多路选择器230,该MCU210中可以包括多个CAN控制器,该多路选择器230中可以包括选择器231和多个双向开关,每个双向开关与一个外部网络节点相对应。As shown in FIG. 2 , the communication device 200 may include an MCU 210, multiple CAN transceivers, and a multiplexer 230, the MCU 210 may include multiple CAN controllers, and the multiplexer 230 may include a selector 231 and a multiplexer 230. A plurality of bidirectional switches, each corresponding to an external network node.
可选地,该CAN控制器也可以不在MCU210中,而是作为一个独立的器件存在,本申请实施例对此不予限定。Optionally, the CAN controller may not be in the MCU 210 but exist as an independent device, which is not limited in this embodiment of the present application.
参见图2,外部网络节点A通过总线连接至双向开关A0,A0连接至CAN收发器221的接入点A1,从而该外部网络节点A通过该双向开关A0连接至CAN通道中。当该外部网络节点A连接的CAN通道A出现故障时,该双向开关A0断开与A1的连接,并连接至备份通道中的CAN收发器225的接入点A2,从而该外部网络节点可以连接至CAN备份通道。Referring to FIG. 2 , the external network node A is connected to the bidirectional switch A0 through the bus, and A0 is connected to the access point A1 of the CAN transceiver 221 , so that the external network node A is connected to the CAN channel through the bidirectional switch A0 . When the CAN channel A connected to the external network node A fails, the bidirectional switch A0 disconnects the connection with A1, and is connected to the access point A2 of the CAN transceiver 225 in the backup channel, so that the external network node can connect to the CAN backup channel.
具体地,当MCU210检测到CAN收发器221或CAN控制器211出现故障时,MCU210会初始化备份通道,并设置备份通道数据的接收和发送为外部网络节点A连接的CAN通道A的完全镜像;初始化备份通道完成之后,该MCU210向多路选择器230中的选择器231发送切换指示信息;该选择器231接收到该切换指示信息之后,控制双向开关A0断开与CAN通道A中的CAN收发器221的接入点A1的连接,并将A0连接至备份通道的CAN收发器225的接入点A2,从而完成从故障通道至备份通道的切换。Specifically, when the MCU210 detects that the CAN transceiver 221 or the CAN controller 211 fails, the MCU210 will initialize the backup channel, and set the reception and transmission of the backup channel data as a complete mirror image of the CAN channel A connected to the external network node A; After the backup channel is completed, the MCU 210 sends switching instruction information to the selector 231 in the multiplexer 230; after the selector 231 receives the switching instruction information, it controls the bidirectional switch A0 to disconnect the CAN transceiver in the CAN channel A 221 access point A1, and connect A0 to the access point A2 of the CAN transceiver 225 of the backup channel, thereby completing the switch from the faulty channel to the backup channel.
同样的,外部网络节点B通过总线连接至双向开关B0,B0连接至CAN收发器222的接入点B1,从而该外部网络节点B通过该双向开关B0连接至CAN通道中。当该外部网络节点B连接的CAN通道出现故障时,该双向开关B0断开与B1的连接,并连接至备份通道中的CAN收发器225的接入点B2,从而该外部网络节点可以连接至CAN备份通道。Similarly, the external network node B is connected to the bidirectional switch B0 through the bus, and B0 is connected to the access point B1 of the CAN transceiver 222, so that the external network node B is connected to the CAN channel through the bidirectional switch B0. When the CAN channel connected to the external network node B fails, the bidirectional switch B0 disconnects the connection with B1, and connects to the access point B2 of the CAN transceiver 225 in the backup channel, so that the external network node can be connected to CAN backup channel.
具体地,当MCU210检测到CAN收发器222或CAN控制器214出现故障时,MCU210会初始化备份通道,并设置备份通道数据的接收和发送为外部网络节点B连接的CAN通道B的完全镜像;初始化备份通道完成之后,该MCU210向多路选择器230中的选择器 231发送切换指示信息;该选择器231接收到该切换指示信息之后,控制双向开关B0断开与CAN通道B中的CAN收发器222的接入点B1的连接,并将B0连接至备份通道的CAN收发器225的接入点B2,从而完成从故障通道至备份通道的切换。Specifically, when the MCU210 detects that the CAN transceiver 222 or the CAN controller 214 fails, the MCU210 will initialize the backup channel, and set the receiving and sending of the backup channel data as a complete image of the CAN channel B connected to the external network node B; After the backup channel is completed, the MCU 210 sends switching instruction information to the selector 231 in the multiplexer 230; after the selector 231 receives the switching instruction information, it controls the bidirectional switch B0 to disconnect the CAN transceiver in the CAN channel B. 222 access point B1, and connect B0 to the access point B2 of the CAN transceiver 225 of the backup channel, thereby completing the switch from the faulty channel to the backup channel.
对于外部网络节点C和外部网络节点D来说,可以参照外部网络节点A、外部网络节点B的相关描述,为了简洁,不再赘述。For the external network node C and the external network node D, reference may be made to the relevant descriptions of the external network node A and the external network node B, and for the sake of brevity, details are not repeated here.
本申请实施例中,为多个外部通信节点设计了一个备份通道,该备份通道包括CAN收发器225和CAN控制器213,该CAN收发器225具有四个接入点A2、B2、C2、D2,分别对应四个外部网络节点,当四个外部网络节点中的其中一个网络节点连接的CAN通道出现故障时,可通过该多路选择器中的双向开关完成从故障CAN通道到备份通道的切换。In the embodiment of the present application, a backup channel is designed for multiple external communication nodes, the backup channel includes CAN transceiver 225 and CAN controller 213, and the CAN transceiver 225 has four access points A2, B2, C2, D2 , respectively corresponding to four external network nodes, when the CAN channel connected to one of the four external network nodes fails, the switch from the faulty CAN channel to the backup channel can be completed through the bidirectional switch in the multiplexer .
应理解,本申请实施例以四个外部网络节点为例进行说明,但这不应对本申请造成任何限定,在实际应用中,该外部网络节点的数量可以不做具体限定。It should be understood that the embodiment of the present application uses four external network nodes as an example for description, but this should not cause any limitation to the present application. In practical applications, the number of external network nodes may not be specifically limited.
上文介绍了多个外部网络节点中的其中一个网络节点连接的CAN通道出现故障的情形,在一些示例中,有可能出现多个网络节点连接的CAN通道出现故障的情况。The above describes the situation that the CAN channel connected to one of the multiple external network nodes fails. In some examples, it is possible that the CAN channel connected to multiple network nodes fails.
可能出现的CAN通道的故障情形是:Possible failure scenarios for CAN channels are:
情形一:Scenario 1:
在检测到其中一个网络节点对应的CAN通道出现故障,已经将该网络节点对应的CAN通道切换至备份通道的情况下,又检测到另一个网络节点对应的CAN通道出现故障。When it is detected that the CAN channel corresponding to one of the network nodes has failed, and the CAN channel corresponding to the network node has been switched to a backup channel, it is detected that the CAN channel corresponding to another network node has failed.
例如,当外部网络节点A对应的CAN通道出现故障(如,CAN收发器211故障),MACU210向多路选择器发送切换指示信息,控制双向开关A0与A1断开,并将A0连接至A2,此时,外部网络节点A已经连接至备份通道,这种情况下,MCU210又检测到CAN收发器222出现故障。For example, when the CAN channel corresponding to the external network node A fails (for example, the CAN transceiver 211 fails), the MACU 210 sends switching instruction information to the multiplexer, controls the bidirectional switch A0 to disconnect from A1, and connects A0 to A2, At this time, the external network node A has been connected to the backup channel. In this case, the MCU 210 detects that the CAN transceiver 222 fails again.
情形二:Scenario 2:
同时检测到多路网络节点对应的CAN通道出现故障。At the same time, it is detected that the CAN channel corresponding to the multi-channel network node fails.
例如,当CAN控制器211和CAN控制器214出现故障时,该CAN控制器对应的CAN通道A和CAN通道B会出现故障。For example, when CAN controller 211 and CAN controller 214 fail, CAN channel A and CAN channel B corresponding to the CAN controller will fail.
对于上述可能出现的CAN通道的故障情形,本申请实施例在通信系统初始设计时,会根据各路CAN通道中传输的数据的重要性,制定各路CAN通道的优先级,在多个CAN通道出现故障时,根据各路CAN通道的优先级的高低,优先将优先级高的CAN通道切换至备份通道。For the above-mentioned failure situations of CAN channels that may occur, in the initial design of the communication system in the embodiment of the present application, the priority of each CAN channel will be formulated according to the importance of the data transmitted in each CAN channel. When a fault occurs, according to the priority of each CAN channel, the CAN channel with higher priority will be switched to the backup channel.
对于上述情形一:For the above situation one:
由于在通信系统初始设计时,已经制定了各路CAN通道的优先级顺序,此时可以判断当前连接备份通道的网络节点对应的CAN通道的优先级和后检测到的另一网络节点对应的CAN通道的优先级的大小。若当前连接备份通道的网络节点对应的CAN通道的优先级大于后检测到的另一网络节点对应的CAN通道的优先级,则继续保持当前状态;若当前连接备份通道的网络节点对应的CAN通道的优先级小于后检测到的另一网络节点对应的CAN通道的优先级,则将当前连接备份通道的网络节点断开与备份通道的连接,并将后检测到的另一网络节点连接至备份通道。Since the priority order of each CAN channel has been established during the initial design of the communication system, at this time, the priority of the CAN channel corresponding to the network node currently connected to the backup channel and the CAN channel corresponding to another network node detected later can be judged. The size of the priority of the channel. If the priority of the CAN channel corresponding to the network node currently connected to the backup channel is greater than the priority of the CAN channel corresponding to another network node detected later, then continue to maintain the current state; if the CAN channel corresponding to the network node currently connected to the backup channel If the priority is lower than the priority of the CAN channel corresponding to another network node detected later, the network node currently connected to the backup channel will be disconnected from the backup channel, and another network node detected later will be connected to the backup channel. aisle.
例如,外部网络节点A连接的CAN通道A出现故障,且该网络节点A已经连接至 备份通道,此时,又检测到外部网络节点B对应的CAN通道B出现故障。若CAN通道A的优先级大于CAN通道B的优先级,则保持当前状态,若CAN通道的优先级小于CAN通道B的优先级,则断开外部网络节点A与备份通道的连接,将外部网络节点B连接至该备份通道。For example, the CAN channel A connected to the external network node A fails, and the network node A has been connected to the backup channel. At this time, it is detected that the CAN channel B corresponding to the external network node B has failed. If the priority of CAN channel A is greater than the priority of CAN channel B, then keep the current state, if the priority of CAN channel is lower than the priority of CAN channel B, disconnect the connection between external network node A and the backup channel, and connect the external network Node B is connected to the backup channel.
对于上述情形二:For the second case above:
当同时检测到多路CAN通道出现故障时,可以将多路故障CAN通道中优先级最高的一路CAN通道对应的外部网络节点连接至备份通道,以完成故障CAN通道至备份通道的切换。When faults in multiple CAN channels are detected at the same time, the external network node corresponding to the CAN channel with the highest priority among the multiple faulty CAN channels can be connected to the backup channel to complete the switching from the faulty CAN channel to the backup channel.
例如,同时检测到CAN通道A和CAN通道B出现故障,若CAN通道A的优先级大于CAN通道B的优先级,则将CAN通道A对应的外部网络节点连接至备份通道。如CAN通道A中传输的数据为汽车发动机控制单元的数据,CAN通道B中传输的数据为调节车内空调的数据,则汽车发动机控制单元的数据显然要比调节车内空调的数据更为重要。For example, if CAN channel A and CAN channel B are detected to be faulty at the same time, if the priority of CAN channel A is higher than that of CAN channel B, the external network node corresponding to CAN channel A is connected to the backup channel. For example, the data transmitted in CAN channel A is the data of the car engine control unit, and the data transmitted in CAN channel B is the data for adjusting the air conditioner in the car, then the data of the car engine control unit is obviously more important than the data for adjusting the air conditioner in the car .
基于本申请实施例,多个外部网络节点通过多路选择器中的双向开关分别连接至多个CAN通道,并设计了一路备份通道,当检测到其中一个外部网络节点对应的CAN通道出现故障时,可通过控制双向开关的断开与连接实现故障CAN通道至备份通道的切换。该技术方案不仅能够保证车内通信的可靠性,又能够降低车内通信系统的成本和车内线束结构的复杂度。Based on the embodiment of the present application, multiple external network nodes are respectively connected to multiple CAN channels through bidirectional switches in the multiplexer, and a backup channel is designed. When it is detected that the CAN channel corresponding to one of the external network nodes fails, The switch from the faulty CAN channel to the backup channel can be realized by controlling the disconnection and connection of the bidirectional switch. The technical solution can not only ensure the reliability of the in-vehicle communication, but also reduce the cost of the in-vehicle communication system and the complexity of the structure of the in-vehicle wiring harness.
进一步地,当检测两路CAN通道出现故障时,将优先级高的CAN通道切换至备份通道,从而有利于保证重要数据的通信可靠性。Furthermore, when a failure of two CAN channels is detected, the CAN channel with higher priority is switched to the backup channel, which is beneficial to ensure the communication reliability of important data.
上文介绍了CAN通信系统中设计了一路备份通道的情形,下面结合图3介绍CAN通信系统中设计两路备份通道的情形。The above describes the design of one backup channel in the CAN communication system, and the following describes the design of two backup channels in the CAN communication system in conjunction with Figure 3.
图3是本申请实施例提供的另一种CAN通信系统架构的示意图。FIG. 3 is a schematic diagram of another CAN communication system architecture provided by an embodiment of the present application.
如图3所示,该通信装置300可以包括MCU210、多个CAN收发器、多路选择器230,该MCU210中可以包括多个CAN控制器。该多路选择器230中可以包括选择器231和多个开关,每个开关与一个外部网络节点相对应。As shown in FIG. 3 , the communication device 300 may include an MCU 210 , multiple CAN transceivers, and a multiplexer 230 , and the MCU 210 may include multiple CAN controllers. The multiplexer 230 may include a selector 231 and a plurality of switches, each switch corresponding to an external network node.
与通信装置200不同的是,通信装置300中设计了两路备份通道,分别是备份通道a,包括CAN控制器213、CAN收发器225,备份通道b,包括CAN控制器216、CAN收发器226。Different from the communication device 200, two backup channels are designed in the communication device 300, namely backup channel a, including CAN controller 213, CAN transceiver 225, and backup channel b, including CAN controller 216, CAN transceiver 226 .
参见图3,该备份通道a中的CAN收发器225分别具有四个接入点A2、B2、C2、D2,该备份通道b中的CAN收发器226分别具有四个接入点A3、B3、C3、D3,分别对应四个外部网络节点。Referring to Fig. 3, the CAN transceiver 225 in the backup channel a has four access points A2, B2, C2, D2 respectively, and the CAN transceiver 226 in the backup channel b has four access points A3, B3, C3 and D3 respectively correspond to four external network nodes.
在通信装置3具有两路备份通道的情况下,可能出现的故障情形是:In the case that the communication device 3 has two backup channels, the possible failure situations are:
情形一:Scenario 1:
检测到一路CAN通道出现故障。A CAN channel failure was detected.
情形二:Scenario 2:
检测到两路CAN通道出现故障。A fault has been detected on two CAN channels.
情形三:Case three:
同时检测到两路以上的CAN通道出现故障。At the same time, more than two CAN channels are detected to be faulty.
情形四:Situation 4:
检测到两路CAN通道出现故障,已经将该两路故障CAN通道对应的网络节点分别连接至两路备份通道的情况下,又检测到一路CAN通道出现故障。Two CAN channels are detected to be faulty, and the network nodes corresponding to the two faulty CAN channels have been respectively connected to the two backup channels, and one CAN channel is detected to be faulty.
对于上述情形一:For the above situation one:
由于通信系统中有两路CAN备份通道,当检测到正常使用的其中一路CAN通道出现故障时,可以将该故障CAN通道对应的网络节点连接至两路备份通道中的其中一路。Since there are two CAN backup channels in the communication system, when a fault is detected in one of the normally used CAN channels, the network node corresponding to the faulty CAN channel can be connected to one of the two backup channels.
示例性地,可以在系统中设定,该两路备份通道使用的顺序。或者,不对该两路备份通道使用的顺序做限定,在使用时随机选择其中一路。Exemplarily, the order in which the two backup channels are used can be set in the system. Alternatively, the order in which the two backup channels are used is not limited, and one of them is randomly selected during use.
以外部网络节点A为例,正常情况下,其通过开关A0默认连接CAN收发器221的接入点A1,某一时刻,当MCU210检测到该外部网络节点A连接的CAN通道A出现故障时,可以将开关A0断开与A1的连接,并将A0连接至A2点或A3点,从而可以实现该外部网络节点连接的CAN通道从故障CAN通道A至备份通道的切换。Taking the external network node A as an example, under normal circumstances, it is connected to the access point A1 of the CAN transceiver 221 by default through the switch A0. At a certain moment, when the MCU 210 detects that the CAN channel A connected to the external network node A fails, Switch A0 can be disconnected from A1, and A0 can be connected to point A2 or point A3, so that the CAN channel connected to the external network node can be switched from faulty CAN channel A to backup channel.
例如,该外部网络节点A连接的CAN通道A发送故障时,开关A0断开与A1的连接,并连接至A2,则该外部网络节点连接的CAN通道为备份通道a。For example, when the CAN channel A connected to the external network node A fails, the switch A0 disconnects the connection with A1 and connects to A2, then the CAN channel connected to the external network node is the backup channel a.
对于上述情形二:For the second case above:
由于通信系统中有两路CAN备份通道,当检测到两路CAN通道出现故障时,可以将该两路故障CAN通道对应的网络节点分别连接至两路备份通道。Since there are two CAN backup channels in the communication system, when a failure of the two CAN channels is detected, the network nodes corresponding to the two faulty CAN channels can be connected to the two backup channels respectively.
在一种可能的实现方式中,该两路CAN备份通道先后出现故障,例如,在外部网络节点A已经连接至一路备份通道的情况下,MCU210又检测到网络节点B连接的CAN通道B出现故障,则将网络节点B连接至另一路备份通道。In a possible implementation, the two CAN backup channels fail successively. For example, when the external network node A has been connected to one backup channel, the MCU 210 detects that the CAN channel B connected to the network node B fails again. , then connect the network node B to another backup channel.
在另一种可能的实现方式中,该两路CAN备份通道同时出现故障,则将该两路故障CAN通道对应的网络节点分别连接至两路备份通道即可。In another possible implementation, if the two CAN backup channels fail at the same time, then the network nodes corresponding to the two faulty CAN channels can be respectively connected to the two backup channels.
对于上述情形三:For the above situation three:
本申请实施例在通信系统初始设计时,会根据各路CAN通道中传输的数据的重要性,制定各路CAN通道的优先级,当同时检测到两路以上的CAN通道出现故障时,可以根据该两路以上的故障CAN通道的优先级的大小,选择优先级大的前两路故障CAN通道对应的网络节点连接至两路备份CAN通道。In the initial design of the communication system in the embodiment of the present application, the priority of each CAN channel will be formulated according to the importance of the data transmitted in each CAN channel. According to the priority of the two or more faulty CAN channels, the network nodes corresponding to the first two faulty CAN channels with higher priorities are selected to be connected to the two backup CAN channels.
对于上述情形四:For the above situation four:
在通信系统初始设计时,会根据各路CAN通道中传输的数据的重要性,制定各路CAN通道的优先级,在检测到两路CAN通道出现故障,已经将该两路故障CAN通道对应的网络节点分别连接至两路备份通道的情况下,若此时又检测到一路CAN通道出现故障,可以通过该三路故障CAN通道的优先级顺序,确定是保持当前状态还是将后检测到的故障CAN通道对应的网络节点连接至其中一路备份通道。In the initial design of the communication system, the priority of each CAN channel will be determined according to the importance of the data transmitted in each CAN channel. When the network nodes are respectively connected to two backup channels, if a CAN channel failure is detected at this time, the priority order of the three faulty CAN channels can be used to determine whether to maintain the current state or to detect the fault in the future The network node corresponding to the CAN channel is connected to one of the backup channels.
示例性地,若网络节点A、网络节点B默认连接的CAN通道A、CAN通道B出现故障,且该网络节点A、网络节点B也已经分别连接至两路备份通道,如网络节点A连接至备份通道a,网络节点B连接至备份通道b,此时,MCU210检测到网络节点C默认连接的CAN通道C出现故障,则MCU210可以根据该CAN通道A、CAN通道B和CAN通道C的优先级大小进行决策。For example, if the CAN channel A and CAN channel B connected by default to network node A and network node B fail, and the network node A and network node B have also been connected to two backup channels respectively, such as network node A connected to Backup channel a, network node B is connected to backup channel b, at this time, MCU210 detects that the CAN channel C connected to network node C by default fails, then MCU210 can size decision.
若,CAN通道C的优先级小于CAN通道A和CAN通道B的优先级,则保持当前状态。If the priority of CAN channel C is lower than the priorities of CAN channel A and CAN channel B, the current state is maintained.
若CAN通道C的优先级大于CAN通道A的优先级,且CAN通道A的优先级大于CAN通道B的优先级,则将网络节点B与备份通道b的连接断开,并将网络节点C连接至备份通道b。If the priority of CAN channel C is greater than the priority of CAN channel A, and the priority of CAN channel A is greater than the priority of CAN channel B, disconnect the connection between network node B and backup channel b, and connect network node C to backup channel b.
若CAN通道C的优先级大于CAN通道A的优先级,且CAN通道A的优先级小于CAN通道B的优先级,则将网络节点A与备份通道a的连接断开,并将网络节点C连接至备份通道a。If the priority of CAN channel C is greater than the priority of CAN channel A, and the priority of CAN channel A is lower than the priority of CAN channel B, disconnect the connection between network node A and backup channel a, and connect network node C to backup channel a.
基于本申请实施例,多个外部网络节点通过多路选择器中的开关分别连接至多个CAN通道,并设计了两路备份通道,当检测到其中一个或两个外部网络节点对应的CAN通道出现故障时,可通过控制开关的断开与连接实现故障CAN通道至备份通道的切换。该技术方案不仅能够保证车内通信的可靠性,又能够降低车内通信系统的成本和车内线束结构的复杂度。Based on the embodiment of this application, multiple external network nodes are respectively connected to multiple CAN channels through switches in the multiplexer, and two backup channels are designed. When it is detected that the CAN channels corresponding to one or two external network nodes appear In case of failure, the switch from the faulty CAN channel to the backup channel can be realized by disconnecting and connecting the control switch. The technical solution can not only ensure the reliability of the in-vehicle communication, but also reduce the cost of the in-vehicle communication system and the complexity of the structure of the in-vehicle wiring harness.
进一步地,当检测两路以上CAN通道出现故障时,将优先级高的两路CAN通道切换至两路备份通道,从而有利于保证重要数据的通信可靠性。Furthermore, when it is detected that two or more CAN channels fail, the two CAN channels with higher priority are switched to two backup channels, which is beneficial to ensure the communication reliability of important data.
图4是本申请实施例提供的一种CAN冗余通信的方法的示意性流程图。如图4所示,该方法可以包括步骤410至步骤420。Fig. 4 is a schematic flowchart of a CAN redundant communication method provided by an embodiment of the present application. As shown in FIG. 4 , the method may include steps 410 to 420 .
410,多路CAN通道分别与多个网络节点建立连接。410. Establish connections between multiple CAN channels and multiple network nodes respectively.
其中,每一路CAN通道可以包括一个CAN控制器和一个CAN收发器,多路CAN通道分别与多个网络节点建立连接,可以理解为多个网络节点分别通过总线与多路CAN通道中的CAN收发器进行通信。Among them, each CAN channel can include a CAN controller and a CAN transceiver, and multiple CAN channels respectively establish connections with multiple network nodes, which can be understood as multiple network nodes respectively transmit and receive with CAN in multiple CAN channels device to communicate.
例如,CAN收发器通过总线接收网络节点发送的数据,并将该数据传输到CAN控制器。For example, a CAN transceiver receives data sent by a network node via the bus and transmits this data to a CAN controller.
该网络节点可以是发动机控制单元、电动助力转向控制单元、空调控制单元等。The network node may be an engine control unit, an electric power steering control unit, an air conditioning control unit, and the like.
420,当检测到所述多路CAN通道中的第一CAN通道出现故障时,控制多路选择器将与第一网络节点连接的CAN通道切换至第一备份CAN通道,所述第一CAN通道包括与所述第一网络节点连接的CAN通道。420. When it is detected that the first CAN channel in the multiple CAN channels fails, control the multiplexer to switch the CAN channel connected to the first network node to the first backup CAN channel, and the first CAN channel A CAN channel connected to the first network node is included.
其中,该第一CAN通道可以包括一个CAN通道,也可以包括多个CAN通道。Wherein, the first CAN channel may include one CAN channel, or may include multiple CAN channels.
该多路选择器可以包括多个双向开关,每个双向开关与一路CAN通道相对应,正常情况下,每个双向开关默认连接一个正常通信的CAN通道,每个双向开关可以连接的另一个接入点为第一备份CAN通道的接入点。当第一网络节点连接的CAN通道出现故障时,可以控制多路选择器将与第一网络节点连接的CAN通道切换至第一备份CAN通道。The multiplexer can include multiple bidirectional switches, and each bidirectional switch corresponds to a CAN channel. Under normal circumstances, each bidirectional switch is connected to a normal communication CAN channel by default, and each bidirectional switch can be connected to another CAN channel. The entry point is the access point of the first backup CAN channel. When the CAN channel connected to the first network node fails, the multiplexer can be controlled to switch the CAN channel connected to the first network node to the first backup CAN channel.
基于本申请实施例,为多个CAN通道设计了一个备份通道,当第一网络节点连接的CAN通道出现故障时,可以控制多路选择器将第一网络节点连接的CAN通道切换至第一备份CAN通道。该技术方案可以实现通过一个备份CAN通道为多路CAN通道备份,不仅能够保证车内通信的可靠性,又能够降低车内通信系统的成本和车内线束结构的复杂度。Based on the embodiment of this application, a backup channel is designed for multiple CAN channels. When the CAN channel connected to the first network node fails, the multiplexer can be controlled to switch the CAN channel connected to the first network node to the first backup CAN channel. The technical solution can realize the backup of multiple CAN channels through a backup CAN channel, which not only ensures the reliability of in-vehicle communication, but also reduces the cost of the in-vehicle communication system and the complexity of the structure of the in-vehicle wiring harness.
可选地,所述多路选择器包括多个双向开关,所述多个双向开关与所述多个网络节点一一对应,所述当检测到多路CAN通道中的第一CAN通道出现故障时,控制多路选择器将与第一网络节点连接的CAN通道切换至第一备份CAN通道,包括:控制所述多路选择器将所述第一网络节点对应的双向开关断开与所述第一CAN通道的连接,并连接至所述第一备份CAN通道。Optionally, the multiplexer includes a plurality of bidirectional switches, the plurality of bidirectional switches correspond to the plurality of network nodes one by one, and when it is detected that the first CAN channel in the multiple CAN channels fails , controlling the multiplexer to switch the CAN channel connected to the first network node to the first backup CAN channel includes: controlling the multiplexer to disconnect the bidirectional switch corresponding to the first network node from the The first CAN channel is connected and connected to the first backup CAN channel.
该实施例中,第一网络节点连接的CAN通道即为第一CAN通道。In this embodiment, the CAN channel connected to the first network node is the first CAN channel.
示例性地,参见图2,多路选择器230包括多个双向开关A0、B0、C0和D0。该第一网络节点可以是网络节点A,与网络节点A连接的CAN通道为CAN通道A,当检测到该CAN通道A出现故障时,控制多路选择器230将与该网络节点A对应的双向开关断开与CAN通道A的连接,并连接至备份通道。Exemplarily, referring to FIG. 2 , the multiplexer 230 includes a plurality of bidirectional switches A0 , B0 , C0 and D0 . The first network node can be network node A, and the CAN channel connected to network node A is CAN channel A. The switch disconnects the CAN channel A and connects to the backup channel.
可选地,所述控制所述多路选择器将所述第一网络节点对应的双向开关断开与所述第一CAN通道的连接,并连接至所述第一备份CAN通道,包括:向所述多路选择器发送第一切换指示信息,所述第一切换指示信息用于指示所述多路选择器将所述第一网络节点对应的双向开关断开与所述第一CAN通道的连接,并连接至所述第一备份CAN通道。Optionally, the controlling the multiplexer to disconnect the bidirectional switch corresponding to the first network node from the first CAN channel and connect to the first backup CAN channel includes: The multiplexer sends first switching instruction information, and the first switching instruction information is used to instruct the multiplexer to disconnect the bidirectional switch corresponding to the first network node from the first CAN channel. connected, and connected to the first backup CAN channel.
示例性地,参见图2,该第一备份CAN通道可以是图2中的备份通道,包括CAN控制器213和CAN收发器225,该第一网络节点可以是网络节点A,当检测到网络节点A连接的CAN通道A出现故障时,MCU210会向多路选择器发送第一切换指示信息,多路选择器中230中的选择器231接收到该第一切换指示信息之后,去控制开关A0断开与A1的连接,并连接至A2,以此完成从故障CAN通道至第一备份CAN通道的切换。Exemplarily, referring to Fig. 2, the first backup CAN channel may be the backup channel in Fig. 2, including the CAN controller 213 and the CAN transceiver 225, the first network node may be the network node A, when the network node is detected When the CAN channel A connected to A fails, the MCU210 will send the first switching instruction information to the multiplexer, and after the selector 231 in the 230 of the multiplexer receives the first switching instruction information, it will control the switch A0 to turn off. Open the connection with A1 and connect to A2, so as to complete the switching from the faulty CAN channel to the first backup CAN channel.
可选地,该方法还可以包括步骤430至440:Optionally, the method may also include steps 430 to 440:
430,当检测到所述多路CAN通道中的第二CAN通道出现故障时,确定所述第一CAN通道与所述第二CAN通道的优先级。430. Determine the priority of the first CAN channel and the second CAN channel when it is detected that a failure occurs in the second CAN channel in the multiple CAN channels.
示例性地,参见图2,该第一CAN通道可以为网络节点A连接的CAN通道A,第二CAN通道可以为网络节点B连接的CAN通道B。当网络节点A首先出现故障,在已经将CAN通道A切换至第一备份通道的情况下,又检测到网络节点B连接的CAN通道B出现故障,则此时可以判断CAN通道A与CAN通道B的优先级,根据其优先级的大小确定切换策略。For example, referring to FIG. 2 , the first CAN channel may be CAN channel A connected to network node A, and the second CAN channel may be CAN channel B connected to network node B. When network node A fails first, and CAN channel A has been switched to the first backup channel, and CAN channel B connected to network node B is detected to be faulty, CAN channel A and CAN channel B can be judged at this time The priority of the switch is determined according to the size of its priority.
440,当所述第二CAN通道的优先级大于所述第一CAN通道的优先级时,控制所述多路选择器将所述第一网络节点对应的双向开关断开与所述第一备份CAN通道的连接,将第二网络节点对应的双向开关断开与所述第二CAN通道的连接,并将所述第二网络节点对应的双向开关连接至所述第一备份CAN通道。440. When the priority of the second CAN channel is greater than the priority of the first CAN channel, control the multiplexer to disconnect the bidirectional switch corresponding to the first network node from the first backup The connection of the CAN channel disconnects the bidirectional switch corresponding to the second network node from the second CAN channel, and connects the bidirectional switch corresponding to the second network node to the first backup CAN channel.
示例性地,如步骤430中所述的,当CAN通道B的优先级大于CAN通道A的优先级时,确定将CAN通道B切换至第一备份通道,则控制多路选择器将网络节点A对应的双向开关A0断开与A2的连接,将网络节点B对应的双向开关B0断开与B1点的连接,并将B0连接至B2。以此,完成网络节点B连接至备份通道。Exemplarily, as described in step 430, when the priority of CAN channel B is greater than the priority of CAN channel A, it is determined to switch CAN channel B to the first backup channel, then control the multiplexer to switch network node A The corresponding bidirectional switch A0 is disconnected from A2, the bidirectional switch B0 corresponding to the network node B is disconnected from point B1, and B0 is connected to B2. In this way, the connection of the network node B to the backup channel is completed.
具体地,可以向多路选择器发送切换指示信息,以指示其进行上述切换操作。Specifically, switching instruction information may be sent to the multiplexer to instruct it to perform the above switching operation.
可选地,当第二CAN通道的优先级小于第一CAN通道的优先级时,可以保持当前状态,即保持第一网络节点与第一备份通道的连接。Optionally, when the priority of the second CAN channel is lower than that of the first CAN channel, the current state may be maintained, that is, the connection between the first network node and the first backup channel may be maintained.
可选地,所述确定所述第一CAN通道与所述第二CAN通道的优先级,包括:Optionally, the determining the priority of the first CAN channel and the second CAN channel includes:
根据所述第一CAN通道与所述第二CAN通道传输的数据确定所述第一CAN通道与所述第二CAN通道的优先级。determining the priorities of the first CAN channel and the second CAN channel according to the data transmitted by the first CAN channel and the second CAN channel.
例如,在通信系统初始涉及时,可以根据各个CAN通道需要传输的数据的重要性设定各个CAN通道的优先级,如,传输汽车发动机控制数据的CAN通道的优先级高于传输调节汽车空调数据的CAN通道的优先级。For example, when the communication system is initially involved, the priority of each CAN channel can be set according to the importance of the data that each CAN channel needs to transmit. For example, the priority of the CAN channel that transmits the control data of the automobile engine is higher than that of the data that adjusts the air conditioner of the automobile. The priority of the CAN channel.
该技术方案将优先级高的CAN通道切换至备份通道,从而有利于保证重要数据的通信可靠性。The technical solution switches the CAN channel with high priority to the backup channel, thereby helping to ensure the communication reliability of important data.
可选地,所述控制所述多路选择器将所述第一网络节点对应的双向开关断开与所述第一备份CAN通道的连接,将第二网络节点对应的双向开关与断开所述第二CAN通道的连接,并将所述第二网络节点对应的双向开关连接至所述第一备份CAN通道,包括:Optionally, controlling the multiplexer to disconnect the bidirectional switch corresponding to the first network node from the first backup CAN channel, and disconnecting the bidirectional switch corresponding to the second network node from the disconnected The connection of the second CAN channel, and connecting the bidirectional switch corresponding to the second network node to the first backup CAN channel, including:
向多路选择器发送第二切换指示信息,所述第二切换指示信息用于指示所述多路选择器将所述第一网络节点对应的双向开关断开与所述第一备份CAN通道的连接,将第二网络节点对应的双向开关断开与所述第二CAN通道的连接,并将所述第二网络节点对应的双向开关连接至所述第一备份CAN通道。sending second switching instruction information to the multiplexer, where the second switching instruction information is used to instruct the multiplexer to disconnect the bidirectional switch corresponding to the first network node from the first backup CAN channel Connecting, disconnecting the bidirectional switch corresponding to the second network node from the second CAN channel, and connecting the bidirectional switch corresponding to the second network node to the first backup CAN channel.
该实施例中,当确定将第二网络节点连接至第一备份通道时,可以向多路选择器发送第二切换指示信息,以指示其进行切换。In this embodiment, when it is determined to connect the second network node to the first backup channel, second switching instruction information may be sent to the multiplexer to instruct it to perform switching.
可选地,所述第一CAN通道包括至少两路CAN通道,与所述第一网络节点连接的CAN通道的优先级高于与第三网络节点连接的CAN通道的优先级,与所述第三网络节点连接的CAN通道为所述至少两个CAN通道中除与所述第一网络节点连接的CAN通道之外的通道。Optionally, the first CAN channel includes at least two CAN channels, and the priority of the CAN channel connected to the first network node is higher than that of the CAN channel connected to the third network node. The CAN channels connected to the three network nodes are channels other than the CAN channel connected to the first network node among the at least two CAN channels.
该实施例中,第一CAN通道可以包括多路CAN通道。例如,该第一CAN通道包括两路CAN通道,即同时出现检测到两路CAN通道出现故障,那么将优先级高的第一网络节点连接的CAN通道切换至第一备份通道,从而有利于保证重要数据的通信可靠性。In this embodiment, the first CAN channel may include multiple CAN channels. For example, the first CAN channel includes two CAN channels, that is, if two CAN channels are detected to be faulty at the same time, then the CAN channel connected to the first network node with high priority is switched to the first backup channel, which is beneficial to ensure Communication reliability of important data.
可选地,当检测到所述多路CAN通道中的第三CAN通道出现故障时,控制所述多路选择器将与第三网络节点连接的所述第三CAN通道切换至第二备份CAN通道,所述第二备份CAN通道与所述第一备份CAN通道为不同的CAN通道。Optionally, when it is detected that the third CAN channel in the multiple CAN channels fails, the multiplexer is controlled to switch the third CAN channel connected to the third network node to the second backup CAN channel channels, the second backup CAN channel and the first backup CAN channel are different CAN channels.
该实施例中,通信系统具有两路备份通道。示例性地,参见图3,第一网络节点可以是网络节点A,第三网络节点可以是网络节点B,在第一网络节点连接的CAN通道A切换至第一备份CAN通道之后,又检测到网络节点B对应的CAN通道B出现故障,则可以将该网络节点B连接的CAN通道切换至第二备份CAN通道。In this embodiment, the communication system has two backup channels. For example, referring to FIG. 3 , the first network node may be network node A, and the third network node may be network node B. After the CAN channel A connected to the first network node is switched to the first backup CAN channel, it is detected that If the CAN channel B corresponding to the network node B fails, the CAN channel connected to the network node B may be switched to the second backup CAN channel.
在有两路备份CAN通道的情况下,可以设定该两路备份通道CAN的使用顺序,例如,在仅有一路CAN通道出现故障时,优先使用第一备份CAN通道。In the case of two backup CAN channels, the use sequence of the two backup CAN channels can be set, for example, when only one CAN channel fails, the first backup CAN channel is used preferentially.
可选地,当检测到所述多路CAN通道中的第四CAN通道出现故障时,确定所述第一CAN通道、所述第三CAN通道和所述第四CAN通道的优先级;Optionally, when it is detected that the fourth CAN channel in the multiple CAN channels fails, determine the priorities of the first CAN channel, the third CAN channel, and the fourth CAN channel;
当所述第四CAN通道的优先级大于所述第一CAN通道的优先级,且所述第一CAN通道的优先级大于第三通道的优先级时,控制所述多路选择器断开所述第三网络节点与所述第二备份CAN通道的连接,并将第四网络节点连接的CAN通道从所述第四CAN通道切换至所述第二备份CAN通道;或者When the priority of the fourth CAN channel is greater than the priority of the first CAN channel, and the priority of the first CAN channel is greater than the priority of the third channel, control the multiplexer to disconnect all the connection between the third network node and the second backup CAN channel, and switch the CAN channel connected to the fourth network node from the fourth CAN channel to the second backup CAN channel; or
当所述第四CAN通道的优先级大于所述第一CAN通道的优先级,且所述第一CAN通道的优先级小于或等于第三通道的优先级时,控制所述多路选择器断开所述第一网络节点与所述第一备份CAN通道的连接,并将第四网络节点连接的CAN通道从所述第四CAN通道切换至所述第一备份CAN通道。When the priority of the fourth CAN channel is greater than the priority of the first CAN channel, and the priority of the first CAN channel is less than or equal to the priority of the third channel, control the multiplexer to turn off Opening the connection between the first network node and the first backup CAN channel, and switching the CAN channel connected to the fourth network node from the fourth CAN channel to the first backup CAN channel.
示例性地,参见图3,该第一网络节点可以是网络节点A,第一CAN通道为该网络节点A连接的CAN通道A,该第三网络节点可以是网络节点B,该第二CAN通道为该 网络节点B连接的CAN通道B,该第四网络节点可以是网络节点C,该第三CAN通道为该网络节点C连接的CAN通道C。当网络节点A、网络节点B原本连接的CAN通道出现故障,且已经分别切换至两路备份CAN通道的情况下,又检测到网络节点C连接的CAN通道C出现故障,此时,可以根据CAN通道A、CAN通道B、CAN通道C的优先级大小来进行切换决策。Exemplarily, referring to FIG. 3, the first network node may be a network node A, the first CAN channel is the CAN channel A connected to the network node A, the third network node may be a network node B, and the second CAN channel For the CAN channel B connected to the network node B, the fourth network node may be the network node C, and the third CAN channel is the CAN channel C connected to the network node C. When the CAN channels originally connected to network node A and network node B fail, and have been switched to two backup CAN channels respectively, and it is detected that the CAN channel C connected to network node C fails, at this time, the CAN Switching decisions are made based on the priorities of channel A, CAN channel B, and CAN channel C.
例如,当CAN通道C的优先级大于CAN通道A的优先级,CAN通道A的优先级大于CAN通道B的优先级时,控制多路选择器将网络节点B的开关B0断开与B3的连接,将网络节点C对应的C0断开与C1的连接,并将C0连接至C3,从而网络节点C可以连接至备份CAN通道。For example, when the priority of CAN channel C is higher than that of CAN channel A, and the priority of CAN channel A is higher than that of CAN channel B, the multiplexer is controlled to disconnect switch B0 of network node B from B3 , disconnect C0 corresponding to network node C from C1, and connect C0 to C3, so that network node C can be connected to the backup CAN channel.
当CAN通道C的优先级大于CAN通道A的优先级,CAN通道A的优先级小于CAN通道B的优先级时,控制多路选择器将网络节点A的开关A0断开与A2的连接,将网络节点C对应的C0断开与C1的连接,并将C0连接至C2,从而网络节点C可以连接至备份CAN通道。When the priority of CAN channel C is greater than the priority of CAN channel A, and the priority of CAN channel A is lower than the priority of CAN channel B, control the multiplexer to disconnect switch A0 of network node A from A2, and C0 corresponding to network node C disconnects from C1 and connects C0 to C2, so that network node C can be connected to the backup CAN channel.
当CAN通道C的优先级既小于CAN通道A,又小于CAN通道B的优先级时,保持当前状态,即继续保持网络节点A和网络节点B与备份通道的连接。When the priority of CAN channel C is lower than that of CAN channel A and CAN channel B, keep the current state, that is, continue to maintain the connection between network node A and network node B and the backup channel.
该技术方案有利于保证重要数据的通信可靠性。The technical solution is beneficial to ensure the communication reliability of important data.
图5是本申请实施例提供的另一种CAN冗余通信的方法的示意性流程图。Fig. 5 is a schematic flowchart of another CAN redundant communication method provided by the embodiment of the present application.
如图5所示,该方法可以包括步骤510至步骤530。As shown in FIG. 5 , the method may include step 510 to step 530 .
510,多路CAN通道分别与多个网络节点建立连接。510. Establish connections between multiple CAN channels and multiple network nodes respectively.
该步骤510可以参见步骤410中的相关描述,为了简洁,不再赘述。For this step 510, reference may be made to the related description in step 410, and for the sake of brevity, details are not repeated here.
520,当同时检测到所述多路CAN通道中的至少两路CAN通道出现故障时,确定所述至少两路CAN通道的优先级。520. Determine priorities of the at least two CAN channels when faults are detected in at least two CAN channels among the multiple CAN channels at the same time.
当同时检测到多路CAN通道出现故障时,可以根据该多路CAN通道的优先级,进行切换决策。When multiple CAN channels are detected to be faulty at the same time, switching decisions can be made according to the priorities of the multiple CAN channels.
530,控制多路选择器将所述至少两路CAN通道中优先级高的两路CAN通道分别切换至两路备份CAN通道。530. Control the multiplexer to switch the two CAN channels with higher priority among the at least two CAN channels to the two backup CAN channels respectively.
本申请实施例中,为通信系统设计了两路备份CAN通道,在有多路CAN通道同时出现故障时,可以将优先级高的两路CAN通道分别切换至两路备份通道中。In the embodiment of the present application, two backup CAN channels are designed for the communication system. When multiple CAN channels fail at the same time, the two CAN channels with higher priority can be switched to the two backup channels respectively.
由于各个CAN通道传输的数据的重要程度可能是不同的,因此,该技术方案有利于保证重要数据的通信可靠性。Since the importance of data transmitted by each CAN channel may be different, this technical solution is beneficial to ensure the communication reliability of important data.
本申请实施例还提供一种通信装置,包括处理单元,所述处理单元用于执行如上文中任一项所述的CAN通信冗余的方法。The embodiment of the present application also provides a communication device, including a processing unit, the processing unit is configured to execute the CAN communication redundancy method described in any one of the above.
本申请实施例还提供一种通信装置,包括存储器,用于存储指令;处理器,用于读取所述指令,当所述指令被所述处理器执行时,使得所述通信装置执行如上文中任一项所述的CAN通信冗余的方法。The embodiment of the present application also provides a communication device, including a memory for storing instructions; a processor for reading the instructions, and when the instructions are executed by the processor, the communication device performs the above-mentioned The CAN communication redundancy method described in any one.
本申请实施例还提供一种芯片,所述芯片包括处理器和通信接口,所述通信接口用于接收信号,并将所述信号传输至所述处理器,所述处理器处理所述信号,使得如上述任一项所述的CAN通信冗余的方法被执行。The embodiment of the present application also provides a chip, the chip includes a processor and a communication interface, the communication interface is used to receive a signal, and transmit the signal to the processor, and the processor processes the signal, A method of making CAN communication redundant as described in any one of the above is performed.
本申请实施例还提供一种计算机可读存储介质,包括计算机指令,当所述计算机指令 在通信装置上运行时,使得所述通信装置执行如上文中任一项所述的CAN通信冗余的方法。The embodiment of the present application also provides a computer-readable storage medium, including computer instructions, and when the computer instructions are run on the communication device, the communication device is made to perform the CAN communication redundancy method described in any one of the above .
本申请实施例还提供一种计算机程序产品,包括计算机指令,当所述计算机指令在计算机上运行时,使得如上文中任一项所述的CAN通信冗余的方法被执行。The embodiment of the present application also provides a computer program product, including computer instructions, when the computer instructions are run on the computer, the CAN communication redundancy method described in any one of the above is executed.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those skilled in the art can appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the functions described above are realized in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (read-only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disc and other media that can store program codes. .
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above is only a specific implementation of the application, but the scope of protection of the application is not limited thereto. Anyone familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the application. Should be covered within the protection scope of this application. Therefore, the protection scope of the present application should be determined by the protection scope of the claims.

Claims (21)

  1. 一种CAN通信冗余的方法,其特征在于,包括:A method for CAN communication redundancy, characterized in that, comprising:
    多路CAN通道分别与多个网络节点建立连接;Multiple CAN channels respectively establish connections with multiple network nodes;
    当检测到所述多路CAN通道中的第一CAN通道出现故障时,控制多路选择器将与第一网络节点连接的CAN通道切换至第一备份CAN通道,所述第一CAN通道包括与所述第一网络节点连接的CAN通道。When it is detected that the first CAN channel in the multiple CAN channels fails, the multiplexer is controlled to switch the CAN channel connected to the first network node to the first backup CAN channel, and the first CAN channel includes and A CAN channel to which the first network node is connected.
  2. 根据权利要求1所述的方法,其特征在于,所述多路选择器包括多个双向开关,所述多个双向开关与所述多个网络节点一一对应,所述当检测到多路CAN通道中的第一CAN通道出现故障时,控制多路选择器将与第一网络节点连接的CAN通道切换至第一备份CAN通道,包括:The method according to claim 1, wherein the multiplexer includes a plurality of bidirectional switches, the plurality of bidirectional switches correspond to the plurality of network nodes one by one, and when multiple CAN When the first CAN channel in the channel fails, the multiplexer is controlled to switch the CAN channel connected to the first network node to the first backup CAN channel, including:
    控制所述多路选择器将所述第一网络节点对应的双向开关断开与所述第一CAN通道的连接,并连接至所述第一备份CAN通道。Controlling the multiplexer to disconnect the bidirectional switch corresponding to the first network node from the first CAN channel and connect it to the first backup CAN channel.
  3. 根据权利要求2所述的方法,其特征在于,所述控制所述多路选择器将所述第一网络节点对应的双向开关断开与所述第一CAN通道的连接,并连接至所述第一备份CAN通道,包括:The method according to claim 2, wherein the control of the multiplexer disconnects the bidirectional switch corresponding to the first network node from the first CAN channel and connects it to the The first backup CAN channel, including:
    向所述多路选择器发送第一切换指示信息,所述第一切换指示信息用于指示所述多路选择器将所述第一网络节点对应的双向开关断开与所述第一CAN通道的连接,并连接至所述第一备份CAN通道。Sending first switching indication information to the multiplexer, where the first switching indication information is used to instruct the multiplexer to disconnect the bidirectional switch corresponding to the first network node from the first CAN channel connection and connect to the first backup CAN channel.
  4. 根据权利要求1-3中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-3, further comprising:
    当检测到所述多路CAN通道中的第二CAN通道出现故障时,确定所述第一CAN通道与所述第二CAN通道的优先级;When detecting that the second CAN channel in the multiple CAN channels fails, determine the priority of the first CAN channel and the second CAN channel;
    当所述第二CAN通道的优先级大于所述第一CAN通道的优先级时,控制所述多路选择器将所述第一网络节点对应的双向开关断开与所述第一备份CAN通道的连接,将第二网络节点对应的双向开关断开与所述第二CAN通道的连接,并将所述第二网络节点对应的双向开关连接至所述第一备份CAN通道。When the priority of the second CAN channel is greater than the priority of the first CAN channel, control the multiplexer to disconnect the bidirectional switch corresponding to the first network node from the first backup CAN channel disconnect the bidirectional switch corresponding to the second network node from the second CAN channel, and connect the bidirectional switch corresponding to the second network node to the first backup CAN channel.
  5. 根据权利要求4所述的方法,其特征在于,所述确定所述第一CAN通道与所述第二CAN通道的优先级,包括:The method according to claim 4, wherein the determining the priority of the first CAN channel and the second CAN channel comprises:
    根据所述第一CAN通道与所述第二CAN通道传输的数据确定所述第一CAN通道与所述第二CAN通道的优先级。determining the priorities of the first CAN channel and the second CAN channel according to the data transmitted by the first CAN channel and the second CAN channel.
  6. 根据权利要求4或5所述的方法,其特征在于,所述控制所述多路选择器将所述第一网络节点对应的双向开关与所述第一备份CAN通道断开,将第二网络节点对应的双向开关与所述第二CAN通道断开,并将所述第二网络节点对应的双向开关连接至所述第一备份CAN通道,包括:The method according to claim 4 or 5, characterized in that the control of the multiplexer disconnects the bidirectional switch corresponding to the first network node from the first backup CAN channel, and disconnects the second network node The bidirectional switch corresponding to the node is disconnected from the second CAN channel, and the bidirectional switch corresponding to the second network node is connected to the first backup CAN channel, including:
    向多路选择器发送第二切换指示信息,所述第二切换指示信息用于指示所述多路选择器将所述第一网络节点对应的双向开关断开与所述第一备份CAN通道的连接,将第二网络节点对应的双向开关断开与所述第二CAN通道的连接,并将所述第二网络节点对应的双向开关连接至所述第一备份CAN通道。sending second switching instruction information to the multiplexer, where the second switching instruction information is used to instruct the multiplexer to disconnect the bidirectional switch corresponding to the first network node from the first backup CAN channel Connecting, disconnecting the bidirectional switch corresponding to the second network node from the second CAN channel, and connecting the bidirectional switch corresponding to the second network node to the first backup CAN channel.
  7. 根据权利要求1所述的方法,其特征在于,所述第一CAN通道包括至少两路CAN通道,与所述第一网络节点连接的CAN通道的优先级大于与第三网络节点连接的CAN通道的优先级,与所述第三网络节点连接的CAN通道为所述至少两个CAN通道中除与所述第一网络节点连接的CAN通道之外的通道。The method according to claim 1, wherein the first CAN channel comprises at least two CAN channels, and the priority of the CAN channel connected to the first network node is greater than that of the CAN channel connected to the third network node priority, the CAN channel connected to the third network node is one of the at least two CAN channels except the CAN channel connected to the first network node.
  8. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method according to claim 1, further comprising:
    当检测到所述多路CAN通道中的第三CAN通道出现故障时,控制所述多路选择器将与第三网络节点连接的CAN通道从所述第三CAN通道切换至第二备份CAN通道,所述第二备份CAN通道与所述第一备份CAN通道为不同的CAN通道。When it is detected that the third CAN channel in the multiple CAN channels fails, the multiplexer is controlled to switch the CAN channel connected to the third network node from the third CAN channel to the second backup CAN channel , the second backup CAN channel and the first backup CAN channel are different CAN channels.
  9. 根据权利要求8所述的方法,其特征在于,所述方法还包括:The method according to claim 8, characterized in that the method further comprises:
    当检测到所述多路CAN通道中的第四CAN通道出现故障时,确定所述第一CAN通道、所述第三CAN通道和所述第四CAN通道的优先级;When detecting that the fourth CAN channel in the multiple CAN channels fails, determine the priorities of the first CAN channel, the third CAN channel, and the fourth CAN channel;
    当所述第四CAN通道的优先级大于所述第一CAN通道的优先级,且所述第一CAN通道的优先级大于第三通道的优先级时,控制所述多路选择器断开所述第三网络节点与所述第二备份CAN通道的连接,并将第四网络节点连接的CAN通道从所述第四CAN通道切换至所述第二备份CAN通道;或者When the priority of the fourth CAN channel is greater than the priority of the first CAN channel, and the priority of the first CAN channel is greater than the priority of the third channel, control the multiplexer to disconnect all the connection between the third network node and the second backup CAN channel, and switch the CAN channel connected to the fourth network node from the fourth CAN channel to the second backup CAN channel; or
    当所述第四CAN通道的优先级大于所述第一CAN通道的优先级,且所述第一CAN通道的优先级小于第三通道的优先级时,控制所述多路选择器断开所述第一网络节点与所述第一备份CAN通道的连接,并将第四网络节点连接的CAN通道从所述第四CAN通道切换至所述第一备份CAN通道。When the priority of the fourth CAN channel is greater than the priority of the first CAN channel, and the priority of the first CAN channel is less than the priority of the third channel, control the multiplexer to disconnect all The connection between the first network node and the first backup CAN channel, and switch the CAN channel connected to the fourth network node from the fourth CAN channel to the first backup CAN channel.
  10. 一种CAN通信冗余的方法,其特征在于,包括:A method for CAN communication redundancy, characterized in that, comprising:
    多路CAN通道分别与多个网络节点建立连接;Multiple CAN channels respectively establish connections with multiple network nodes;
    当同时检测到所述多路CAN通道中的至少两路CAN通道出现故障时,确定所述至少两路CAN通道的优先级;When detecting that at least two CAN channels in the multiple CAN channels fail at the same time, determine the priority of the at least two CAN channels;
    控制多路选择器将所述至少两路CAN通道中优先级高的两路CAN通道分别切换至两路备份CAN通道。Controlling the multiplexer to switch the two CAN channels with higher priority among the at least two CAN channels to the two backup CAN channels respectively.
  11. 一种通信装置,其特征在于,包括:A communication device, characterized by comprising:
    存储器,用于存储指令;memory for storing instructions;
    处理器,用于读取所述指令,当所述指令被所述处理器执行时,使得所述通信装置执行以下步骤:a processor, configured to read the instruction, and when the instruction is executed by the processor, the communication device is made to perform the following steps:
    多路CAN通道分别与多个网络节点建立连接;Multiple CAN channels respectively establish connections with multiple network nodes;
    当检测到所述多路CAN通道中的第一CAN通道出现故障时,控制多路选择器将与第一网络节点连接的CAN通道切换至第一备份CAN通道,所述第一CAN通道包括与所述第一网络节点连接的CAN通道。When it is detected that the first CAN channel in the multiple CAN channels fails, the multiplexer is controlled to switch the CAN channel connected to the first network node to the first backup CAN channel, and the first CAN channel includes and A CAN channel to which the first network node is connected.
  12. 根据权利要求11所述的装置,其特征在于,所述多路选择器包括多个双向开关,所述多个双向开关与所述多个网络节点一一对应,当所述指令被所述处理器执行时,使得所述通信装置执行以下步骤:The device according to claim 11, wherein the multiplexer includes a plurality of bidirectional switches, and the plurality of bidirectional switches correspond to the plurality of network nodes one by one, and when the instruction is processed by the When the controller is executed, the communication device is made to perform the following steps:
    控制所述多路选择器将所述第一网络节点对应的双向开关断开与所述第一CAN通道的连接,并连接至所述第一备份CAN通道。Controlling the multiplexer to disconnect the bidirectional switch corresponding to the first network node from the first CAN channel and connect it to the first backup CAN channel.
  13. 根据权利要求12所述的装置,其特征在于,当所述指令被所述处理器执行时, 使得所述通信装置执行以下步骤:The device according to claim 12, wherein when the instruction is executed by the processor, the communication device is made to perform the following steps:
    向所述多路选择器发送第一切换指示信息,所述第一切换指示信息用于指示所述多路选择器将所述第一网络节点对应的双向开关断开与所述第一CAN通道的连接,并连接至所述第一备份CAN通道。Sending first switching indication information to the multiplexer, where the first switching indication information is used to instruct the multiplexer to disconnect the bidirectional switch corresponding to the first network node from the first CAN channel connection and connect to the first backup CAN channel.
  14. 根据权利要求11-13中任一项所述的装置,其特征在于,当所述指令被所述处理器执行时,使得所述通信装置执行以下步骤:The device according to any one of claims 11-13, wherein when the instruction is executed by the processor, the communication device is made to perform the following steps:
    当检测到所述多路CAN通道中的第二CAN通道出现故障时,确定所述第一CAN通道与所述第二CAN通道的优先级;When it is detected that the second CAN channel in the multiple CAN channels fails, determine the priority of the first CAN channel and the second CAN channel;
    当所述第二CAN通道的优先级大于所述第一CAN通道的优先级时,控制所述多路选择器将所述第一网络节点对应的双向开关断开与所述第一备份CAN通道的连接,将第二网络节点对应的双向开关断开与所述第二CAN通道的连接,并将所述第二网络节点对应的双向开关连接至所述第一备份CAN通道。When the priority of the second CAN channel is greater than the priority of the first CAN channel, control the multiplexer to disconnect the bidirectional switch corresponding to the first network node from the first backup CAN channel disconnect the bidirectional switch corresponding to the second network node from the second CAN channel, and connect the bidirectional switch corresponding to the second network node to the first backup CAN channel.
  15. 根据权利要求14所述的装置,其特征在于,当所述指令被所述处理器执行时,使得所述通信装置执行以下步骤:The device according to claim 14, wherein when the instruction is executed by the processor, the communication device is caused to perform the following steps:
    根据所述第一CAN通道与所述第二CAN通道传输的数据确定所述第一CAN通道与所述第二CAN通道的优先级。determining the priorities of the first CAN channel and the second CAN channel according to the data transmitted by the first CAN channel and the second CAN channel.
  16. 根据权利要求14所述的装置,其特征在于,当所述指令被所述处理器执行时,使得所述通信装置执行以下步骤:The device according to claim 14, wherein when the instruction is executed by the processor, the communication device is caused to perform the following steps:
    向多路选择器发送第二切换指示信息,所述第二切换指示信息用于指示所述多路选择器将所述第一网络节点对应的双向开关断开与所述第一备份CAN通道的连接,将第二网络节点对应的双向开关断开与所述第二CAN通道的连接,并将所述第二网络节点对应的双向开关连接至所述第一备份CAN通道。sending second switching instruction information to the multiplexer, where the second switching instruction information is used to instruct the multiplexer to disconnect the bidirectional switch corresponding to the first network node from the first backup CAN channel Connecting, disconnecting the bidirectional switch corresponding to the second network node from the second CAN channel, and connecting the bidirectional switch corresponding to the second network node to the first backup CAN channel.
  17. 根据权利要求11所述的装置,其特征在于,所述第一CAN通道包括至少两路CAN通道,与所述第一网络节点连接的CAN通道的优先级大于与第三网络节点连接的CAN通道的优先级,与所述第三网络节点连接的CAN通道为所述至少两个CAN通道中除与所述第一网络节点连接的CAN通道之外的通道。The device according to claim 11, wherein the first CAN channel includes at least two CAN channels, and the CAN channel connected to the first network node has a higher priority than the CAN channel connected to the third network node priority, the CAN channel connected to the third network node is one of the at least two CAN channels except the CAN channel connected to the first network node.
  18. 根据权利要求11所述的装置,其特征在于,当所述指令被所述处理器执行时,使得所述通信装置执行以下步骤:The device according to claim 11, wherein when the instruction is executed by the processor, the communication device is made to perform the following steps:
    当检测到所述多路CAN通道中的第三CAN通道出现故障时,控制所述多路选择器将与第三网络节点连接的CAN通道从所述第三CAN通道切换至第二备份CAN通道,所述第二备份CAN通道与所述第一备份CAN通道为不同的CAN通道。When it is detected that the third CAN channel in the multiple CAN channels fails, the multiplexer is controlled to switch the CAN channel connected to the third network node from the third CAN channel to the second backup CAN channel , the second backup CAN channel and the first backup CAN channel are different CAN channels.
  19. 根据权利要求18所述的装置,其特征在于,当所述指令被所述处理器执行时,使得所述通信装置执行以下步骤:The device according to claim 18, wherein when the instructions are executed by the processor, the communication device is caused to perform the following steps:
    当检测到所述多路CAN通道中的第四CAN通道出现故障时,确定所述第一CAN通道、所述第三CAN通道和所述第四CAN通道的优先级;When detecting that the fourth CAN channel in the multiple CAN channels fails, determine the priorities of the first CAN channel, the third CAN channel, and the fourth CAN channel;
    当所述第四CAN通道的优先级大于所述第一CAN通道的优先级,且所述第一CAN通道的优先级大于第三通道的优先级时,控制所述多路选择器断开所述第三网络节点与所述第二备份CAN通道的连接,并将第四网络节点连接的CAN通道从所述第四CAN通道切换至所述第二备份CAN通道;或者When the priority of the fourth CAN channel is greater than the priority of the first CAN channel, and the priority of the first CAN channel is greater than the priority of the third channel, control the multiplexer to disconnect all the connection between the third network node and the second backup CAN channel, and switch the CAN channel connected to the fourth network node from the fourth CAN channel to the second backup CAN channel; or
    当所述第四CAN通道的优先级大于所述第一CAN通道的优先级,且所述第一CAN通道的优先级小于第三通道的优先级时,控制所述多路选择器断开所述第一网络节点与所述第一备份CAN通道的连接,并将第四网络节点连接的CAN通道从所述第四CAN通道切换至所述第一备份CAN通道。When the priority of the fourth CAN channel is greater than the priority of the first CAN channel, and the priority of the first CAN channel is less than the priority of the third channel, control the multiplexer to disconnect all The connection between the first network node and the first backup CAN channel, and switch the CAN channel connected to the fourth network node from the fourth CAN channel to the first backup CAN channel.
  20. 一种通信装置,其特征在于,包括:A communication device, characterized by comprising:
    存储器,用于存储指令;memory for storing instructions;
    处理器,用于读取所述指令,当所述指令被所述处理器执行时,使得所述通信装置执行以下步骤:a processor, configured to read the instruction, and when the instruction is executed by the processor, the communication device is made to perform the following steps:
    多路CAN通道分别与多个网络节点建立连接;Multiple CAN channels respectively establish connections with multiple network nodes;
    当同时检测到所述多路CAN通道中的至少两路CAN通道出现故障时,确定所述至少两路CAN通道的优先级;When detecting that at least two CAN channels in the multiple CAN channels fail at the same time, determine the priority of the at least two CAN channels;
    控制多路选择器将所述至少两路CAN通道中优先级高的两路CAN通道分别切换至两路备份CAN通道。Controlling the multiplexer to switch the two CAN channels with higher priority among the at least two CAN channels to the two backup CAN channels respectively.
  21. 一种计算机可读存储介质,包括计算机指令,所述计算机可读存储介质中存储有计算机指令,当所述计算机指令在计算机上运行时,使得如权利要求1-9或10中任一项所述的CAN通信冗余的方法被执行。A computer-readable storage medium, comprising computer instructions, computer instructions are stored in the computer-readable storage medium, when the computer instructions are run on a computer, so that as described in any one of claims 1-9 or 10 The described CAN communication redundancy method is implemented.
PCT/CN2022/083411 2021-05-21 2022-03-28 Can communication redundancy method and communication apparatus WO2022242314A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110557716.1 2021-05-21
CN202110557716.1A CN115378754A (en) 2021-05-21 2021-05-21 CAN communication redundancy method and communication device

Publications (1)

Publication Number Publication Date
WO2022242314A1 true WO2022242314A1 (en) 2022-11-24

Family

ID=84059726

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/083411 WO2022242314A1 (en) 2021-05-21 2022-03-28 Can communication redundancy method and communication apparatus

Country Status (2)

Country Link
CN (1) CN115378754A (en)
WO (1) WO2022242314A1 (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1479488A (en) * 2002-08-05 2004-03-03 M:N channel protection
CN1859062A (en) * 2006-03-27 2006-11-08 华为技术有限公司 Protective method for wave length conversion unit sharing, realizing device and applicating system
CN101729278A (en) * 2008-10-27 2010-06-09 华为技术有限公司 Channel protection method, node device and communication system
CN101854566A (en) * 2009-04-02 2010-10-06 华为技术有限公司 Passive optical network protection method and active/standby switch device and system
CN101938309A (en) * 2010-09-15 2011-01-05 重庆邮电大学 Network code-based WDM network sectionalized protection method
CN102215080A (en) * 2011-06-13 2011-10-12 南京邮电大学 Dynamic protection method for multi-domain optical network
US20140071813A1 (en) * 2012-09-07 2014-03-13 Electronics And Telecommunications Research Institute Protection switching method and apparatus
CN106301952A (en) * 2016-09-18 2017-01-04 北京邮电大学 A kind of SDN datum plane link backup method and device
CN110601945A (en) * 2019-10-31 2019-12-20 上海无线电设备研究所 Dual-redundancy CAN bus communication system and communication method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101712303B (en) * 2009-12-15 2011-08-31 浙江吉利汽车研究院有限公司 Multi-channel redundant bus system of hybrid electric vehicle
KR101566640B1 (en) * 2014-11-19 2015-11-09 경북대학교 산학협력단 Fault-tolerant dual-can (ft-dcan) device and method to tolerate arbitrary network faults, recording medium for performing the method
CN111654359B (en) * 2020-06-23 2023-08-11 中国民用航空总局第二研究所 Hot standby redundant communication system and method

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1479488A (en) * 2002-08-05 2004-03-03 M:N channel protection
CN1859062A (en) * 2006-03-27 2006-11-08 华为技术有限公司 Protective method for wave length conversion unit sharing, realizing device and applicating system
CN101729278A (en) * 2008-10-27 2010-06-09 华为技术有限公司 Channel protection method, node device and communication system
CN101854566A (en) * 2009-04-02 2010-10-06 华为技术有限公司 Passive optical network protection method and active/standby switch device and system
CN101938309A (en) * 2010-09-15 2011-01-05 重庆邮电大学 Network code-based WDM network sectionalized protection method
CN102215080A (en) * 2011-06-13 2011-10-12 南京邮电大学 Dynamic protection method for multi-domain optical network
US20140071813A1 (en) * 2012-09-07 2014-03-13 Electronics And Telecommunications Research Institute Protection switching method and apparatus
CN106301952A (en) * 2016-09-18 2017-01-04 北京邮电大学 A kind of SDN datum plane link backup method and device
CN110601945A (en) * 2019-10-31 2019-12-20 上海无线电设备研究所 Dual-redundancy CAN bus communication system and communication method

Also Published As

Publication number Publication date
CN115378754A (en) 2022-11-22

Similar Documents

Publication Publication Date Title
US9917725B2 (en) Automotive neural network
CN110474943B (en) Vehicle network redundancy system and gateway switching method based on MVB and Ethernet
US7483778B2 (en) Redundant array of control devices
US8762610B2 (en) Processing method for reprioritizing software application tasks
US20030107987A1 (en) Reconfiguration system for a communication network
CN112887152B (en) Train communication network architecture and method based on Ethernet and rail train
KR102533939B1 (en) vehicle control system
JP7030742B2 (en) Communication system and communication control method
US7698039B2 (en) Mobile communication system
WO2019207917A1 (en) Gateway device
WO2012083642A1 (en) Computer-control method for multi-unit coupling of a rail locomotive
WO2022242314A1 (en) Can communication redundancy method and communication apparatus
JP2009302783A (en) Failure detecting method and failure detection system of communication network
KR100976710B1 (en) Gateway device for car
CN113625622A (en) Data redundancy transmission system based on zone controller
US11764995B2 (en) Transceiver device
US20190305983A1 (en) Method and apparatus for configuring backup path in vehicle network
EP1359057B1 (en) Vehicle data transmission system with link redundancy
JP2006020117A (en) Train-mounted information control system
JP2017114406A (en) Network system
EP4243352A1 (en) Collective switching from a differential signalling communication mode to a single-ended communication mode upon the detection of a fault
JP2002152219A (en) Multiplex transmitter for vehicle
JP5138492B2 (en) Information processing apparatus and information processing method
JP4566531B2 (en) Serial communication dual system controller
CN117104156A (en) Vehicle control circuit, vehicle host and vehicle

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: 22803640

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE