Skip to content

Vehicle architecture

Service-oriented architecture in a vehicle

The idea that makes features addable after production — components offering named capabilities others discover and call, and the interface discipline it demands.

Intermediate6 minSOA · Services · Architecture

If you take one idea from this whole curriculum, take this one. is what actually makes a vehicle software-defined. The hardware consolidation enables it; this is the thing it enables.

The problem it solves#

Signal-oriented — everyone shouts, everyone listensECU AECU BCAN busECU CHead unitno addressing · no replies · fixed at build timeService-oriented — components offer and callSeat serviceoffers: setPosition()Light serviceoffers: setBeam()Cockpit appdiscovers · callsdiscovered at runtime · request/response · versionedsignals: add a consumer and you re-wire · services: add a consumer and nothing changesthat difference is what makes features addable after the car ships
Broadcast signals versus callable servicesOn the left, values are shouted onto a shared wire and the wiring is fixed at design time. On the right, capabilities are offered, discovered at runtime, and called.

What a service actually is#

A named capability with a defined interface, offered by one component and usable by others.

A seat service, conceptually
SeatService  (version 1.2)
 
  methods
    setPosition(seat, position)  -> ok | INVALID_SEAT | BLOCKED
    getPosition(seat)            -> position
    savePreset(seat, slot)       -> ok
 
  events
    positionChanged(seat, position)
    occupancyChanged(seat, occupied)
 
  fields
    massageIntensity   get · set · notify

Discovery is the part that matters#

A consumer does not have a hard-coded address for the seat service. It asks the network at runtime: who offers SeatService, version 1 or compatible?

The discipline it demands#

Service orientation is not free. It trades network-design work for interface design work, and the interface has to survive a decade.

Version from the first message. Both ends will be updated on different schedules by different suppliers. An unversioned interface means neither end can ever change.

Add, never reorder or remove. New methods go at the end. Removing one breaks consumers you may not know about.

Errors are part of the contract. A method that returns void and reports failures through a side channel is not a service — it is a signal wearing a costume.

Design for absence. A consumer must handle the service not being present at all, because on a cheaper trim it will not be.

Absence is the normal case, not an error
val seat = discover<SeatService>(minVersion = 1)
    ?: run {
        hideSeatControls()   // this trim has no powered seats
        return
    }

Where services actually run#

A service is software on some processor. Which processor is, deliberately, not the consumer's business.

ServiceTypically runs on
Seat, door, lightingA zone controller, or central compute
Vehicle stateCentral compute
NavigationCockpit domain controller
ADAS stateThe ADAS domain, exposed read-only
ChargingVehicle domain, often with its own safety constraints

Migration reality#

Next#

How the software actually gets deployed onto these computers.

References & further reading

Code links target the main branch on cs.android.com. AOSP moves — if a path 404s, search the symbol instead.