CAN / CAN FD to TSN protocol converter based on FPGA and application thereof

By designing a protocol converter based on FPGA, efficient conversion between CAN/CAN FD and TSN protocols is solved, and the compatibility and performance of industrial networks are significantly improved.

CN119814895APending Publication Date: 2025-04-11TIANJIN UNIVERSITY OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411933687.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

The lack of an effective conversion mechanism between the existing CAN/CAN FD protocol and the emerging TSN protocol limits the integration of the two protocols in practical applications and cannot meet the needs of industrial networks for efficient, real-time and reliable communication.

Method used

A protocol converter based on FPGA is designed, including CAN/CAN FD interface module, TSN interface module and protocol conversion processing unit. By deeply analyzing CAN/CAN FD messages and framing them according to the TSN protocol, it realizes efficient and accurate conversion between CAN/CAN FD and TSN protocols, and introduces a high-precision clock synchronization mechanism and intelligent flow control and scheduling algorithm.

Benefits of technology

It realizes seamless and efficient docking between CAN/CAN FD equipment and TSN network, significantly improves the compatibility and scalability of industrial networks, ensures real-time, certainty and reliability of data transmission, and improves the performance and reliability of the entire industrial network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119814895A_ABST
    Figure CN119814895A_ABST
Patent Text Reader

Abstract

The invention discloses a CAN / CAN FD to TSN protocol converter based on an FPGA and application of the CAN / CAN FD to TSN protocol converter. The protocol converter architecture comprises a CAN / CAN FD interface module, a TSN interface module and a protocol conversion processing unit. The conversion method comprises the following steps: deeply analyzing a CAN / CAN FD message, framing according to a TSN protocol, and reversely converting a TSN frame into the CAN / CAN FD message. The clock synchronization unit adopts an IEEE 1588v2 protocol to realize high-precision clock synchronization, and a flow control and scheduling algorithm optimizes data flow based on a token bucket and a priority queue mechanism. The method is suitable for the fields of industrial automation, intelligent factories and the like, seamless butt joint of CAN / CAN FD equipment and a TSN network is achieved, the compatibility, real-time performance, certainty and reliability of an industrial network are improved, industrial intelligent development is promoted, and enterprise upgrading cost and risks are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of industrial communications, and in particular to a protocol conversion method between CAN (Controller Area Network) / CAN FD (Flexible Data Rate Controller Area Network) and Time Sensitive Network (TSN) and an application thereof in an industrial network. Background Art

[0002] In the field of industrial automation, fieldbus technology is the key communication network connecting intelligent field devices and industrial automation systems. CAN / CAN FD bus is widely used in many industrial fields such as ships, automobiles, railways, and geological exploration due to its high reliability, good flexibility, and high cost performance. However, with the continuous development of industrial automation, higher requirements are placed on the real-time, deterministic, and reliable performance of the network.

[0003] At the same time, time-sensitive network (TSN) technology continues to develop. As a protocol family that can achieve deterministic minimum time delay in non-deterministic Ethernet, TSN adds determinism and reliability to standard Ethernet to ensure that data can be transmitted in real time, deterministically and reliably. TSN provides deterministic or bounded end-to-end delay for data transmission through a series of measures such as precise clock synchronization, bandwidth reservation, traffic shaping, frame preemption, gate control mechanism, circular queue forwarding, stream-by-stream filtering, and seamless redundancy, significantly enhancing the real-time performance of Ethernet.

[0004] Although CAN / CAN FD has been widely used in the field of industrial automation, with the development and application of TSN technology, the existing CAN / CAN FD protocol faces an urgent need to be compatible with the emerging TSN protocol. The lack of an effective conversion mechanism between the two has largely limited the integration of the two protocols in practical applications. Therefore, developing a method that can achieve efficient and accurate conversion between CAN / CAN FD and TSN protocols is of vital importance to improving the performance and compatibility of the entire industrial network. Summary of the invention

[0005] The present invention provides an efficient and reliable CAN / CAN FD and time-sensitive network protocol conversion method and its application, which can realize efficient and accurate conversion between CAN / CAN FD protocol data and TSN protocol data to adapt to different communication environments and application requirements. The implementation scheme of the present invention is as follows:

