Date: Thu, 28 Mar 2024 12:38:49 +0000 (UTC) Message-ID: <1366359482.9.1711629529781@ip-172-31-8-223.us-west-2.compute.internal> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_8_29412130.1711629529777" ------=_Part_8_29412130.1711629529777 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
Information related to translation or use of Protocol Buffers (a= .k.a. protobuf), together with the common data or service model.
Purpose:
Alternatives:
Useful links:
Concerns
One translation proposal encodes each branch as its own type (protobuf: = message) . Leaves are, but branches (message types) containi= ng branches (other message types) are also shown:
message Ve= hicleBodyWindshieldFrontHeating { bool Status =3D 1; } message VehicleBodyWindshieldFrontWasherFluid { bool LevelLow =3D 1; uint32 Level =3D 2; } message VehicleBodyWindshieldFront { VehicleBodyWindshieldFrontWiping Wiping =3D 1; VehicleBodyWindshieldFrontHeating Heating =3D 2; VehicleBodyWindshieldFrontWasherFluid WasherFluid =3D 3; } message VehicleBodyWindshieldRearWiping { string Status =3D 1; } message VehicleBodyWindshieldRearHeating { bool Status =3D 1; } message VehicleBodyWindshieldRearWasherFluid { bool LevelLow =3D 1; uint32 Level =3D 2; } message VehicleBodyWindshieldRear { VehicleBodyWindshieldRearWiping Wiping =3D 1; VehicleBodyWindshieldRearHeating Heating =3D 2; VehicleBodyWindshieldRearWasherFluid WasherFluid =3D 3; } message VehicleBodyWindshield { VehicleBodyWindshieldFront Front =3D 1; VehicleBodyWindshieldRear Rear =3D 2; } message VehicleBodyLights { bool IsHighBeamOn =3D 1; bool IsLowBeamOn =3D 2; bool IsRunningOn =3D 3; bool IsBackupOn =3D 4; bool IsParkingOn =3D 5; bool IsBrakeOn =3D 6; bool IsRearFogOn =3D 7; bool IsFrontFogOn =3D 8; bool IsHazardOn =3D 9; bool IsLeftIndicatorOn =3D 10; bool IsRightIndicatorOn =3D 11; }
The above is essentially describing the VSS data tree / catalog and is v= ery similar to the definition of the full tree in GraphQL as can be seen he= re.
Alternatively we can focus on the serialization aspect. This is to= define the exact payload in a generic communication protocol - e.= g. MQTT which describes the transport and topic structure, but does not in = itself define the payload format. A definition of what is actually tr= ansferred on topics is required:
The page Data = serialization / value formats gives a high-level proposal for message t= ypes that are needed in a typical generic data transfer protocol.
Another option is to mirror the message structure of the VISS web protocol specification. Message types ar= e described in the JSON Schema in the Transport Specification and this "schema" coul= d be described using Protobufs.
Timesta= mpedRecord: message TimestampedRecord_uint32 { string ts =3D 1; # Zulu time, ISO std with microseconds uint32 value =3D 2; # (with specific uint32 type -- only valid for sign= als of that type) } # Or alternative that can encode multiple value types: message TimestampedRecord { string ts =3D 1; # Zulu time, ISO std with microseconds google.protobuf.any value; # There is a default "any" type defined by pr= otobuf named google.protobuf.any but it might not be the only choice } message GeospatialRecord { GeoPosition pos; =20 TimeStampType ts =3D 1; # Some efficient time stamp type? Zulu tim= e, ISO std with microseconds google.protobuf.any value; # ValueType needs to be a union/any/variant ty= pe.=20 } # Just a proposal for a GNSS position type: message GeoPosition { float latitude =3D 1; float longitude =3D 2; float accuracy =3D 3; }
VISS schema includes a lot of parts, some that seem optional (descriptio=
ns etc.)? There is also some hierarchy that could be included, or fla=
ttened.
In this example the hierarchy is roughly the same, the subtype "dp" is incl=
uded and it encompasses the value and time stamp.
message= VISS_data_message { string path =3D 1; dp_type dp =3D 2; # Other optional parts? Description, properties ... } message dp_type { google.protobuf.any value =3D 1; string ts =3D 2; # Also here, a more efficient time stamp type?? }