CAN communication redundancy method and communication device
By designing connections between multiple CAN channels and network nodes in automotive in-car network communications, and using multiplexers to switch to backup channels, the cost and complexity issues caused by redundant design are solved and reliability and economy are achieved. balance.
Patent Information
- Application Number
- CN202110557716.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-21
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2041-05-21
AI Technical Summary
When designing in-vehicle network communications, in order to ensure the reliability of communication, redundant design of CAN communications is usually required, but this will lead to increased cost and increased complexity of the in-vehicle wire harness structure.
By designing multiple CAN channels to connect to multiple network nodes, and when a fault is detected, a multiplexer is used to switch to the backup CAN channel to achieve redundant switching.
While ensuring the reliability of in-vehicle communication, it also reduces the cost of the in-vehicle communication system and the complexity of the in-vehicle wiring harness structure.
Smart Images

Figure CN115378754B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communications, and more specifically, to a CAN communication redundancy method and a communication device. Background Art
[0002] When designing in-vehicle network communications, in order to ensure the reliability of communication, a redundant design of the controller area network (CAN) communication is generally performed. However, although the redundant design improves the reliability of the network communication system, it also inevitably brings about problems such as increased costs and complex in-vehicle wiring harness structures.
[0003] 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 that needs to be solved. Summary of the invention
[0004] The present application provides a CAN communication redundancy method and communication device, which 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 in-vehicle communication.
[0005] In a first aspect, a method for CAN communication redundancy is provided, the method comprising: establishing connections between multiple CAN channels and multiple network nodes respectively; when a failure is detected in a first CAN channel among the multiple CAN channels, controlling a multiplexer to switch the CAN channel connected to the first network node to a first backup CAN channel, the first CAN channel comprising a CAN channel connected to the first network node.
[0006] Based on the embodiment of the present 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. This technical solution can achieve backup of multiple CAN channels through a backup CAN channel, which can not only ensure the reliability of in-vehicle communication, but also reduce the cost of the in-vehicle communication system and the complexity of the in-vehicle wiring harness structure.
[0007] In combination with the first aspect, in some implementations of the first aspect, the multiplexer includes multiple bidirectional switches, the multiple bidirectional switches correspond one-to-one to the multiple network nodes, and when a fault is detected in a first CAN channel among the multiple CAN channels, 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 first CAN channel and connect it to the first backup CAN channel.
[0008] Based on the embodiment of the present application, the multiplexer includes multiple bidirectional switches. When a fault is detected in the CAN channel corresponding to one of the external network nodes, the faulty CAN channel can be switched to the backup channel by controlling the disconnection and connection of the bidirectional switch.
[0009] In combination with the first aspect, in certain implementations of the first aspect, 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 includes: 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 and connect it to the first backup CAN channel.
[0010] Based on the embodiment of the present application, when it is necessary to switch the CAN channel, switching instruction information is sent to the multiplexer to instruct it to switch from the faulty channel to the backup channel.
[0011] In combination with the first aspect, in some implementations of the first aspect, the method further includes: when a fault is detected in a second CAN channel among the multiple CAN channels, determining 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, controlling 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.
[0012] Based on the embodiment of the present application, when a fault is detected in two CAN channels, the CAN channel with a higher priority is switched to the backup channel, which helps to ensure the communication reliability of important data.
[0013] In combination with the first aspect, in some implementations of the first aspect, determining the priority of the first CAN channel and the second CAN channel includes: determining the priority of the first CAN channel and the second CAN channel according to data transmitted by the first CAN channel and the second CAN channel.
[0014] Based on the embodiments of the present application, the priority of the CAN channel can be determined by the data transmitted in the CAN channel, which is helpful to ensure the communication reliability of important data.
[0015] In combination with the first aspect, in some implementations of the first aspect, controlling the multiplexer to disconnect the bidirectional switch corresponding to the first network node from the first backup CAN channel, 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 includes: sending second switching indication information to the multiplexer, where 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, 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.
[0016] In combination with the first aspect, in some implementations of the first aspect, the first CAN channel includes at least two CAN channels, the priority of the CAN channel connected to the first network node is greater than the priority of the CAN channel connected to the third network node, and the CAN channel connected to the third network node is a channel of the at least two CAN channels except the CAN channel connected to the first network node.
[0017] Based on the embodiment of the present application, when the first CAN channel includes multiple CAN channels, the CAN channel to which the first network node is connected has a higher priority, which is beneficial for ensuring the communication reliability of important data.
[0018] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: when a fault is detected in a third CAN channel among the multiple CAN channels, controlling the multiplexer to switch the CAN channel connected to the third network node from the third CAN channel to a second backup CAN channel, wherein the second backup CAN channel and the first backup CAN channel are different CAN channels.
[0019] Based on the embodiments of the present application, the technical solution designs two backup channels, thereby improving the reliability of in-vehicle communications.
[0020] In combination with the first aspect, in some implementations of the first aspect, the method further includes: when a fault is detected in a fourth CAN channel among the multiple CAN channels, determining the priorities 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, and the priority of the first CAN channel is greater than the priority of the third channel, controlling the multiplexer to disconnect the third network node from the second backup CAN channel, and switching the CAN channel connected to the fourth network node 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.
[0021] Based on the embodiment of the present application, when there are two backup channels, the two CAN channels with high priorities are switched to the two backup channels, which is helpful to ensure the communication reliability of important data in the vehicle.
[0022] In a second aspect, a method for CAN communication redundancy is provided, the method comprising: establishing connections with multiple network nodes respectively for multiple CAN channels; determining the priorities of the at least two CAN channels when failures are detected in at least two of the multiple CAN channels at the same time; and controlling a multiplexer to switch the two CAN channels with higher priorities among the at least two CAN channels to two backup CAN channels respectively.
[0023] 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 high priority can be switched to the two backup channels respectively.
[0024] Since the importance of data transmitted by each CAN channel may be different, this technical solution is conducive to ensuring the communication reliability of important data.
[0025] According to a third aspect, a communication device is provided, 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 device performs the following steps: multiple CAN channels respectively establish connections with multiple network nodes; when a failure is detected in a first CAN channel among the multiple CAN channels, a multiplexer is controlled to switch the CAN channel connected to the first network node to a first backup CAN channel, wherein the first CAN channel includes a CAN channel connected to the first network node.
[0026] In combination with the third aspect, in certain implementations of the third aspect, the multiplexer includes multiple bidirectional switches, and the multiple bidirectional switches correspond one-to-one to the multiple network nodes. When the instruction is executed by the processor, the communication device performs the following steps: 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.
[0027] In combination with the third aspect, in certain implementations of the third aspect, when the instruction is executed by the processor, the communication device performs the following steps: sending first switching indication information to the multiplexer, the first switching indication information being 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.
[0028] In combination with the third aspect, in certain implementations of the third aspect, when the instruction is executed by the processor, the communication device performs the following steps: when a fault is detected in the second CAN channel of the multiple CAN channels, determining 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, controlling 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.
[0029] In combination with the third aspect, in certain implementations of the third aspect, when the instruction is executed by the processor, the communication device performs the following steps: determining the priority of the first CAN channel and the second CAN channel based on data transmitted by the first CAN channel and the second CAN channel.
[0030] In combination with the third aspect, in certain implementations of the third aspect, when the instruction is executed by the processor, the communication device performs the following steps: sending second switching indication information to the multiplexer, wherein 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, 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.
[0031] In combination with the third aspect, in certain implementations of the third aspect, the first CAN channel includes at least two CAN channels, the priority of the CAN channel connected to the first network node is greater than the priority of the CAN channel connected to the third network node, and the CAN channel connected to the third network node is a channel of the at least two CAN channels except the CAN channel connected to the first network node.
[0032] In combination with the third aspect, in certain implementations of the third aspect, when the instruction is executed by the processor, the communication device performs the following steps: when a fault is detected in the third CAN channel among the multiple CAN channels, controlling the multiplexer to switch the CAN channel connected to the third network node from the third CAN channel to a second backup CAN channel, wherein the second backup CAN channel and the first backup CAN channel are different CAN channels.
[0033] In combination with the third aspect, in certain implementations of the third aspect, when the instruction is executed by the processor, the communication device performs the following steps: when a fault is detected in the fourth CAN channel of the multiple CAN channels, determining the priorities 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, and the priority of the first CAN channel is greater than the priority of the third channel, controlling the multiplexer to disconnect the third network node from the second backup CAN channel, and switching the CAN channel connected to the fourth network node 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.
[0034] In a fourth aspect, a communication device is provided, comprising: a memory for storing instructions; a processor for reading the instructions, wherein 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 of the multiple CAN channels are detected to have faults at the same time, determine the priorities of the at least two CAN channels; and control a multiplexer to switch the two CAN channels with higher priorities among the at least two CAN channels to two backup CAN channels, respectively.
[0035] In a fifth aspect, a chip is provided, comprising a processor and a communication interface, wherein 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 first aspect and any possible implementation thereof is executed.
[0036] In a sixth aspect, a chip is provided, comprising a processor and a communication interface, wherein 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 described in the second aspect above is executed.
[0037] In a seventh aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions. When the computer instructions are executed on a computer, the method for CAN communication redundancy as described in the first aspect and any possible implementation thereof is executed.
[0038] In an eighth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions. When the computer instructions are executed on a computer, the method for CAN communication redundancy as described in the second aspect is executed.
[0039] In a ninth aspect, a computer program product is provided, comprising computer instructions, which, when executed on a computer, enable the method for CAN communication redundancy as described in the first aspect and any possible implementation thereof to be executed.
[0040] In a tenth aspect, a computer program product is provided, comprising computer instructions, which, when executed on a computer, enable the method for CAN communication redundancy as described in the second aspect to be executed. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 It is a schematic diagram of a CAN communication system architecture provided in an embodiment of the present application.
[0042] Figure 2It is a schematic diagram of another CAN communication system architecture provided in an embodiment of the present application.
[0043] Figure 3 It is a schematic diagram of another CAN communication system architecture provided in an embodiment of the present application.
[0044] Figure 4 It is a schematic flow chart of a CAN communication redundancy method provided in an embodiment of the present application.
[0045] Figure 5 It is a schematic flow chart of another CAN communication redundancy method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] The technical solution in this application will be described below in conjunction with the accompanying drawings.
[0047] The technical solution of the embodiment of the present application can be applied to the in-vehicle communication system of an automobile.
[0048] Figure 1 It is a schematic diagram of a CAN communication system architecture provided in an embodiment of the present application.
[0049] like Figure 1 As shown, the external network node 100a and the network node 100b communicate with the communication device 100, and the communication device 100 may include a micro control unit (MCU) 110, and the micro control unit 110 may include multiple CAN controllers. The communication device 100 may also include multiple CAN transceivers.
[0050] A CAN channel can include a CAN transceiver and a CAN controller. Figure 1 , the external network node 110a is connected to a CAN channel through the 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, converts the coded signal into a differential signal, and sends it to the network node 100a through the bus 101a.
[0051] For example, the external network nodes 100a, 100b may be any functional unit or device 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.
[0052] In order to ensure the stability of the CAN communication system, CAN communication is generally designed to be redundant. Figure 1The communication device 100 designs a backup channel a for the external network node 100a, and the backup channel a includes a CAN transceiver 104a and a CAN controller 105a. The external network node 100a is connected to the backup channel a through a bus 106a. When the CAN channel to which the external network node 100a is normally connected fails, the external network node 100a can be switched to the backup channel a.
[0053] It should be understood that in the embodiment of the present application, one CAN controller corresponds to one CAN transceiver.
[0054] Optionally, one CAN controller may correspond to multiple CAN transceivers. When a CAN channel fails, it may be that the CAN transceiver fails, the CAN controller fails, the bus fails, and so on.
[0055] For the external network node B, a backup channel b is also designed. When the CAN channel to which it is connected fails, it can switch to the backup channel b, thereby improving the reliability of the network communication within the vehicle.
[0056] Figure 1 The external network nodes in the embodiment are connected to two CAN channels through two buses respectively. In some embodiments, the external network nodes can also be connected to two CAN channels through one bus. Although this solution saves one bus, it is still relatively complicated as a whole.
[0057] 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 the in-vehicle network communication, when there are many external network nodes in the vehicle, the in-vehicle network topology will become complicated and its wiring harness deployment will also be very cumbersome. In addition, the design of a backup channel for each network node further increases the cost of communication.
[0058] In view of this, an embodiment of the present application provides a CAN communication redundancy method and communication device. This 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.
[0059] The following will be combined Figures 2 to 5 , introduces the CAN communication redundancy method and communication device in the embodiments of the present application.
[0060] Figure 2 It is a schematic diagram of another CAN communication system architecture provided in an embodiment of the present application.
[0061] like Figure 2As shown, the communication device 200 may include an MCU 210, multiple CAN transceivers and a multiplexer 230. The MCU 210 may include multiple CAN controllers. The multiplexer 230 may include a selector 231 and multiple bidirectional switches, each bidirectional switch corresponding to an external network node.
[0062] Optionally, the CAN controller may not be in the MCU210, but exist as an independent device, which is not limited in the embodiments of the present application.
[0063] See also Figure 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 is disconnected from A1 and connected to the access point A2 of the CAN transceiver 225 in the backup channel, so that the external network node can be connected to the CAN backup channel.
[0064] Specifically, when MCU210 detects that the CAN transceiver 221 or the CAN controller 211 has a fault, MCU210 will initialize the backup channel and set the reception and transmission of the backup channel data to be a complete mirror of the CAN channel A connected to the external network node A; after the backup channel is initialized, the MCU210 sends a switching indication message to the selector 231 in the multiplexer 230; after receiving the switching indication message, the selector 231 controls the bidirectional switch A0 to disconnect from the access point A1 of the CAN transceiver 221 in the CAN channel A, and connects A0 to the access point A2 of the CAN transceiver 225 of the backup channel, thereby completing the switching from the faulty channel to the backup channel.
[0065] 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 from 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 the CAN backup channel.
[0066] Specifically, when MCU210 detects that the CAN transceiver 222 or the CAN controller 214 has a fault, MCU210 will initialize the backup channel and set the reception and transmission of the backup channel data to a complete mirror of the CAN channel B connected to the external network node B; after the backup channel is initialized, the MCU210 sends a switching indication message to the selector 231 in the multiplexer 230; after receiving the switching indication message, the selector 231 controls the bidirectional switch B0 to disconnect from the access point B1 of the CAN transceiver 222 in the CAN channel B, and connects B0 to the access point B2 of the CAN transceiver 225 of the backup channel, thereby completing the switching from the faulty channel to the backup channel.
[0067] For the external network node C and the external network node D, reference may be made to the relevant description of the external network node A and the external network node B, which will not be described in detail for the sake of brevity.
[0068] In an embodiment of the present application, a backup channel is designed for multiple external communication nodes, and the backup channel includes a CAN transceiver 225 and a CAN controller 213. The CAN transceiver 225 has four access points A2, B2, C2, and D2, which correspond to four external network nodes respectively. When a CAN channel connected to one of the four external network nodes fails, switching from the faulty CAN channel to the backup channel can be completed through the bidirectional switch in the multiplexer.
[0069] It should be understood that the embodiment of the present application is described by taking four external network nodes as an example, but this should not cause any limitation to the present application. In practical applications, the number of the external network nodes may not be specifically limited.
[0070] The above describes a situation where a CAN channel connected to one of the multiple external network nodes fails. In some examples, it is possible that a CAN channel connected to multiple network nodes fails.
[0071] Possible CAN channel failure scenarios are:
[0072] Scenario 1:
[0073] When it is detected that a CAN channel corresponding to one of the network nodes fails and the CAN channel corresponding to the network node has been switched to a backup channel, it is detected that a CAN channel corresponding to another network node fails.
[0074] For example, when the CAN channel corresponding to the external network node A fails (such as the CAN transceiver 211 fails), MACU210 sends a switching instruction message to the multiplexer, controls the bidirectional switches A0 and A1 to disconnect, and connects A0 to A2. At this time, the external network node A has been connected to the backup channel. In this case, MCU210 detects that the CAN transceiver 222 has failed.
[0075] Scenario 2:
[0076] At the same time, it is detected that the CAN channels corresponding to the multiple network nodes are faulty.
[0077] For example, when the CAN controller 211 and the CAN controller 214 fail, the CAN channel A and the CAN channel B corresponding to the CAN controllers will fail.
[0078] For the above-mentioned possible CAN channel failure scenarios, during the initial design of the communication system, the embodiment of the present application will formulate the priority of each CAN channel according to the importance of the data transmitted in each CAN channel. When multiple CAN channels fail, the CAN channel with a high priority will be switched to the backup channel according to the priority of each CAN channel.
[0079] For the above situation 1:
[0080] Since the priority order of each CAN channel has been established during the initial design of the communication system, the priority of the CAN channel corresponding to the network node currently connected to the backup channel and the priority of the CAN channel corresponding to another network node detected later can be determined at this time. 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, the current state will continue to be maintained; if the priority of the CAN channel corresponding to the network node currently connected to the backup channel is less 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 the other network node detected later will be connected to the backup channel.
[0081] For example, CAN channel A connected to external network node A fails, and network node A has been connected to the backup channel. At this time, it is detected that CAN channel B corresponding to external network node B fails. If the priority of CAN channel A is greater than the priority of CAN channel B, the current state is maintained. If the priority of the CAN channel is less than the priority of CAN channel B, the connection between external network node A and the backup channel is disconnected, and external network node B is connected to the backup channel.
[0082] For the above situation 2:
[0083] When faults are detected in multiple CAN channels 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.
[0084] For example, if a fault is detected in both CAN channel A and CAN channel B at the same time, and if the priority of CAN channel A is greater than that of CAN channel B, the external network node corresponding to CAN channel A is connected to the backup channel. If the data transmitted in CAN channel A is the data of the vehicle 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 vehicle engine control unit is obviously more important than the data for adjusting the air conditioner in the car.
[0085] Based on the embodiment of the present application, multiple external network nodes are respectively connected to multiple CAN channels through the bidirectional switch in the multiplexer, and a backup channel is designed. When a CAN channel corresponding to one of the external network nodes is detected to be faulty, the faulty CAN channel can be switched to the backup channel by controlling the disconnection and connection of the bidirectional switch. This technical solution can not only ensure the reliability of in-vehicle communication, but also reduce the cost of the in-vehicle communication system and the complexity of the in-vehicle wiring harness structure.
[0086] Furthermore, when a fault is detected in two CAN channels, the CAN channel with a higher priority is switched to the backup channel, thereby facilitating the communication reliability of important data.
[0087] The above describes the situation where a backup channel is designed in the CAN communication system. Figure 3 This paper introduces the situation of designing two backup channels in the CAN communication system.
[0088] Figure 3 It is a schematic diagram of another CAN communication system architecture provided in an embodiment of the present application.
[0089] like Figure 3 As shown, the communication device 300 may include an MCU 210, multiple CAN transceivers, and a multiplexer 230, wherein the MCU 210 may include multiple CAN controllers. The multiplexer 230 may include a selector 231 and multiple switches, each of which corresponds to an external network node.
[0090] Different from the communication device 200 , two backup channels are designed in the communication device 300 , namely, backup channel a including the CAN controller 213 and the CAN transceiver 225 , and backup channel b including the CAN controller 216 and the CAN transceiver 226 .
[0091] See also Figure 3The CAN transceiver 225 in the backup channel a has four access points A2, B2, C2, and D2, and the CAN transceiver 226 in the backup channel b has four access points A3, B3, C3, and D3, which correspond to four external network nodes respectively.
[0092] In the case where the communication device 3 has two backup channels, possible failure scenarios are:
[0093] Scenario 1:
[0094] A CAN channel failure was detected.
[0095] Scenario 2:
[0096] Faults on two CAN channels were detected.
[0097] Scenario 3:
[0098] Faults in more than two CAN channels are detected at the same time.
[0099] Scenario 4:
[0100] It is detected that two CAN channels are faulty, and when the network nodes corresponding to the two faulty CAN channels have been connected to two backup channels respectively, it is detected that another CAN channel is faulty.
[0101] For the above situation 1:
[0102] Since there are two CAN backup channels in the communication system, when it is detected that one of the CAN channels in normal use fails, the network node corresponding to the failed CAN channel can be connected to one of the two backup channels.
[0103] For example, the order in which the two backup channels are used may be set in the system. Alternatively, the order in which the two backup channels are used is not limited, and one of the two backup channels is randomly selected when used.
[0104] 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 MCU210 detects that the CAN channel A connected to the external network node A fails, the 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 the faulty CAN channel A to the backup channel.
[0105] For example, when the CAN channel A connected to the external network node A fails to send, the switch A0 is disconnected from A1 and connected to A2, and the CAN channel connected to the external network node is the backup channel a.
[0106] For the above situation 2:
[0107] Since there are two CAN backup channels in the communication system, when failures of the two CAN channels are detected, the network nodes corresponding to the two failed CAN channels can be connected to the two backup channels respectively.
[0108] In one possible implementation, the two CAN backup channels fail successively. For example, when the external network node A is already connected to one backup channel, MCU210 detects that CAN channel B connected to network node B fails, and then connects network node B to another backup channel.
[0109] In another possible implementation, if the two CAN backup channels fail at the same time, the network nodes corresponding to the two failed CAN channels can be connected to the two backup channels respectively.
[0110] For the above situation 3:
[0111] In the initial design of the communication system of the embodiment of the present application, the priority of each CAN channel is determined according to the importance of the data transmitted in each CAN channel. When faults are detected in more than two CAN channels at the same time, the network nodes corresponding to the first two faulty CAN channels with higher priorities can be selected and connected to the two backup CAN channels according to the priorities of the more than two faulty CAN channels.
[0112] For the above situation 4:
[0113] During the initial design of the communication system, the priority of each CAN channel will be determined based on the importance of the data transmitted in each CAN channel. When two CAN channels are detected to have failed and the network nodes corresponding to the two failed CAN channels have been connected to two backup channels respectively, if another CAN channel is detected to have failed at this time, the priority order of the three failed CAN channels can be used to determine whether to maintain the current state or to connect the network node corresponding to the later detected failed CAN channel to one of the backup channels.
[0114] For example, if the CAN channel A and CAN channel B to which network node A and network node B are connected by default fail, and the network node A and network node B have also been connected to two backup channels respectively, such as network node A is connected to backup channel a and network node B is connected to backup channel b, at this time, MCU210 detects that the CAN channel C to which network node C is connected by default fails, then MCU210 can make a decision based on the priority of CAN channel A, CAN channel B and CAN channel C.
[0115] If the priority of CAN channel C is lower than the priority of CAN channel A and CAN channel B, the current state is maintained.
[0116] 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, the connection between network node B and backup channel b is disconnected, and network node C is connected to backup channel b.
[0117] If the priority of CAN channel C is greater than the priority of CAN channel A, and the priority of CAN channel A is less than the priority of CAN channel B, the connection between network node A and backup channel a is disconnected, and network node C is connected to backup channel a.
[0118] Based on the embodiment of the present application, multiple external network nodes are connected to multiple CAN channels respectively through switches in the multiplexer, and two backup channels are designed. When a CAN channel corresponding to one or two external network nodes is detected to be faulty, the faulty CAN channel can be switched to the backup channel by controlling the disconnection and connection of the switch. This technical solution can not only ensure the reliability of in-vehicle communication, but also reduce the cost of the in-vehicle communication system and the complexity of the in-vehicle wiring harness structure.
[0119] Furthermore, when more than two CAN channels are detected to have faults, the two CAN channels with higher priorities are switched to the two backup channels, thereby facilitating the communication reliability of important data.
[0120] Figure 4 is a schematic flow chart of a CAN redundant communication method provided by an embodiment of the present application. Figure 4 As shown, the method may include steps 410 to 420.
[0121] 410, multiple CAN channels respectively establish connections with multiple network nodes.
[0122] Each CAN channel may include a CAN controller and a CAN transceiver, and multiple CAN channels are connected to multiple network nodes respectively. It can be understood that multiple network nodes communicate with the CAN transceivers in the multiple CAN channels through the bus respectively.
[0123] For example, a CAN transceiver receives data sent by a network node via the bus and transmits the data to a CAN controller.
[0124] The network node may be an engine control unit, an electric power steering control unit, an air conditioning control unit, etc.
[0125] 420. When a fault is detected in a first CAN channel among the multiple CAN channels, control 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 a CAN channel connected to the first network node.
[0126] The first CAN channel may include one CAN channel or multiple CAN channels.
[0127] The multiplexer may include multiple bidirectional switches, each bidirectional switch corresponds to a CAN channel. Under normal circumstances, each bidirectional switch is connected to a CAN channel for normal communication by default, and another access point that each bidirectional switch can be connected to is an access point of the first backup CAN channel. When the CAN channel connected to the first network node fails, the multiplexer may be controlled to switch the CAN channel connected to the first network node to the first backup CAN channel.
[0128] Based on the embodiment of the present 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. This technical solution can achieve backup of multiple CAN channels through a backup CAN channel, which can not only ensure the reliability of in-vehicle communication, but also reduce the cost of the in-vehicle communication system and the complexity of the in-vehicle wiring harness structure.
[0129] Optionally, the multiplexer includes multiple bidirectional switches, and the multiple bidirectional switches correspond one-to-one to the multiple network nodes. When a fault is detected in the first CAN channel of the multiple CAN channels, 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 first CAN channel and connect it to the first backup CAN channel.
[0130] In this embodiment, the CAN channel to which the first network node is connected is the first CAN channel.
[0131] For example, see Figure 2 , the multiplexer 230 includes a plurality of bidirectional switches A0, B0, C0 and D0. The first network node may be a network node A, and the CAN channel connected to the network node A is a CAN channel A. When a fault is detected in the CAN channel A, the multiplexer 230 is controlled to disconnect the bidirectional switch corresponding to the network node A from the CAN channel A and connect it to the backup channel.
[0132] Optionally, 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 includes: sending first switching indication information to the multiplexer, wherein 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 and connect it to the first backup CAN channel.
[0133] For example, see Figure 2 , the first backup CAN channel can be Figure 2 The backup channel in includes a CAN controller 213 and a CAN transceiver 225. The first network node may be a network node A. When a fault is detected in a CAN channel A connected to the network node A, the MCU 210 sends a first switching indication message to the multiplexer. After receiving the first switching indication message, the selector 231 in the multiplexer 230 controls the switch A0 to disconnect from A1 and connect to A2, thereby completing the switching from the faulty CAN channel to the first backup CAN channel.
[0134] Optionally, the method may further include steps 430 to 440:
[0135] 430 , when it is detected that a second CAN channel among the multiple CAN channels fails, determine the priority of the first CAN channel and the second CAN channel.
[0136] For example, see Figure 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 then CAN channel B connected to network node B is detected to have failed, the priorities of CAN channel A and CAN channel B can be determined at this time, and the switching strategy can be determined according to the priorities.
[0137] 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 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.
[0138] For example, 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, and the multiplexer is controlled to disconnect the bidirectional switch A0 corresponding to network node A from A2, disconnect the bidirectional switch B0 corresponding to network node B from point B1, and connect B0 to B2. In this way, the network node B is connected to the backup channel.
[0139] Specifically, switching instruction information may be sent to the multiplexer to instruct it to perform the above switching operation.
[0140] Optionally, when the priority of the second CAN channel is lower than the priority 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 is maintained.
[0141] Optionally, determining the priority of the first CAN channel and the second CAN channel includes:
[0142] The priorities of the first CAN channel and the second CAN channel are determined according to data transmitted by the first CAN channel and the second CAN channel.
[0143] For example, when the communication system is initially connected, 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 automobile engine control data is higher than the priority of the CAN channel that transmits automobile air conditioning adjustment data.
[0144] This technical solution switches the high-priority CAN channel to the backup channel, which helps to ensure the communication reliability of important data.
[0145] Optionally, controlling 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 includes:
[0146] Sending second switching indication information to the multiplexer, wherein 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, 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.
[0147] In this embodiment, when it is determined to connect the second network node to the first backup channel, second switching indication information may be sent to the multiplexer to instruct it to perform switching.
[0148] Optionally, the first CAN channel includes at least two CAN channels, the priority of the CAN channel connected to the first network node is higher than the priority of the CAN channel connected to the third network node, and the CAN channel connected to the third network node is the channel of the at least two CAN channels except the CAN channel connected to the first network node.
[0149] 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, the CAN channel connected to the first network node with a high priority is switched to the first backup channel, thereby facilitating the communication reliability of important data.
[0150] Optionally, when a fault is detected in a third CAN channel among the multiple CAN channels, the multiplexer is controlled to switch the third CAN channel connected to the third network node to a second backup CAN channel, where the second backup CAN channel is a different CAN channel from the first backup CAN channel.
[0151] In this embodiment, the communication system has two backup channels. Figure 3 The first network node may be network node A, and the third network node may be network node B. After CAN channel A connected to the first network node is switched to the first backup CAN channel, it is detected that CAN channel B corresponding to network node B fails, then the CAN channel connected to network node B may be switched to the second backup CAN channel.
[0152] In the case where there are two backup CAN channels, the order in which the two backup CAN channels are used can be set. For example, when only one CAN channel fails, the first backup CAN channel is used preferentially.
[0153] Optionally, when a fault is detected in a fourth CAN channel among the multiple CAN channels, determining the priorities of the first CAN channel, the third CAN channel and the fourth CAN channel;
[0154] 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, controlling the multiplexer to disconnect the third network node from the second backup CAN channel, and switching the CAN channel connected to the fourth network node from the fourth CAN channel to the second backup CAN channel; or
[0155] 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, the multiplexer is controlled to disconnect the first network node from the first backup CAN channel, and the CAN channel connected to the fourth network node is switched from the fourth CAN channel to the first backup CAN channel.
[0156] For example, see Figure 3 , the first network node may be network node A, the first CAN channel is CAN channel A connected to network node A, the third network node may be network node B, the second CAN channel is CAN channel B connected to network node B, the fourth network node may be network node C, the third CAN channel is CAN channel C connected to 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 CAN channel C connected to network node C fails, at this time, a switching decision can be made according to the priority of CAN channel A, CAN channel B, and CAN channel C.
[0157] For example, when 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, 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.
[0158] When the priority of CAN channel C is greater than the priority of CAN channel A, and the priority of CAN channel A is less than the priority of CAN channel B, the multiplexer is controlled to disconnect switch A0 of network node A from A2, disconnect C0 corresponding to network node C from C1, and connect C0 to C2, so that network node C can be connected to the backup CAN channel.
[0159] When the priority of CAN channel C is lower than both the priority of CAN channel A and the priority of CAN channel B, the current state is maintained, that is, the connection between network node A and network node B and the backup channel is maintained.
[0160] This technical solution is conducive to ensuring the communication reliability of important data.
[0161] Figure 5 It is a schematic flowchart of another CAN redundant communication method provided in an embodiment of the present application.
[0162] like Figure 5 As shown, the method may include steps 510 to 530.
[0163] 510, multiple CAN channels respectively establish connections with multiple network nodes.
[0164] For step 510, reference may be made to the relevant description in step 410, which will not be repeated for the sake of brevity.
[0165] 520 , when it is simultaneously detected that at least two CAN channels among the multiple CAN channels are faulty, determine the priorities of the at least two CAN channels.
[0166] When multiple CAN channels are detected to have faults at the same time, a switching decision can be made based on the priorities of the multiple CAN channels.
[0167] 530 , controlling the multiplexer to switch two CAN channels with higher priorities among the at least two CAN channels to two backup CAN channels respectively.
[0168] 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 high priority can be switched to the two backup channels respectively.
[0169] Since the importance of data transmitted by each CAN channel may be different, this technical solution is conducive to ensuring the communication reliability of important data.
[0170] An embodiment of the present application further provides a communication device, comprising a processing unit, wherein the processing unit is used to execute the CAN communication redundancy method as described in any one of the above.
[0171] An 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 executes the CAN communication redundancy method as described in any one of the above.
[0172] An embodiment of the present application also provides a chip, which includes a processor and a communication interface, wherein 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 CAN communication redundancy method as described in any one of the above items is executed.
[0173] An embodiment of the present application further provides a computer-readable storage medium, comprising computer instructions. When the computer instructions are executed on a communication device, the communication device executes the method for CAN communication redundancy as described in any one of the above texts.
[0174] An embodiment of the present application further provides a computer program product, comprising computer instructions. When the computer instructions are executed on a computer, the method for CAN communication redundancy as described in any one of the above is executed.
[0175] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0176] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0177] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0178] 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 distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0179] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0180] If the functions are implemented in the form of software functional 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 can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks or optical disks.
[0181] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for CAN communication redundancy, characterized in that: include: Multiple CAN channels establish connections with multiple network nodes respectively; When a fault is detected in a first CAN channel among the multiple CAN channels, controlling the multiplexer to switch the CAN channel connected to the first network node to a first backup CAN channel, wherein the first CAN channel includes a CAN channel connected to the first network node; When a fault is detected in a second CAN channel among the multiple CAN channels, determining a priority between 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, the multiplexer is controlled 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.
2. The method according to claim 1, characterized in that 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 a fault is detected in a first CAN channel among the plurality of CAN channels, the multiplexer is controlled to switch the CAN channel connected to the first network node to the first backup CAN channel, including: The multiplexer is controlled 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. The method according to claim 2, characterized in that The 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 includes: 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 and connect it to the first backup CAN channel.
4. The method according to any one of claims 1 to 3, characterized in that The determining the priority of the first CAN channel and the second CAN channel includes: The priorities of the first CAN channel and the second CAN channel are determined according to data transmitted by the first CAN channel and the second CAN channel.
5. The method according to claim 4, characterized in that The controlling 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 includes: Sending second switching indication information to the multiplexer, wherein 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, 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.
6. The method according to claim 1, characterized in that The first CAN channel includes at least two CAN channels, the priority of the CAN channel connected to the first network node is greater than the priority of the CAN channel connected to the third network node, and the CAN channel connected to the third network node is a channel of the at least two CAN channels except the CAN channel connected to the first network node.
7. The method according to claim 1, characterized in that The method further comprises: When a fault is detected in a third CAN channel among the multiple CAN channels, the multiplexer is controlled to switch the CAN channel connected to the third network node from the third CAN channel to a second backup CAN channel, where the second backup CAN channel is a different CAN channel from the first backup CAN channel.
8. The method according to claim 7, characterized in that The method further comprises: When a fault is detected in a fourth CAN channel among the multiple CAN channels, determining the priorities 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, and the priority of the first CAN channel is greater than the priority of the third channel, controlling the multiplexer to disconnect the third network node from the second backup CAN channel, and switching the CAN channel connected to the fourth network node 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, the multiplexer is controlled to disconnect the first network node from 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.
9. A method for CAN communication redundancy, characterized in that: include: Multiple CAN channels establish connections with multiple network nodes respectively; When at least two CAN channels among the multiple CAN channels are detected to be faulty at the same time, determining the priorities of the at least two CAN channels, wherein the at least two CAN channels include a first CAN channel, a second CAN channel, and a third CAN channel; Controlling the multiplexer to switch two CAN channels with higher priorities among the at least two CAN channels to at least two backup CAN channels respectively, wherein the at least two backup CAN channels include a first backup CAN channel and a second backup CAN channel; The controlling multiplexer to switch two CAN channels with higher priorities among the at least two CAN channels to two backup CAN channels respectively includes: When the priority of the first CAN channel and the priority of the second CAN channel are both greater than the priority of the third CAN channel, the multiplexer is controlled to switch the CAN channel connected to the first network node to the first backup CAN channel, and the multiplexer is controlled to switch the CAN channel connected to the second network node to the second backup CAN channel, the first CAN channel includes the CAN channel connected to the first network node, and the second CAN channel includes the CAN channel connected to the second network node.
10. A communication device, characterized in that: include: A memory for storing instructions; A processor is used to read the instruction, and when the instruction is executed by the processor, the communication device performs the following steps: Multiple CAN channels establish connections with multiple network nodes respectively; When a fault is detected in a first CAN channel among the multiple CAN channels, controlling the multiplexer to switch the CAN channel connected to the first network node to a first backup CAN channel, wherein the first CAN channel includes a CAN channel connected to the first network node; When a fault is detected in a second CAN channel among the multiple CAN channels, determining a priority between 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, the multiplexer is controlled 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.
11. The device according to claim 10, characterized in that The multiplexer includes a plurality of bidirectional switches, and the plurality of bidirectional switches correspond to the plurality of network nodes one by one. When the instruction is executed by the processor, the communication device performs the following steps: The multiplexer is controlled 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.
12. The device according to claim 11, characterized in that When the instructions are executed by the processor, the communication device performs the following steps: 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 and connect it to the first backup CAN channel.
13. The device according to any one of claims 10 to 12, characterized in that When the instructions are executed by the processor, the communication device performs the following steps: The priorities of the first CAN channel and the second CAN channel are determined according to data transmitted by the first CAN channel and the second CAN channel.
14. The device according to claim 13, characterized in that When the instructions are executed by the processor, the communication device performs the following steps: Sending second switching indication information to the multiplexer, wherein 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, 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. The device according to claim 10, characterized in that The first CAN channel includes at least two CAN channels, the priority of the CAN channel connected to the first network node is greater than the priority of the CAN channel connected to the third network node, and the CAN channel connected to the third network node is a channel of the at least two CAN channels except the CAN channel connected to the first network node.
16. The device according to claim 10, characterized in that When the instructions are executed by the processor, the communication device performs the following steps: When a fault is detected in a third CAN channel among the multiple CAN channels, the multiplexer is controlled to switch the CAN channel connected to the third network node from the third CAN channel to a second backup CAN channel, where the second backup CAN channel is a different CAN channel from the first backup CAN channel.
17. The device according to claim 16, characterized in that When the instructions are executed by the processor, the communication device performs the following steps: When a fault is detected in a fourth CAN channel among the multiple CAN channels, determining the priorities 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, and the priority of the first CAN channel is greater than the priority of the third channel, controlling the multiplexer to disconnect the third network node from the second backup CAN channel, and switching the CAN channel connected to the fourth network node 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, the multiplexer is controlled to disconnect the first network node from 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.
18. A communication device, characterized in that: include: A memory for storing instructions; A processor is used to read the instruction, and when the instruction is executed by the processor, the communication device performs the following steps: Multiple CAN channels establish connections with multiple network nodes respectively; When at least two CAN channels among the multiple CAN channels are detected to be faulty at the same time, determining the priorities of the at least two CAN channels, wherein the at least two CAN channels include a first CAN channel, a second CAN channel, and a third CAN channel; Controlling the multiplexer to switch two CAN channels with higher priorities among the at least two CAN channels to at least two backup CAN channels respectively, wherein the at least two backup CAN channels include a first backup CAN channel and a second backup CAN channel; The controlling multiplexer to switch two CAN channels with higher priorities among the at least two CAN channels to two backup CAN channels respectively includes: When the priority of the first CAN channel and the priority of the second CAN channel are both greater than the priority of the third CAN channel, the multiplexer is controlled to switch the CAN channel connected to the first network node to the first backup CAN channel, and the multiplexer is controlled to switch the CAN channel connected to the second network node to the second backup CAN channel, the first CAN channel includes the CAN channel connected to the first network node, and the second CAN channel includes the CAN channel connected to the second network node.
19. A computer-readable storage medium, characterized in that: The computer comprises computer instructions, wherein the computer readable storage medium stores the computer instructions, and when the computer instructions are executed on a computer, the method for CAN communication redundancy as claimed in any one of claims 1 to 8 or 9 is executed.
Citation Information
Patent Citations
Hot standby redundant communication system and method
CN111654359A