Module 6/10 · Weeks 9 · 14 h

System architecture and job intake

UAT 457 UAS for Transportation and Autonomous Delivery

About 85 minDraft, awaiting reviewLast updated 24 October 2026

Lesson

By the end of this module you will be able to

  1. Explain the components and layers of an autonomous delivery system, from the requester's systems to drones, docks and parcel lockers
  2. Write the life cycle of a delivery job as a state-transition table and explain why out-of-order events must be refused
  3. Design a job-intake step that checks weight, destination, goods category and deadline before accepting a job
  4. Use HTTP status codes and request IDs to answer requesters correctly when a request is repeated or fails

Prerequisites: UAT 105 Digital Technology and Networks (basic MQTT and REST) · UAT 304 UAS Mission Planning and Autonomous Flight (recommended)

Why this matters

Most people picture drone delivery as one drone flying off to drop a box. In a real service the aircraft is only one part. A system that works every day has to take jobs from several sources, decide which jobs it can accept, queue them, pick a drone and a route, look after docks and batteries, hand the item to the right person, and report back to the customer’s own systems. If any part is designed loosely, for example accepting an overweight job and discovering it only at packing, the whole system jams and customers lose trust. The survey by Otto and colleagues (2018) stresses that system decisions such as base locations, fleet size and job allocation must always be made together with the limits of the aircraft.

This course looks at delivery from the systems and software side: architecture, job intake, scheduling, localization, autonomous take-off and landing, docks, hand-over, information-system integration and performance measurement. Aircraft selection, payload, energy and release mechanisms belong to modules 1–5 of this course.

Modules 6 to 10 of this course follow one fictional case through all of them: an industrial estate in eastern Thailand runs an express drone parcel service between the estate service centre and its member factories. Items are small spare parts, quality-control samples and documents, up to 2 kg. The service centre (called H) has a bank of docks, and six factory drop points (F1 to F6) have parcel lockers on the roofs of their receiving buildings. All figures are fictional. The Python code can be downloaded from /downloads/uat-457/.

Components of an autonomous delivery system

An autonomous delivery system takes a job and carries the item to the recipient with as little human intervention as possible. Think of a parcel company with a counter, a sorting hub, vans and pick-up points, except that every stage is replaced by software and machines. It has three layers.

  1. External systems: the factories’ ERP (enterprise resource planning) systems that send jobs, the requester and recipient app, and the UAS traffic management (UTM) service that receives flight plans
  2. Fleet management system: a central server split into services for job intake, scheduling, route planning, dock management, and monitoring with indicators
  3. Field equipment: drones with an autopilot and a companion computer, docks with chargers, and parcel lockers at the drop points

The upper layer talks to the server through REST APIs, a request-and-wait pattern. The lower layer talks to it through MQTT, which pushes messages through a broker whenever there is new data. Both were covered in UAT 105, and module 10 goes into the integration details.

Three-layer diagram. Top layer in yellow: factory ERP systems, requester and recipient app, and UTM/USS service, linked by REST and API to a purple fleet management server containing five services: job intake, scheduler, route planner, dock manager, and monitoring and KPI. Bottom layer in green: drones, docks and chargers, and parcel lockers, linked by MQTT
Figure 1 Architecture of the estate delivery system

Three rules decide what goes in which layer. First, anything that must respond within a fraction of a second, such as holding attitude or stopping before an obstacle, runs on the drone itself, because the link can drop. Second, anything that needs the whole picture, such as which drone takes which job, runs on the server. Third, every layer must stay safe when another disappears: if the server goes down mid-flight, the drone must finish its accepted task or return to a dock on its own.

Commercial systems that publish details are split the same way. Wing states that drone selection, route planning and coordination with other drones are automatic, and that one pilot oversees several flights from a central location while watching weather and air traffic (Wing, n.d.). People stay in the system, but their role shifts from flying to supervising. In Thailand, delivery flights beyond visual line of sight or over populated areas need permission under the CAAT notification in force since 17 May 2026 (Civil Aviation Authority of Thailand, 2026), covered in UAT 401 and UAT 402.

The job life cycle