[0006] 1. Protocol converter architecture design

[0007] The protocol converter architecture designed in the present invention mainly includes a CAN / CAN FD interface module, a TSN interface module and an FPGA-based protocol conversion processing unit.

[0008] The CAN / CAN FD interface module is responsible for physically connecting to the CAN / CAN FD bus to receive and send data. The module can parse the messages on the CAN / CAN FD bus and extract valid information, such as message ID, data field, control field, etc. At the same time, it also has electrical isolation function to enhance the anti-interference ability of the system and ensure the stability of data transmission.

[0009] The TSN interface module is used to connect to the time-sensitive network, following the communication protocol of the TSN network (IEEE802.1 working group), accurately sending the converted data to the TSN network, or receiving data from the TSN network. This module supports a variety of TSN standard functions, such as time synchronization (IEEE 1588v2 protocol), traffic shaping (IEEE 802.1Qbv), frame preemption and redundant transmission, etc., to meet the needs of different industrial scenarios.

[0010] As the core part, the protocol conversion processing unit is responsible for implementing the conversion logic between the CAN / CAN FD protocol and the TSN protocol. It can convert CAN / CAN FD messages into data frames that conform to the TSN protocol format according to the pre-set conversion rules, and vice versa. During the conversion process, the differences between the two protocols in data format, transmission mechanism, etc. are fully considered to ensure the accuracy and integrity of the data.

[0011] 2. Protocol conversion method

[0012] CAN / CAN FD to TSN conversion: When the protocol converter receives data from the CAN / CAN FD interface module, it first performs in-depth analysis of the CAN / CAN FD message. This includes detailed analysis of the message frame format, bit timing, and bit stream encoding, and obtaining key information in the message, such as ID information in the arbitration field, data length code (DLC) in the control field, and actual data in the data field. Based on the information obtained, accurate framing is performed according to the frame format requirements of the TSN protocol. During the framing process, the relevant information in the CAN / CAN FD message is mapped to the corresponding field of the TSN frame, such as mapping the ID of the CAN / CAN FD message to the priority field of the TSN frame to ensure that the data can be transmitted according to the correct priority in the TSN network. At the same time, the necessary timestamp information is added to the TSN frame to meet the time sensitivity requirements of the TSN network and ensure that the data transmission in the network is deterministic and traceable. The framed data is processed by TSN-specific operations, such as traffic shaping and scheduling, to optimize the allocation of network resources and improve the transmission efficiency and reliability of the network. Finally, the converted TSN frames are sent to the TSN network through the TSN interface module.

[0013] Conversion from TSN to CAN / CAN FD: After the protocol converter receives the TSN frame from the TSN interface module, it first parses the information in the TSN frame and extracts the data part and related control information that need to be converted. According to the pre-set mapping rules, the data and control information in the TSN frame are converted into the CAN / CAN FD message format. During the conversion process, ensure that the various parameters in the CAN / CANFD message (such as arbitration field, control field, data field, etc.) are correctly set to ensure that the CAN / CAN FD device can correctly identify and process the converted message. Perform necessary checks and processing on the converted CAN / CAN FD message, such as CRC check, to ensure the integrity and accuracy of the message. At the same time, according to the load of the CAN / CAN FD bus, the message is reasonably scheduled and sent to avoid bus conflicts and data loss. Finally, the converted CAN / CAN FD message is sent to the CAN / CAN FD bus through the CAN / CAN FD interface module.

[0014] 3. Clock synchronization mechanism

[0015] In order to ensure the clock synchronization between CAN / CAN FD devices and TSN networks, the present invention introduces a high-precision clock synchronization unit in the protocol converter. The unit adopts advanced clock synchronization protocols such as IEEE 1588v2 Precision Time Protocol (PTP) to achieve accurate clock synchronization between CAN / CAN FD networks and TSN networks.

[0016] The clock synchronization unit regularly sends and receives clock synchronization messages in the protocol converter, and interacts with the master clock in the TSN network to accurately adjust the time of the local clock so that it is highly consistent with the clock of the TSN network. During the synchronization process, advanced clock filtering algorithms are used to effectively reduce clock jitter and deviation and improve the accuracy of clock synchronization.

