AFC系统通信中间件的研究与设计
- 格式:doc
- 大小:647.00 KB
- 文档页数:56
学校代号10536 学号0810803550 分类号TP391 密级公开硕士学位论文AFC系统通信中间件的研究与设计学位申请人姓名张良春培养单位长沙理工大学导师姓名及职称龙鹏飞教授学科专业计算机应用技术研究方向人工智能及应用论文提交日期2011年3月学校代号:10536学号:0810803550密级:公开长沙理工大学硕士学位论文AFC系统通信中间件的研究与设计学位申请人姓名张良春导师姓名及职称龙鹏飞教授培养单位长沙理工大学专业名称计算机应用技术论文提交日期2011年3月论文答辩日期2011年5月答辩委员会主席车生兵教授Research and Design of Communication Middlewareon AFC SystembyZhang LiangchunB.E.( Hunan City University) 2008A thesis submitted in partial satisfaction of theRequirements for the degree ofMaster of EngineeringinComputer Application TechnologyinChangsha University of Science & TechnologySupervisorProfessor Long PengfeiMarch, 2011长沙理工大学学位论文原创性声明本人郑重声明:所呈交的论文是本人在导师的指导下独立进行研究所取得的研究成果。
除了文中特别加以标注引用的内容外,本论文不包含任何其他个人或集体已经发表或撰写的成果作品。
对本文的研究做出重要贡献的个人和集体,均已在文中以明确方式标明。
本人完全意识到本声明的法律后果由本人承担。
作者签名:日期:年月日学位论文版权使用授权书本学位论文作者完全了解学校有关保留、使用学位论文的规定,同意学校保留并向国家有关部门或机构送交论文的复印件和电子版,允许论文被查阅和借阅。
本人授权长沙理工大学可以将本学位论文的全部或部分内容编入有关数据库进行检索,可以采用影印、缩印或扫描等复制手段保存和汇编本学位论文。
本学位论文属于1、保密□,在______年解密后适用本授权书。
2(请在以上相应方框内打“√”)作者签名:日期:年月日导师签名:日期:年月日摘要随着城市化进程的加速,城市人口暴增,城市交通压力越来越严重。
中国各大城市都在想方设法解决这方面的问题,其中就投入了大量人力物力财力进行城市轨道交通的建设,因此城市轨道交通智能化和信息化的发展空间巨大。
自动售检票(Automatic Fare Collection, AFC)系统作为轨道交通智能化设备的重要组成部分,其信息化建设一直备受重视。
中间件技术作为一种前沿的软件应用技术,在各种软件系统中发挥着集成度高、可复用性强和提高应用开发效率的优势。
本文通过对中间件,特别是通信中间件的研究,阐述了一种通过通信中间件来提高AFC系统软件可靠性、降低开发成本、缩短开发周期的开发体制。
本文根据通用性和易维护性原则设计了一种基于消息的通信中间件,同时利用具备兼容性的C++和socket开发技术,封装了一套为各种系统应用软件提供统一接口的通信模式。
该通信中间件屏蔽网络连接,不再考虑通信方面的细节问题。
在具体实现过程中,运用了以下几点技术来优化通信中间件的性能:采用多线程技术并发通信,提高了数据传输效率,降低了CPU的占用率;对紧急信息开辟实时的通道,对其做专门的处理,尽可能减少这类消息的延时;对所有消息实行优先级控制,建立数据缓冲机制,应用程序在轮询消息队列时,优先检测级别高的消息队列;提供了加密过程,确保数据传输过程中的安全。
根据实际应用情况,使用通信中间件后,简化了AFC系统的开发,提高了应用软件的开发效率,使开发人员更加专注于对具体业务的研究。
关键词:中间件;消息队列;并发处理;SocketABSTRACTWith the acceleration of urbanization process and the explosion of urban population, pressure on urban transport becomes more and more intense. Many big cities in China are trying to solve this problem through investments of a great deal of human, material and financial resources in the construction of urban rail transit system, so the intelligence and information technology development of urban rail transit has a great potential; AFC (Automatic Fare Collection) system acting as an important part of intelligent rail transportation equipment and its information construction has always been given priority. Middleware, as a cutting-edge software application technology, in a variety of software systems has a lot of advantages such as a high integration, a high reusability, and a better application development efficiency. Through studying the middleware, the communication middleware in particular, this paper describes the development system which can improve AFC system’s software reliability, lower development costs and shorten development cycle with its help.According to the principles of commonality and easy-maintainability, a message based communication middleware is designed, while taking advantages of C++ and Socket technologies, a communication pattern of unified interface for different systems and applications is designed.The communication middleware can shield the network connection and thus it is needless to consider the communication details. In practical implementation, several techniques are used to improve the performance: the multi-thread technology for simultaneous communication to improve the data transmission efficiency as to reduce the occupancy rate of CPU; the real-time channel for emergence messages as to reduce the delay; the priority control and data buffer for all messages as to give priority to higher priority message in polling message sequence; encryption procedure of data transmission as to guarantee the security.The research shows that the application of communication middleware can simplify the development of AFC system, improve the development efficiency of application software and enable the developers to give a higher focus on the specific business.Key words:Middleware ; Message Queue ; Concurrent Process ; Socket目录摘要........................................................................................................................................... I ABSTRACT ............................................................................................................................. II 第一章绪论1.1 研究背景及意义 (1)1.2 国内外研究现状 (2)1.3 本文所做的工作 (3)1.4 本文的内容组织 (3)第二章中间件技术分析2.1中间件的概述 (5)2.2 通信中间件的几种形式 (6)2.2.1远程过程调用 (6)2.2.2会话编程 (6)2.3 面向消息的中间件技术 (7)2.3.1消息传递的相关概念 (8)2.3.2消息中间件的结构 (10)2.3.3消息队列技术 (12)2.3.4消息路由 (13)2.4 网络通信协议 (15)2.4.1 TCP传输控制协议 (15)2.4.2 UDP用户数据报协议 (16)第三章AFC系统通信中间件的分析与设计3.1 AFC系统简介 (18)3.1.1 AFC系统结构 (18)3.1.2 AFC系统功能需求 (19)3.2 通信中间件总体设计 (21)3.3 通信管理器设计 (21)3.3.1 功能说明 (22)3.3.2 通信管理器结构 (22)3.4 用户接口设计 (24)3.4.1功能说明 (24)3.4.2 用户接口的结构 (24)第四章AFC系统中间件实现4.1 Socket技术 (26)4.1.1 Socket基础 (26)4.1.2 Socket通信实现 (27)4.2 自定义通信协议 (29)4.2.1 本地通信协议 (29)4.2.2 业务通信协议 (30)4.3 通信中间件的消息处理机制 (31)4.3.1 消息传递方式 (32)4.3.2 并发机制 (33)4.3.3 消息队列优先级调度 (33)4.3.4 拥塞控制 (34)4.4 通信中间件的具体实现 (35)4.4.1 功能模块划分 (35)4.4.2 系统接口 (36)4.4.3 内部处理通信流程 (38)4.5 仿真实验 (40)4.5.1 实验环境 (40)4.5.2 实验软件 (40)4.5.3 实验数据 (41)4.5.4 实验结论 (42)结论与展望 (43)参考文献 (44)致谢 (47)附录(攻读硕士学位期间发表录用论文) (48)第一章绪论1.1 研究背景及意义随着城市化进程的加速,城市人口暴增,城市交通压力越来越严重。