Summary of the invention
The present invention seeks to can cause communication disruption in order to solve existing CAN bus gateway when the list node overall failure, the problem that causes admission control or time-delay situation greatly to occur provides a kind of high fault tolerance CAN bus digital gateway based on two DSP.
High fault tolerance CAN bus digital gateway based on two DSP of the present invention, it comprises host node, from node, two-way redundancy CAN network A, two-way redundancy CAN network B, nonredundancy sub-network bus #E1 and nonredundancy sub-network bus #E2,
Two-way redundancy CAN network A comprises network-bus #A1 and network-bus #A2;
Two-way redundancy CAN network B comprises network-bus #B1 and network-bus #B2;
Host node comprises DSP#A1, DSP#A2, CAN bus port #A11, CAN bus port #A12, CAN bus port #A21 and CAN bus port #A22;
Comprise DSP#B1, DSP#B2, CAN bus port #B11, CAN bus port #B12, CAN bus port #B21 and CAN bus port #B22 from node;
Pass through SPI data channel the transmission of data between DSP#A1 and DSP#A2, DSP#A1 is connected with network-bus #A1 by CAN bus port #A11, DSP#A1 is connected with nonredundancy sub-network bus #E1 by CAN bus port #A12, DSP#A2 is connected with network-bus #B2 by CAN bus port #A21, and DSP#A2 is connected with nonredundancy sub-network bus #E2 by CAN bus port #A22;
Pass through SPI data channel the transmission of data between DSP#B1 and DSP#B2, DSP#B1 is connected with network-bus #B1 by CAN bus port #B11, DSP#B1 is connected with nonredundancy sub-network bus #E2 by CAN bus port #B12, DSP#B2 is connected with network-bus #A2 by CAN bus port #B21, and DSP#B2 is connected with nonredundancy sub-network bus #E1 by CAN bus port #B22;
The DSP#A1 of host node and DSP#A2 and between the DSP#B1 of node and DSP#B2 by SPI data channel the transmission of data.
Host node also comprises CAN driver #A11, CAN driver #A12, CAN driver #A21 and CAN driver #A22,
CAN driver #A11 is arranged between DSP#A1 and CAN bus port #A11, CAN driver #A12 is arranged between DSP#A1 and CAN bus port #A12, CAN driver #A21 is arranged between DSP#A2 and CAN bus port #A21, and CAN driver #A22 is arranged between DSP#A2 and CAN bus port #A22;
Also comprise CAN driver #B11, CAN driver #B12, CAN driver #B21 and CAN driver #B22 from node,
CAN driver #B11 is arranged between DSP#B1 and CAN bus port #B11, CAN driver #B12 is arranged between DSP#B1 and CAN bus port #B12, CAN driver #B21 is arranged between DSP#B2 and CAN bus port #B21, and CAN driver #B22 is arranged between DSP#B2 and CAN bus port #B22.
Host node also comprises main storage #A1 and main storage #A2,
Be connected by external expansion interface between main storage #A1 and DSP#A1, be connected by external expansion interface between main storage #A2 and DSP#A2;
Also comprise from memory #B1 with from memory #B2 from node,
Be connected by external expansion interface between memory #B1 and DSP#B1, be connected by external expansion interface between memory #B2 and DSP#B2.
It also comprises liquid crystal display and operator,
Liquid crystal display and operator are connected with DSP#A1, DSP#A2, DSP#B1 and DSP#B2 respectively as man-machine interface.
It also comprises power supply, and power supply is used to DSP#A1, DSP#A2, DSP#B1 and DSP#B2 that working power is provided.
Advantage of the present invention: digital gateway of the present invention has high fault tolerance, it can realize comprising the hot redundancy of total system bimodulus of link port, bus transceiver, bus control unit, gateway CPU and power module etc., under the local or whole condition that breaks down of the list node of intra-gateway, still can guarantee the not interrupt of communicating by letter, and without the self-healing time, be conducive to improve failure tolerant and the reliability of network interconnection comprehensively.
The present invention possesses very strong compatibility and versatility, provide between the CAN backbone network of dual link redundancy, protocol conversion and data cache and forwarding between CAN backbone network and the nonredundant CAN subnet of single-link, can reduce significantly inter-net communication time-delay, be adapted at the actual industrial field and popularize.
The present invention has the network bridging passage of the complete hot redundancy of two-way, in the situation that the single channel fault still can guarantee not interrupt of the two real-time connections of netting, has high reliability.It has adopted inside to be integrated with the dsp chip that enriches control module and high-performance CPU, thereby has strengthened the processing of data and the speed that the transmitting-receiving of CAN bus is controlled, and has greatly reduced the technology time-delay of gateway.The present invention uses the SPI interface and substitutes two-port RAM and realize between two DSP at a high speed exchanges data, simplified wiring, reduces costs and has reduced that in plate, electromagnetic interference on the impact that high-speed data communication brings, has improved the reliability of system.
The present invention has stronger fault diagnosis functions, host node, from node by periodically or the time mutual inspection that triggers property can find in time fault and to the host computer warning, be conducive to reliability service and the repair and replacement of system with self check.Be equipped with liquid crystal display and operator, make gateway use simple to operation, running status can be obtained by user's Real Time Monitoring.Compare with other existing product: there is no on the market similarly can be applied at present the industrial circle technical products very high to reliability requirement.
Embodiment
Embodiment one: present embodiment is described below in conjunction with Fig. 1, the described high fault tolerance CAN bus digital gateway based on two DSP of present embodiment, it comprises host node 1, from node 2, two-way redundancy CAN network A 3, two-way redundancy CAN network B 4, nonredundancy sub-network bus #E15 and nonredundancy sub-network bus #E26
Two-way redundancy CAN network A 3 comprises network-bus #A1 and network-bus #A2;
Two-way redundancy CAN network B 4 comprises network-bus #B1 and network-bus #B2;
Host node 1 comprises DSP#A11-1, DSP#A21-2, CAN bus port #A111-3, CAN bus port #A121-4, CAN bus port #A211-5 and CAN bus port #A221-6;
Comprise DSP#B12-1, DSP#B22-2, CAN bus port #B112-3, CAN bus port #B122-4, CAN bus port #B212-5 and CAN bus port #B222-6 from node 2;
Pass through SPI data channel the transmission of data between DSP#A11-1 and DSP#A21-2, DSP#A11-1 is connected with network-bus #A1 by CAN bus port #A111-3, DSP#A11-1 is connected with nonredundancy sub-network bus #E15 by CAN bus port #A121-4, DSP#A21-2 is connected with network-bus #B2 by CAN bus port #A211-5, and DSP#A21-2 is connected with nonredundancy sub-network bus #E26 by CAN bus port #A221-6;
Pass through SPI data channel the transmission of data between DSP#B12-1 and DSP#B22-2, DSP#B12-1 is connected with network-bus #B1 by CAN bus port #B112-3, DSP#B12-1 is connected with nonredundancy sub-network bus #E26 by CAN bus port #B122-4, DSP#B22-2 is connected with network-bus #A2 by CAN bus port #B212-5, and DSP#B22-2 is connected with nonredundancy sub-network bus #E15 by CAN bus port #B222-6;
The DSP#A11-1 of host node 1 and DSP#A21-2 and between the DSP#B12-1 of node 2 and DSP#B22-2 by SPI data channel the transmission of data.
Shown in Figure 1, the digital gateway internal main will be comprised of identical two separate child nodes, is called the host node 1 of gateway and from node 2.Host node 1 and from node 2 physically fully the isolation, work on power simultaneously, for different tasks, cooperation and the division of labor are arranged respectively, only loose coupling is connected with nonredundancy sub-network bus #E26 by nonredundancy sub-network bus #E15 each other, is the relation of Hot Spare each other on function.
8 independently CAN bus ports are provided in present embodiment, be CAN bus port #A111-3, CAN bus port #A121-4, CAN bus port #A211-5, CAN bus port #A221-6, CAN bus port #B112-3, CAN bus port #B122-4, CAN bus port #B212-5 and CAN bus port #B222-6, can realize between two-way redundancy CAN network A 3 and two-way redundancy CAN network B 4, internet bridge joint between two-way redundancy CAN network A 3 and two-way redundancy CAN network B 4 and nonredundancy sub-network bus #E15 and nonredundancy sub-network bus #E26, in the situation that host node or from part or the global failure of node, still the use of can demoting, guarantee that internetwork the interruption is communicated with.
Embodiment two: present embodiment is described below in conjunction with Fig. 1 and Fig. 2, present embodiment is described further execution mode one, the described host node 1 of present embodiment also comprises CAN driver #A111-7, CAN driver #A121-8, CAN driver #A211-9 and CAN driver #A221-10
CAN driver #A111-7 is arranged between DSP#A11-1 and CAN bus port #A111-3, CAN driver #A121-8 is arranged between DSP#A11-1 and CAN bus port #A121-4, CAN driver #A211-9 is arranged between DSP#A21-2 and CAN bus port #A211-5, and CAN driver #A221-10 is arranged between DSP#A21-2 and CAN bus port #A221-6;
Also comprise CAN driver #B112-7, CAN driver #B122-8, CAN driver #B212-9 and CAN driver #B222-10 from node 2,
CAN driver #B112-7 is arranged between DSP#B12-1 and CAN bus port #B112-3, CAN driver #B122-8 is arranged between DSP#B12-1 and CAN bus port #B122-4, CAN driver #B212-9 is arranged between DSP#B22-2 and CAN bus port #B212-5, and CAN driver #B222-10 is arranged between DSP#B22-2 and CAN bus port #B222-6.
In present embodiment, dsp chip is as gateway child node nucleus module, inside is integrated with CPU and CAN bus control module, its fast operation, reliability are high, transmitting-receiving control, rate-matched, the address of not only being in charge of the CAN bus of data remaps the buffer memory with data, and each other by SPI, CAN#E1 and three kinds of data channel of CAN#E2, remove redundancy, information redundancy, data shaping, scheduling controlling scheduling algorithm based on certain information, according to the actual requirements, realize protocol conversion and data retransmission between heterogeneous networks.
Embodiment three: below in conjunction with Fig. 2, present embodiment is described, present embodiment is described further execution mode two, and the described host node 1 of present embodiment also comprises main storage #A11-11 and main storage #A21-12,
Be connected by external expansion interface between main storage #A11-11 and DSP#A11-1, be connected by external expansion interface between main storage #A21-12 and DSP#A21-2;
Also comprise from memory #B12-11 with from memory #B22-12 from node 2,
Be connected by external expansion interface between memory #B12-11 and DSP#B12-1, be connected by external expansion interface between memory #B22-12 and DSP#B22-2.
By the interconnection of SPI serial ports, not only provide speed up to the 10M/b exchanges data between two DSP, and taken into account anti-interference and the reliability of transmission.The CAN driver can be realized the physical layer function of differential code and binary data conversion.Each DSP respectively is furnished with the buffer memory that a memory SRAM is used for treating forwarding data frame, and DSP is connected by external expansion interface X1NTF with memory SRAM.
Embodiment four: below in conjunction with Fig. 2, present embodiment is described, present embodiment is described further execution mode one, two or three, and present embodiment also comprises liquid crystal display and operator 7,
Liquid crystal display and operator 7 are connected with DSP#A11-1, DSP#A21-2, DSP#B12-1 and DSP#B22-2 respectively as man-machine interface.
Liquid crystal display and operator 7 are used for configuration and the fault alarm of gateway child node as man-machine interface.
Embodiment five: present embodiment is described below in conjunction with Fig. 1 to Fig. 8, present embodiment is described further execution mode one, two, three or four, present embodiment also comprises power supply 8, and power supply 8 is used to DSP#A11-1, DSP#A21-2, DSP#B12-1 and DSP#B22-2 that working power is provided.
Operation principle of the present invention and running:
The bridge joint that two-way redundancy CAN network A 3 and two-way redundancy CAN network B are 4:
Two-way redundancy CAN
network A 3 and two-way redundancy CAN network B 4 are by the mutual bridge joint of CAN gateway, as shown in Figure 3.At this moment, the
host node 1 of gateway and from
node 2 synchronous workings is realized the two-way converting of two net data frames.
With
Two data passages are Hot Spare each other, the break-make of link P, Q and Z is relevant with the health status that CAN#A11 port, CAN#A21 port, CAN transceiver, DSP#A1, the DSP#A2 of gateway host node reach SPI interface between two DSP, and the break-make of link L, M and N is relevant from the health status of SPI interface between CAN#B21 port, CAN#B11 port, CAN transceiver, DSP#A1, DSP#A2 and two DSP of node with gateway.
Because be mutually fully independently from node and host node, so on the host node of hypothesis gateway, certain software occurs or hardware fault causes in Fig. 3
Data channel disconnects, so the data channel of gateway
Still can work, can not cause the interruption of transfer of data between two nets, namely the communication node in two-way redundancy CAN
network A 3 and two-way redundancy CAN network B 4 still can pass through link CAN network-bus #A2
Gateway is from node
CAN network-bus #B1 realizes mutual communication.In like manner, when part or global fault occurring from node, the gateway host node can be completed the interconnection between two nets too.
Bridge joint between nonredundancy sub-network bus #E15 and nonredundancy sub-network bus #E26:
Pass through the mutual bridge joint of CAN gateway between nonredundancy sub-network bus #E15 and nonredundancy sub-network bus #E26, as shown in Figure 4.At this moment, the host node of gateway and working simultaneously from node, monitoring mutually respectively has the task division of labor.The real time bidirectional that host node is responsible for Frame between two nets forwards, wouldn't forward after receiving data frames from node, but the Frame that the monitoring host node forwards in stand-by period window Skew_Max, and by contrasting content and the sequence number of the Frame that self receives and the host node forwarding data frame that monitors, judge whether host node the situations such as frame mistake, LOF, Transmission or large time-delay occur in the process that Frame forwards.If monitor host node, above-mentioned mistake occuring, reissues in real time correct Frame, send the fault inquiry frame and report to the police to host computer to host node from node.At this moment, host node can be manually be set as from node under fault condition, perhaps repeatedly automatically switch to host node from node during double faults when host node, and handoff procedure communication disruption can be do not caused.Take the bridge joint between nonredundancy sub-network bus #E15 and nonredundancy sub-network bus #E26 as example, host node and from the workflow of node respectively as shown in Figure 5 and Figure 6.
As above-mentioned principle, even if host node or occur from the serious situation of node generation local fault or global failure, nonredundancy sub-network bus #E15 still can not interrupt with the intercommunication mutually between nonredundancy sub-network bus #E26, and the stand-by period setting of window Skew_Max is no more than 1ms, in case namely host node breaks down, from the reissuing the technology time-delay that Frame introduces and can not surpass 1ms of node, it is definite that the CAN bus communication of this moment remains Millisecond.The working method of this mode of structural redundancy to greatest extent and Hot Spare has greatly improved the reliability of CAN gateway.
The bridge joint of redundant network and nonredundant network:
The present invention can realize redundancy CAN network and the internetwork bridge joint of nonredundancy CAN.Network-bus #A1 and network-bus #A2 be hot redundancy each other, as shown in Figure 7, passage in figure (one) is realized the data retransmission between network-bus #A1 and nonredundancy sub-network bus #E15, passage (two) is realized the data retransmission between network-bus #A2 and nonredundancy sub-network bus #E15, and two data passages are the relations of Hot Spare each other.In like manner, passage (three) and (four) realize the data retransmission between network-bus #B1 or network-bus #B2 and nonredundancy sub-network bus #E2.
The bridge joint of redundant network and nonredundant network is divided into redundancy process and nonredundancy process, and the below illustrates as an example of the bridge joint between redundant network bus #A1 or network-bus #A2 and nonredundancy sub-network bus #E15 example:
The redundancy process:
Nonredundancy sub-network bus #E15 to network-bus #A1 or network-bus #A2 be the redundancy process, relate to the CAN gateway Frame on nonredundancy sub-network bus #E15 is carried out information redundancy, and be forwarded to simultaneously two of network-bus #A1 and network-bus #A2 each other on the communication link of hot redundancy.In the redundancy process, gateway host node and be reciprocity from node is completed identical Frame repeating process.And, process in order to reduce the gateway data as far as possible the technology time-delay of introducing, do not carry out mutual real-time contrast monitoring in repeating process.It is no matter host node or from node, when receiving the Frame of nonredundancy sub-network bus #E15, as long as verification correctly just forwards immediately.Simultaneously, in order to guarantee the gateway host node and from internodal synchronous, two nodes can carry out periodic synchronous and state by nonredundancy sub-network bus #E15 and examine mutually in the course of the work.
Go the redundancy process: be the redundancy process by network-bus #A1 and network-bus #A2 to nonredundancy sub-network bus #E15, host node 1, from node 2 based on certain Redundant Control algorithm that goes, described control algolithm is relevant with the concrete agreement of CAN network using, here take the ARINC825 agreement as example, Frame on network-bus #A1 and network-bus #A2 is carried out the redundancy of going of information, then be forwarded on nonredundancy sub-network bus #E15.Go in the redundancy process, the host node of gateway is responsible for the forwarding of data, in the situation that working, gateway only forwards to host node the Frame that its CAN bus port #B212-5 receives from node, and completed for two-way by host node and have same sequence number, namely the comparison test of mutually redundant Frame, redundant information remove and to the forwarding of nonredundancy sub-network bus #E15.In going the redundancy process, due to the impact of two-way redundant link transmission delay and fault, the situation that has following three kinds is occured, respectively three kinds of mode of operations of corresponding gateway:
1 hypothesis is owing to the situations such as time-delay occurring from node failure or network-bus #A2, the CAN bus port #A111-3 of host node first receives the Frame that network-bus #A1 mails to nonredundancy sub-network bus #E1, it will in stand-by period window Skew_Max, wait for the backup frame that forwarding comes through nonredundancy sub-network bus #E1 from node so.If host node can be received the backup frame from node in the stand-by period window, and can be by the contrast verification, host node externally forwards this frame, and renewal sequence decision threshold PSN=PSN+1, and can think that the state of gateway and link all is in good range this moment.If received in time window the backup frame sent from node but comparison test do not pass through, think so on link or from intra-node generation disturbance, host node can report an error to host computer, and in request two-way redundancy CAN network A 3, the respective end node resends this frame.And if do not receive backup frame from node in waiting for window, host node will directly forward to nonredundancy sub-network bus #E15 the Frame that receives so, then to sending the status poll frame from node and host computer being carried out fault alarm, inform that the situation of frame losing has appearred in the user.
2 hypothesis are due to situations such as master node port fault or network-bus #A1 appearance time-delays, host node first receives by forwarding by nonredundancy sub-network bus #E15 the backup frame of coming from node, and it will wait for the same serial number data frame that has on network-bus #A1 in the stand-by period window so.Then, if received this Frame in the stand-by period window, and passed through the contrast verification, host node will externally forward this frame so.If do not receive this frame in the stand-by period window, forward to nonredundancy sub-network bus #E15 the backup frame of sending from node, and renewal sequence decision threshold PSN=PSN+1, carry out fault alarm to host computer simultaneously.
3 hypothesis are due to situations such as host node permanent fault or network-bus #A1 disconnections, so from node to host node after the backup frame on success transmission network bus #A2, to can not monitor the Frame that host node externally forwards in the stand-by period window, can directly externally forward this backup frame from node this moment so, and renewal sequence decision threshold PSN=PSN+1, carry out fault alarm to host computer simultaneously.
The present invention can be applied to the air environment networking of small commercial secondary-line-aircraft, completes the bus based on aviation CAN, i.e. the avionics system backbone network of ARINC825 bus and the bridge joint between the subregion sub-network.As shown in Figure 8, CAN#A1/CAN#A2 and CAN#B1/CAN#B2 consist of two two redundant backbones networks of certain small commercial secondary-line-aircraft electronic system, wherein CAN#A1/#A2 is the actor network of air environment, redundancy each other, and CAN#A1/#A2 is sensor network.The passenger cabin control system is as the control terminal of whole avionics system, and its inner airborne computer is in charge of all airborne electronic equipment resources by four independently CAN port and two backbone network interconnection.In the cabin, each avionics subsystem must access backbone network by the network equipment, completes control command transmission and information sharing highly.Digital gateway of the present invention can effectively be supported the ARINC825 agreement, and the interconnected Reliable guarantee that provides of high speed of subsystem network and backbone network is provided.Conversion by digital gateway, avionics system trunk redundant network CAN#A1/CAN#A2 and CAN#B1/CAN#B2 realize interconnected bridge joint with nonredundant network CAN#E1 and the CAN#E2 of subsystem #3 inside respectively, and as long as have one can normally work in two child nodes of intra-gateway, so

With
Data communication just any interruption can not occur.