程序员关于航空的错误认知
Falsehoods programmers believe about aviation

原始链接: https://flightaware.engineering/falsehoods-programmers-believe-about-aviation/

FlightAware的软件处理航空数据的混沌现实,这些数据往往违背简单的假设。虽然看似合乎逻辑,但许多关于航班信息的假设都被证明是错误的。航班可能并非始于登机口,可以多次从同一登机口出发,并且会严重偏离其预定时间表。航班标识并不一致;航班号会更改,使用来自无关航空公司的代码,或者重复出现。机场本身远非标准化:它们可能缺乏明确的标识符,使用不一致的名称,拥有多个代码,甚至会“移动”。数据不一致充斥着整个系统。航班信息可能不准确,雷达数据可能存在差异,并且可能会报告意外目的地。ADS-B信息旨在增强追踪能力,但并非万无一失:它们可能来自非航空器来源,具有不准确的GPS数据,错误的航班ID,并且可能受到篡改、损坏或彻底伪造。处理这些不规则性对于提供可靠的航班追踪至关重要。

一篇名为“程序员关于航空的错误认知”的文章引发了Hacker News的讨论。文章详细介绍了开发者在处理航空数据时常犯的错误假设,例如飞机拥有单一且不变的标识符。一位参与定义唯一飞机标识符(制造商、型号、序列号)专利申请的评论员对缺乏标准化系统表示惊讶。讨论扩展到“右键专利”的普遍性和从现实世界数据中推导出唯一标识符的挑战。 其他论点包括航班号、跑道 ID 的变化性,以及飞机着陆地点超出机场范围的现实情况。讨论还涉及到模拟现实世界系统时常见的编程陷阱,提倡使用灵活的数据模型和强大的测试来处理边缘情况。一些人认为这些清单很有帮助,因为它们突出了假设的子集,这些假设的失败可能带来巨大的影响。对于这篇文章是否提供了有价值的见解,或者仅仅指出了明显的设计缺陷,人们意见不一。
相关文章
  • (评论) 2024-08-19
  • (评论) 2024-05-31
  • 程序员对 TCP 的误解 2024-09-16
  • 2024-08-19
  • (评论) 2024-06-30

  • 原文

    At FlightAware, our software needs to gracefully handle all sorts of weird and wonderful situations. While we as engineers might hope for aviation data to be clean and well-standardized, the real world is messy.

    There are a lot of assumptions one could make when designing data types and schemas for aviation data that turn out to be inaccurate. In the spirit of Patrick McKenzie’s classic piece on names, here are some false assumptions one might make about aviation. While many of these are simply common misconceptions, some of these assumptions have bitten our customers at various points, and others have caused issues in our own systems over the years.

    Together they are illustrative of the situations that Hyperfeed, our flight tracking engine, is responsible for correctly interpreting in order to provide a clean and consistent data feed for our website, apps, and APIs.

    • Flights depart from a gate
    • Flights that depart from a gate only leave their gate once
    • Flights depart within a few hours of the time they were scheduled to
    • Flights depart within a day of the time they were scheduled to
    • Flights have schedules
    • Flights take off and land at airports
    • Airplanes (excluding helicopters) take off and land at airports
    • Flights are at most a dozen or so hours long
    • Okay, they’re at most a few days long
    • Flights are identified by a flight number consisting of an airline’s code plus some numbers, like UAL1234
    • Flights are identified by either an airline flight number like UAL1234, or the aircraft’s registration like N12345, B6459, or FHUVL
    • A flight identifier like B6459 is unambiguously either a registration (B–6459), an airline flight number (B6 459), or something else
    • Flights don’t have multiple flight numbers
    • Flights with multiple flight numbers unambiguously have one “main” flight number
    • A particular trip’s flight number(s) never change
    • The flight number shown on your ticket is what the pilots and air traffic control are using
    • Flights don’t use the code of some entirely unrelated airline in their flight identifier
    • No flights use the same flight number within a day
    • Surely at least no flights use the same flight number at the same time?
    • Okay fine, separate flights from the same major passenger airline that depart within a few minutes of each other would not both have the same flight number… right?
    • Airports never move
    • Terminal and gate numbers have a consistent naming scheme
    • Each runway is only used by one airport
    • Airports always have two unique identifiers: a 4-letter Civil Aviation Organization (ICAO) code and a 3-letter International Air Transport Association (IATA) code
    • Airports always have three unique identifiers: an ICAO, an IATA, and a regionally-administered location code
    • The U.S. Department of Transportation assigns one canonical code to each airport it oversees
    • No airports have multiple IATA codes
    • The ICAO code for airports in the U.S. always starts with the letter K
    • For U.S. airports whose ICAO code starts with K, the last three letters are its IATA code
    • You can tell which geographic region an airport is in from its ICAO code
    • Everything that has an IATA code is an airport
    • Everything that has an ICAO code is on Earth
    • Airports have at least one well-known identifier of some sort
    • Waypoint names are unique
    • There is one agreed-upon definition of altitude
    • Flight information from Air Navigation Service Providers is accurate
    • Okay, pretty accurate; they wouldn’t indicate that a flight had departed unless it really had
    • If they indicate that a flight plan has been cancelled, then that flight definitely isn’t going to operate — it wouldn’t simply be due to someone editing the flight plan
    • At least their radar data accurately identifies each aircraft
    • Radars with overlapping coverage areas agree on the location of a target they can both see
    • If they send us a flight plan with the ICAO identifier of a known airport as the destination, then there must have been some intention of arriving there
    • If an aircraft diverts to another destination, it won’t divert again
    • ADS-B messages only come from aircraft
    • ADS-B messages only come from aircraft and airport service vehicles
    • ADS-B messages only come from vehicles of some kind
    • The GPS position in ADS-B messages is accurate
    • The GPS position in ADS-B messages is accurate within some known uncertainty radius
    • ADS-B messages always include the correct flight identification
    • Transponders are correctly programmed to indicate the aircraft type (helicopter, airplane, balloon, etc)
    • You can always determine a aircraft’s registration number from its ADS-B messages
    • Transponders are programmed with the correct Mode S address
    • All of the transponders on a single aircraft are programmed with the same Mode S address
    • Nobody will ever set their flight identification to weird things like NULL
    • People will remember to update the transponder when the aircraft’s registration changes
    • ADS-B messages are always received exactly as they were transmitted
    • No one ever transmits false ADS-B messages
    • Transponders never break and rodents never chew through cables

    Thanks to my colleagues who contributed to or reviewed this collection of falsehoods: Mark Duell, Paul Durandt, Karina Elizondo, Matt Higgins, Thomas Kyanko, Nathan Reed, and Amy Szczepanski.

    联系我们 contact @ memedata.com