Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Move AVRO example to the end and update it

...

The VSS Taxonomy defines what data "entities" (Signals and Attributes) we can deal with, and are used in the protocol(s) defined by W3C Automotive Working group, as well as other initiatives inside and outside the vehicle.

But in addition to VSS itself, we need to define the data-exchange formats for measured valuesof those Signals.  This starts by defining terms, but quickly develops into defining one or several variants of the actual message content format, whether in JSON or other.

...

  • Continuous delivery of data points according to a predefined agreement
  • This is not to be seen as a different container type.  It is more a definition of the delivery method (constant stream compared to atomic message)
  • A stream does not have a fixed start/end time
  • It delivers a stream of Records (or Bundles, although Snapshot is the most likely subtype.  A stream of TimeSeries is likely redundant, and might often just be a stream of Records instead)
    • It might also deliver side-band information (e.g. Job information)
  • It is related to a delivery of a Subscription for protocols that support subscriptions.




...

Examples,

...

using JSON


(Plain) Record:

{
   "value" : " 100.54"
}

...


    "signal"  :  "vehicle.body.cabin.temperature"
"count" : "132" # Might be redundant information, optional.
    "values" : {
        { 
   "ts" : "2020-01-10T02:59:43.491751"
   "value" : "42.5"
     },
        { 
   "ts" : "2020-01-10T02:59:43.491751"
   "value" : "43.0"
     },
... 130 more records
  }
}
AVRO-schema example (not complete, and of course the "#comments" are not allowed to be there)

...


Snapshot:


"timeperiod" {
"start" : "2020-01-10T02:00:00Z",
"end" : "2020-01-11T01:59:59Z"
},
"values" : {
{
    "signal" : "vehicle.body.cabin.temperature",
     "value" : "22.0",
     "ts" : "2020-01-10T02:59:43.491751"
},
{
 

...

       "signal" : "

...

vehicle.drivetrain.engine.rpm.average",
 

...

  

...

  

...

 

...

 "

...

value"

...

 

...

: "

...

3200",

...


     "ts" : "2020-01-10T02:59:44.100403"
}
}

todo: Examples of Derived/Statistics Records

Other example representations


Above we used a simple JSON encoding for the data (as an example). A more space-efficient binary format is also possible, and here we can reuse existing technologies (AVRO, Protobuf, Thrift, CBOR, ...)

Note that the AVRO schemas are also written in JSON, so unlike the examples above this is not an example of the data content →  JSON is used here to describe how data will  be structured. 
The data content is stored/transferred by AVRO implementations according to the schema.  It uses an efficient binary encoding for the values.

AVRO-schema example

{
  "type" : "record",
  "name" : "SpecifiedTimeStampedRecord",
  "fields" : [
    { "name" : "signal_identifier", "type" : "string" },
    { "name" : "ts", "type" : "long" },
    { "name" : "value", "type" : "Value" }
  ]

... where Value is a union of all the possible VSS types.
This is a little convoluted because values can be any plain data type, or an Array of such datatypes:

{
  "type" : "record",
  "name" : "Value",
  "fields" : [
    { "name" : "item", "type" : [
      "int", "long", "float", "double", "string", "boolean",
        { "type" : "array",
          "items" : [ "int", "long", "float", "double", "string", "boolean" ]
        }
      ]
    }
  ]
}

More AVRO encoding here: vss-tools (serializations branch)

More AVRO example work here: vss-tools (serializations branch)

Snapshot:


"timeperiod" {
"start" : "2020-01-10T02:00:00Z",
"end" : "2020-01-11T01:59:59Z"
},
"values" : {
{
    "signal" : "vehicle.body.cabin.temperature",
     "value" : "22.0",
     "ts" : "2020-01-10T02:59:43.491751"
},
{
    "signal" : "vehicle.drivetrain.engine.rpm.average",
      "value" : "3200",
     "ts" : "2020-01-10T02:59:44.100403"
}
}

todo: Examples of Derived/Statistics Records