[0017] During data conversion and transmission, the clock synchronization unit adds accurate timestamp information to the data frame to ensure the time accuracy and consistency of data transmission between different networks. At the same time, according to the timestamp information, the data is reasonably scheduled and processed to improve the transmission efficiency and real-time performance of the network.

[0018] 4. Flow control and scheduling algorithm

[0019] Considering the complexity and real-time requirements of data traffic in industrial networks, the present invention designs an intelligent traffic control and scheduling algorithm in the protocol converter. The algorithm can reasonably control and optimize the data traffic between CAN / CANFD and TSN according to the network load and data priority.

[0020] The flow control and scheduling algorithm monitors the data flow on the CAN / CAN FD bus in real time. When it detects that the load on the bus is too high, it takes flexible measures, such as dynamically adjusting the data transmission rate and delaying the transmission of some non-critical data, to avoid network congestion and ensure the real-time transmission of critical data.

[0021] For TSN networks, the algorithm allocates different bandwidths and transmission time windows for data of different priorities according to the characteristics of the TSN protocol, ensuring that data with high real-time requirements can be transmitted first, while ensuring the fairness and stability of the entire network. In the scheduling process, advanced queue management technologies such as priority queues and weighted fair queues are used to improve the efficiency and flexibility of data scheduling.

[0022] 5. Application scenarios

[0023] The protocol converter of the present invention and its application can be widely used in the fields of industrial automation systems, smart factories, automobile manufacturing, rail transportation, etc. In these application scenarios, by connecting CAN / CAN FD devices to the TSN network, efficient interconnection between different networks is achieved, significantly improving the performance and reliability of the entire industrial network.

[0024] In industrial automation production lines, numerous sensors and actuators usually communicate using the CAN / CAN FD bus. Through the protocol converter of the present invention, these devices can be seamlessly connected to the TSN network to achieve real-time, accurate transmission and precise control of production data, greatly improving production efficiency and product quality.

[0025] In the field of automobile manufacturing, the electronic control units (ECUs) in the car communicate with each other using the CAN / CAN FD bus, while the car and the external intelligent transportation system need to exchange data through the TSN network. The technology of the present invention can achieve effective connection between the in-car network and the external network, improve the intelligence level and safety of the car, and provide strong support for intelligent driving.

[0026] 6. Advantages and positive effects

[0027] The FPGA-based CAN / CAN FD to TSN protocol converter and its application provided by the present invention have the following significant advantages and positive effects:

[0028] It realizes seamless and efficient connection between CAN / CAN FD devices and TSN networks, greatly improving the compatibility and scalability of industrial networks. When enterprises upgrade their industrial networks, they do not need to replace a large number of existing CAN / CAN FD devices, which effectively reduces upgrade costs and risks and improves the system's return on investment.

[0029] By introducing a high-precision clock synchronization mechanism and an optimized flow control and scheduling algorithm, the real-time, deterministic and reliable transmission of data between different networks is ensured. In industrial control scenarios, control instructions can be delivered to execution devices in a timely and accurate manner, significantly improving the stability and safety of the production process and reducing production accidents and losses caused by communication failures.

[0030] It has improved the performance of the entire industrial network, better met the needs of the industrial automation field for efficient, accurate and reliable communication, and effectively promoted the development of industrial intelligence. In smart factories, it has achieved a high degree of collaboration between equipment, optimized production processes, improved resource utilization and production efficiency, and enhanced the market competitiveness of enterprises. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 This is the overall structure diagram of the protocol converter;

[0032] Figure 2 It is the workflow diagram of the protocol conversion module;

[0033] Figure 3 It is a schematic diagram of clock synchronization mechanism;

[0034] Figure 4 This is the basic principle diagram of the token bucket algorithm. DETAILED DESCRIPTION

[0035] The specific implementation of the present invention is described below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the present invention, and is not used to limit the present invention.

[0036] The FPGA-based CAN / CAN FD to TSN protocol converter architecture provided by the present invention includes a CAN / CAN FD interface module, a TSN interface module and a protocol conversion processing unit. The overall structure is shown in the attached figure. Figure 1 The conversion method includes deep parsing of CAN / CAN FD messages and framing according to the TSN protocol, as well as reverse conversion of TSN frames into CAN / CAN FD messages. The protocol conversion module workflow diagram is shown in Figure 2 The overall structure and working process of the protocol converter of the present invention are further described below in conjunction with the accompanying drawings.

