## 3 A Design of the Lightweight Autonomous Vehicle Self-Diagnosis (LAVS)
### The Multi-Protocol Integrated Gateway Module (MIGM)
#### 3.2.2 A Design of a Message Storage Sub-Module (MSS)  
The MSS manages the messages received from the MIS. Figure 4 shows three functions (address table, message queue, and data collection table) in which the MSS manages messages as follows.  
First, the header information (destination address, source address, etc.) is stored in the address table. When sensor messages are converted in the MCS, the address table helps them be converted rapidly and is used to detect errors. Figure 6 shows the address table in detail.  
Figure 5: The hardware structure of the MIGM.  
Second, the message queue consists of an input message queue and an output message queue. The input message queue is one that stores the messages transferred from the MIS. The MSS transfers the messages to the MCS according to message order within the queue. The order of messages within the input message queue is decided by the priority of messages. The output message queue is one storing the messages transferred from the MCS and the MSS transfers the messages of the output message queue to the MIS according to priority.  
Third, the payloads of the received sensor messages are stored in the data collection table and then they are transferred to the IN-VDM. If the IN-VDM completes the self-diagnosis of an autonomous vehicle, the MSS stores the diagnosed result in the data collection table. The payloads and vehicle diagnosis result collected in the same hour are transferred to the MCS and the MCS converts the collected payloads and vehicle diagnosis result to a WAVE message. The WAVE messages are transferred to the neighboring RSU and the Cloud through IoV. Table 1 shows the example of the data collection table.  
The payloads (or data) of Table 1 are collected within 0.5 s and the diagnosed result by the In-VDM is made based on the payloads. The payloads and the diagnosed result are transferred to the MCS and are converted to WAVE messages. The generation process of a WAVE message is shown in Section 3.2.3 in detail.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Time** & **Attribute** & **Data (or Payload)** \\ \hline
2018.11.09 & \\
17:00:25:012 & Engine voltage & 12 V \\ \hline
2018.11.09 & \\
17:00:25:054 & Tire Pressure & 30 psi \\ \hline
2018.11.09 & \\
17:00:25:021 & Tire temp & 50 \({}^{\circ}\)C \\ \hline
2018.11.09 & \\
17:00:25:008 & Front light & 9.254 lx \\ \hline \(\ldots\) & \(\ldots\) & \(\ldots\) \\ \hline
2018.11.09 & \\
17:00:26:078 & Diagnosis result & 75\% \\ \hline \hline \end{tabular}
\end{table}
Table 1: Example of the data collection table.  
Figure 6: The conversion of a MOST message to CAN messages.  
rate is decided according to the size of a message. The reserved of the OFDM signal field represents an address that receives messages. The LENGTH of the OFDM signal field represents the length of a message. The Parity of the OFDM signal field is used to examine errors and the Tail of the OFDM Signal field means the end of the OFDM signal field. The DATA field consists of a service field, a PLCP service data unit(PSDU) field meaning data, a tail field meaning message end, and pad bits examining the error of the DATA field [24]. After the payloads and diagnosed result measured in the same time are converted to the PSDU of the WAVE message, the WMGS transfers the converted message to the neighboring RSU or the Cloud.