Automated Ticket Ordering Feature in China Railway 12306: Design and Implementation
China Railway’s 12306 trial of an automatic ticket‑ordering feature lets users pre‑select up to 60 trains, set priority and pre‑pay the highest fare for Spring Festival travel, with the system submitting orders automatically, handling refunds, and addressing priority sorting, scheduling, payment accuracy, and server load through extensive stress testing and a gray‑release strategy.
From Dec 30, 2024 to Feb 8, 2025, China Railway announced a trial of the “system automatic ticket order submission” feature for long‑distance tickets between major cities and stations in Sichuan and Chongqing.
Users can pre‑fill travel dates within the Spring Festival period (Jan 14–Feb 22, 2025), choose a combination of one date plus up to 60 train numbers, keep up to six pending orders, and include up to nine passengers per order.
Sixteen days before departure, 12306 sends a reminder to adjust priority, confirm information, and optionally pre‑pay the highest fare.
Fifteen days before departure, the system automatically submits pre‑paid orders according to the user‑defined priority, while manual orders join the queue by submission time.
If the ticket is secured, any excess pre‑payment is refunded; if not, the full amount is returned. Users who do not pre‑pay follow the normal manual process.
Example: a user from Shanghai to Chengdu on Jan 20, 2025 can pre‑select 60 trains, set priorities, pre‑pay the highest price, and let the system handle the purchase.
Key technical challenges include priority sorting and scheduling, accurate pre‑payment and refund handling, real‑time notifications, and ensuring fairness between automatic and manual purchases.
A possible implementation places manual purchase tasks into a message queue, while the automatic feature uses a scheduled job that creates or enqueues tasks at sale time, optionally pre‑creating tasks in a database for early sorting.
The feature aims to reduce the Spring Festival ticket‑snatching pressure, but it also imposes heavy load on 12306’s servers, requiring extensive stress testing and a gray‑release strategy to mitigate risk.
Java Tech Enthusiast
Sharing computer programming language knowledge, focusing on Java fundamentals, data structures, related tools, Spring Cloud, IntelliJ IDEA... Book giveaways, red‑packet rewards and other perks await!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.