Energy & Power · Study deck

ACE and Shared Context Sensing

Picture three phone apps waking the same motion sensor for the same answer.

Battery Bruno is your guide for this deck.

contextsystem
Battery Bruno, the module guide, in a scene from this chapter.
iotclass.org

After studying this chapter

Learning objectives

You will be able to:

  • Explain: This recurrence explains why “always choose the cheapest sensor first” can fail: a cheap sensor whose result rarely resolves the query merely adds its own cost before the expensive fallback.
  • Explain: With $n$ optional attributes there are already $2^n$ possible subsets, $n!$ possible full orderings, and a branch can expose a different remaining choice after every outcome.
  • Explain: A rare rule with high confidence may still be useful for a niche event; a common rule with weak confidence should not drive high-consequence decisions.
  • Explain: Proxy sensing can become wasted work if the proxy is weak.
iotclass.org

Major section

Start With One Shared Fact

A broker means a service that receives information and passes it to the right users or systems.

  • This proves one shared context rule, not every privacy or accuracy case; the deeper sections cover the ACE roles, planning, inference, reuse, and limits.
  • If one sensor reading can answer several questions, repeating the same sensing work wastes energy.
  • Ownership, freshness, correlation, and validation decide whether shared context is an energy saving or a stale shortcut.
iotclass.org

Major section

Shared Context Sensing

The cached value is not just a raw answer; it is an evidence record.

  • A useful review of shared context sensing needs both Context Consumers and: App 1 in view.
  • Against it,: App 1 adds a distinct review condition; the later: Location Tracker adds a distinct review condition.

Key terms

Correlation
Correlation is valuable only when its fallback order remains inspectable.

Numbers to remember

80%The intervening : INFER rule carries 80% support
88%88% confidence, so it cannot masquerade as a directly sensed fact.
ACE architecture for shared context: multiple applications consume shared context values through ACE middleware and an inference cache rather than each sensing independently.
ACE architecture for shared context: multiple applications consume shared context values through ACE middleware and an inference cache rather than each sensing independently.
iotclass.org

Major section

Cross-App Context Correlations

ACE becomes more powerful when it can infer one context attribute from another.

  • Confidence tells whether the rule is reliable when the antecedent is true.
  • A rare rule with high confidence may still be useful for a niche event; a common rule with weak confidence should not drive high-consequence decisions.
ACE rule mining gates showing observed context history, candidate rules, support filter, confidence filter, consequence threshold, and accepted rule set.
ACE rule mining gates showing observed context history, candidate rules, support filter, confidence filter, consequence threshold, and accepted rule set.
iotclass.org

Major section

Cross-App Context Correlations (continued)

A rule observed twice in a month should not control an energy policy without more evidence.

  • Their relationship shows which part of the claim still needs evidence.
  • The next checkpoint,: Candidates, adds a distinct review condition, while if-then rules adds a distinct review condition.
  • An old Driving = true value should not infer current location.
iotclass.org

Major section

Sensing Planner

Value is fresh, trusted, and allowed for this consumer.

  • Stale context can silently make the wrong policy look cheap.
  • Rule confidence clears the threshold and the proxy is cheaper than target sensing.
  • The proxy may drift when user behavior or deployment patterns change.
  • A low-power sensor can update a rule antecedent before using an expensive target sensor.
Measured energy per sense in millijoules for ten context attributes, grouped by the sensor(s) each one requires.
Measured energy per sense in millijoules for ten context attributes, grouped by the sensor(s) each one requires.
iotclass.org

Major section

Sensing Planner (continued)

Proxy sensing can become wasted work if the proxy is weak.

  • Cache and inference fail, or the decision needs direct evidence.
  • GPS-plus-WiFi indoor detection costs about 1985 millijoules.
  • The planner should also record the rejected options.
  • That makes it possible to review why the system sensed directly even though a cached value or proxy rule existed.
iotclass.org

Major section

Sensing-Planner Complexity and a Practical Heuristic

A conditional sensing plan is a decision tree.

  • Each internal node either tests a cached attribute, wakes a sensor, or runs an inference; each outgoing edge represents a possible result.
  • The planner's job is to find a tree that minimizes expected energy without violating those correctness gates.
  • At a terminal leaf, $J=0$ only when the available evidence is sufficient to answer.

Why it matters

Otherwise that branch must pay for another test or fall back to the authoritative sensor.

iotclass.org

Major section

Sensing-Planner Complexity and a Practical Heuristic (continued)

Exact optimal decision-tree and related sensing-plan formulations contain known NP-hard problems.

  • This recurrence explains why “always choose the cheapest sensor first” can fail: a cheap sensor whose result rarely resolves the query merely adds its own cost before the expensive fallback.
  • Outcome probabilities must come from representative traces; invented confidence values only make the optimizer precisely wrong.
  • In production, re-plan when energy costs, cache-hit rates, or correlations drift.
iotclass.org

Major section

Sensing-Planner Complexity and a Practical Heuristic (continued)

