# BSM-Data Reuse Model Based on In-Vehicular Computing
## 5 Study Case: In-Vehicle BSM Data Services Platform
### Data Preprocessing
#### 5.2.1 Lossless Compression for BSM  
Most of the data elements in this dataset are collected at a frequency of 10 Hz. This frequency results in a number of the tables being very large, restricting the tables' ease of use. Looking to the \"No. of Rows\" column in Table 5, we can easily notice the huge amount of just a One Day generated data. Using the aforementioned dataset, we could observe that: most of the time, the majority of vehicles continue straight ahead at the same speed. As a result, if we take into account that a basic safety message is broadcast at 10 Hz, Most of the data elements will maintain their values during normal traffic flow. As shown in Table 6. If we consider a time period of two seconds with 20 messages, the only susceptible change for most of the two-second fragment of data is the position (longitude and latitude). Most often, no useful data are provided by messages 2 through 19. Despite that, it is crucial when a significant modification occurs in the data that the proper application receives it with minimum delay. Effective opportunities for a significant reduction in storage and bandwidth requirements are evident in Table 6, yet any data element may also have individual compression techniques applied to it. In our work, we perform an individual compression on speed data element. Data compression methods, like run-length encoding, has exhibited its importance in such cases. However, traditional database systems (i.e., row-oriented databases) do not widely apply data compression techniques. On the contrary, column-oriented databases provide more opportunities for data compression as the values of the same attribute are stored consecutively [28]. Using columnar database like MonetDB, we found that RLE is an attractive approach for compressing data in a column-store. Run-length encoding compresses continuous duplicate values in a column to a compact singular representation. For example, RLE compresses k continuous duplicates whose value is t into one tuple (t; k), i.e., (value, count) pair. RLE is widely used in column-oriented databases, where attributes are consecutively stored and runs of the same value are common. \begin{table}
\begin{tabular}{p{113.8 pt} p{113.8 pt} p{113.8 pt} p{113.8 pt} p{113.8 pt}} \hline \hline
**Field Name** & **No. of Unique Values** & **Min. Value** & **Max. Value** & **Sample Values** & **No. of Rows** \\ \hline BSMID & 16,095,310 & & 1,738,218,409, & 1,801,843,621, & 16,095,310 \\  & & & 1,801,843,622, 1,920,703,252 & \\ \hline DSRCMsgld & 1 & & 2 & \\ \hline MsgCount & 128 & & 108, 42, 0, 1, 2 & \\ \hline TemporaryID & 11,587 & & \(-1,275,975,333,\) & 738,663,065, & \\  & & & \(-1,157,424,605,\) & 738,663,065, & \\  & & & \(-1,157,424,605\) & 738,663,065, & \\ \hline D5 econds & 2194 & 0 & 65,535 & 0, 100, 200, 400, 59,900 & \\ \hline Latitude & 456,480 & 0 & 900,000,001 & 423,091,009, 423,051,742, 423,072,124, & 423,051,743 & \\ \hline Longitude & 640,092 & \(-840,921,953\) & 180,000,001 & \(-836,928,071,\) & \(-836,925,983,\) \\  & & & \(-836,847,010,\) & \(-836,925,983\) & \\ \hline Elevation & 1775 & \(-12,773\) & 7315 & 2510, 2436, 2401, 2436, 2511 & \\ \hline Positional Accuracy & 5 & & & 0 xE4 FFFF, 0 xFFFF, 0 xE5 FFFF, 0 xE5 FFFF, 0 xFE000000 & \\ \hline Transmission State & 5 & & & 0,1,2,3,7 & \\ \hline Speed & 512 & 0 & 511 & 398, 177, 0, 381, 471 & \\ \hline Heading & 28,805 & \(-34\) & 28,805 & 13,870, 28,708, 28,704, 5586 & \\ \hline SteeringWheelAngle & 254 & 0 & 255 & 78, 144, 41, 47, 67 & \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Summary Measures for Data Elements of the (.CSV) BSM File. To apply run-length encoding to a column, the column itself should have the following features: 1. the column is sorted. 2. the fanout of this column is high. The first requirement is easy to understand. If the column is not sorted, then elements with the same values are not grouped together. The second requirement is utilized to measure the average number of duplicates.