As an open standard in the field of instant message system, XMPP protocol has good openness and extensibility. But its core agreement is only a minimum completed set, and the existing expansion contains some defects, specific include:the message confirmation mechanism appeared to be inefficient, the message reliability used "one at a time to confirm" mode, which proved to be low efficiency. Secondly, the file transfer mode that XMPP protocol support must download files directly from the other equipment, the transfer rate is frequently not ideal. Finally, the XMPP protocol supports group chat, but in its open source implementation, groups cannot be persistent storage.For message confirmation problems, this paper introduced a new mechanism with version number, both sides of communication should discuss a window for confirming messages which has been received, so as to achieve the batch confirmation.For file transfer problem we introduced a new server called file transfer server, the XMPP server only responsible for transport general message, the process of file transfer and message transfer would be separated.According to group persistence problem, we optimized the data persistence module of Openfire framework, completed the group chat. In addition, in order to validate the feasibility of the above protocol extension, we designed and realized an IM system based on extended XMPP protocol. In this paper, we made the following innovative results:1. Extended the XMPP message confirmation mechanism based on version number, the new mechanism used batch confirmation instead of one at a time to confirm. At the same time, in order to enhance the communication reliability, the new mechanism support opening this mechanism automatically in weak network.2. Bring the file transfer server in XMPP, separated file transfer and message transfer, keep XMPP server simplified, support asynchronous transmission and send offline files at the same time.3. According to group persistent problem, optimized the Openfire framework of data persistence layer, and designed group plugin, completed the function of group chat, promotes the user experience of the instant message system.Experimental results and system commissioning shows that the performance of extension XMPP protocol improved significantly, the project has achieved the expected effect. |