| The car is a real-time system,and the real-time feature of the in-vehicle network is a safety-critical issue.Due to various factors,The traditional vehicle network is generally composed of multiple real-time buses,such as CAN,Flex Ray,etc.,and the buses are connected through a central gateway.With the advent of autonomous driving in recent years,cars need to process a large number of audio and video streams to make decisions.Traditional in-vehicle networks are biased towards real-time control and are relatively weak in terms of bandwidth.It is difficult to meet the new requirements of autonomous driving in terms of delay,bandwidth,and real-time performance at the same time.Ethernet gradually entered the field of vision of autom obile manufacturers with its advantages of openness,high bandwidth and low cost.In order to solve the real-time problem of Ethernet,IEEE has formulated the relevant standards of TSN Ethernet.With the application of TSN Ethernet in in-vehicle networks,the next generation of in-vehicle networks is developing towards a heterogeneous in-vehicle network architecture with TSN as the backbone and various traditional buses as branches.The gateway has a great influence on the real-time performance of message frames that need to cross the bus.Under the new TSN-CAN heterogeneous network,the CAN frame forwarding scheduling strategy in the traditional CAN-CAN gateway may not be suitable for the new network architecture.Under the TSN-CAN heterogeneous network,it has important practical significance to research the impact of CAN frame scheduling strategies on the cross-gateway message frame.This article first introduces TSN and CAN related foundations,WCRT theory and gateway design in traditional CAN gateway cluster system,and then proposes the CAN frame scheduling strategy in the gateway based on WCRT theory under TSN-CAN heterogeneous network.In the central gateway of the traditional CAN-CAN network,automobile manufacturers usually adopt the scheduling strategy of "first in first out" and "CAN ID priority" for the message frames across the gateway.In order to evaluate the pros and cons of these three similar scheduling strategies,this paper also designed a TSN-CAN heterogeneous network construction plan,using some development boards and discrete modules to build a TSN-CAN heterogeneous network.Analyzing the data collected in the experiment,and Based on various indicators of average response time,throughput and minimum remaining interval,the scheduling strategy based on WCRT theory is better than the "first in first out" and "CAN ID priority" scheduling strategies.In addition,in order to simplify engineering calculations and avoid the use of complex iterative convergence calculation methods of WCRT theory in the traditional CAN gateway cluster system,this paper also proposes and implements a scenario simulation algorithm for calculating the WCRT of cross-gateway message frames for the scheduling algorithm in the gateway.At the same time,in terms of experiments,this article creatively proposes and implements a timer synchronization measurement method to measure the actual end-to-end response time of cross-gateway message frames.The measurement method is relatively low-cost,and the network itself can be used to complete the measurement without additional instrument assistance.Moreover,the measurement accuracy of the measurement method is the timing frequency of the hardware timer.If the measurement duration is not pursued,the hardware timer frequency can be increased,so that the accuracy of the entire end-to-end measurement will be very high.Because the hardware interrupt mechanism is used,the CPU can deal with it in time,so the measurement error will not be large. |