CN114500157A - Redundancy implementation system based on CAN gateway, electronic device and computer readable storage medium - Google Patents
Redundancy implementation system based on CAN gateway, electronic device and computer readable storage medium Download PDFInfo
- Publication number
- CN114500157A CN114500157A CN202210357154.0A CN202210357154A CN114500157A CN 114500157 A CN114500157 A CN 114500157A CN 202210357154 A CN202210357154 A CN 202210357154A CN 114500157 A CN114500157 A CN 114500157A
- Authority
- CN
- China
- Prior art keywords
- channel
- gateway
- processing unit
- central processing
- nodes
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L12/40169—Flexible bus arrangements
- H04L12/40176—Flexible bus arrangements involving redundancy
- H04L12/40182—Flexible bus arrangements involving redundancy by using a plurality of communication lines
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/22—Arrangements for detecting or preventing errors in the information received using redundant apparatus to increase reliability
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L12/40169—Flexible bus arrangements
- H04L12/40176—Flexible bus arrangements involving redundancy
- H04L12/40195—Flexible bus arrangements involving redundancy by using a plurality of nodes
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/0654—Management of faults, events, alarms or notifications using network fault recovery
- H04L41/0663—Performing the actions predefined by failover planning, e.g. switching to standby network elements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L2012/40208—Bus networks characterized by the use of a particular bus standard
- H04L2012/40215—Controller Area Network CAN
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention provides a redundancy implementation system based on a CAN gateway, electronic equipment and a computer readable storage medium. According to the technical scheme, the overall operation reliability of the controller local area network is guaranteed by using dual redundancy setting of gateway redundancy and channel redundancy, meanwhile, when using logic setting of channel redundancy, switching between a main channel and a standby channel can be achieved, the dual channels are allowed to be used for data communication under the condition that receiving fault nodes exist in the dual channels, and mixed mounting of redundant nodes and non-redundant nodes is achieved. The technical scheme provided by the application CAN be realized in various bus topological structures such as a CAN bus, an RS485 bus and the like, a processor is not needed for judging and processing the node state of a large amount of gateway forwarding data, the occupied resources are less, the modifiability and the flexibility are strong, and the popularization value is realized.
Description
Technical Field
The invention relates to the technical field of data communication and industrial automation, and particularly discloses a redundancy implementation system based on a CAN gateway, electronic equipment and a computer readable storage medium.
Background
With the continuous development of scientific technology, the technical level in the field of industrial automation is also continuously improved, and the method is widely applied to various fields such as industrial manufacturing, daily chemicals, aerospace and navigation. The CAN bus is used as a field bus in the application fields with higher requirements on communication reliability and usability, such as the fields of vehicle automation and ship automation, the anti-interference capability of the CAN bus is widely used and verified, and the CAN bus has popularization value. However, in special scenes such as ship navigation, the CAN bus is easily damaged due to the fact that the working environment is severe and the installation density of a unit area is high, if the CAN bus is established on a single channel, the reliability of the CAN bus is relatively weak, when the CAN bus breaks down, the whole control system is easily failed, and corresponding potential safety hazards exist.
Disclosure of Invention
In order to solve the above problems in the prior art, the present invention provides a redundancy implementation system, an electronic device, and a computer-readable storage medium based on a CAN gateway.
In a first aspect of the present application, a redundancy implementation system based on a CAN gateway is provided, where the redundancy implementation system is applied in a controller area network including a plurality of nodes, and specifically includes:
a central processing unit;
the first CAN gateway is in communication connection with all the nodes through a first channel, reads node states corresponding to all the nodes through the first channel and uploads the node states to the central processing unit;
the second CAN gateway is in communication connection with all the nodes through a second channel, reads the node state through the second channel and uploads the node state to the central processing unit;
the first channel and the second channel are redundant with each other;
when the central processing unit sends a unicast message to any node, the unicast message is sent through the first CAN gateway under the condition that the handshake authentication between the central processing unit and the first CAN gateway is normal; under the condition that the central processing unit is abnormal in handshake authentication with the first CAN gateway and normal in handshake authentication with the second CAN gateway, a unicast message is sent through the second CAN gateway;
when the central processing unit sends broadcast messages to all nodes, the central processing unit judges the normality of the access of the first channel and the second channel according to the node state;
under the condition that the first channel is in a normal access state, the first channel is used for sending broadcast messages;
under the condition that the first channel is in the abnormal state of the access and the second channel is in the normal state of the access, the second channel is used for sending the broadcast message;
and under the condition that the first channel and the second channel are both in the state of abnormal access, simultaneously using the first channel and the second channel to transmit the broadcast message.
In a possible implementation of the first aspect, the central processing unit determines that a node has a reception fault and reports the reception fault when the first CAN gateway handshake condition is abnormal and the second CAN gateway handshake condition is abnormal.
In a possible implementation of the first aspect, the central processing unit preferentially selects to send the unicast message to the node through the first CAN gateway when the first CAN gateway is in a normal handshake condition and the second CAN gateway is in a normal handshake condition.
In a possible implementation of the first aspect, the central processing unit preferentially selects the first channel to be used for sending the broadcast message when both the first channel and the second channel are in the normal state of the channel.
In a possible implementation of the first aspect, the central processing unit further includes a switching subunit, and the switching subunit selects one of the first channel and the second channel as a transmission main channel:
in the initial state, the first channel is set as a transmission main channel.
In a possible implementation of the first aspect, when the central processing unit sends a unicast packet to any one of the nodes, the switching subunit preferentially selects the transmission main channel to perform transmission handshake verification of the unicast packet:
under the condition that the transmission main channel passes the transmission handshake verification, the central processing unit sends a unicast message through the transmission main channel;
under the condition that the transmission main channel fails to pass the transmission handshake verification, the switching subunit selects another channel to perform the transmission handshake verification;
and under the condition that the other channel passes the transmission handshake verification, the switching subunit switches the other channel into an updated transmission main channel, and the central processing unit transmits the unicast message through the transmission main channel.
In a possible implementation of the first aspect, when the central processing unit sends the broadcast packet to all nodes, the switching subunit preferentially selects the transmission main channel to determine whether all the nodes on the transmission main channel are in the normal online state:
under the condition that all nodes on the transmission main channel are in a normal online state, the central processing unit transmits a broadcast message through the transmission main channel;
under the condition that the nodes on the transmission main channel are not all in the normal online state, the switching subunit selects another channel to carry out node online state verification;
under the condition that the nodes on the other channel are in a normal on-line state, the switching subunit switches the other channel into an updated transmission main channel, and the central processing unit transmits the broadcast message through the transmission main channel;
and under the condition that the nodes on the other channel are not in the normal on-line state, the central processing unit simultaneously transmits the broadcast message through the first channel and the second channel.
In a possible implementation of the first aspect, the node regularly feeds back a self state to the central processing unit through the first CAN gateway and the second CAN gateway according to a preset period; and
and under the condition that the node receives the unicast message and/or the broadcast message, the node feeds back response information to the central processing unit through the first CAN gateway and the second CAN gateway.
A second aspect of the present application provides an electronic device comprising:
a memory for storing a computer program;
and the processor is used for realizing the CAN gateway-based redundancy implementation system provided by the first aspect when executing the computer program.
A third aspect of the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the CAN gateway-based redundancy implementation system provided by the aforementioned first aspect.
Compared with the prior art, the method has the following beneficial effects:
according to the technical scheme, the overall operation reliability of the controller local area network is guaranteed by using dual redundancy setting of gateway redundancy and channel redundancy, meanwhile, when using logic setting of channel redundancy, switching between a main channel and a standby channel can be achieved, the dual channels are allowed to be used for data communication under the condition that receiving fault nodes exist in the dual channels, and mixed mounting of redundant nodes and non-redundant nodes is achieved. The technical scheme provided by the application CAN be realized in various bus topological structures such as a CAN bus, an RS485 bus and the like, a processor is not needed for judging and processing the node state of a large amount of gateway forwarding data, the occupied resources are less, the modifiability and the flexibility are strong, and the popularization value is realized.
Drawings
Other features, objects and advantages of the invention will become more apparent upon reading of the detailed description of non-limiting embodiments with reference to the following drawings:
fig. 1 is a schematic structural diagram illustrating a redundancy implementation system based on a CAN gateway according to an embodiment of the present application;
fig. 2 is a schematic diagram illustrating a flow of implementing redundancy of a unicast packet according to an embodiment of the present application;
fig. 3 shows a schematic diagram of a redundancy implementation flow of a broadcast packet according to an embodiment of the present application.
Detailed Description
The present invention will be described in detail with reference to specific examples. The following examples will assist those skilled in the art in further understanding the invention, but are not intended to limit the invention in any way. It should be noted that it would be obvious to those skilled in the art that various changes and modifications can be made without departing from the spirit of the invention. All falling within the scope of the present invention.
The term "include" and variations thereof as used herein is meant to be inclusive in an open-ended manner, i.e., "including but not limited to". Unless specifically stated otherwise, the term "or" means "and/or". The term "based on" means "based at least regionally. The terms "one example embodiment" and "one embodiment" mean "at least one example embodiment". The term "another embodiment" means "at least one additional embodiment". The terms "first," "second," and the like may refer to different or the same object. Other explicit and implicit definitions are also possible below.
In some embodiments of the present application, a main/standby redundancy mechanism applied to a CAN bus system is provided to solve the problem of poor stability of a CAN bus system for establishing a pre-single channel in the prior art. In the main/standby redundancy mechanism, two bus channels are usually accessed to the system by two CAN bus ports, and in a normal state, one of the channels is selected by the controller as a working bus, while the other bus does not transmit data or only transmits state information, which is called as a backup bus. When the working bus has communication failure, the nodes on the bus can start the switching of the main bus and the standby bus, thereby realizing the redundancy setting of the whole system of the controller local area network and ensuring that when one channel has failure, the other channel can be adopted to realize the maintenance of communication.
However, this kind of active/standby redundancy mechanism also creates new problems in the practical application process: for the main/standby redundancy mechanism, if more than two nodes have faults, and part of the nodes belong to the faults on the working bus, and the fault on the backup bus of the part of the nodes, the integrity of the system is fatal to be damaged, so that the system cannot normally operate. Meanwhile, under the master-slave switching mechanism, the backup bus does not transmit data, and if the non-redundant on-line node is mounted on the backup bus, the data transmission cannot be realized, that is, the mixed mounting of the redundant node and the non-redundant node is not supported. Therefore, the improvement of dual redundancy availability of the system realized by adopting the main and standby redundancy mechanism is limited, the system operation is still possibly influenced when a fault occurs, and the improvement of stability and reliability is less.
In addition, in some practical applications of the present application, in the context of the above-mentioned primary/secondary redundancy mechanism, if the primary/secondary switching mode is adopted according to the DS307 protocol under the CANopen protocol, when the primary line fails, a node receiving an error initiates a primary/secondary switching frame, which requires the primary channel to be changed into a secondary channel, and promotes the secondary channel to be upgraded into the primary channel. When the multiple nodes respectively detect the receiving faults, the bus is frequently switched between the main bus and the standby bus with high probability, and finally normal communication cannot be performed. This problem also has a serious negative impact on the stability and reliability of the primary-backup redundancy mechanism.
In view of the above reliability deficiency problem in the foregoing active/standby redundancy mechanism, the present application provides a redundancy implementation system, an electronic device, and a computer-readable storage medium based on a CAN gateway. Through the technical scheme provided by the application, the defects in the main/standby redundancy mechanism can be overcome, and the reliability of the system is further improved. The technical solutions provided in the present application will be illustrated and described below with reference to examples.
Specifically, in some embodiments of the present application, fig. 1 illustrates a schematic structural diagram of a redundancy implementation system based on a CAN gateway. It can be understood that, the redundancy implementation system is applied to a controller area network including a plurality of nodes, as shown in fig. 1, the redundancy implementation system specifically includes:
the central processing unit 100, wherein the specific implementation functions of the central processing unit 100 will be specifically illustrated and described later.
The first CAN gateway 200, as shown in fig. 1, the first CAN gateway 200 is communicatively connected to the nodes 1 to n through the first channel 400. The first CAN gateway 200 is also communicatively connected to the central processing unit 100. It is understood that in the case that any one or more of the nodes 1 to n performs message transmission through the first channel 400, the first CAN gateway 200 may obtain the node statuses associated with the first channel 400 from the message transmission and upload the node statuses to the central processing unit 100 for aggregation and subsequent determination.
The second CAN gateway 300, as shown in fig. 1, the second CAN gateway 300 is in communication connection with the nodes 1 to n through a second channel 500. Likewise, the second CAN gateway is also communicatively connected to the central processing unit 100, and in the case where any one or more of the nodes 1 to n performs message transmission via the second channel 500, the second CAN gateway 300 CAN acquire the node statuses associated with the second channel 500 therefrom and upload the node statuses to the central processing unit 100.
In the above embodiment, as shown in fig. 1, it can be understood that the first channel 400 and the second channel 500 are redundant with each other. Through the arrangement of the first channel 400 and the second channel 500, the redundant implementation of the controller area network including the nodes 1 to the node n CAN be realized, and no matter the first channel 400 or the second channel 500, when any node on the channel has an unacceptable fault, the reliability of the whole CAN bus topology structure CAN be increased through a channel switching mode. The implementation of the redundancy function in combination with a specific application scenario will be further specifically described below with respect to the redundancy implementation system provided in the foregoing embodiment.
In some practical applications of the foregoing embodiments, when the central processing unit 100 needs to send a unicast message to any one node, a suitable CAN gateway may be selected according to the message handshaking conditions between the central processing unit 100 and the first and second CAN gateways 200 and 300 to send the unicast message. Wherein: under the condition that the handshake authentication between the central processing unit 100 and the first CAN gateway 200 is normal, the central processing unit 100 CAN send a unicast message to a corresponding node through the first CAN gateway 200; and under the condition that the handshake authentication between the central processing unit 100 and the first CAN gateway 200 is abnormal and the handshake authentication between the central processing unit 100 and the second CAN gateway 300 is normal, the central processing unit 100 CAN send the unicast message to the corresponding node through the second CAN gateway 300.
Further, it CAN be understood that, in the process of sending the unicast message, if the central processing unit 100 is not normal in handshake with the first CAN gateway 200 and not normal in handshake with the second CAN gateway 300, it indicates that the node cannot normally receive information in both channels, and at this time, it may be determined that a reception fault occurs in the node, and report the reception fault, and wait for further processing.
In other practical applications of the above embodiments, when the central processing unit 100 needs to send broadcast messages to all nodes, all nodes may send their corresponding status messages to the first CAN gateway 200 and the second CAN gateway 300 through the first channel 400 and the second channel 500, respectively, the first CAN gateway 200 uploads the status messages transmitted through the first channel 400 to the central processing unit 100, and the second CAN gateway 300 uploads the status messages transmitted through the second channel 500 to the central processing unit 100.
Further, in practical applications of the foregoing embodiment, the central processing unit 100 may obtain corresponding node states according to the state message, and determine the normality of the paths of the first channel 400 and the second channel 500 according to the node states, where a normal path state refers to that all nodes on the channel are in a normal communication state, and if any node on the channel is in an offline communication state or in another abnormal communication state, the channel is determined as an abnormal path state: in the case that the first channel 400 is in the normal state of the path, the central processing unit 100 may use the first channel 400 to transmit the broadcast message; in the case that the first channel 400 is in the abnormal state and the second channel 500 is in the normal state, the central processing unit 100 may use the second channel 500 to transmit the broadcast message; in the case that both the first channel 400 and the second channel 500 are in the off-channel state, the central processing unit 100 may simultaneously use the first channel 400 and the second channel 500 to transmit the broadcast message.
It can be understood that, through the descriptions of the two embodiments in practical applications, the implementation strategies of the redundancy implementation system in two action states, namely, the unicast message and the broadcast message, are explained respectively: for the scene of the unicast message, the gateway for sending the unicast message may be selected through the message interactive handshake between the central processing unit 100 and the CAN gateway, where the specific implementation manner of the message interactive handshake may refer to the existing message transmission handshake protocol, and is not limited herein, and then the sending of the unicast message is implemented by selecting the CAN gateway with a normal handshake condition. And aiming at the scene of the broadcast message, the channel with a normal channel can be selected to transmit the broadcast message through the state information of the node. Particularly, when both channels have receiving faults at nodes, the two channels can be used for sending broadcast messages simultaneously, so that the broadcast messages of non-fault nodes are sent to the maximum extent.
Compared with the main/standby redundancy mechanism provided by the foregoing embodiment, in the redundancy implementation system provided by the foregoing embodiment, the setting of the first channel 400 and the second channel 500 is no longer similar to the setting mode of the working bus and the backup bus, and a dual-channel broadcast packet sending mode is added while the main/standby switching requirement is met, so that the hybrid mounting of redundant nodes and non-redundant nodes is realized, the defects of system message interval jitter, main/standby switching disturbance and the like caused by the main/standby redundancy mechanism are effectively avoided, and the stability and reliability of the redundancy system are further improved. Meanwhile, through the redundancy implementation system provided by the application, the transmitted information format is not required to be changed, the redundancy implementation system can be directly used as a bottom layer redundancy implementation protocol of various application layer protocols represented by CANopen and DeviceNet protocols, modification is not required, the problem of transmitting a common application layer protocol on a redundancy channel is solved, the application layer protocol can be used without modification, the problem that only a user-defined protocol can be operated is avoided, and the application range of the redundancy implementation system is expanded. In the above embodiment, the redundancy function is not implemented at the bottom layer, but the logic is written at the application layer, so that the modifiability, maintainability and flexibility of the redundancy function are effectively improved, the resource occupation of the central processing unit 100 is reduced, the reliability and applicability of the controller area network are greatly improved as a whole, the redundancy function CAN be implemented in bus topology structures such as a CAN bus and an RS485, and the redundancy function has promotional value.
It is to be understood that, in the foregoing embodiment, a specific redundancy implementation process in the unicast message and broadcast message sending process is not explained, and the specific implementation process will be further described with reference to the drawings.
In some embodiments of the present application, the central processing unit 100 may further include a switching subunit, where the switching subunit may select one channel from the first channel 400 and the second channel 500 as a main transmission channel, and update the main transmission channel when the main/standby switching is required. For convenience of description, in the following embodiments, the first channel 400 may be set as the transmission primary channel in the initial state.
In some embodiments of the present application, fig. 2 shows a schematic flowchart of implementing redundancy of a unicast packet, which specifically includes the following steps:
step 201: the central processing unit sends a unicast message to any one node.
Step 202: the switching subunit preferentially selects the transmission main channel to perform transmission handshake verification of the unicast message: in case the transmission primary channel is verified by the transmission handshake, go to step 205; in case the transmission primary channel fails the transmission handshake authentication, the flow goes to step 203.
Step 203: the switching subunit selects another channel for transmission handshake verification: in the case where the other channel is verified by the transmission handshake, go to step 204; in the event that the other channel fails the transmission handshake authentication, flow proceeds to step 206.
Step 204: the switching subunit switches the other channel to the updated transmission main channel, and then goes to step 205.
Step 205: the central processing unit transmits the unicast message through the transmission main channel.
Step 206: and judging the node as a fault receiving node and reporting the fault receiving node.
It CAN be understood that, through the foregoing steps 201 to 206, based on the sequential determination of the first CAN gateway and the second CAN gateway, the redundancy guarantee for the unicast packet CAN be implemented.
In some embodiments of the present application, fig. 3 shows a schematic diagram of a redundant implementation flow of a broadcast packet, which may specifically include the following steps:
step 301: the central processing unit sends broadcast messages to all nodes.
Step 302: the switching subunit preferentially selects the transmission main channel to judge whether the nodes on the transmission main channel are all in a normal online state: if yes, go to step 303; otherwise, go to step 304.
Step 303: and under the condition that all the nodes on the transmission main channel are in a normal online state, the central processing unit transmits the broadcast message through the transmission main channel.
Step 304: under the condition that the nodes on the transmission main channel are not all in the normal online state, the switching subunit selects another channel to carry out node online state verification so as to judge whether the nodes on the other channel are all in the normal online state: if yes, go to step 305; otherwise, go to step 306.
Step 305: under the condition that the nodes on the other channel are in a normal online state, the switching subunit switches the other channel into an updated transmission main channel, and the central processing unit transmits the broadcast message through the transmission main channel.
Step 306: and under the condition that the nodes on the other channel are not in the normal on-line state, the central processing unit simultaneously transmits the broadcast message through the first channel and the second channel.
It can be understood that, through the above steps 301 to 306, based on the sequential judgment of the first channel and the second channel, the redundancy guarantee for the broadcast packet can be implemented.
In some embodiments of the present application, there is further provided an electronic device, which may specifically include: a memory for storing a computer program; and the processor is used for realizing the redundancy realization system based on the CAN gateway provided by the technical scheme of the application when executing the computer program.
It should be understood that aspects of the present technology may be implemented as a system, method or program product. Accordingly, aspects of the present technology may be embodied in the form of an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" platform.
In some embodiments of the present application, a computer-readable storage medium is further provided, on which a computer program is stored, and the computer program CAN implement the redundancy implementation system based on the CAN gateway provided in the above embodiments when being executed by a processor.
Although this embodiment does not exhaustively list other specific embodiments, in some possible embodiments, the aspects described in the present technical solution can also be implemented in the form of a program product, which includes program code for causing a terminal device to execute the steps according to the embodiments described in the various embodiments of the present technical solution in the area of the image stitching method in the present technical solution when the program product runs on the terminal device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable storage medium may include a data signal propagating in baseband or as a region of a carrier wave, carrying readable program code therein. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable storage medium may be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the C language or similar programming languages. The program code may execute entirely on the user's computing device, regionally on the user's device, as a stand-alone software package, regionally on a remote computing device on the user's computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
In summary, according to the technical scheme provided by the application, the overall operation reliability of the controller area network is ensured by using dual redundancy settings of gateway redundancy and channel redundancy, and meanwhile, when the channel redundancy is used for logical setting, not only can switching between the main channel and the standby channel be realized, but also the dual channels are allowed to be used for data communication under the condition that both the dual channels have the receiving failure node, so that mixed mounting of the redundant node and the non-redundant node is realized. The technical scheme provided by the application CAN be realized in various bus topological structures such as a CAN bus, an RS485 bus and the like, a processor is not needed for judging and processing the node state of a large amount of gateway forwarding data, the occupied resources are less, the modifiability and the flexibility are strong, and the popularization value is realized.
The above description is only for the purpose of describing the preferred embodiments of the present invention, and is not intended to limit the scope of the present invention, and any variations and modifications made by those skilled in the art based on the above disclosure are within the scope of the appended claims.
Claims (10)
1. A redundancy implementation system based on a CAN gateway is applied to a controller area network comprising a plurality of nodes, and comprises:
a central processing unit;
the first CAN gateway is in communication connection with all the nodes through a first channel, reads node states corresponding to the nodes and uploads the node states to the central processing unit;
the second CAN gateway is in communication connection with all the nodes through a second channel, reads the node states and uploads the node states to the central processing unit;
the first channel and the second channel are redundant to each other;
when the central processing unit sends a unicast message to any one node, the unicast message is sent through the first CAN gateway under the condition that the handshake verification between the central processing unit and the first CAN gateway is normal; under the condition that the central processing unit is not normally authenticated by handshaking with the first CAN gateway and is normally authenticated by handshaking with the second CAN gateway, the unicast message is sent through the second CAN gateway;
when the central processing unit sends broadcast messages to all the nodes, the central processing unit judges the normality of the access of the first channel and the second channel according to the state of the nodes;
under the condition that the first channel is in a normal state of a passage, the first channel is used for sending the broadcast message;
under the condition that the first channel is in an abnormal state and the second channel is in a normal state, the second channel is used for sending the broadcast message;
and under the condition that the first channel and the second channel are both in the abnormal state of the access, simultaneously using the first channel and the second channel to transmit the broadcast message.
2. The CAN gateway-based redundancy implementation system of claim 1, wherein the central processing unit determines that the node has a reception fault and reports the reception fault if the first CAN gateway handshake condition is abnormal and the second CAN gateway handshake condition is abnormal.
3. The CAN gateway-based redundancy implementation system of claim 1, wherein the central processing unit preferentially selects to send the unicast packet to the node through the first CAN gateway if the first CAN gateway handshake condition is normal and the second CAN gateway handshake condition is normal.
4. The CAN gateway-based redundancy implementation system of claim 1, wherein the central processing unit preferentially selects the first channel for the transmission of the broadcast message when the first channel and the second channel are both in a normal access state.
5. The CAN gateway based redundancy implementation system of claim 1, wherein the central processing unit further comprises a switching subunit that selects one of the first channel and the second channel as a transmission primary channel:
and in an initial state, setting the first channel as the transmission main channel.
6. The CAN gateway-based redundancy implementation system of claim 5, wherein when the central processing unit sends a unicast packet to any one of the nodes, the switching sub-unit preferentially selects the transmission main channel for transmission handshake verification of the unicast packet:
under the condition that the transmission main channel passes the transmission handshake verification, the central processing unit sends the unicast message through the transmission main channel;
in the case that the transmission main channel fails the transmission handshake verification, the switching subunit selects another channel for the transmission handshake verification;
and under the condition that the other channel passes the transmission handshake verification, the switching subunit switches the other channel into the updated transmission main channel, and the central processing unit sends the unicast message through the transmission main channel.
7. The CAN gateway-based redundancy implementation system of claim 5, wherein when the central processing unit sends broadcast packets to all the nodes, the switching sub-unit preferentially selects the transmission main channel to determine whether the nodes on the transmission main channel are all in a normal online state:
under the condition that the nodes on the transmission main channel are all in a normal online state, the central processing unit sends the broadcast message through the transmission main channel;
under the condition that the nodes on the transmission main channel are not all in a normal online state, the switching subunit selects another channel to carry out node online state verification;
under the condition that the nodes on the other channel are all in a normal online state, the switching subunit switches the other channel into the updated transmission main channel, and the central processing unit sends the broadcast message through the transmission main channel;
and under the condition that the nodes on the other channel are not in a normal online state, the central processing unit simultaneously transmits the broadcast message through the first channel and the second channel.
8. The CAN-gateway-based redundancy implementation system of claim 1, wherein the node regularly feeds back its own state to the central processing unit through the first and second CAN gateways according to a preset period; and
and the node feeds back response information to the central processing unit through the first CAN gateway and the second CAN gateway under the condition of receiving the unicast message and/or the broadcast message.
9. An electronic device, comprising:
a memory for storing a computer program;
a processor for implementing the CAN gateway based redundancy implementation system of any of claims 1 to 8 when executing the computer program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program which, when being executed by a processor, implements the CAN gateway based redundancy implementation system according to any one of claims 1 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210357154.0A CN114500157B (en) | 2022-04-07 | 2022-04-07 | Redundancy implementation system based on CAN gateway, electronic device and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210357154.0A CN114500157B (en) | 2022-04-07 | 2022-04-07 | Redundancy implementation system based on CAN gateway, electronic device and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114500157A true CN114500157A (en) | 2022-05-13 |
CN114500157B CN114500157B (en) | 2022-07-29 |
Family
ID=81488757
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210357154.0A Active CN114500157B (en) | 2022-04-07 | 2022-04-07 | Redundancy implementation system based on CAN gateway, electronic device and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114500157B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103490959A (en) * | 2013-10-10 | 2014-01-01 | 北京航天发射技术研究所 | Dual-redundancy CAN bus fault detection method |
WO2016080682A1 (en) * | 2014-11-19 | 2016-05-26 | 경북대학교 산학협력단 | Dual can communication device and method capable of resolving unspecified network errors, and recording medium for performing method |
US20160381679A1 (en) * | 2015-06-24 | 2016-12-29 | Hyundai Motor Company | Gateway device, vehicle including the same, and control method for the same |
CN109495292A (en) * | 2018-10-11 | 2019-03-19 | 中国人民解放军海军陆战队训练基地 | A kind of hot standby device of dual redundant |
CN109639546A (en) * | 2018-12-28 | 2019-04-16 | 浙江中控研究院有限公司 | A kind of CAN bus based redundant system |
CN210225442U (en) * | 2019-05-16 | 2020-03-31 | 江苏和正特种装备有限公司 | double-CAN redundancy system based on full backup |
-
2022
- 2022-04-07 CN CN202210357154.0A patent/CN114500157B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103490959A (en) * | 2013-10-10 | 2014-01-01 | 北京航天发射技术研究所 | Dual-redundancy CAN bus fault detection method |
WO2016080682A1 (en) * | 2014-11-19 | 2016-05-26 | 경북대학교 산학협력단 | Dual can communication device and method capable of resolving unspecified network errors, and recording medium for performing method |
US20160381679A1 (en) * | 2015-06-24 | 2016-12-29 | Hyundai Motor Company | Gateway device, vehicle including the same, and control method for the same |
CN109495292A (en) * | 2018-10-11 | 2019-03-19 | 中国人民解放军海军陆战队训练基地 | A kind of hot standby device of dual redundant |
CN109639546A (en) * | 2018-12-28 | 2019-04-16 | 浙江中控研究院有限公司 | A kind of CAN bus based redundant system |
CN210225442U (en) * | 2019-05-16 | 2020-03-31 | 江苏和正特种装备有限公司 | double-CAN redundancy system based on full backup |
Non-Patent Citations (1)
Title |
---|
王爽: "《基于CAN总线与以太网的地铁车辆运行监控系统研究》", 《铁道机车车辆》 * |
Also Published As
Publication number | Publication date |
---|---|
CN114500157B (en) | 2022-07-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8886831B2 (en) | System and methodology for fast link failover based on remote upstream failures | |
FI115271B (en) | Procedure and system for implementing a rapid rescue process in a local area network | |
US20090201831A1 (en) | Vpls n-pe redundancy using pseudo wire fast failover | |
US9385944B2 (en) | Communication system, path switching method and communication device | |
EP3029883B1 (en) | Network protection method and apparatus, next-ring node, and system | |
CN107948063B (en) | Method for establishing aggregation link and access equipment | |
CN112787960B (en) | Stack splitting processing method, device and equipment and storage medium | |
CN111585797A (en) | Ethernet link switching method, device, equipment and computer readable storage medium | |
CN112217718A (en) | Service processing method, device, equipment and storage medium | |
CN114500157B (en) | Redundancy implementation system based on CAN gateway, electronic device and computer readable storage medium | |
JP4340731B2 (en) | Network fault monitoring processing system and method | |
CN114422100B (en) | Up-and-down connection processing system, computer equipment and medium of national standard signaling service terminal | |
CN113194498B (en) | Communication detection method and device | |
CN112954722B (en) | System and method for quickly switching 5G UPF (unified power flow) main link and standby link | |
CN114727324A (en) | Network disaster tolerance processing method and device, storage medium and electronic equipment | |
CN116074187A (en) | Main-standby link switching method and device, electronic equipment and storage medium | |
CN112564931B (en) | Fault processing method, device and storage medium | |
CN112995026A (en) | Link protection method, device, entry node and storage medium | |
KR101740799B1 (en) | Method of failover for network service in software defined networking environment | |
CN105323088A (en) | Springboard processing method and springboard processing device | |
CN110955210B (en) | AGV scheduling method, device and system | |
US11212217B2 (en) | Spanning tree enabled link aggregation system | |
CN113839858A (en) | Communication method and communication device | |
CN115643202A (en) | Link selection control protocol switching method, device, equipment and medium | |
CN117082653A (en) | Network communication optimization method and system based on retransmission mechanism |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |