Abstract
FlexRay has been extensively applied to safety-critical systems, such as powertrain, chassis, and X-by-wire system in vehicles. Its transmission reliability considerably influences vehicle safety. In this study, frame coding and media access control in the FlexRay protocol are analyzed, and calculation equations are deduced for the length of time slot and coded frame of FlexRay. Redundant transmission of FlexRay static frame is introduced to solve the transmission failure caused by the bit error in the physical layer, and the transmission reliability of a static segment is defined for the mechanism. Considering the demands on transmission reliability and network schedulability, the configuration of FlexRay parameters, including communication cycle, time slot allocation, and segment length, is formulated as a generalized optimization problem with constraints on predefined transmission reliability and response time of messages. A Reliability-Based Parameter Optimization algorithm and its sub-algorithms, Response Time of Dynamic Segment and Slot Allocation for the Predefined Reliability, are presented to approximately solve the optimization model. Experiment results validate the proposed method, which can efficiently improve the transmission reliability and guarantee the real-time performance of the FlexRay network.
Introduction
FlexRay bus is the next-generation automotive bus standard. It is extensively used in powertrain, chassis, and X-by-wire system in vehicles given its advantages in bandwidth, fault tolerance, and certainty. 1 These typical safety-critical systems make stringent requirements for the communication reliability of a FlexRay network. However, in addition to communication hardware, communication reliability for the FlexRay network is greatly affected by several protocol parameters that must be selected in the network design stage. A method that can provide system performance optimization and guarantee network communication reliability is required to reduce the design complexity of these parameters.2–4
Existing studies of the reliability of the FlexRay network are mainly concerned on three aspects, namely, the network’s real-time performance, parameter configuration, and reliable transmission. The time analysis and scheduling strategy of a message are the focus of research in terms of the real-time performance of the network. Tanasa et al. 5 proposed an analytical framework for the probabilistic timing analysis of an event-triggered dynamic segment (DS) of the FlexRay communication protocol. Gu et al. 6 considered a slot multiplexing mechanism in timing analysis and proposed a method for calculating the worst-case response time of a message under any bus loads. Kukkala et al. 7 proposed a novel scheduling framework that can handle jitter-affected, time-triggered, and high-priority event-triggered messages to satisfy the timing constraints in message delivery. Darbandi et al. 8 divided the message scheduling problem into message and task scheduling, and optimized task scheduling in accordance with the allocated time window and constraints. Dvorak and Hanzlek 9 decomposed the scheduling problem into the sub-problems of an electronic control unit (ECU)-to-channel assignment, and an algorithm was proposed to create a feasible schedule for channels in independent and fault-tolerant modes. Tanasa et al. 10 proposed a scheduling framework for generating fault-tolerant messages on static message segments and formulated the optimization problem into the constraint logic programming to minimize the number of message retransmissions. But they did not consider the influence on the transmission of dynamic message.
Frame packing and the optimal FlexRay parameters have still been the focus of many researchers for parameter configuration. Li et al. 11 proposed a design approach of the FlexRay parameters, which can satisfy the application requirements of a hybrid transmission of static and dynamic data in the same network. Zhang et al. 12 proposed a kind of heuristic scheduling algorithm and optimized the scheme to obtain the optimal frame identifier (FID) that can efficiently reduce the response time of the worst case of the message. Zhao et al. 13 used a two-dimensional (2D) bin-packing technique to maximize the bandwidth utilization in the static segment (SS) and proposed a fast heuristic and an integer linear programming approach. Wang et al. 14 formulated FlexRay frame packing problem into a generalized integer linear programming problem; a frame-packing algorithm based on transmission reliability was proposed to optimize signal combinations and static slot allocations. Gong and Chen 15 presented an automatic model coefficient matrix-generating algorithm and a phase-reserving algorithm to assign a frame identifier and a phase for each message. However, these approaches did not fully consider the transmission failure of FlexRay messages. Thus, the network reliability could not be guaranteed.
Most studies have concentrated on transmission fault detection, multi-channel redundancy, and message retransmission in terms of the reliable transmission of FlexRay. Tolentino et al. 16 presented an implementation method for an error detection/correction code for corrupted transmitted bits to be detected and corrected satisfactorily. Jovic et al. 17 proposed a solution for testing the FlexRay bus communication, which can detect the errors in processing FlexRay information transmission among multiple ECUs. Do Souto et al. 18 presented an approach to evaluating the reliability of FlexRay and time-division multiple access (TDMA) buses, such as reliable broadcast (RB). Chen and Leu 19 proposed a two-level redundancy approach for a safety-critical FlexRay bus, which can use backup nodes, mirror tasks, and task migration to maintain a system operation when an ECU fails. Lee et al. 20 proposed a new fast reliability scheduling algorithm that reduced the probability of a transient fault in a clock cycle by retransmitting a message to ensure system reliability. Peng et al. 21 proposed a message retransmission scheduling strategy for an automobile X-by-wire system. It improved the bus bandwidth utilization and the success rate of message scheduling and minimized transmission delay. Liu et al. 22 presented a detailed prompt retransmission mechanism by acknowledging the recovery of transient errors in safety-critical, time-triggered messages. Previous methods can slightly improve the reliability of a FlexRay system. However, transmission fault detection and multi-channel redundancy are complicated and are difficult to implement in real ECUs. Existing retransmission mechanisms consider neither the optimal configuration of network parameters nor the impact on the network’s real-time performance. Therefore, the mechanism’s ability to improve network reliability is limited.
To address the problems in previous works, this study analyzes the reliability of FlexRay SS under redundant transmission and proposes an optimization design model of FlexRay network parameters. An approximate algorithm RBPO (Reliability-Based Parameter Optimization) and its sub-algorithms are presented to design the network parameters. The remainder of this article is organized as follows. First, the frame encoding, media access control, and time slot in the FlexRay communication protocol are analyzed, and the calculation of related network parameters is presented. Second, the message parameters and the reliability of the FlexRay SS are modeled for the redundant transmission of a message. Third, an optimal model for the FlexRay parameter optimization design is proposed. Fourth, the RBPO algorithm and its sub-algorithms RTDS (Response Time of Dynamic Segment) and SAPR (Slot Allocation for the Predefined Reliability) are described based on the previous optimal model, respectively. Fifth, the experimental results are analyzed and discussed. Finally, the conclusion is provided.
FlexRay communication protocol
Frame and coding
FlexRay messages include static and dynamic frames. Each frame is composed of a header, a payload segment, and a tail. The header is 5 bytes, the payload segment includes 0–254 bytes, and the tail consists of 3 bytes of frame cyclic redundancy check (CRC). The FlexRay frames must be encoded in the transmission. Figures 1 and 2 illustrate that several coding sequences, namely, transmission start sequence (TSS), frame start sequence (FSS), byte start sequence (BSS), and frame end sequences (FES), are added to the original frames. In a DS, the FES is followed by a dynamic trailing sequence (DTS), which is used for back-filling the time until the next minislot. In Figures 1 and 2, the red and blue blocks represent logical high bits (“1”) and logical low bits (“0”), respectively. 23