A delivery job passes through many steps, and several parties want to know where it is now. The clearest way to describe it is a finite state machine: list the states a job can be in and the events that move it from one state to another. Harel (1987) introduced statecharts, widely used to design embedded and control software. It is like a parcel tracking slip stamped box by box: you may not stamp “delivered” before “left the hub”.

State diagram. Top row of six boxes from left to right: CREATED, QUEUED, ASSIGNED, IN_FLIGHT, AT_DEST and DELIVERED in green, joined by arrows validate_ok, assign, takeoff, arrive and handed_over. Bottom row: pink REJECTED from validate_fail, pink CANCELLED from cancel at QUEUED and ASSIGNED, orange RETURNING from abort at IN_FLIGHT and handoff_fail at AT_DEST, and RETURNING leads to FAILED on docked
Figure 2 State diagram of one delivery job

The key rule is that every event is checked against the current state. An event not in the table must be refused, not silently ignored. If a requester presses cancel after the drone has taken off, the system must not simply mark the job CANCELLED, because the item is still in the air. The correct event is abort, which brings the drone back.

Example 1 Writing the life cycle as a table

The team writes the transition table as a Python dictionary and feeds it four event sequences.

# job state machine: each state lists the events it accepts and the next state
T = {
    "CREATED":   {"validate_ok": "QUEUED", "validate_fail": "REJECTED"},
    "QUEUED":    {"assign": "ASSIGNED", "cancel": "CANCELLED"},
    "ASSIGNED":  {"takeoff": "IN_FLIGHT", "cancel": "CANCELLED"},
    "IN_FLIGHT": {"arrive": "AT_DEST", "abort": "RETURNING"},
    "AT_DEST":   {"handed_over": "DELIVERED", "handoff_fail": "RETURNING"},
    "RETURNING": {"docked": "FAILED"},
}

def run(events, state="CREATED"):
    path = [state]
    for e in events:
        nxt = T.get(state, {}).get(e)
        if nxt is None:                      # event not allowed in this state
            path.append(f"[{e} refused]")
            break
        state = nxt
        path.append(state)
    return " > ".join(path)

print(run(["validate_ok", "assign", "takeoff", "arrive", "handed_over"]))
print(run(["validate_ok", "assign", "takeoff", "abort", "docked"]))
print(run(["validate_ok", "assign", "takeoff", "cancel"]))
print(run(["validate_ok", "assign", "takeoff", "arrive", "handed_over", "abort"]))
CREATED > QUEUED > ASSIGNED > IN_FLIGHT > AT_DEST > DELIVERED
CREATED > QUEUED > ASSIGNED > IN_FLIGHT > RETURNING > FAILED
CREATED > QUEUED > ASSIGNED > IN_FLIGHT > [cancel refused]
CREATED > QUEUED > ASSIGNED > IN_FLIGHT > AT_DEST > DELIVERED > [abort refused]

The first sequence is the normal path. In the second the drone aborts and returns, and the job ends as FAILED, meaning the item must be recovered and the customer told. In the third, cancel during flight is refused. In the fourth, DELIVERED is a terminal state that no event can leave, so a late abort message cannot corrupt the job history.

The table matters more than the code, because everyone reads it the same way: software team, flight supervisors and customer service. Every time a state changes, the system logs the time, the event and who caused it. That log is the raw material for the indicators in module 10.

Job intake and checks before acceptance

Job intake is the first gate deciding which jobs are accepted. The principle is reject as early as possible: a job that cannot be done should be refused when it is ordered, not when staff weigh the item at the dock. At least five things must be checked.

  • Destination: a registered drop point with a locker on the corridor network
  • Weight and size: within what the drone and the box can carry
  • Goods category: not forbidden by policy, for example loose lithium batteries or flammable liquids (policy of this case, assumed)
  • Deadline: can it arrive in time?
  • Repeated requests: a factory system may resend the same request after a network glitch

The estimated time of arrival is , where is the queue wait, the distance along the corridor, the cruise speed and the other time for take-off, climb, landing and hand-over. A job is accepted when .

Requests arrive through a REST API in the style described by Fielding (2000): each request carries everything needed, without relying on what the server remembers from earlier calls. Replies use HTTP status codes as defined in RFC 9110 (Fielding and colleagues, 2022), such as 201 Created when a new job is created and 422 Unprocessable Content when the request is understood but cannot be carried out because a business rule fails.