[0037] Step 1: Hardware implementation of the protocol converter. The protocol converter uses a high-performance FPGA chip as the core processor. The FPGA chip has programmability and powerful parallel processing capabilities, which can meet the high requirements for data processing speed and flexibility during the protocol conversion process.

[0038] The CAN / CAN FD interface module is connected to the CAN / CAN FD transceiver through a carefully designed hardware circuit to achieve a stable electrical connection with the CAN / CAN FD bus. The transceiver is responsible for accurately converting the differential signal on the bus into a digital signal that the FPGA can process, and converting the digital signal sent by the FPGA into a differential signal and sending it to the bus. In the hardware circuit design, signal integrity and anti-interference capabilities are fully considered, and differential transmission, shielded wiring and other technologies are used to ensure the reliability of data transmission.

[0039] The TSN interface module uses advanced Ethernet physical layer chips to achieve high-speed physical connection with the TSN network. The Ethernet physical layer chip is responsible for processing key functions such as signal encoding, decoding, and clock recovery in the TSN network to ensure the correct transmission of data at the physical layer. At the same time, in order to improve the adaptability of the network, the module supports multiple Ethernet interface standards, such as RJ45, fiber optic interface, etc.

[0040] The protocol conversion processing unit is implemented in the FPGA through a hardware description language (such as Verilog or VHDL). According to the pre-designed protocol conversion logic, efficient format conversion, data mapping and complex processing are performed between CAN / CAN FD messages and TSN frames. In the process of code implementation, the algorithm structure is fully optimized to improve the execution efficiency and resource utilization of the code.

[0041] Step 2: Data parsing module, when receiving CAN / CAN FD message or TSN frame, the data parsing module deeply parses the data according to the corresponding protocol format, accurately extracts key information, and stores it efficiently in the internal buffer. In the parsing process, state machine, finite state automaton and other technologies are used to improve the accuracy and efficiency of the parsing.

[0042] Conversion processing module: According to the strict protocol conversion rules, the conversion processing module reads the parsed information from the buffer and performs data format conversion and mapping operations. During the conversion process, the specifications of the TSN protocol and CAN / CAN FD protocol are strictly followed to ensure that the converted frame format is completely correct. At the same time, in order to improve the conversion efficiency, optimization methods such as table lookup method and pipeline technology are adopted.

[0043] Data transmission module: Sends the converted frames through the corresponding interface module. During the transmission process, the transmission rate and time interval are dynamically adjusted according to the network status and flow control strategy to ensure stable and efficient data transmission. At the same time, the retransmission mechanism, error detection and correction technology, etc. are adopted to improve the reliability of data transmission.

[0044] Step 3: Implementation of the clock synchronization unit. Figure 3As shown in Figure 1, the unit uses the IEEE 1588v2 protocol to achieve high-precision clock synchronization. In the protocol converter, a dedicated clock synchronization module is set up to communicate accurately with the master clock in the TSN network.

[0045] The clock synchronization module periodically sends gPTP synchronization messages and receives response messages from the master clock. It calculates the slight time deviation between the local clock and the master clock by accurately measuring the round-trip time of the message and using an advanced point-to-point network path delay measurement algorithm.

[0046] According to the calculated time deviation, a precise clock adjustment algorithm is used to adjust the frequency and phase of the local clock so that it gradually synchronizes with the master clock. In the synchronization process, adaptive filtering, phase-locked loop and other technologies are used to effectively reduce the impact of clock adjustment on system operation and improve the stability and accuracy of clock synchronization.

[0047] Step 4: Implementation of flow control and scheduling algorithm. The flow control and scheduling algorithm implements intelligent flow management based on the token bucket algorithm and priority queue mechanism.

[0048] The basic principle of the token bucket algorithm is as follows Figure 4 As shown in the figure, it is used to accurately control the data flow on the CAN / CAN FD bus. A token bucket is set for each CAN / CAN FD node, and tokens are generated and stored in the "bucket" at a reasonable rate. When a node sends data, a corresponding number of tokens needs to be consumed. If there are insufficient tokens, data transmission will be delayed or paused, thereby effectively avoiding bus congestion. At the same time, according to the network load, the token generation rate is dynamically adjusted to improve the utilization of the network.

