基于ACE框架的并发消息总线的研究与设计
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
消息中间件是中间件的一个重要分支,它为分布式应用系统的开发提供了一个异步、松耦合的编程架构,其思想与现代软件技术的发展趋势相吻合,因而在工业界被广泛地应用于企业应用整合和分布式计算。
     消息总线是消息中间件的一种简单实现,但以其独特的优势为各种分布式应用的开发注入了强大的动力,极大地推动了应用系统集成的发展。消息总线主要负责建立网络通信的通道,其优点在于能够在客户和服务器之间提供同步和异步的通信机制,适用于需要在多个进程之间进行通信的分布式环境,而且容易实现跨平台操作,为不同操作系统上的应用软件集成提供服务。因此,基于消息总线的上层应用就可以专注于具体业务逻辑的设计与开发,从复杂的网络通信处理中解放出来,简单而且高效的实现分布式可扩展的应用系统。
     本论文中主要对消息总线服务器中涉及的两个关键问题—并发模型和内存管理机制进行深入研究,设计提出了基于ACE并发服务组件的多线程并发模型和池式内存分配方案,并在消息总线MTBus系统的设计中得到应用。
     第一章概述部分对于ACE通信框架和中间件及消息总线技术做个总体的介绍,之后介绍了基于消息总线架构的移动智能网网管系统,总结了目前该系统中消息总线存在的缺点,指出了MTBus系统设计的出发点。
     第二章总体上阐述了MTBus系统的设计目标和功能定义,并对系统总体设计进行了介绍。MTBus系统在结构上包含两个部分,消息服务器和客户端API。消息服务器实现客户端消息的转发、名字信息管理、消息监控和消息流持久化等功能。客户端API对底层网络通信进行了封装,为上层应用提供了同步和异步通信的接口。
     第三章详细介绍了MTBus系统服务器子系统的各个核心模块的设计和实现,包括通信消息、底层通信模块、名字信息管理模块、消息池管理器以及消息处理模块。
     第四章阐述了对MTBus系统设计中三个难点技术的研究,并提出了相应的解决方案。服务器并发模型采用半同步/半异步的结构,采用具有优先级的消息池作为排队层,采用多线程反应器作为异步层组件,结合池式内存管理,实现了高处理性能、高稳定性的设计目标。
     第五章对MTBus系统性能进行整体的测试,同时阐述了MTBus系统在网管系统中的应用和存在的一些局限。
     此外,消息总线系统MTBus所采用的客户端API与已有的消息总线MRB保持一致的接口,因此已有的基于MRB的应用可以平滑的迁移到MRBMTBus系统上。目前,该系统已经在移动智能网网管系统和彩铃业务质量评价系统中得到应用,现网使用反馈进一步说明了MTBus系统具有较高的并发处理能力,有效的防止了由于消息通信集中导致的消息爆发所带来的消息传输失败的情况。同时,MTBus系统服务器提供了丰富的操作维护功能,可以帮助用户更好的控制和管理通信过程。
Message Oriented Middleware (MOM) is an important branch of Middleware and it provides an asynchronous, loosely coupled framework for distributed application system. Since its method embodies the trends of modern software technology, it has been widely applied to enterprise application integration and distributed computing in many fields.
     Message Bus (MB), with its unique advantages, has significantly accelerated the development of integrated application system by injecting a powerful driving force into it. It is mainly used to establish the network communication channel and its strong point is that it can provide synchronous and asynchronous communication mechanism among the clients and the servers. It's applicable to distributed environment of multi-process communication and is very capable of fulfilling cross-platform operation to support application software running on different operating systems. Insomuch, MB frees the advanced applications based on it from the complexity of net-communication processing and enables them to concentrate on practical logic design and development so as to achieve the purposes of simplicity, efficiency and extensibility in a distributed environment.
     This paper is mainly focused on two key problems of MB server; they are concurrency model and memory management. We design a model which is based on ACE concurrent service components for process synchronization and introduce a technique for memory-pool assignment and put them into practice in the design of a MB system that is MTBus.
     Chapter I gives first a general view of the ACE communication framework and message middleware technology, then it introduces the Mobile Intelligent Network Management System which is based on MB architecture. The disadvantages of the system and the direction for designing an MTBus system are also concluded in this chapter.
     Chapter II expounds in general the aims and the function definitions of MTBus system and its design.
     Chapter III introduces in detail the design and implement of the system's components including their communication message, machine communication module, name information management module, message pool management and message process module.
     Chapter IV describes three key techniques to designing an MTBus system and their schemes.
     Chapter V shows the test results of MTBus system's overall performance and points out its shortcomings in the practice of web-management system.
     In addition, MTBus system designed the consistent interfaces in client APIs with MRB system,so the application which based on MRB system can smooth migration to MTBus system。Now, the system has been used in Mobile Intelligent Network Management System and CRBT service quality evaluation system. the application Feedback has further proved that MTBus system has high concurrent processing capabilities and can prevent the message flood effectively. Meanwhile MTBus server provides many maintenance functions,which can help users control and manage the communication processes better.
