本文阐述了一款基于Linux操作系统与Android相结合的火车售票系统。在Linux上使用C语言进行服务端的编写,通过GCC、Makefile对代码进行编译,并利用GDB和tcpdump调试工具进行调试程序,同时使用Linux系统上的pycharm软件进行python爬虫的编写,对12306网站的车票进行爬取。此外,使用Windows系统上的Android studio软件对安卓APP进行编程,将Linux服务端通过socket通信与安卓APP进行通信。最后实现了一个服务端、多个客户端的火车售票系统,其具有爬取12306网站的车票信息、登录/注册账号、用户买票/退票/改签、管理员修改车票/用户信息等功能。
This paper describes a GUI train ticket system based on Linux system via combining Linux with Android. The related program of the server is written on Linux through C language, the code is compiled through GCC and Makefile, and the program is debugged by GDB and tcpdump. Meanwhile, the software named pycharm from Linux is utilized to compile python in order to scrap the ticket information of the 12306 website. Besides, an APP, compiled by Android Studio from Windows, communicates with Linux server through socket. Therefore, a GUI train ticket system with a server and multiple clients is realized. It has functions that include crawling the ticket information of the 12306 website, logging in/registering an account, buying/refunding/changing tickets, and modifying the ticket/user information by the administrator.
References
[1]
W. Richard Stevens, Stephen A. Rago. UNIX环境高级编程: 影印版[M]. 第2版. 尤晋元, 张亚英, 戚正伟, 译. 北京: 人民邮电出版社, 2019.