<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Database support for automotive analysis ?</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Dennis Marten</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Holger Meyer</string-name>
          <email>g@informatik.uni-rostock.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Andreas Heuer[</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Institute of Computer Science, Rostock University</institution>
          ,
          <addr-line>Albert-Einstein-Strasse 22, 18059 Rostock</addr-line>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Based on an analysis of typical automotive measurements data as found in ASAM MDF les, we derive requirements managing these data in a database system and create a mapping to a relational database structure. The performance of a parallel relational database solution is compared with a Python-based direct access and querying timeseries in Python and with big data frameworks such as Apache Spark in di erent scenarios. A hybrid approach using some object-relational features of PostgreSQL performs best in most cases.</p>
      </abstract>
      <kwd-group>
        <kwd>automotive data</kwd>
        <kwd>time-series data</kwd>
        <kwd>time merge</kwd>
        <kwd>relational database systems</kwd>
        <kwd>ASAM MDF</kwd>
        <kwd>les</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>In the automotive industry, due to the continuous growth of collected sensor
data, traditional hardware and software setups come to their limits. Within a
joint project with an industrial partner, we developed and evaluated database
oriented solutions to o er scalable automotive analysis.</p>
      <p>
        The basis for this project is the Measurement Data Format (MDF).
MDF is a binary le format that has been originally developed for automotive
measurement and analysis in the 1990's. It has been o cially standardized with
version 4.0 (MDF4) by the Association for Standardization of Automation and
Measuring Systems (ASAM) in 2009 and is even today the standard for storing
and reading automotive sensor data in industrial usage [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. While MDF4 les do
not have any restriction on its actual size, analyzing a set of large or even many
moderate sized les can become hardware demanding for local setups. Neglecting
possible main memory shortages on long measurements, the disk storage problem
might be worked around using network drives. Due to un ltered data
communication, this approach has shown to perform poorly even on comparatively small
amounts of data.
      </p>
      <p>
        In order to overcome these data size limitations, we started a cooperation
project with an industrial partner and examined solutions that are based on
database support with Python front ends using a conventional vertical
architecture [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. The main goal of this project was to survey a variety of database
? Copyright c 2019 for this paper by its authors. Use permitted under Creative
Commons License Attribution 4.0 International (CC BY 4.0).
systems on automotive analysis for industrial usage using a variety of di erent
settings. Hereby, two groups of systems have been taken into consideration:
{ (Parallel) relational database systems and
{ Apache Spark with either NoSQL database systems or HDFS as data sources.
Besides the factor of scalability, relational database approaches generally promise
several additional advantages, like fast selective queries via index structures,
physical and logical optimization, data security aspects, as well as easy
integration in current IT-setups. On the other hand, Apache Spark has shown to
be a promising parallelization framework for big data applications. Both groups
should have been evaluated using three given methods of frequently used basic
automotive analysis tasks, while varying between three di erent storage and
computation schemes:
1. storing data locally or on a cluster setup in order to allow analysts using the
same API for di erent purposes,
2. storing converted oating-point data or raw xed-point data with the
respective conversion rules and parameters for online conversion, and
3. pushing di erent sub-methods into the database system (arithmetic
operations and time merges, i.e. time series interpolation) in order to decrease
communication costs and the need of resource demanding local
computations.
      </p>
      <p>The three tasks of automotive analysis we evaluated can be categorized
into two groups:
{ The rst, more data intensive group, is selecting time series ("channels") of a
number of les (measurements). All channels of one measurement are
interpolated with respect to one of the time axes, so all channels ultimately share
one time axis, allowing for pointwise comparison or calculation. The
interpolated data is either visualized, manipulated (for instance using arithmetic
operations) or analyzed, e.g. nding time intervals where channel values are
in certain ranges.
{ The second group can be refered to as meta-information queries: the goal is
to nd measurements under constraints, like a concrete date of recording or
some speci c time axis information.</p>
      <p>
        Due to space limitations, we would like to refer to an extended technical report
[
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] for a more detailed presentation of the problem speci cation and a State of
the Art analysis of time series management in database systems.
      </p>
      <p>In the following section, we give a brief overview of the course of the presented
project.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Course of Project</title>
      <p>We started our investigation focusing on relational database systems, as these
seemed to be best suited for (1) the comparatively small amount of test data
Exemplary Relation
Exemplary Relation
name time[ ]</p>
      <p>A {0,1,2}
B {0.5,1.5}
values[ ]
{0.2,0.4,0.6}
{6.4,5.4}
Simplified Internal Storage Scheme</p>
      <p>row store with arrays
... A 0 1 2 0.2 0.4 0.6 ...
(around 40 GB) that was available at the start of the project and (2) the
evaluation of quite selective algorithms.</p>
      <p>After evaluating rst drafts of database schemas, we found that providing
a schema that enables systems to transparently apply compression techniques
is a key factor for our automotive scenario. Therefore, we distinguished three
di erent setups:
{ row stores,
{ column stores,
{ and row stores that allow the use of array data types (such as
objectrelational database systems).</p>
      <p>Since automotive measurement data are heavily compressible, especially in the
context of run length encoding (RLE), column stores for rst normal form (1NF)
relations or row stores with array data types (object-relational scheme) perform
best (see Figures 1 and 2 for exemplary relations in the three di erent setups).
With this di erentiation, we developed four di erent relational schemas in
order to satisfy the requirement of either storing raw data (bit varying) and
its conversion rules, or converted oating point data (double precision), while
enabling sequential data storage and therefore transparent run-length encoding.
As an example, the (ER) schema using arrays in a row store with oating point
storage is depicted in Figure 2.</p>
      <p>As requested by our industrial partner, we implemented the adjustment of
MDF data and the subsequent import into database systems in Python. For this,
we needed to evaluate di erent packages for reading MDF- les and database
communication.</p>
      <p>
        For the three automotive analysis tasks we have implemented several database
supported approaches. We took special focus on evaluating the pushdown of as
many operations as possible into database systems as we have discussed in our
recent work on SQL-based scienti c computing [
        <xref ref-type="bibr" rid="ref3 ref4 ref5 ref6">6,5,4,3</xref>
        ]. We compared pure SQL
implementations and UDF-based ones.
name
fid
t[]
      </p>
      <p>grid
file
[1,N]
stores</p>
      <p>
        [
        <xref ref-type="bibr" rid="ref1 ref1">1,1</xref>
        ]
starttime
comment
channelgroup
gid
[1,N]
stores
[
        <xref ref-type="bibr" rid="ref1 ref1">1,1</xref>
        ]
      </p>
      <p>
        v[]
timeseries
[
        <xref ref-type="bibr" rid="ref1 ref1">1,1</xref>
        ] ref. [
        <xref ref-type="bibr" rid="ref1">0,1</xref>
        ]
by
name
cid
channel_dict
[
        <xref ref-type="bibr" rid="ref1 ref1">1,1</xref>
        ]
      </p>
      <p>[1,N]
measured by
name
device
did</p>
      <p>After using RDBMSs, we evaluated Apache Spark with di erent types
of data storages including the use of CSV- and Parquet- les in HDFS and
requesting data from (parallel) RDBMSs and NoSQL-systems using (array-based)
schemas similar to the ones for row stores with array support.</p>
      <p>
        As a starting point, we reviewed di erent libraries for storing and analyzing
timeseries in Apache Spark. Here, we have found that these have not been
sufcient for automotive data [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. Therefore, new implementations based on RDDs
and DataFrames had to be developed and evaluated.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>Results and Conclusions</title>
      <p>
        We have found several noteworthy results that we can only summarize in this
short paper. A more detailed description of all the results can be found in [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ].
      </p>
      <p>As a rst conclusion, importing complete datasets of measurements into
relational database systems via Python is ine ective. As the heavily compressed
sensor data is decompressed in order to adjust its structure to the internal
representation of the respective database system, the amount of data that is
communicated is needlessly high. Solutions to this problem are either transforming
sensor data in its actual compressed form before the communication process or
fully integrating the import (if possible) into the database system as a UDF.</p>
      <p>Regarding relational database schemas, we have found that row stores
supporting array datatypes performed best. Here, he main reasons are superior
compression and faster selections as relations contain so much lesser tuples, that
even data selections via B-tree index structures become signi cantly faster. On
the other hand, row stores that have to work on strictly rst normal form
relations are unusable for these kinds of operations as relation sizes in ate rapidly.</p>
      <p>Evaluating the three aforementioned automotive methods has shown that
the pushdown of interpolation (only applicable with UDFs) and arithmetic
operations, as well as nding intervals under constraints are very e ective in this
scenario. In comparison to Python implementations on SSD drives for local
calculation or using network drives for cluster computing, all of the three methods
could experience a signi cant speed up when supported by (parallel) relational
database systems. Especially, inter-measurement queries for metainformation
performed up to nearly 500 times faster, due to the very low communication
cost and the selectivity of the problem.</p>
      <p>The most promising relational database systems we have tested are
PostgreSQL (local) and its parallel branch Postgres-XL (cluster setups). Besides
superior performance, both systems run under BSD-like licenses and support a
wide range of useful functionalities, like index structures, UDFs and array data
types with transparent run length encoding. However, due to a relatively small
amount of test data (40 GB) and fairly light-weight analysis, Postgres-XL could
not bene t from its parallel computation capabilities, ultimately leading to a
reduction of relative performance bene ts obtained by database support in
comparison to the local setup. Similarly, the initial overhead of Apache Spark has
shown to be to overwhelming for the data sizes we evaluated, making a
comparison to the relational systems unfair. Despite this, the most promising data
storage for Apache Spark has shown to be Parquet les in HDFS.</p>
      <p>As this project has only been meant as an initial survey of possible database
support for automotive applications, there are many ways to continue the
research, like evaluating larger data sets or more complex methods like pattern
recognition (e.g., peak detection). Nonetheless, this project has shown that
scalable solutions for automotive inter-measurement analysis can be done e ciently
using relational database systems.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <article-title>Association for Standardization of Automation and Measuring Systems: ASAM MDF (</article-title>
          <year>2019</year>
          ), https://www.asam.net/standards/detail/mdf
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Lutsch</surname>
          </string-name>
          , A.:
          <article-title>E ziente Datenvorbereitung fur Analysen im Automotive-Bereich</article-title>
          .
          <source>Bachelor Thesis</source>
          , Rostock University (
          <year>2019</year>
          ), http://eprints.dbis.informatik. uni-rostock.de/989/
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Marten</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Heuer</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>A framework for self-managing database support and parallel computing for assistive systems</article-title>
          .
          <source>In: Proceedings of the 8th ACM International Conference on PErvasive Technologies</source>
          Related to Assistive Environments,
          <string-name>
            <surname>PETRA</surname>
          </string-name>
          <year>2015</year>
          , Corfu,
          <source>Greece, July 1-3</source>
          ,
          <year>2015</year>
          . pp.
          <volume>25</volume>
          :
          <issue>1</issue>
          {
          <issue>25</issue>
          :
          <issue>4</issue>
          (
          <year>2015</year>
          ). https://doi.org/10.1145/2769493.2769526, https://doi.org/10.1145/ 2769493.2769526
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Marten</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Heuer</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <source>Machine Learning on Large Databases: Transforming Hidden Markov</source>
          Models to SQL Statements.
          <source>Open Journal of Databases (OJDB) 4</source>
          (
          <issue>1</issue>
          ),
          <volume>22</volume>
          {
          <fpage>42</fpage>
          (
          <year>2017</year>
          ), https://www.ronpub.com/ojdb/OJDB_2017v4i1n02_Marten.html
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Marten</surname>
          </string-name>
          , D., Meyer, H.,
          <string-name>
            <surname>Dietrich</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Heuer</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Sparse and Dense Linear Algebra for Machine Learning on Parallel-RDBMS Using SQL</article-title>
          .
          <source>OJBD</source>
          <volume>5</volume>
          (
          <issue>1</issue>
          ),
          <volume>1</volume>
          {
          <fpage>34</fpage>
          (
          <year>2019</year>
          ), https://www.ronpub.com/ojbd/OJBD_2019v5i1n01_Marten.html
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Marten</surname>
          </string-name>
          , D., Meyer, H.,
          <string-name>
            <surname>Heuer</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Calculating Fourier transforms in SQL</article-title>
          .
          <source>In: Advances in Databases and Information Systems - 23nd European Conference, ADBIS</source>
          <year>2019</year>
          , Bled, Slovenia, September 8-
          <issue>11</issue>
          ,
          <year>2019</year>
          ,
          <string-name>
            <surname>Proceedings</surname>
          </string-name>
          (
          <year>2019</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Marten</surname>
          </string-name>
          , D., Meyer, H.,
          <string-name>
            <surname>Heuer</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Database support for automotive analysis</article-title>
          .
          <source>Technical Report. Chair of Database and Information Systems</source>
          , Rostock University, Rostock, Germany (
          <year>September 2019</year>
          ), http://eprints.dbis.informatik. uni-rostock.de/995/
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>