引文
[1]王柏著,分布式计算技术,北京邮电大学出版社,2002年6月:12-20
    [2]王春明,中间件技术及其在分布式系统中的应用,南通大学学报(自然科学版),2006年3月,第5卷第1期:71-73
    [3]Stephen D.Huston/James CE Johnson/Umar Syyid著,马维达译,ACE程序员指南,中国电力出版社,2005年7月:23-28
    [4]Douglas C.Schmidt Stephen D.Huston著,於春景译,C++网络编程卷1:运用ACE和模式消除复杂性,华中科技大学出版社,2004年6月:18-22
    [5]Douglas C.Schmidt Stephen D.Huston著,於春景译,C++网络编程卷2:基于ACE和框架的系统化复用,电子工业出版社,2005年3月:7-11
    [6]于曦,李丹,面向消息的中间件概述,成都大学学报(自然科学版),2002年12月,第21卷第4期:34-36
    [7]徐晶,许炜,消息中间件综述,计算机工程,2005年8月,第31卷第16期:73-75
    [8]Salah Aidarous,Thomas Plevyak著,董嘉奋 等译,电信网络管理技术与应用,电子工业出版社,2003年1月:61-64
    [9]李海峰 廖建新等,一种分布式环境中消息中间件的设计与分析,计算机与信息技术,2004年12期:40-43
    [10]Schmidt,D.,et al.Pattern-Oriented Software Architecture,Volume 2,Patterns for Concurrent and Networked Objects.s.l.:John Wiley & Sons,2000.
    [11]Stevens,W.R.,Fenner,B.and Rudoff,A.M.Unix Network Programming,Vol.1:The Sockets Networking API,Third Edition.s.l.:Addison-Wesley Professional,2003.2
    [12]W.Richard Stevens著,尤基元等译,Unix环境高级编程,机械工业出版社,2000年2月:298-304
    [13]Nagar,S.,et al.Comparison of Performance of Different poll implementations.[Online]2002.http://lse.sourceforge.net/epoll/index.html.
    [14]Schmidt,D.C.and O'Ryan,C.Leader/Followers:A Design Pattern for Efficient Multi-threaded I/O Demultiplexing and Dispatching.Electrical and Computer Engineering Dept.University of California.2000.9
    [15]Schmidt,D.C.and Cranor,C.D.Half-Sync/Half-Async:An Architectural Pattern for Efficient and Well-structured Concurrent I/O.Pattern languages of program design 2.1996:437-459.
    [16]哈罗德著,XML宝典(第二版),电子工业出版社,2002年01月:43-50
    [17]W.Richard Stevens,Bill Fenner等著,杨继张译,UNIX网络编程第1卷套接口API,清华大学出版社,2006年1月:312-322
    [18]W.Richard Stevens著,UNIX网络编程第2卷进程间通信,清华大学出版社,2000年3月:78-92
    [19]郑庆良,张翔等,网络服务器模型分析与实现,杭州电子工业学院学报,2004年8月
    [20]邓新国,贾利民等,消息中间件中多线程池并发模型的研究,铁路计算机应用,2005年2月,第14卷第2期:5-8
    [21]李刚,金蓓弘,两种线程池的实现和性能评价,计算机工程与设计,2007年4月,第28卷第7期:1490-1492
    [22]Alexandrescu,A.Modern C++ Design:Generic Programming and Design Patterns Applied.s.l.:Addison-Wesley Professional,2001年4月:183-206
    [23]李涛,李慧等,基于ACE的并发编程模式和池式内存分配的研究,计算机工程与应用,2006年1月,第27卷第1期:26-29
    [24]侯捷,STL源码剖析,华中理工大出版社,2002年6月:43-71
    [25]徐有明,曹元大,集群技术在消息中间件中的应用,微机发展,2005年12月,第15卷第11期:109-113

© 2004-2018 中国地质图书馆版权所有 京ICP备05064691号 京公网安备11010802017129号

地址:北京市海淀区学院路29号 邮编:100083

电话:办公室:(+86 10)66554848;文献借阅、咨询服务、科技查新:66554700