Repeated requests need special care. RFC 9110 explains that POST is not idempotent: sending it twice does not have the same effect as sending it once, so a client should not retry it automatically unless it has a way to know the first request was not processed. The usual fix is for the requester to attach a unique request ID. The server remembers IDs it has seen and returns the earlier result for a repeat instead of creating a new job. Otherwise one spare part might fly twice.

Example 2 Checking six job requests

Corridor distances from the service centre to each drop point come from the route search in module 7. The drone cruises at 12 m/s, other time is 4 minutes, the queue wait is now 6 minutes, and the weight limit is 2.0 kg (all assumed). The last request is a resend from an ERP system.

# check incoming jobs before accepting them (all values assumed)
route_km = {"F1": 2.09, "F2": 3.23, "F3": 3.59, "F4": 4.85, "F5": 4.20, "F6": 4.79}
MAX_KG, V, T_OVER, T_QUEUE = 2.0, 12.0, 4.0, 6.0     # kg, m/s, min, min
BANNED = {"lithium battery", "flammable liquid"}
seen = {}                                             # request_id -> earlier answer

def intake(req):
    rid = req["request_id"]
    if rid in seen:                                   # same request sent twice
        return 200, f"duplicate, return {seen[rid]}"
    if req["dest"] not in route_km:
        return 422, "unknown drop point"
    if req["kg"] > MAX_KG:
        return 422, f"too heavy ({req['kg']} kg)"
    if req["category"] in BANNED:
        return 422, "dangerous goods"
    eta = T_QUEUE + route_km[req["dest"]] * 1000 / V / 60 + T_OVER
    if eta > req["due_min"]:
        return 422, f"ETA {eta:.1f} min > due {req['due_min']} min"
    seen[rid] = req["job"]
    return 201, f"accepted, ETA {eta:.1f} min"

orders = [
    dict(request_id="r-01", job="J101", dest="F3", kg=1.4, category="spare part", due_min=20),
    dict(request_id="r-02", job="J102", dest="F5", kg=2.6, category="spare part", due_min=30),
    dict(request_id="r-03", job="J103", dest="F9", kg=0.5, category="document", due_min=30),
    dict(request_id="r-04", job="J104", dest="F6", kg=0.8, category="QC sample", due_min=12),
    dict(request_id="r-05", job="J105", dest="F2", kg=0.5, category="lithium battery", due_min=30),
    dict(request_id="r-01", job="J101", dest="F3", kg=1.4, category="spare part", due_min=20),
]
for o in orders:
    code, msg = intake(o)
    print(o["job"], code, msg)
J101 201 accepted, ETA 15.0 min
J102 422 too heavy (2.6 kg)
J103 422 unknown drop point
J104 422 ETA 16.7 min > due 12 min
J105 422 dangerous goods
J101 200 duplicate, return J101

Only J101 is accepted, arriving in 15.0 minutes (). J104 to F6 needs 16.7 minutes, longer than the 12 requested. A good system should not just say no; it should offer the earliest feasible time and let the requester decide. The repeated request r-01 gets the earlier answer, job J101, and no second job is created.

The order of checks matters. If the time were computed before checking the destination, the code would crash on drop point F9, which is not in the table. Check cheap, simple things first and complex things later, and make every refusal state a reason the requester can act on.

Levels of autonomy and the role of people

“Autonomous” does not mean nobody is involved. People still have three important roles in this system.

  • Flight supervisors watch several flights at once and decide when the system asks, for example when weather changes or an incident occurs near a corridor
  • Ground staff pack items, look after docks and deal with locker faults
  • System administrators change settings, such as closing a corridor where a crane is working, and review daily indicators

A good design states clearly which decisions the machine makes and which need human confirmation. Normal job acceptance is automatic, but launching when wind exceeds the limit needs a person to confirm, and every decision is logged for later review.

Module lab

