JOIN/SIGN UP
Already a Member? |
GET INVOLVED
Understanding and Engaging in COVESA Expert Groups & Projects |
COLLABORATIVE PROJECTS
HISTORICAL
SDV Telemetry Project - On Hold |
...
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.
...
...
...
(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
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