Static frame encoding.

Dynamic frame encoding.
where
Media access control
The FlexRay bus transmits messages through a communication cycle loop. A communication cycle is defined through four timing hierarchy levels, namely, the communication cycle, arbitration grid, macrotick, and microtick levels (Figure 3). Each communication cycle contains SS, DS, symbol windows (SW), and network idle time (NIT). Several static slots with identical duration constitute DS within the SS. A single symbol can be transmitted on the network within the SW. The NIT serves as a phase during which the node calculates and applies clock correction terms. The communication cycle can be obtained by
where

Timing hierarchy within the communication cycle.
Static and dynamic slot
Assume that n static messages and m dynamic messages are included in the FlexRay network. Moreover,
where gdbit is the time of 1 bit. For the DS, the size of the dynamic slot,
where gdMinislot is the length of one minislot.
FlexRay message and transmission reliability
Parameters of FlexRay message
In general, periodic and safety-critical messages are put into the SS for transmission, whereas aperiodic messages are transmitted in the DS. In this study, slightly different parameters are proposed for the static and dynamic messages considering the various demands of transmission reliability. Let the message set in the SS as
Parameter designation.
Transmission reliability of SS
FlexRay protocol consists of the physical, data link, and application layers. Different reliabilities are demanded by various layers. In this study, only the transmission failure of the static messages caused by a bit error in the physical layer is addressed. To ensure that static messages are transmitted reliably, additional slots must be allocated to several messages for redundant transmission, that is,
Bit error is assumed to exist in the process of message transmission.
24
Let
where
If T denotes the communication cycle of the FlexRay, then, for the message
where
For a given time interval
For example, four static messages, namely,
Reliability of different static slot combinations.

