CN114500157B - 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 PDF

Info

Publication number
CN114500157B
CN114500157B CN202210357154.0A CN202210357154A CN114500157B CN 114500157 B CN114500157 B CN 114500157B CN 202210357154 A CN202210357154 A CN 202210357154A CN 114500157 B CN114500157 B CN 114500157B
Authority
CN
China
Prior art keywords
channel
gateway
processing unit
central processing
condition
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.)
Active
Application number
CN202210357154.0A
Other languages
Chinese (zh)
Other versions
CN114500157A (en
Inventor
钱豫平
许欣炎
孙昊
梅帆
严成玲
李俭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZHEJIANG SUPCON RESEARCH CO LTD
Original Assignee
ZHEJIANG SUPCON RESEARCH CO LTD
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ZHEJIANG SUPCON RESEARCH CO LTD filed Critical ZHEJIANG SUPCON RESEARCH CO LTD
Priority to CN202210357154.0A priority Critical patent/CN114500157B/en
Publication of CN114500157A publication Critical patent/CN114500157A/en
Application granted granted Critical
Publication of CN114500157B publication Critical patent/CN114500157B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/40169Flexible bus arrangements
    • H04L12/40176Flexible bus arrangements involving redundancy
    • H04L12/40182Flexible bus arrangements involving redundancy by using a plurality of communication lines
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/22Arrangements for detecting or preventing errors in the information received using redundant apparatus to increase reliability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/40169Flexible bus arrangements
    • H04L12/40176Flexible bus arrangements involving redundancy
    • H04L12/40195Flexible bus arrangements involving redundancy by using a plurality of nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0663Performing the actions predefined by failover planning, e.g. switching to standby network elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40215Controller Area Network CAN

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

Redundancy implementation system based on CAN gateway, electronic device and computer readable storage medium
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 abnormal state, 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 handshake condition is normal and the second CAN gateway handshake condition is normal.
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 through 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 carry out 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 redundant 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 aid those skilled in the art in further understanding the present invention, but are not intended to limit the invention in any manner. 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 master-slave redundancy mechanism, two bus channels are usually accessed to the system through two CAN bus ports, and in a normal state, the controller selects one of the channels as a working bus, while the other bus does not transmit data or only transmits status 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, part of the nodes belong to the faults on the working bus, and the other part of the nodes have faults on the backup bus, the integrity of the system is fatally damaged, so that the system cannot normally operate. Meanwhile, under the master-slave switching mechanism, the backup bus does not transmit data, and if a 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 and 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 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 and the first CAN gateway 200 are not normally holding and the second CAN gateway 300 is not normally holding, 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 where 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 description of the two embodiments in practical application, the implementation strategies of the redundancy implementation system in two action states of a unicast message and a broadcast message are explained respectively: for a unicast message scenario, a gateway for sending a unicast message may be selected through a message interaction handshake between the central processing unit 100 and the CAN gateway, where a specific implementation manner of the message interaction handshake may refer to an existing message transmission handshake protocol, which is not limited herein, and then sending of a unicast message is implemented by selecting a CAN gateway with a normal handshake condition. And aiming at the scene of the broadcast message, a 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 the nodes, the two channels can be used for sending the broadcast messages at the same time, so that the broadcast messages of the nodes without faults 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 also 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, locally on the user's device, as a stand-alone software package, locally on the user's computing device, locally on a remote computing device, or entirely on the remote computing device or server. In situations involving remote computing devices, the remote computing devices 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 external computing devices (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 characterized by being applied to a controller area network comprising a plurality of nodes, and comprising:
a central processing unit;
the first CAN gateway is in communication connection with the node through a first channel, and reads the corresponding node state and uploads the node state to the central processing unit under the condition that the node sends a message through the first channel;
the second CAN gateway is in communication connection with the node through a second channel, and reads the corresponding node state and uploads the node state to the central processing unit under the condition that the node sends a message through the second channel;
the first channel and the second channel are redundant to each other;
when the central processing unit sends a unicast message to any one of the nodes, according to the message handshaking conditions between the central processing unit and the first and second CAN gateways:
Under the condition that the first CAN gateway handshake condition is normal, the central processing unit sends the unicast message to the node through the first CAN gateway;
under the condition that the first CAN gateway handshake condition is abnormal and the second CAN gateway handshake condition is normal, the central processing unit sends the unicast message to the node through the second CAN gateway;
when the central processing unit sends broadcast messages to all the nodes, all the nodes send state messages corresponding to the nodes to the first CAN gateway and the second CAN gateway through the first channel and the second channel respectively, the first CAN gateway uploads the state messages transmitted through the first channel to the central processing unit, and the second CAN gateway uploads the state messages transmitted through the second channel to the central processing unit;
the central processing unit judges the normality of the access of the first channel and the second channel according to the state message, wherein:
under the condition that the first channel is in a normal state of a path, the central processing unit uses the first channel to send the broadcast message, wherein the normal state of the path is that all nodes on the channel are in a normal communication state;
Under the condition that the first channel is in a channel abnormal state and the second channel is in a channel normal state, the central processing unit uses the second channel to send the broadcast message, wherein the channel abnormal state is that any node on the channel is in a communication offline state or other states which can not normally communicate;
and under the condition that the first channel and the second channel are both in an abnormal access state, the central processing unit simultaneously uses 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 a broadcast packet to all the nodes, the switching sub-unit preferentially selects the transmission primary channel to determine whether the nodes on the transmission primary 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 transmits 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 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.
CN202210357154.0A 2022-04-07 2022-04-07 Redundancy implementation system based on CAN gateway, electronic device and computer readable storage medium Active CN114500157B (en)

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 CN114500157A (en) 2022-05-13
CN114500157B true 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)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103490959B (en) * 2013-10-10 2016-12-07 北京航天发射技术研究所 A kind of dual-redundant CAN bus fault detection method
KR101566640B1 (en) * 2014-11-19 2015-11-09 경북대학교 산학협력단 Fault-tolerant dual-can (ft-dcan) device and method to tolerate arbitrary network faults, recording medium for performing the method
KR101640054B1 (en) * 2015-06-24 2016-07-22 현대자동차주식회사 Gateway device, vehicle including the same, and control method for the same
CN109495292B (en) * 2018-10-11 2021-09-28 中国人民解放军海军陆战队训练基地 Dual-redundancy hot standby device
CN109639546B (en) * 2018-12-28 2021-07-30 浙江中控研究院有限公司 Redundancy system based on CAN bus
CN210225442U (en) * 2019-05-16 2020-03-31 江苏和正特种装备有限公司 double-CAN redundancy system based on full backup

Also Published As

Publication number Publication date
CN114500157A (en) 2022-05-13

Similar Documents

Publication Publication Date Title
US10715411B1 (en) Altering networking switch priority responsive to compute node fitness
EP3029883B1 (en) Network protection method and apparatus, next-ring node, and system
CN112787960B (en) Stack splitting processing method, device and equipment and storage medium
US20070270984A1 (en) Method and Device for Redundancy Control of Electrical Devices
CN107948063B (en) Method for establishing aggregation link and access equipment
CN109120446A (en) A kind of zero configuration starting method and apparatus
CN112165429A (en) Link aggregation convergence method and device for distributed switching equipment
CN114500157B (en) Redundancy implementation system based on CAN gateway, electronic device and computer readable storage medium
CN113194498B (en) Communication detection method and device
CN112217718A (en) Service processing method, device, equipment and storage medium
CN114422100A (en) Up-and-down connection processing system, computer equipment and medium of national standard signaling service terminal
JP3917467B2 (en) Power system monitoring control system and program
CN112954722A (en) System and method for rapidly switching 5G UPF (unified power flow) main link and standby link
CN113852514A (en) Data processing system with uninterrupted service, processing equipment switching method and connecting equipment
CN101645840A (en) Method, system and routing equipment for retransmitting message
JP2017114406A (en) Network system
KR101740799B1 (en) Method of failover for network service in software defined networking environment
JP4863984B2 (en) Monitoring processing program, method and apparatus
CN110955210B (en) AGV scheduling method, device and system
CN112564931B (en) Fault processing method, device and storage medium
CN105323088A (en) Springboard processing method and springboard processing device
CN114567536B (en) Abnormal data processing method, device, electronic equipment and storage medium
US11212217B2 (en) Spanning tree enabled link aggregation system
WO2021259097A1 (en) Communication method, communication device, and storage 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