Lab: sketch the architecture and build the intake gate

  1. Sketch the architecture of a delivery system for a site your group chooses (an estate, a campus or a port), showing external systems, server services and field equipment with every communication link
  2. Write the state table from Example 1, add a LOADING state between ASSIGNED and IN_FLIGHT, and test three valid and three invalid event sequences
  3. Extend the code in Example 2 to check box dimensions (width, length, height) and to propose the earliest delivery time when the deadline fails
  4. Build a test set of at least 10 requests covering every reason for refusal, run it and record the results in a table

Common mistakes

Watch out

  • Letting the drone decide everything, or the server decide everything: fast responses belong on the drone, whole-picture decisions on the server
  • Allowing every state change, so a delivered job gets cancelled or a late message overwrites the latest state
  • Accepting first and checking later, leaving undeliverable items stuck at the dock
  • Not using request IDs, so a resent request becomes two jobs
  • Refusing without a reason, so the requester cannot fix the request and has to phone

Summary

  • An autonomous delivery system has three layers: external systems, the fleet management system and field equipment; each must stay safe when another fails
  • Write the job life cycle as a finite state machine, check every event against the current state, and refuse out-of-order events
  • The intake gate checks destination, weight, goods category and deadline with before accepting
  • Use HTTP status codes as defined, and request IDs to prevent duplicate jobs, because POST is not idempotent

Check your understanding

  1. A job is in QUEUED and receives the event arrive. Using the table in Example 1, what should the system do?
  2. Queue wait 6 minutes, other time 4 minutes, 12 m/s to F2 at 3.23 km. What is the estimated arrival time, and can a job due within 15 minutes be accepted?
  3. Why can a repeated POST create two jobs, and how is this prevented?
  4. Give one task that must run on the drone and one that belongs on the server, with reasons.
  5. A job to F6 (4.79 km) must arrive within 20 minutes, with a 6-minute queue and 4 minutes of other time. What is the lowest usable cruise speed?
Answers
  1. Refuse the event, keep the state as QUEUED and log the out-of-order event for review, because QUEUED accepts only assign and cancel
  2. minutes, within 15 minutes, so it can be accepted
  3. POST is not idempotent, so a repeat can create a new resource again. Have the requester attach a unique request ID; the server remembers it and returns the earlier result for repeats
  4. On the drone: stopping before an obstacle or holding attitude, because it must be fast and the link may drop. On the server: choosing which drone takes which job, because it needs all jobs and drones in view
  5. Flight time left minutes s, so the lowest speed is m/s

Key formulas

Estimated time of arrival
Deadline acceptance condition

Key references

  1. Otto, A., Agatz, N., Campbell, J., Golden, B., & Pesch, E. (2018). Optimization approaches for civil applications of unmanned aerial vehicles (UAVs) or aerial drones: A survey. Networks, 72(4), 411–458. link
  2. Wing. Technology: How Wing delivers. link
  3. Harel, D. (1987). Statecharts: A visual formalism for complex systems. Science of Computer Programming, 8(3), 231–274. link
  4. Fielding, R. T. (2000). Architectural styles and the design of network-based software architectures [Doctoral dissertation, University of California, Irvine]. link
  5. Fielding, R. (Ed.), Nottingham, M. (Ed.), & Reschke, J. (Ed.). (2022). HTTP semantics (RFC 9110). RFC Editor. link
  6. สำนักงานการบินพลเรือนแห่งประเทศไทย. (2569). ประกาศ กพท. เรื่อง หลักเกณฑ์และวิธีการในการอนุญาตให้ผู้บังคับหรือปล่อยอากาศยานซึ่งไม่มีนักบิน ประเภทอากาศยานที่ควบคุมการบินจากภายนอก ที่มีน้ำหนักไม่เกิน 25 กิโลกรัม ปฏิบัติแตกต่างไปจากเงื่อนไขที่กำหนด พ.ศ. 2569 (มีผล 17 พฤษภาคม 2569). link

Further reading

Study the assigned knowledge units in advance, review media and take the module quiz

In class / field

Lab or field practice from worksheets with a safety checklist

Learning evidence: Checked worksheets and quiz results

Module quiz

This is a formative self-check, not a graded exam

Knowledge domain: Delivery, indoor operations and warehousing · Programming and digital technology · Communications, networks and IoT