Locomotive Tbox software design method based on TSN protocol
By introducing the TSN network protocol into the locomotive Tbox controller, the problem of packet delay or packet loss under high load conditions is solved, real-time and consistency of data upload is achieved, and the data acquisition and transmission capabilities of the Tbox controller are improved.
Patent Information
- Application Number
- CN202411960069.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-06-24
AI Technical Summary
Existing locomotive Tbox controllers may cause delays in packet processing or packet loss under high load conditions, which cannot meet the real-time and consistency requirements of data upload.
In the traditional Tbox controller, the TSN network protocol is introduced, and the time synchronization and frame preemption characteristics of the TSN protocol are used to redefine the priority of TRDP packets, and the priority transmission of high-priority packets is performed at the data link layer.
Through clock synchronization and frame preemption characteristics, bus blocking under high load conditions is avoided, real-time and reliability of transmission of important messages are improved, and the stability and integrity of Tbox uploaded data is ensured.
Smart Images

Figure CN120201109A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of locomotive Tbox software design methods based on the TSN protocol, and in particular to a locomotive Tbox software design method based on the TSN protocol. Background Art
[0002] With the upgrading of digital and intelligent requirements in the rail transit industry, the data bandwidth is increasing day by day. As the only device for collecting important data and uploading it externally, the locomotive Tbox needs to meet the real-time and consistency requirements of data collection, that is, to ensure the timely and effective recording and uploading of data. At present, MVB (Multifunction Vehicle Bus) is widely used in the train network system of urban rail transit, and its real-time performance and reliability can meet the basic needs of current train applications. However, due to the low bandwidth of MVB, it cannot meet the needs of passengers for information services (such as high-definition video, real-time transmission, etc.). TSN (Time-Sensitive Network) technology is optimized on the basis of Ethernet technology, which can realize the time synchronization of key devices in the train network system and perform traffic planning and shaping to ensure the determinacy of data traffic and meet the real-time and consistency requirements of data under high bandwidth and high load. TSN technology can effectively increase the data bandwidth, reduce the delay, and ensure the transmission determinacy of key data streams. This proposal integrates the real-time related sub-protocols in the TSN protocol into the Tbox controller software design, and solves the real-time problem of data collection under big data by reclassifying the existing data. Summary of the Invention
[0003] In order to overcome the problem that the Tbox controller on a locomotive usually uses the TRDP protocol to collect data on the locomotive Ethernet bus, and after processing the data, it uploads it to the server side through the 4G network. In the data collection system based on the TRDP protocol, since part of the TRDP protocol is implemented by pure software, the real-time performance of the protocol completely depends on the hardware clocks or processor performance of each network node device. Therefore, the communication message cycles and phase starts of different ComIDs are different. When the bus bandwidth load is high, packet processing delays or even packet loss may occur due to communication cycle misalignment, resulting in delays or packet loss in the data uploaded by the Tbox. The present invention provides a method of adding the TSN network protocol to a traditional Tbox controller, which can use the time synchronization and frame preemption and other characteristics in the TSN protocol to synchronize the clocks of network communication devices. Based on unified clock management, the data priorities of TRDP messages with different importance levels can be redefined, and high-priority messages can be preferentially sent at the data link layer, which can avoid the delay and packet loss of important messages caused by bus congestion under high load, resulting in unstable data cycles and data loss in the data uploaded by the Tbox.
[0004] The technical solution adopted by the present invention to solve its technical problems is: a locomotive Tbox software design method based on the TSN protocol, including an application layer, a communication intermediate layer, a system service layer, and a hardware driver layer in the Tbox controller; the application layer includes data storage, data acquisition, and data transmission; the communication intermediate layer includes the TRDP protocol, the MQTT protocol, and TSN data parsing; the system service layer includes the TCP / UDP protocol stack and the TSN protocol cluster; the hardware driver layer includes Ethernet hardware device drivers, main processor drivers, and other hardware device drivers external to the Tbox controller; among them, data is acquired through the application layer, the acquired data is stored, and data is transmitted. The data is converted into the TSN protocol format by the TSN data parsing module in the communication intermediate layer, the TRDP protocol data is reclassified, and the MQTT protocol is used to send it to the system service layer; the system service layer classifies and matches the data through the TCP / UDP protocol stack and the TSN protocol cluster, and then sends the control data to the Ethernet hardware device driver, the main processor driver, and other hardware device drivers external to the Tbox controller.
[0005] According to another embodiment of the present invention, it further includes that the communication middleware layer includes the TRDP protocol for data acquisition from traditional Ethernet, the MQTT protocol used by the Tbox to send data based on the 4G network, and the TSN data parsing module for converting the TRDP to the TSN protocol format.
[0006] According to another embodiment of the present invention, it further includes that the TRDP protocol data is reclassified into four types of data, namely: type I event discardable data, type II event non-discardable data, type III periodic discardable data, and type IV periodic non-discardable data.
[0007] According to another embodiment of the present invention, it further includes that the event-type discardable data has a high requirement for real-time performance, but the data importance is general. Therefore, only time-sensitive traffic configuration is made for this type of data, and a higher priority is given to ensure data retransmission; the event-type non-discardable data has both a high requirement for real-time performance and needs to ensure data integrity and consistency. This type of data needs to be configured as time-sensitive traffic and also configured for redundant transmission; the periodic discardable data has low requirements for both real-time performance and integrity, and is configured as a common data type for transmission; the periodic non-discardable data has low real-time performance requirements and high integrity requirements, and is configured as redundant transmission data.
[0008] According to another embodiment of the present invention, it further includes that the sub-protocols in the TSN protocol cluster classify different types of data into time-sensitive traffic data and ordinary data. According to another embodiment of the present invention, it further includes that after the time-sensitive traffic data is represented by a specific algorithm and priority, it can complete the reception and transmission of data within a specified time period; the data redundancy transmission mechanism ensures the redundant transmission of data, and for important data, the function of recovering data through another path after one path is lost can be achieved.
[0009] According to another embodiment of the present invention, it further includes that the system service layer uses the Linux operating system, and at the same time includes the Ethernet basic protocol required for Tbox data collection, namely the TCP / UDP protocol stack in the network layer, and the TSN protocol located in the data link layer for expanding the ability of the Tbox controller to access the TSN network.
[0010] The beneficial effects of the present invention are as follows: The method adds the TSN network protocol to the traditional Tbox controller and utilizes the characteristics of time synchronization and frame preemption in the TSN protocol to synchronize the clocks of network communication devices. Based on unified clock management, the data priorities of TRDP messages with different importance levels can be redefined, and high-priority messages can be preferentially sent at the data link layer, which can avoid the delay and packet loss of important messages caused by bus congestion under high load, resulting in unstable data cycles and data loss in the data uploaded by the Tbox. In particular: This method adds the TSN network protocol to the traditional locomotive Tbox product, enabling the locomotive Tbox product to have the ability to access the TSN network; this method improves the expansion ability of the current locomotive Tbox product and has the ability to connect the traditional TRDP network data of the locomotive to the next-generation locomotive TSN backbone network; this method uses the clock synchronization and frame preemption characteristics in the TSN network protocol to redefine the data types received by the current Tbox, which can improve the real-time performance of important data transmission and ensure the integrity of data transmission; this method can improve the data collection ability of the current locomotive Tbox controller for the traditional TRDP network bus data and ensure the real-time performance of high-priority data transmission and reception. Description of the Drawings
[0011] The present invention will be further described below with reference to the drawings and embodiments.
[0012] Figure 1 It is a block diagram of the software hierarchical architecture design combined with the TSN protocol; Figure 2 It is the definition of the TRDP data classification identifier. Detailed Embodiment
[0013] As Figure 1It is a structural schematic diagram of the present invention. A locomotive Tbox software design method based on the TSN protocol includes an application layer, a communication intermediate layer, a system service layer, and a hardware driver layer in the Tbox controller; the application layer includes data storage, data acquisition, and data transmission; the communication intermediate layer includes the TRDP protocol, the MQTT protocol, and TSN data parsing; the system service layer includes the TCP / UDP protocol stack and the TSN protocol cluster; the hardware driver layer includes an Ethernet hardware device driver, a main processor driver, and other hardware device drivers external to the Tbox controller; among them, data is acquired through the application layer, the acquired data is stored, and data is transmitted. The data is converted into the TSN protocol format by the TSN data parsing module in the communication intermediate layer for the TRDP data, the TRDP protocol data is reclassified, and the MQTT protocol is used to send it to the system service layer; the system service layer classifies and matches the data through the TCP / UDP protocol stack and the TSN protocol cluster, and then sends the control data to the Ethernet hardware device driver, the main processor driver, and other hardware device drivers external to the Tbox controller to ensure that the physical period can exert its due actual performance.
[0014] Specifically, the TSN-based locomotive Tbox software design method includes the design of a new software architecture for the locomotive Tbox product combined with the TSN protocol; a method for redefining the current Ethernet TRDP data type and reclassifying data in combination with the characteristics of the TSN protocol. The new software architecture design of the locomotive Tbox product combined with the TSN protocol adopts a layered design approach, including a hardware driver layer, a system service layer, a communication middleware layer, and an application layer. Among them, the hardware driver layer mainly implements the driver of the main CPU and peripheral hardware devices, and is located at the bottom of the software layer; the system service layer is mainly the operating system and the various services it provides, including the basic network services required for network communication, such as TCP / UDP and other network basic protocol stacks; the communication middleware layer includes all the communication protocols needed by the Tbox device, such as the TRDP protocol and the TSN protocol. Since most of the TSN protocols are solidified in the hardware chip, the TSN protocol part in the middleware layer is the analysis of the timestamp and priority part in the TSN frame, and the current Ethernet data packet analysis and packaging operations are realized through this layer; the application layer is the function implementation of various requirements of the upper layer of the Tbox device. Compared with the traditional Tbox software architecture design, this method adds the conversion function of TRDP protocol and TSN protocol data in the middleware layer, converting the data collected from the TRDP protocol into a data format that meets the requirements of the TSN protocol, thereby meeting the real-time transmission improvement of the data frame. In order to realize the data conversion between the TRDP protocol and the TSN protocol in the above communication middleware layer, it is necessary to reclassify the existing TRDP protocol data and define the priority of the data packet; this method divides the existing data from the two dimensions of real-time and importance, where real-time data is divided into periodic data and event data; importance data is divided into discardable data and non-discardable data; through the combination of the above two dimensions, each TRDP data packet can be combined into four different data identifiers according to the above two dimensions. In the protocol conversion function module in the middleware layer, the TRDP data is converted into different types of TSN protocol data by parsing the data identifier.
[0015] According to another embodiment of the present invention, the communication middleware layer further includes a TRDP protocol for data collection on a traditional Ethernet, an MQTT protocol used by Tbox to send data based on a 4G network, and a TSN data parsing module for converting TRDP into a TSN protocol format.
[0016] According to another embodiment of the present invention, further comprising: reclassifying the TRDP protocol data into four types of data types, namely: one type of event discardable data, two types of event non-discardable data, three types of periodic discardable data, and four types of periodic non-discardable data.
[0017] Specifically, the Tbox product needs to be connected to the traditional locomotive TRDP network and also forward TSN network packets. It is necessary to forward TRDP network packets to the TSN network. Since the TSN network protocol has a frame preemption algorithm based on packet priority, it is necessary to define the priority of the packets before packet forwarding. This solution reclassifies the packets according to the real-time nature and importance of the data packets. According to two dimensions, the packets can be defined as four data types.
[0018] According to another embodiment of the present invention, it further includes that the event-type discardable data has a relatively high requirement for real-time performance, but the data importance is average. Therefore, only time-sensitive traffic configuration is performed for this type of data, and a higher priority is given to ensure data reproduction and forwarding; the event-type non-discardable data has both a relatively high requirement for real-time performance and needs to ensure data integrity and consistency. This type of data needs to be configured as time-sensitive traffic and also configured for redundant transmission; the periodic discardable data has low requirements for both real-time performance and integrity, and is configured for transmission as a common data type; the periodic non-discardable data has low real-time requirements and high integrity requirements, and is configured as redundant transmission data.
[0019] According to another embodiment of the present invention, it further includes that the sub-protocols in the TSN protocol cluster classify different types of data into time-sensitive traffic data and common data According to another embodiment of the present invention, it further includes that after the time-sensitive traffic data is represented by a specific algorithm and priority, it can complete the reception and transmission of data within a specified time period; the data redundancy transmission mechanism ensures the redundant transmission of data, and for important data, the function of recovering data through another path after one path is lost can be achieved.
[0020] According to another embodiment of the present invention, it further includes that the system service layer uses the Linux operating system, and at the same time includes the Ethernet basic protocol required for the Tbox to collect data, that is, the TCP / UDP protocol stack in the network layer, and the TSN protocol located in the data link layer that extends the ability of the Tbox controller to access the TSN network.
[0021] Specifically, the present invention incorporates the TSN protocol into the Tbox controller, enabling the Tbox controller to not only have the ability to collect data from the traditional locomotive TRDP network protocol but also have the ability to collect data from the TSN network protocol, expanding the application scenarios of the Tbox controller; after the TSN protocol is incorporated into the Tbox controller, the real-time performance and reliability of data collection by the Tbox controller are improved; a method for converting TRDP into the TSN data type; by classifying the TRDP protocol data, the data type is divided from two dimensions of real-time performance and importance, corresponding to the time-sensitive traffic and ordinary traffic in the TSN protocol cluster and two types of data redundancy sending and ordinary sending, and the TRDP data is converted into TSN data for sending.
[0022] The above description is illustrative rather than restrictive to the present invention. Those of ordinary skill in the art understand that many modifications, variations, or equivalents can be made without departing from the spirit and scope defined by the appended claims, and all of them will fall within the protection scope of the present invention.
Claims
1. A locomotive Tbox software design method based on TSN protocol, characterized in that: It includes the application layer, communication middle layer, system service layer and hardware driver layer in the Tbox controller; the application layer includes data storage, data collection and data transmission; the communication middle layer includes TRDP protocol, MQTT protocol and TSN data analysis; the system service layer includes TCP / UDP protocol stack and TSN protocol cluster; the hardware driver layer includes Ethernet hardware device driver, main processor driver and other hardware device drivers outside the Tbox controller; wherein, data collection is performed through the application layer, the collected data is stored, and the data is sent, and the data is converted into TSN protocol format by the TSN data analysis module of the communication middle layer, the TRDP protocol data is reclassified, and the MQTT protocol is sent to the system service layer; the system service layer classifies and matches the data through the TCP / UDP protocol stack and TSN protocol cluster, and then sends the control data to the Ethernet hardware device driver, the main processor driver and other hardware device drivers outside the Tbox controller.
2. The locomotive Tbox software design method based on the TSN protocol according to claim 1 is characterized in that: The communication middleware layer includes the TRDP protocol for data collection on traditional Ethernet, the MQTT protocol used by Tbox to send data based on the 4G network, and a TSN data parsing module that converts TRDP into the TSN protocol format.
3. The locomotive Tbox software design method based on the TSN protocol according to claim 1 is characterized in that: The TRDP protocol data is reclassified into four data types, namely: one type of event discardable data, two type of event non-discardable data, three type of periodic discardable data, and four type of periodic non-discardable data.
4. The locomotive Tbox software design method based on the TSN protocol according to claim 3 is characterized in that: The event-type discardable data has high requirements for real-time performance, but the data importance is general. Therefore, only time-sensitive traffic is configured for this type of data, and a higher priority is given to ensure data forwarding. Event-type non-discardable data has high requirements for real-time performance and must ensure data integrity and consistency. This type of data must be configured as time-sensitive traffic and redundant transmission. Periodic discardable data has low requirements for real-time performance and integrity, and is configured as ordinary data type transmission. Periodic non-discardable data has low requirements for real-time performance and high requirements for integrity, and is configured as redundant transmission data.
5. The locomotive Tbox software design method based on the TSN protocol according to claim 1 is characterized in that: The sub-protocols in the TSN protocol cluster divide different types of data into time-sensitive traffic data and ordinary data.
6. The locomotive Tbox software design method based on the TSN protocol according to claim 5 is characterized in that: After the time-sensitive traffic data is represented by a specific algorithm and priority, the reception and transmission of the data can be completed within the specified time period; the data redundant transmission mechanism ensures the redundant transmission of data, and for important data, the function of restoring data through another path after one path is lost can be achieved.
7. The locomotive Tbox software design method based on the TSN protocol according to claim 1 is characterized in that: The system service layer uses the Linux operating system, and also includes the Ethernet basic protocol needed for Tbox to collect data, namely the TCP / UDP protocol stack in the network layer and the TSN protocol at the data link layer that expands the ability of the Tbox controller to access the TSN network.
Citation Information
Cited By
Communication method and communication device of TSN terminal, computing equipment and storage medium
CN121056535A