Preparing your design workspace

Loading the problem and your latest saved attempt…

Design a Device Demand-Response Control System

Design a demand-response control plane that acts as demand nears grid capacity, protects critical loads, lowers or postpones flexible loads within each device's declared limits, brings postponed load back in paced waves, reconciles unreliable device evidence, and shows live per-device power usage.

Problem statement

For this exercise, assume a grid operator coordinates a mixed fleet of electric vehicles, refrigerators, air conditioners, hospital equipment, and other connected loads against the grid's available capacity. Capacity is a versioned value per region that the grid operator can change during the day.

A control-grade demand aggregate, computed per region from grid-side meters and refreshed every five seconds, is compared with the current capacity version; it is separate from the per-device usage view described below.

When measured demand enters the headroom band, which for this exercise starts 5% below capacity, or goes above capacity, the system opens a reduction plan. The plan's required reduction is derived by the system from measured demand, the capacity version, and the band edge, not supplied from outside.

A plan is re-planned when the capacity version changes or when measured demand moves enough to change the required reduction by more than 10%, and it closes once demand has stayed below the band for two minutes.

Critical loads such as hospital equipment must never be shed.

After critical loads and owner-ineligible devices are excluded, every remaining device carries a flexibility tier from its device policy, and the planner draws from the most flexible tier first, moving to a less flexible tier only when the more flexible ones cannot cover the required reduction.

Which device types sit in which tier is a policy choice of this exercise; EV charging is one example of a highly flexible load. A request asks a device either to lower its draw or to postpone its load to a later time, for example by pausing a charge. An owner policy or real-time owner decision may refuse a request.

A refusal is authoritative for that request and may be superseded only by a later authorized policy change or a new request. Devices may repeatedly go online and offline, miss delivery, accept or reject a request, and report execution telemetry late.

A flexible device may also declare a versioned limit on how long or how much it can give up: for example, a vehicle's ready-by time together with the energy it still needs, or the temperature band a refrigerator must stay within. The planner selects only devices whose current limit can tolerate the request.

A participating device is released from its reduction, even while demand stays high, when its limit is about to be breached: for this exercise, when the time left before a ready-by time is less than the charging time still needed plus 15 minutes, or when a reported temperature is within 1 °C of its band edge.

A device whose limit evidence is stale (no limit-relevant reading for three minutes) is not newly selected and, if participating, is released. The planner must replace every released device's capacity from remaining eligible devices or report the shortfall.

When a plan closes, reduced and postponed load comes back in paced restoration waves rather than all at once.

For this exercise, waves start at least 30 seconds apart, each wave restores load estimated at no more than half of the spare capacity below the band edge, devices in a wave resume at randomized offsets spread over its first 20 seconds, and devices closest to their declared limits resume first.

Restoration respects owner state and device limits, pauses if demand re-enters the band, and its progress is visible to operators.

Assume ten million registered devices, bursts of one million targeted devices per reduction plan, and 200,000 connectivity, decision, and telemetry events per second during an overload. Detect entry into the headroom band within 15 seconds of the meter readings that show it, confirm a durable reduction plan within ten seconds of detection, begin regional fan-out within another ten seconds, and expose plan and restoration progress with a two-second freshness objective. Target 99.9% monthly availability for planning, progress, and usage reads, reconcile late evidence for 24 hours, and retain immutable plan and observation audit records for 90 days. Treat unknown delivery and stale connectivity conservatively, and never count an acknowledgement as measured reduction.

Operators also need a live power-usage view. For this exercise, assume each online device reports its current power draw about once a minute, which is about 170,000 readings per second across the fleet on top of overload bursts, and dashboards issue up to 5,000 usage reads per second.

The view shows each device's latest reading and its age, plus live totals by region and device type that say how many devices contributed. A new reading should appear for its device within five seconds and in the totals within ten seconds.

A device with no reading for three minutes is shown as stale and is left out of the totals; it is never shown as zero draw. Usage ingestion must not slow command delivery during an overload.