[0049] For TSN networks, a priority queue mechanism is used. Data is assigned to different queues according to their priority, and data in high-priority queues is sent first. Advanced scheduling algorithms are used within each queue, such as weighted fair queuing and earliest deadline priority, to ensure that data of the same priority can occupy network bandwidth fairly, while ensuring that data with high real-time requirements can be transmitted in a timely manner.

[0050] Although the present invention has been described above, the present invention is not limited to the above-mentioned specific embodiments. The above-mentioned specific embodiments are merely illustrative and not restrictive. Under the guidance of the present invention, ordinary technicians in this field can make many modifications without departing from the purpose of the present invention, which are all within the protection of the present invention.

Claims

1. A CAN / CAN FD to TSN protocol converter based on FPGA, characterized in that: include: 1) CAN / CAN FD interface module, which is used to physically connect to the CAN / CAN FD bus, parse the messages on the CAN / CAN FD bus and extract valid information, and also has electrical isolation function; 2) TSN interface module, which is used to connect to the time-sensitive network, follow the TSN network communication protocol to send and receive data, and support TSN standard functions; 3) A protocol conversion processing unit, which is used to implement the conversion logic between the CAN / CAN FD protocol and the TSN protocol, convert the CAN / CAN FD message into the TSN frame format, and convert the TSN frame into the CAN / CAN FD message format.

2. The protocol converter according to claim 1, characterized in that: When parsing a message, the CAN / CAN FD interface module performs a detailed analysis on the frame format, bit timing and bit stream coding of the message, and extracts arbitration field ID information, control field data length code and data field data.

3. The protocol converter according to claim 1, characterized in that: The TSN standard functions supported by the TSN interface module include time synchronization and traffic shaping.

4. The protocol converter according to claim 1, characterized in that: It also includes a clock synchronization unit, which uses the IEEE1588v2 protocol to achieve clock synchronization between the CAN / CAN FD network and the TSN network, and adds timestamp information to the data frame; the clock synchronization unit uses a clock filtering algorithm during the synchronization process to reduce clock jitter and deviation, thereby improving synchronization accuracy.

5. The protocol conversion method of the FPGA-based CAN / CAN FD to TSN protocol converter according to any one of claims 1 to 4, characterized in that: During the conversion process from CAN / CAN FD to TSN, the protocol conversion processing unit forms frames according to the TSN protocol frame format requirements, maps relevant information in the CAN / CAN FD message to the corresponding field of the TSN frame, adds timestamp information, and performs TSN specific processing before sending the TSN frame through the TSN interface module; During the conversion process from TSN to CAN / CAN FD, the protocol conversion processing unit parses TSN frame information, converts it into CAN / CAN FD message format according to mapping rules, performs CRC check, and schedules transmission according to bus load conditions.

6. The protocol conversion method according to claim 5, characterized in that: It also includes flow control and scheduling algorithms to control and schedule data traffic between CAN / CAN FD and TSN, and allocate bandwidth and transmission time windows based on network load and data priority.

7. The protocol conversion method according to claim 6, characterized in that: The flow control and scheduling algorithm adopts a token bucket algorithm to control the flow on the CAN / CAN FD bus, adopts a priority queue mechanism for scheduling in the TSN network, and adopts a weighted fair queuing or earliest deadline priority algorithm inside the queue.

8. The application of the FPGA-based CAN / CAN FD to TSN protocol converter according to any one of claims 1 to 4, characterized in that: It is used in industrial automation systems, smart factories, automobile manufacturing, and rail transportation to achieve interconnection between CAN / CAN FD devices and TSN networks.

9. The use according to claim 8, characterized in that: On industrial automation production lines, sensors and actuators that use CAN / CANFD bus communication will be connected to the TSN network to achieve real-time, accurate transmission and precise control of production data.

10. The use according to claim 8, characterized in that: In the field of automobile manufacturing, effective connection between the in-vehicle CAN / CAN FD network and the external TSN network is achieved to improve the intelligence and safety of the vehicle.