Data interaction method for FC (Fiber Channel) bus and CAN (Controller Area Network) bus
By establishing a mapping mechanism and node data communication process between the CAN bus and the FC bus, the wiring complexity and delay problems caused by the use of different transmission links in the control system of CAN bus and the fiber bus is solved, and high-speed data transmission is achieved Seamless interaction with low-speed control instructions reduces the system's wiring complexity and cost.
Patent Information
- Application Number
- CN202411477497.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2024-12-13
AI Technical Summary
In the prior art, CAN bus and optical fiber bus use different transmission links in the control system, resulting in increased system wiring complexity and cost, and a longer data transmission delay.
By establishing a mapping mechanism and node data communication process between the CAN bus and the FC bus, the node address of the CAN bus is mapped into the FC bus protocol, and the gateway is used to convert the CAN frame into the FC frame to realize the data between the CAN bus and the FC bus. Switch and route forwarding through the fiber switch according to the receiver ID field.
It realizes seamless interaction of data at different rates, reduces data transmission delay, simplifies system routing, and reduces wiring complexity and cost.
Smart Images

Figure CN119135469A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of optical fiber communication, and in particular to a data interaction method between an FC bus and a CAN bus. Background Art
[0002] The CAN bus transmits control instructions or status parameters. The effective data rate of control instructions and status parameters constrained by bus rate and bus load rate is relatively low, usually not exceeding 600Kbps. The control instructions or status parameters sent by different nodes in the system are ensured to be real-time through protocol priority. The high-priority data packets sent by the node can preempt the low-priority data packets sent by other nodes, while the low-priority data packets sent by the node cannot preempt the high-priority data packets sent by other nodes. The fiber optic bus uses special encoding and data reception processing methods, and the transmission rate can reach more than 1Gbps, which is suitable for transmitting raw image data or software program data. Therefore, in the control system, the CAN bus and the fiber optic bus use different transmission links to transmit different business data, and only complete the fusion and interaction of business data on a certain transmission node.
[0003] The above solution is subject to the different transmission links of the CAN bus and the optical fiber bus. It is necessary to configure optical fiber links and twisted pair links in the control system, which increases the complexity and cost of system wiring and the weight of the cable network. At the same time, the optical fiber bus and the CAN bus integrate and interact with business data at a certain transmission node, which increases the data transmission delay for any two communication nodes of different links in the system. Summary of the invention
[0004] The purpose of the present invention is to propose a mapping mechanism of a CAN bus and a FC bus and a node data communication process, which can realize barrier-free transmission of information in a structure including the CAN bus and the FC bus, and greatly reduce the delay of data transmission.
[0005] The technical solution of the present invention is to provide a data interaction method between an FC bus and a CAN bus, the method comprising:
[0006] Map the node address of the CAN bus to the FC bus protocol, use a unique identifier to correspond to each CAN node, convert the CAN frame into an FC frame through the gateway, and realize data exchange between the CAN bus and the FC bus;
[0007] The fiber switch identifies the target node according to the receiver ID field in the FC protocol frame and forwards the FC protocol frame to the target node by querying the routing table. When the fiber switch receives the FC protocol frame from the cascade interface or non-cascade interface, it will parse the target terminal address. If the address is consistent with the port of the switch, it will be directly forwarded to the target node, otherwise it will be forwarded to the cascade port.
[0008] The mapping between the CAN bus and the FC bus and the conversion between protocol frames specifically include:
[0009] According to the device code of the CAN bus node, the sender ID and receiver ID of the CAN frame are mapped to the SID and DID fields in the FC protocol, and the MESSAGE ID field of the CAN frame is mapped to the MESSAGE ID field in the FC protocol.
[0010] In any of the above technical solutions, further, the FC frame structure of the CAN frame mapping includes: a start flag SOF, frame content and an end flag EOF;
[0011] The frame content consists of a general frame header including SID and DID, an FC-AE-ASM frame header including MESSAGE ID, payload data including CAN frame content, and a CRC check field.
[0012] In any of the above technical solutions, further, the communication workflow between CAN interfaces specifically includes:
[0013] S11, the CAN device sends a CAN frame to the CAN interface of the gateway;
[0014] S12, the gateway maps the sender ID and receiver ID of the FC protocol according to the device code in the CAN frame identifier and the upper computer device code corresponding to the CAN interface; the gateway converts the CAN frame into an FC frame in combination with the mapped sender ID and receiver ID;
[0015] S13, the gateway sends the FC frame to the fiber switch through the FC interface;
[0016] S14, the fiber optic switch performs a route query according to the receiver ID field of the FC frame; according to the route query result, if the FC frame forwarded by the fiber optic switch is sent to the gateway, step S15 is executed; if the FC frame is sent to another bus access device through the cascaded FC interface, step S14 is repeated;
[0017] S15, the fiber optic switch sends the FC frame to the gateway;
[0018] S16, the gateway maps the CAN device code according to the receiver ID of the FC frame;
[0019] S17, the gateway converts the FC frame into a CAN frame;
[0020] S18. The gateway sends the CAN frame to the CAN device according to the destination CAN device code.
[0021] In any of the above technical solutions, further, the workflow of the CAN interface sending data to the FC interface specifically includes:
[0022] S21, the CAN device sends a CAN frame to the CAN interface of the gateway;
[0023] S22, the gateway performs sender ID and receiver ID mapping of the FC protocol according to the device code in the CAN frame identifier and the upper computer device code corresponding to the CAN interface;
[0024] S23, the gateway converts the CAN frame into an FC frame by combining the mapped sender ID and receiver ID;
[0025] S24, the gateway sends the FC frame to the fiber switch through the FC interface;
[0026] S25, the fiber switch performs a route query according to the receiver ID field of the FC frame; according to the route query result, if the FC frame forwarded by the fiber switch is sent to a non-cascaded FC interface, step S26 is executed; if the FC frame is sent to another bus access device through a cascaded FC interface, step S25 is repeated;
[0027] S26. The fiber optic switch sends the FC frame to the FC device.
[0028] In any of the above technical solutions, further, the workflow of the FC interface sending data to the CAN interface specifically includes:
[0029] S31, the FC device sends an FC-AE-ASM protocol frame to the FC interface of the fiber switch;
[0030] S32, the fiber switch performs a route query according to the receiver ID field of the FC frame; according to the route query result, if the FC frame forwarded by the fiber switch is sent to the gateway, step S33 is executed; if the FC frame is sent to another bus access device through the cascaded FC interface, step S32 is repeated;
[0031] S33, the optical fiber switch sends the FC frame to the gateway;
[0032] S34, the gateway maps the CAN device code according to the receiver ID of the FC frame;
[0033] S35, the gateway converts the FC frame into a CAN frame;
[0034] S36. The gateway sends the CAN frame to the CAN device according to the destination CAN device code.
[0035] The beneficial effects of the present invention are:
[0036] The technical solution of the present invention proposes a unified bus architecture by combining the high-speed FC bus and the low-speed CAN bus, thereby realizing seamless interaction of data at different rates; the optical fiber bus is responsible for high-speed data transmission, and the CAN bus is responsible for the transmission of low-speed control instructions, which greatly improves the flexibility and applicability of the system.
[0037] In the prior art, the fiber optic bus and the CAN bus use different transmission links, which leads to complex wiring and increased costs. The present invention uses the mapping mechanism and protocol conversion of the gateway to achieve data interaction between the two buses in the same network architecture, reducing the need for multiple transmission lines in the system, simplifying wiring, and reducing construction complexity and wiring costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The advantages of the above and additional aspects of the present invention will become apparent and easily understood in the description of the embodiments in conjunction with the following drawings, in which:
[0039] Figure 1 It is a schematic diagram of a protocol mapping mechanism of a CAN bus and a FC bus according to a method for data interaction between an FC bus and a CAN bus according to an embodiment of the present invention;
[0040] Figure 2 It is a flow chart of a CAN node sending data to a CAN node in a method for data interaction between an FC bus and a CAN bus according to an embodiment of the present invention;
[0041] Figure 3 It is a flow chart of a CAN node sending data to an FC node in a method for data interaction between an FC bus and a CAN bus according to an embodiment of the present invention;
[0042] Figure 4 The present invention is a flowchart of a method for data interaction between an FC bus and a CAN bus in which an FC node sends data to a CAN node. DETAILED DESCRIPTION
[0043] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.
[0044] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.
[0045] This embodiment provides a method for data interaction between an FC bus and a CAN bus, the method comprising:
[0046] The conversion between CAN frames and FC-AE-ASM protocol frames (FC-AE-ASM means anonymous message transmission without signature, and the rest of the FC-AE-ASM protocol frames in this article are referred to as FC frames) requires mapping between CAN device codes and FC_ID to correctly forward data. Therefore, the address of the CAN bus node is mapped to the FC bus protocol. Each CAN node address has a corresponding unique identifier in the FC bus protocol to ensure seamless communication between devices with different protocols. For example, when transmitting data, the code of the CAN device needs to be mapped to the sender ID (SID) and receiver ID (DID) fields of the FC bus.
[0047] During protocol conversion, the SID, DID and MESSAGE ID of the FC frame need to be mapped and defined. SID represents the FC_ID of the data transmitter, DID represents the FC_ID of the data receiver, and MESSAGE ID represents the message type of the data. The MESSAGE ID of the FC-AE-ASM protocol frame converted by all CAN frames is uniformly defined.
[0048] Specifically, as mentioned above, the CAN frame will be converted into an FC frame, such as Figure 1 As shown, the FC frame mapped by the CAN frame can be divided into a start flag SOF, a frame content and an end flag EOF; wherein the frame content is composed of a general frame header including SID and DID, an FC-AE-ASM frame header including MESSAGEID, payload data including CAN frame content and a CRC check field.
[0049] Each CAN device belongs to a different communication group, and there is a fixed host device in the communication group. The CAN frame identifier device code is fixed to represent the device code of the non-host device. In the CAN frame identifier sent by the host device, the code direction is 0. In the CAN frame identifier sent by the non-host device, the code direction is 1. Although the CAN identifier only contains the non-host device code information, since each CAN device belongs to a fixed communication group, the unique host device code can still be determined.
[0050] After the mapping is completed, the communication workflow is specified. The CAN interface communication includes the communication between the CAN interface and the CAN interface, and the communication between the CAN interface and the FC interface.
[0051] Among them, Figure 2 As shown in the figure, the communication workflow between CAN interfaces specifically includes:
[0052] S11. The CAN device sends a CAN frame to the CAN interface of the gateway.
[0053] S12. The gateway maps the sender ID and receiver ID of the FC protocol according to the device code in the CAN frame identifier and the upper computer device code corresponding to the CAN interface; the gateway converts the CAN frame into an FC frame in combination with the mapped sender ID and receiver ID.
[0054] S13. The gateway sends the FC frame to the fiber switch through the FC interface.
[0055] S14. The fiber switch performs a routing query based on the receiver ID field of the FC frame. Based on the routing query result, if the FC frame forwarded by the fiber switch is sent to the gateway, step S15 is executed; if the FC frame is sent to another bus access device through the cascaded FC interface, step S14 is repeated.
[0056] S15. The fiber optic switch sends the FC frame to the gateway.
[0057] S16. The gateway maps the CAN device code according to the receiver ID of the FC frame.
[0058] S17. The gateway converts the FC frame into a CAN frame.
[0059] S18. The gateway sends the CAN frame to the CAN device according to the destination CAN device code.
[0060] The communication between the CAN interface and the FC interface includes two directions. When the CAN bus transmits data to the FC bus, the gateway receives multiple CAN frames and encapsulates them into an FC protocol frame for transmission to improve data transmission efficiency. The fiber optic switch identifies the target node according to the receiver ID field in the FC protocol frame and forwards the FC protocol frame to the target node by querying the routing table. When the fiber optic switch receives the FC protocol frame from the cascade interface or non-cascade interface, it will parse the target terminal address. If the address is consistent with the port of the switch, it will be forwarded directly to the target node, otherwise it will be forwarded to the cascade port.
[0061] like Figure 3 As shown in the figure, the workflow of sending data from the CAN interface to the FC interface specifically includes:
[0062] S21. The CAN device sends a CAN frame to the CAN interface of the gateway.
[0063] S22. The gateway maps the sender ID and the receiver ID of the FC protocol according to the device code in the CAN frame identifier and the upper computer device code corresponding to the CAN interface.
[0064] S23. The gateway converts the CAN frame into an FC frame by combining the mapped sender ID and receiver ID.
[0065] S24. The gateway sends the FC frame to the fiber switch through the FC interface.
[0066] S25. The fiber optic switch performs a route query according to the receiver ID field of the FC frame. According to the route query result, if the FC frame forwarded by the fiber optic switch is sent to a non-cascaded FC interface, step S26 is executed; if the FC frame is sent to another bus access device through a cascaded FC interface, step S25 is repeated.
[0067] S26. The fiber optic switch sends the FC frame to the FC device.
[0068] When the FC bus transmits data to the CAN bus, the packet segmentation method is used to split the large data packet in the FC protocol frame into multiple small data packets; the data flow is controlled by the gateway, and the data transmission rate is adjusted according to the transmission load of the CAN bus to ensure smooth transmission of data on the CAN bus; Figure 4 As shown in the figure, the workflow of sending data from the FC interface to the CAN interface specifically includes:
[0069] S31. The FC device sends an FC-AE-ASM protocol frame to the FC interface of the fiber switch.
[0070] S32. The fiber switch performs a routing query based on the receiver ID field of the FC frame. Based on the routing query result, if the FC frame forwarded by the fiber switch is sent to the gateway, step S33 is executed; if the FC frame is sent to another bus access device through the cascaded FC interface, step S32 is repeated.
[0071] S33. The optical fiber switch sends the FC frame to the gateway.
[0072] S34. The gateway maps the CAN device code according to the receiver ID of the FC frame.
[0073] S35. The gateway converts the FC frame into a CAN frame.
[0074] S36. The gateway sends the CAN frame to the CAN device according to the destination CAN device code.
[0075] In summary, the present invention provides a method for data interaction between an FC bus and a CAN bus, the method comprising:
[0076] The node address of the CAN bus is mapped to the FC bus protocol, a unique identifier is used to correspond to each CAN node, and the CAN bus protocol frame is converted into the FC bus protocol frame through the gateway to realize data exchange between the CAN bus and the FC bus.
[0077] When the FC bus transmits data to the CAN bus, the packet segmentation method is used to split the large data packet in the FC protocol frame into multiple small data packets; the data flow is controlled through the gateway, and the data sending rate is adjusted according to the transmission load of the CAN bus to ensure smooth transmission of data on the CAN bus.
[0078] When the CAN bus transmits data to the FC bus, the gateway receives multiple CAN frames and encapsulates them into an FC protocol frame for transmission, thereby improving data transmission efficiency; the fiber optic switch identifies the target node according to the receiver ID field in the FC protocol frame and forwards the FC protocol frame to the target node by querying the routing table; when the fiber optic switch receives the FC protocol frame of the non-cascaded FC interface, it directly sends it to the target node, otherwise it continues to forward the data through the cascaded FC interface.
[0079] The mapping between the CAN bus and the FC bus and the conversion between protocol frames specifically include:
[0080] According to the device code of the CAN bus node, the sender ID and receiver ID of the CAN frame are mapped to the SID and DID fields in the FC protocol, and the MESSAGE ID field of the CAN frame is mapped to the MESSAGE ID field in the FC protocol.
[0081] The steps in the present invention can be adjusted in order, combined or deleted according to actual needs.
[0082] The units in the device of the present invention can be combined, divided and deleted according to actual needs.
[0083] Although the present invention is disclosed in detail with reference to the accompanying drawings, it should be understood that these descriptions are merely exemplary and are not intended to limit the application of the present invention. The scope of protection of the present invention is defined by the appended claims and may include various modifications, alterations and equivalents made to the invention without departing from the scope and spirit of the present invention.
Claims
1. A data interaction method between an FC bus and a CAN bus, characterized in that: The method comprises: Map the node address of the CAN bus to the FC bus protocol, use a unique identifier to correspond to each CAN node, convert the CAN frame into an FC frame through the gateway, and realize data exchange between the CAN bus and the FC bus; The fiber switch identifies the target node according to the receiver ID field in the FC protocol frame and forwards the FC protocol frame to the target node by querying the routing table. When the fiber switch receives the FC protocol frame from the cascade interface or non-cascade interface, it will parse the target terminal address. If the address is consistent with the port of the switch, it will be directly forwarded to the target node, otherwise it will be forwarded to the cascade port. The mapping between the CAN bus and the FC bus and the conversion between protocol frames specifically include: According to the device code of the CAN bus node, the sender ID and receiver ID of the CAN frame are mapped to the SID and DID fields in the FC protocol, and the MESSAGE ID field of the CAN frame is mapped to the MESSAGEID field in the FC protocol.
2. The data interaction method between the FC bus and the CAN bus according to claim 1, characterized in that: The FC frame structure of the CAN frame mapping includes: the start flag SOF, the frame content and the end flag EOF; The frame content consists of a general frame header including SID and DID, an FC-AE-ASM frame header including MESSAGE ID, payload data including CAN frame content, and a CRC check field.
3. The data interaction method between the FC bus and the CAN bus according to claim 1, characterized in that: The communication workflow between CAN interfaces specifically includes: S11, the CAN device sends a CAN frame to the CAN interface of the gateway; S12, the gateway maps the sender ID and receiver ID of the FC protocol according to the device code in the CAN frame identifier and the upper computer device code corresponding to the CAN interface; the gateway converts the CAN frame into an FC frame in combination with the mapped sender ID and receiver ID; S13, the gateway sends the FC frame to the fiber switch through the FC interface; S14, the fiber optic switch performs a route query according to the receiver ID field of the FC frame; according to the route query result, if the FC frame forwarded by the fiber optic switch is sent to the gateway, step S15 is executed; if the FC frame is sent to another bus access device through the cascaded FC interface, step S14 is repeated; S15, the fiber optic switch sends the FC frame to the gateway; S16, the gateway maps the CAN device code according to the receiver ID of the FC frame; S17, the gateway converts the FC frame into a CAN frame; S18. The gateway sends the CAN frame to the CAN device according to the destination CAN device code.
4. The data interaction method between the FC bus and the CAN bus according to claim 1, characterized in that: The workflow of sending data from the CAN interface to the FC interface includes: S21, the CAN device sends a CAN frame to the CAN interface of the gateway; S22, the gateway performs sender ID and receiver ID mapping of the FC protocol according to the device code in the CAN frame identifier and the upper computer device code corresponding to the CAN interface; S23, the gateway converts the CAN frame into an FC frame by combining the mapped sender ID and receiver ID; S24, the gateway sends the FC frame to the fiber switch through the FC interface; S25, the fiber switch performs a route query according to the receiver ID field of the FC frame; according to the route query result, if the FC frame forwarded by the fiber switch is sent to a non-cascaded FC interface, step S26 is executed; if the FC frame is sent to another bus access device through a cascaded FC interface, step S25 is repeated; S26. The fiber optic switch sends the FC frame to the FC device.
5. The data interaction method between the FC bus and the CAN bus according to claim 1, characterized in that: The workflow of sending data from the FC interface to the CAN interface includes: S31, the FC device sends an FC-AE-ASM protocol frame to the FC interface of the fiber switch; S32, the fiber switch performs a route query according to the receiver ID field of the FC frame; according to the route query result, if the FC frame forwarded by the fiber switch is sent to the gateway, step S33 is executed; if the FC frame is sent to another bus access device through the cascaded FC interface, step S32 is repeated; S33, the optical fiber switch sends the FC frame to the gateway; S34, the gateway maps the CAN device code according to the receiver ID of the FC frame; S35, the gateway converts the FC frame into a CAN frame; S36. The gateway sends the CAN frame to the CAN device according to the destination CAN device code.
Citation Information
Patent Citations
FC network-based cascaded port load balancing method
CN105391645A
FC-EG gateway and communication conversion method between optical fiber channel and Ethernet
CN106789609A
Multi-protocol fusion system and IP communication and FC-AE-1553 communication method between nodes
CN106790104A
Multi-node parallel working method of multi-protocol hybrid network
CN113328870A
Ethernet frame transmission system based on FC switch with fusion port
CN117135233A