The view is read-only: the control loop reads the separate control-grade demand aggregate, not this view, so the view never triggers a reduction, and a drop in a live reading is not counted as measured reduction.

Design demand aggregation and band detection, capacity versions, criticality, owner-policy, flexibility-tier and device-limit authority, cohort selection, reduction planning, reduce, postpone, release and resume command fan-out, device decisions, online/offline presence, telemetry aggregation, late-event reconciliation, plan adjustment, paced restoration, live usage ingestion and the usage view, auditability, and observability.

A later report of this exercise described acting before capacity is exceeded, postponing flexible loads, per-device limits, and a staged return of postponed load; the band width, tier order, release rule, timings, and wave sizing here are practice choices.

Device enrollment, billing, long-term usage history and analytics, electricity-market settlement, physical grid protection relays, device firmware, and direct control of critical hospital equipment are outside scope.

What to build

  1. When control-grade demand enters the headroom band below the current capacity version, the system opens a versioned plan with a derived required reduction that excludes critical loads and owner-ineligible devices, draws from the most flexible tiers first, and asks each selected device to lower or postpone its load.
  2. The system applies durable owner policies and explicit refusals without reporting refused or ineligible devices as available reduction; only a later authorized policy change or new request may supersede a refusal.
  3. Flexible devices can declare versioned limits such as a ready-by time with the energy still needed or an allowed temperature band; the planner selects only devices whose limits allow the request, releases a participant that nears its limit or whose limit evidence is stale, and replaces that capacity or reports a shortfall.
  4. The system fans out reduce, postpone, release, and resume requests and distinguishes unknown delivery, offline, refused, accepted, and telemetry-supported execution outcomes.
  5. Within the 24-hour reconciliation horizon, late, duplicate, and out-of-order connectivity, decision, and telemetry evidence updates a versioned plan projection without double counting, while immutable audit evidence remains available for 90 days.
  6. Operators can adjust an unissued or later reduction plan from the reconciled delivered reduction, remaining overload, capacity changes, limit releases, and explicit uncertainty.
  7. After a plan closes, the system restores reduced and postponed load in paced waves that stay within the spare capacity below the band edge, pauses restoration if demand re-enters the band, and shows restoration progress.
  8. Operators can see each device's latest reported power draw and its age, and live totals by region and device type that count contributing and stale devices; a device that stops reporting is shown as stale, never as zero draw.

At scale

  • For this exercise, assume ten million registered devices and plan fan-out to as many as one million eligible devices during a regional overload.
  • For this exercise, handle bursts of 200,000 connectivity, decision, and telemetry events per second while devices flap online and offline.
  • For this exercise, each online device reports its power draw about once a minute (about 170,000 readings per second across the fleet, on top of overload bursts); dashboards issue up to 5,000 usage reads per second, a reading appears for its device within five seconds and in regional and device-type totals within ten seconds, and a device silent for three minutes is stale.
  • For this exercise, compare a regional control-grade demand aggregate refreshed every five seconds with the current capacity version, treat the band from 5% below capacity upward as the trigger, detect entry within 15 seconds of the meter readings that show it, commit a durable plan within ten seconds of detection, begin fan-out within another ten seconds, expose progress within two seconds, re-plan on a capacity change or a change of more than 10% in the required reduction, and close a plan after two minutes below the band.
  • For this exercise, target 99.9% monthly availability for planning, progress, and usage reads, reconcile late evidence for 24 hours, and retain immutable plan and observation audit records for 90 days.
  • For this exercise, critical loads are never eligible for shedding, explicit owner refusals are authoritative for their request, missing delivery or stale connectivity remains unknown rather than successful reduction, a participant within 15 minutes of missing its ready-by charge or within 1 °C of its temperature band edge (or with limit evidence older than three minutes) is released and its capacity replaced or reported as a shortfall.
  • For this exercise, restoration waves start at least 30 seconds apart, each restores load estimated at no more than half of the spare capacity below the band edge, devices in a wave resume at randomized offsets over its first 20 seconds, and restoration pauses if demand re-enters the band.