Messages transmission of different slot allocations: (a) k1 = 2, k2 = 1, k3 = 1, and k4 = 1; (b) k1 = 1, k2 = 2, k3 = 1, and k4 = 1; (c) k1 = 1, k2 = 1, k3 = 2, and k4 = 1; and (d) k1 = 1, k2 = 1, k3 = 1, and k4 = 2.
Reliability-aware network parameter design
Optimization design model
The FlexRay network parameters include communication cycle T, SS length
Assuming that the static message set is
Object
such that
where
For simplicity, let
For illustration, in the calculation process in this study, let
Approximate algorithm RBPO
According to the abovementioned model, the algorithm RBPO is proposed to get approximately optimal solution. The pseudocode of the algorithm is presented in Table 3.
RBPO algorithm.
RBPO: Reliability-Based Parameter Optimization.
First,
The returned parameters
Sub-algorithms RTDS and SAPR
RTDS sub-algorithm
RTDS algorithm.
RTDS: Response Time of Dynamic Segment.
First, the upper limit of the DS length,
SAPR sub-algorithm
The pseudocode of the SAPR algorithm is presented in Table 5. For equation (9a),
SAPR algorithm.
SAPR: Slot Allocation for the Predefined Reliability.
To ensure that each message can be transmitted, initial
Experiments and analysis
Several experiments are performed on an experimental system demonstrated in Figure 5(a) to verify the proposed method in this study. This system consists of a hardware platform and a supervisory program on a PC. On the hardware platform, three FlexRay nodes, namely,

Experiment system: (a) hardware platform and (b) supervisory program.
Experimental equipment.
The message set, which comes from a real FlexRay network, in all experiments is listed in Table 7. Assume that the predefined reliability
Messages in the experiments.
RBPO results.
RBPO: Reliability-Based Parameter Optimization.
The following experiments are conducted to verify whether the aforementioned parameters from the RBPO algorithm are optimal. The experiment cannot begin until the FlexRay parameters have been configured into all nodes and the supervisory program in the experimental system.
Comparison of different slot allocations and
For the messages in Table 7, 11 groups of slot combinations are selected in this experiment and are listed in Table 9. Four groups are selected for T = 1 ms, whereas seven groups are selected for T = 2 ms. For easy comparison, the results from RBPO in Table 8 are also listed in Table 9. The
The groups of parameters.


In Figures 6 and 7, the values of
Comparison of different slot allocation methods
The methods presented in Li et al.
25
and Tanasa et al.
26
are used to allocate the static slot for the six static messages in Table 7 and further verify the RBPO algorithm. For T = 1 ms and Nst = 8, the allocation solution of the static slot of Li et al.
25
is

Figure 9 exhibits the number of static slots calculated using RBPO, the H-1 algorithm in Li et al. 25 for the different message sets. The number of static slots increases with the number of static messages to satisfy the requirement on the reliability and real-time capability of the network. However, the number of static slots is less in RBPO than in H-1, thereby indicating that RBPO can satisfactorily utilize a bandwidth. Figure 10 displays the execution time of RBPO, H-1 algorithm in Li et al., 25 and Method in Tanasa et al. 26 for the different message sets. The execution time of H-1 increases rapidly with the number of static messages. However, the execution time of RBPO rises steadily and is relatively less than the execution time.

Number of static slots for different message sets.

Comparison of execution time.
Conclusion
FlexRay has special advantages over traditional vehicular buses, such as CAN (controller area network) and LIN (local interconnection network) in terms of communication speed and transmission determinism. FlexRay is considered the next-generation automotive bus standard and has been applied to real-time and safety-critical systems in vehicles. These systems have stringent requirements for network transmission reliability. Therefore, designing FlexRay must establish a systematic method in the application layer that can ensure a reliable message transmission among ECUs. Although related advancements are observed in the network’s real-time performance, parameter configuration, and reliable transmission, existing methods cannot be used in industrial applications given their lack of comprehensive consideration.
In this study, a model based on the redundant transmission and the probability of bit errors for the static frame is presented to depict the transmission reliability of FlexRay. The design of FlexRay network parameters is formulated as an optimization problem with constraints that consider the network’s transmission reliability and the message’s real-time performance. The RBPO algorithm and its sub-algorithms, namely, RTDS and SAPR, are proposed to approximately solve the network parameter optimization problems. The experimental results indicate that the method proposed in this study can not only satisfy the real-time requirements of messages but also ensure the transmission reliability of FlexRay SS. This result is confirmed by the values of transmission reliability and the response time of the dynamic message for a given message set. The response time of the dynamic message is less than 49,000 µs, whereas the transmission reliability is up to 0.9999, which has increased by over 5%. Furthermore, the total number of allocated static slots is clearly less than those of existing methods. This finding undoubtedly indicates that the proposed method can make better use of the network bandwidth, which is beneficial for practical application in vehicles. In the future, the reliability of a two-channel FlexRay network will be the subject of research and development.
Footnotes
Appendix 1
Handling Editor: ZW Zhong
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was supported by the National Natural Science Foundation of Anhui (1708085MF157), National Natural Science Foundation of China (61202096), and STSP of Anhui (15czz02039). The authors are also grateful for the sponsorship from projects of Jianghuai Auto and SOTECH Auto-Electronic (W2016JSKF0394, W2016JSKF0454, W2016JSKF0554, and W2018JSKF0308).