With $n$ optional attributes there are already $2^n$ possible subsets, $n!$ possible full orderings, and a branch can expose a different remaining choice after every outcome.

  • That statement applies to the general planning problem; a small, constrained instance can still be searched exactly.
  • The planner is an adaptive policy built from evidence, not a one-time static ordering of sensors.
  • Otherwise that branch must pay for another test or fall back to the authoritative sensor.
iotclass.org

Deck summary

Key takeaways

A broker means a service that receives information and passes it to the right users or systems.

  • The cached value is not just a raw answer; it is an evidence record.
  • ACE becomes more powerful when it can infer one context attribute from another.
  • A rule observed twice in a month should not control an energy policy without more evidence.
  • Value is fresh, trusted, and allowed for this consumer.
iotclass.org

Retrieval practice

Recall check 1 of 6

Battery Bruno says: answer from memory, then check your reasoning.

Q1App A sensed Walking=true 45 seconds ago with a TTL of 120 seconds and confidence 0.94. App B now requests Walking for a low-consequence activity summary with minimum confidence 0.80. What should an ACE-style broker do?

AReuse the cached value and record App B as a consumer
BAlways resense because a different app made the request
CInfer AtHome instead, even though App B requested Walking
DExtend the TTL automatically to improve hit rate
Show answer

Answer: A ACE cache reuse is allowed when the context value is fresh, trusted, permitted, and adequate for the requesting decision.

iotclass.org

Retrieval practice

Recall check 2 of 6

Battery Bruno says: answer from memory, then check your reasoning.

Q2A rule has support 0.04 and confidence 0.58 for inferring RoomOccupied from DoorOpened. The inferred value would suppress motion sensing for lighting control. What is the best review decision?

APromote it to reduce motion-sensor wakeups
BUse it only for high-consequence decisions
CHold or reject the rule for lighting
DIncrease cache duration until support improves
Show answer

Answer: C Rule promotion depends on support, confidence, freshness, and consequence.

iotclass.org

Retrieval practice

Recall check 3 of 6

Battery Bruno says: answer from memory, then check your reasoning.

Q3Place each ACE responsibility where it lives so you can trace a context request from application demand to measured validation.

AApp request
BBattery chemistry
CRadio antenna
DFirmware image
Show answer

Answer: A The three regions separate demand and reuse, rule-guided sensing resolution, and validation evidence so you can see which ACE component owns each decision and fallback.

iotclass.org

Retrieval practice

Recall check 4 of 6

Battery Bruno says: answer from memory, then check your reasoning.

Q4Four subsystems each need the same occupancy context once a minute. What makes a shared inference cache save energy compared with each subsystem sensing on its own?

AThe cache makes the sensor itself draw less current during each reading.
BOne sensing operation populates the cache and the other three reads become cheap lookups.
CThe cache eliminates the need for any sensing at all, forever.
DCaching only helps when there is exactly one reader.
Show answer

Answer: B The first reader pays the full sensing cost and populates the cache; while the value stays fresh, the remaining readers reuse it with cheap lookups.

iotclass.org

Retrieval practice

Recall check 5 of 6

Battery Bruno says: answer from memory, then check your reasoning.

Q5A full context sense costs 0.34 mA-s and a cache hit costs 0.016 mA-s. At a cache hit rate of 80%, what is the average energy per request?

AAbout 0.081 mA-s, from 0.8 x 0.016 + 0.2 x 0.34.
BAbout 0.178 mA-s, the plain average of the two path costs.
CAbout 0.34 mA-s, budgeting a full sense even when the cache contains a value.
DAbout 0.016 mA-s, taking the dominant cache-hit path as the typical request cost.
Show answer

Answer: A The blend weights the cheap lookup by the hit rate and the full sense by the miss rate: 0.0128 + 0.068 = 0.081 mA-s. That is about 4.2x cheaper than always sensing (0.34 mA-s).

iotclass.org

Retrieval practice

Recall check 6 of 6

Battery Bruno says: answer from memory, then check your reasoning.

Q6An engineer shortens the cache validity window from 60 s to 2 s hoping for fresher context, and battery life gets much worse. Why?

AA shorter window makes each individual sensing operation draw more current.
BShorter windows disable the accelerometer, so GPS runs constantly.
CA 2 s window forces almost every request to miss and re-sense.
DFreshness has no effect on energy; the change must be a measurement error.
Show answer

Answer: C Freshness is the knob that sets the hit rate.

iotclass.org

Print reference

Answers 1 of 2

Answer key.

  1. A · ACE cache reuse is allowed when the context value is fresh, trusted, permitted, and adequate for the requesting decision.
  2. C · Rule promotion depends on support, confidence, freshness, and consequence.
  3. A · The three regions separate demand and reuse, rule-guided sensing resolution, and validation evidence so you can see which ACE component owns each decision and fallback.
  4. B · The first reader pays the full sensing cost and populates the cache; while the value stays fresh, the remaining readers reuse it with cheap lookups.
iotclass.org

Print reference

Answers 2 of 2

Answer key.

  1. A · The blend weights the cheap lookup by the hit rate and the full sense by the miss rate: 0.0128 + 0.068 = 0.081 mA-s. That is about 4.2x cheaper than always sensing (0.34 mA-s).
  2. C · Freshness is the knob that sets the hit rate.
iotclass.org