WO2008074244A1 - 一种即时通信的方法、系统及装置 - Google Patents

一种即时通信的方法、系统及装置 Download PDF

Info

Publication number
WO2008074244A1
WO2008074244A1 PCT/CN2007/071051 CN2007071051W WO2008074244A1 WO 2008074244 A1 WO2008074244 A1 WO 2008074244A1 CN 2007071051 W CN2007071051 W CN 2007071051W WO 2008074244 A1 WO2008074244 A1 WO 2008074244A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
module
access server
sent
server
Prior art date
Application number
PCT/CN2007/071051
Other languages
English (en)
French (fr)
Other versions
WO2008074244A8 (zh
Inventor
Qian Yang
Ziguang Gao
Li Zhu
Original Assignee
Tencent Technology (Shenzhen) Company Limited
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology (Shenzhen) Company Limited filed Critical Tencent Technology (Shenzhen) Company Limited
Publication of WO2008074244A1 publication Critical patent/WO2008074244A1/zh
Priority to US12/485,532 priority Critical patent/US20090254628A1/en
Publication of WO2008074244A8 publication Critical patent/WO2008074244A8/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management
    • G06Q10/107Computer-aided management of electronic mailing [e-mailing]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/04Real-time or near real-time messaging, e.g. instant messaging [IM]

Definitions

  • the present invention relates to the field of instant messaging, and in particular, to a method, system and apparatus for instant messaging. Background of the invention
  • the instant messaging system in the prior art adopts a C/S (client/server, client/server) architecture, in which the instant messaging client software is installed on the user terminal for providing input and output, information display, interface operation, and the like.
  • Function, and the server set on the network side is used to provide functions such as data storage, message forwarding, and state saving.
  • the login information is sent to the access server on the network side through the instant messaging client software installed on the user terminal, and the login information includes the user account and password; the access server forwards the login information to the background database.
  • Match verification if the verification is successful, return information such as the friend information of the user to the instant messaging client software, otherwise the user login fails. Once the user has successfully logged in, they can communicate instantly with other users who are currently logged in.
  • a disadvantage of the above prior art is that each time a user logs in to the instant messaging system, the prerequisite is that the corresponding instant messaging client software must be present on the terminal it uses. If not, you must first download and install the instant messaging client software, and then log in to the instant messaging system through the instant messaging client software to communicate instantly with other users who are currently logged in. However, due to short time, hard disk capacity or operating system, etc., users do not have security on the terminal. The instant messaging client software is installed, and the user needs to use the instant communication service. For example, the user only temporarily uses a terminal that does not have the instant messaging client software installed. In this case, the user cannot log in to the instant messaging system and perform instant communication. Summary of the invention
  • the embodiment of the invention provides a method for instant communication, which can perform instant communication without using the instant communication client software.
  • the embodiment of the invention provides a system for instant communication, which can perform instant communication without using instant messaging client software.
  • the embodiment of the present invention provides an access server, which can perform instant communication without using instant messaging client software.
  • a method of implementing instant messaging comprising:
  • the browser logs into the instant messaging backend server through the webpage and sends and receives instant messages through the access server.
  • a system for realizing instant communication including a web server, a browser module, and an access server;
  • the web server provides a webpage for the instant messaging service to the browser module; the browser module acquires a webpage for the instant communication service from the webpage server, logs into the instant messaging backend server through the webpage, and establishes with the access server Hypertext transfer protocol
  • the access server receives an instant message sent by the browser module through an HTTP connection established with the browser module, and forwards the message to the instant messaging backend server, receives the instant message sent by the instant messaging background server, and forwards the message to the browser module. .
  • An access server where the access server includes: a format conversion module, and a message temporary storage Module, message uploading module, detecting module and message sending module;
  • the format conversion module is configured to receive a message sent by the browser, convert it to a protocol format adopted by the background server, and send the message to the message temporary storage module; receive the message sent by the background server, and convert the message to the protocol adopted by the browser module.
  • the format is sent to the message temporary storage module;
  • the message temporary storage module is configured to temporarily store a message sent from the format conversion module, and the message uploading module is configured to send a message sent by the browser module temporarily stored in the message temporary storage module to the background server;
  • the detecting module is configured to detect whether a message that needs to be sent to the browser module exists in the message temporary storage module; if yes, send a command to send a message to the message sending module;
  • the message sending module is configured to receive a command for sending a message sent by the detecting module, and send, by using a currently existing HTTP link, a message that needs to be sent to the browser module in the message temporary storage module to the browser module.
  • the browser utilizes XHR (Xml Http Request, Extensible Markup Language Hypertext) through AJAX (Asynchronous JavaScript and XML, Javascript and Extensible Markup Language Asynchronous) technology.
  • XHR Xml Http Request, Extensible Markup Language Hypertext
  • AJAX Asynchronous JavaScript and XML, Javascript and Extensible Markup Language Asynchronous
  • the transmission protocol requests the HTTP link established between the object and the access server to send a message to the access server, and the access server adds the message to the sending queue, and detects whether there is a need to deliver the message to the user in the sending queue.
  • the message if yes, uses the link to send the message at the front end of the delivery queue, and breaks the link after the message is sent; otherwise, after the preset duration, the link is broken, and the browser detects that the link has been interrupted, Establish an HTTP link with the access server to achieve instant communication through an uninterrupted short link between the browser and the access server.
  • FIG. 1 is a main implementation of a method for realizing instant communication by using a browser according to an embodiment of the present invention
  • FIG. 2 is a flowchart of a user logging in to an instant messaging backend server through a browser and acquiring contact information according to an embodiment of the present invention
  • FIG. 3 is a flowchart of a message that a user uses a browser to implement message transmission and reception with a background server according to an embodiment of the present invention
  • FIG. 4 is a structural block diagram of a system for realizing instant communication by using a browser according to an embodiment of the present invention. Mode for carrying out the invention
  • the embodiment of the present invention provides a solution for realizing instant communication by using a browser, in which the browser sends a message to the access server by using an HTTP link established with the access server, and the access server adds the message to the sending queue. And detecting whether there is a message to be sent to the user in the sending queue, and if yes, using the current link to send the message at the front end of the sending queue, and interrupting the link after the message is sent; otherwise, After the preset duration, the link is broken.
  • the browser detects that the link has been interrupted, the browser re-establishes the HTTP link with the access server, so as to achieve instant communication through the uninterrupted short link between the browser and the access server.
  • FIG. 1 is a flowchart of a main implementation principle of a method for realizing instant communication by using a browser according to an embodiment of the present invention.
  • the main implementation process is as follows:
  • Step S10 The browser user accesses the webpage for providing the instant communication service, logs in to the background server through the browser, and obtains the profile information of the contact and displays it.
  • Step S11 When the user needs to send a message, the browser utilizes the XHR object and the access service.
  • the HTTP link established by the device sends the message to the access server and specifies a callback function for this message type.
  • Step S12 The access server adds a message sent by the browser to the sending queue, and detects whether there is a message that needs to be sent to the user in the sending queue. If yes, go to step S13, step S14, otherwise, perform the step. S15. Step S16.
  • Step S13 The access server sends the message at the front end of the delivery queue to the browser by using the link, and interrupts the link after the message is sent.
  • Step S14 The browser calls the corresponding callback function to process the received message according to the received message type, and re-establishes an HTTP link with the access server when detecting that the link has been interrupted.
  • Step S15 The access server interrupts the link after a preset duration.
  • Step S16 The browser re-establishes an HTTP link with the access server when detecting that the link has been interrupted.
  • FIG. 2 is a flowchart of a user logging in to an instant messaging background server through a browser and obtaining contact data.
  • the main implementation process is as follows:
  • Step S20 The browser user accesses the webpage for providing the instant messaging service, and receives the user identifier and password entered by the user in the webpage for logging into the instant messaging backend server.
  • Step S21 The browser runs a JS (Java Script) script in the webpage to create an XHR object, and uses the XHR object to establish an HTTP link with the access server, and sends a login message to the access server through the link, and the message carries The user ID and password are described, and a corresponding callback function is specified for this type of message.
  • JS Java Script
  • Step S23 The background server verifies the login message, and sends the verification result to the access server by using the verification response message, and the access server converts the verification response message into an HTTP protocol format and passes the currently existing XHR object and the access server.
  • the established HTTP link is sent to the browser, and the browser calls the corresponding callback function to process the verification response message, and displays the risk certificate result in the webpage.
  • Step S24 The browser determines whether the received verification response message is a verification pass message, and if yes, performs step S25, otherwise, the process ends.
  • Step S25 The browser determines whether there is an idle XHR object currently. If yes, the browser establishes an HTTP link with the access server by using the idle XHR object. Otherwise, the browser runs the JS script in the webpage to create an XHR object.
  • the XHR object is used to establish an HTTP link with the access server, and the contact data request message is sent to the access server through the established link, and a callback function is specified for the message type.
  • Step S26 After the access server converts the contact information request message into a protocol format adopted by the background server, sends the contact information to the corresponding background server for processing, and passes the received contact data through the currently existing XHR object.
  • the HTTP link established by the access server is sent to the browser.
  • Step S27 The browser determines whether the received contact information is complete. If yes, go to step S28, otherwise, go back to step S25.
  • step S28 the browser calls the corresponding callback function to display the complete contact data.
  • the HTTP link established between the XHR object and the access server is a short link.
  • the access server After receiving the message carried by the link, the access server detects whether there is a message to be sent locally. If yes, the link is to be sent through this link. The sent message is sent to the browser and the link is interrupted. If it does not exist, the link is interrupted after a predetermined period of time, and the browser detects the chain. After the connection is interrupted, the link between the access server and the access server is established again through the XHR object.
  • FIG. 3 is a flowchart of a message communication between a user and a background server by using a browser in the embodiment of the present invention.
  • the main implementation process is as follows:
  • Step S30 When the message needs to be sent, the browser determines whether there is an idle XHR object currently. If yes, the XHR object is used to establish an HTTP link with the access server, and if no, the JS script in the webpage is executed to create an XHR object. Using the XHR object to establish an HTTP link with the access server, send a message to the access server through the established link, and specify a corresponding callback function for the message of this type.
  • the message to be sent is an instant message input by the user or a predetermined automatically sent system message, such as a heartbeat message.
  • Step S31 The access server converts the message to be sent to the protocol format adopted by the background server, and then adds the message to the sending queue, and detects whether there is a message to be sent to the user in the sending queue, if yes, execute Step S32, otherwise, step S33 is performed.
  • the access server When receiving the message sent by the background server, the access server first converts the message into an HTTP protocol format, and then adds it to the delivery queue corresponding to the target user.
  • Step S32 The access server uses the link to send the message at the front end of the delivery queue, and interrupts the link after the message is sent.
  • Step S33 The access server interrupts the link after a preset duration.
  • Step S34 The browser calls the corresponding callback function to process the received message, and re-establishes an HTTP link with the access server when detecting that the link has been interrupted.
  • Step S35 The browser determines whether there is a message to be sent locally, and if yes, step S36 is performed, otherwise, step S37 is performed.
  • Step S36 The browser sends the cancellation to the access server by using the re-established link.
  • Step S37 The browser sends a heartbeat message to the access server by using the re-established link.
  • the access server detects, in real time, whether there is a message to be sent in the sending queue, and if yes, sends the last message in the sending queue by using an HTTP link established between the currently existing XHR object and the access server. Give the browser.
  • the present invention further proposes a system for realizing instant communication by using a browser.
  • FIG. 4 the figure shows the structure of a system for realizing instant communication by using a browser.
  • Block diagram which mainly includes a web server 40, a browser module 50, and an access server 60;
  • a web server 40 configured to provide a webpage for the instant messaging service to the browser module 50;
  • the browser module 50 is disposed on the client side, and is configured to obtain a webpage that provides an instant communication service from the web server 40, log in to the background server, and obtain the user's contact profile information from the user; use the XHR object to establish an HTTP with the access server.
  • the link sends and receives an instant message to the access server, and specifies a callback function for the message type, and invokes a callback function to process the received message, and re-establishes an HTTP link with the access server upon detecting that the link has been interrupted;
  • the access server 60 is configured to add a message sent by the browser module 50 to the sending queue, and detect whether there is a message in the sending queue that needs to be sent to the user, and if yes, use the current link to send the queue.
  • the most front-end message is sent to the browser module 50, and the link is broken after the message is sent, otherwise.
  • the link is broken after a preset period of time.
  • the browser module 50 specifically includes:
  • a webpage element obtaining submodule 501 configured to obtain, from a webpage server, a page element of a webpage providing an instant messaging service;
  • a link establishing submodule 502 configured to establish an HTTP link with the access server by using the XHR object;
  • the login sub-module 503 is configured to log in to the background server, obtain the contact information of the user, and display the information of the contact information in the webpage.
  • the specific process of logging in and obtaining the contact information of the login sub-module 503 can be referred to the above steps S20 to S29. , No longer.
  • a communication sub-module 504 configured to send and receive a message to the access server 60 by using the established HTTP link, and specify a callback function for the message type, and call a callback function to process the received message, and detect that the link has been interrupted
  • the trigger link establishment sub-module 502 re-establishes the HTTP link with the access server 60
  • the communication sub-module 504 detects whether there is a message to be sent locally, and if so, sends the message to the access server 60. The message, otherwise, sends a heartbeat message to the access server 60.
  • the access server 60 specifically includes:
  • the format conversion module 601 is configured to convert the message to be sent to the protocol format adopted by the background server, add the message to the sending queue of the message temporary storage module 602, and convert the message to be delivered into the browser module 50.
  • the protocol format is added to the sending queue of the message temporary storage module 602;
  • the message temporary storage module 602 is configured to temporarily store the message that needs to be sent and the message that needs to be delivered;
  • the message uploading module 603 is configured to send the messages in the sent queue to the corresponding back-end server for processing
  • the detecting module 604 is configured to detect whether there is a message to be sent in the sending queue, and the message sending module 605 is configured to use the currently existing XHR object and the access server.
  • the established HTTP link sends the top-end instant message in the dispatch queue to the browser module 50.
  • the embodiment of the present invention utilizes an XHR object through a browser.
  • the HTTP link established by the access server sends a message to the access server, and the access server adds the message to the sending queue, and detects whether there is a message that needs to be sent to the user in the sending queue, and if so, utilizes This link sends the message at the front end of the delivery queue, and breaks the link after the message is sent. Otherwise, after the preset time length breaks the link, the browser re-establishes the access server when it detects that the link has been interrupted.
  • HTTP link which enables instant communication through an uninterrupted short link between the browser and the access server. It is within the spirit and scope of the invention. Thus, it is intended that the present invention cover the modifications and the modifications of the invention.

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Data Mining & Analysis (AREA)
  • Economics (AREA)
  • Computer Hardware Design (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Information Transfer Between Computers (AREA)
  • Computer And Data Communications (AREA)

Description

一种即时通信的方法、 系统及装置 技术领域
本发明涉及即时通信领域, 尤其涉及一种即时通信的方法、 系统及 装置。 发明背景
即时通信技术发展到今天, 已经被大多数的网民所接受与认可, 成 为广大网民生活中不可缺少的一部分, 不但在平时的休闲娱乐中, 而且 在用户的工作中得到了广泛的使用。
现有技术中的即时通信系统均采用 C/S ( client/server, 客户端 /服务 器) 架构形式, 其中即时通信客户端软件安装于用户终端上, 用于提供 输入输出、 信息显示、 界面操作等功能, 而设置于网络侧的服务器用于 提供数据存储、 消息转发、 状态保存等功能。 用户进行即时通信时, 通 过安装于用户终端上的即时通信客户端软件向网络侧的接入服务器发 送登录信息, 登录信息中包括用户账号和密码; 接入服务器将该登录信 息转发到后台数据库进行匹配验证, 如验证成功, 则向即时通信客户端 软件返回该用户的好友资料等信息, 否则用户登录失败。 用户登录成功 以后, 就可以与当前已登录的其他用户进行即时通信。
上述现有技术的缺点在于用户每次登录即时通信系统时, 其前提条 件是在其使用的终端上必须有对应的即时通信客户端软件。 如果没有, 则必须首先下载并安装即时通信客户端软件, 然后通过即时通信客户端 软件登录即时通信系统, 与当前已登录的其他用户进行即时通信。 但往 往由于时间短暂、 硬盘容量或者操作系统等原因, 用户在终端上没有安 装即时通信客户端软件, 而用户又需要使用即时通信服务, 例如用户只 是临时使用某台没有安装即时通信客户端软件的终端, 这种情况下用户 是无法登录即时通信系统并进行即时通信的。 发明内容
本发明实施例提供一种即时通信的方法, 无须使用即时通信客户端 软件即可进行即时通信。
本发明实施例提供一种即时通信的系统, 无须使用即时通信客户端 软件即可进行即时通信。
本发明实施例提供一接入服务器, 无须使用即时通信客户端软件即 可进行即时通信。
本发明实施例的技术方案是这样实现的:
一种实现即时通信的方法, 该方法包括:
浏览器通过网页登录即时通信后台服务器, 并通过接入服务器发送 和接收即时消息。
一种实现即时通信的系统, 包括网页服务器、 浏览器模块和接入服 务器;
所述网页服务器, 向浏览器模块提供用于即时通信服务的网页; 所述浏览器模块, 从网页服务器获取用于即时通信服务的网页, 通 过该网页登录即时通信后台服务器, 与接入服务器建立超文本传输协议
HTTP链接, 并通过该链接向接入服务器发送和接收即时消息;
所述接入服务器, 通过与浏览器模块建立的 HTTP连接接收浏览器 模块发来的即时消息, 并向即时通信后台服务器转发, 接收即时通信后 台服务器发来的即时消息, 并向浏览器模块转发。
一种接入服务器, 所述接入服务器包括: 格式转换模块、 消息暂存 模块、 消息上传模块、 检测模块和消息下发模块;
所述格式转换模块, 用于接收浏览器发来的消息, 并转换为后台服 务器采用的协议格式后发送给消息暂存模块; 接收后台服务器发来的消 息, 并转换为浏览器模块采用的协议格式后发送给消息暂存模块;
所述消息暂存模块, 用于暂存从格式转换模块发来的消息; 所述消息上传模块, 用于将消息暂存模块中暂存的浏览器模块发来 的消息发送给后台服务器;
所述检测模块, 用于检测消息暂存模块中是否存在需要发送给浏览 器模块的的消息; 如有, 则向消息下发模块发送下发消息的命令;
所述消息下发模块, 用于接收检测模块发来的下发消息的命令, 利 用当前存在的 HTTP链接将消息暂存模块中需要发送给浏览器模块的消 息发送给所述浏览器模块。
与现有技术相比, 本发明实施例的技术方案中, 浏览器通过 AJAX ( Asynchronous JavaScript and XML, Java脚本和可扩展标识语言异步 ) 技术, 利用 XHR ( Xml Http Request, 可扩展标识语言超文本传输协议 请求)对象与接入服务器建立的 HTTP链接向接入服务器发送消息, 接 入服务器将所述消息添加到上发队列中, 并检测下发队列中是否存在需 要下发给所述用户的消息, 若是, 则利用本次链接发送下发队列中最前 端的消息, 并在消息下发完毕后中断链接; 否则, 经预设时长后中断链 接, 浏览器在检测到链接已中断时, 重新建立与接入服务器的 HTTP链 接, 从而达到通过浏览器与接入服务器之间不间断的短链接实现即时通 信的目的。 附图简要说明
图 1为本发明实施例利用浏览器实现即时通信的方法的主要实现原 理流程图;
图 2为本发明实施例中用户通过浏览器登录即时通信后台服务器并 获取联系人资料的流程图;
图 3为本发明实施例中用户利用浏览器实现与后台服务器之间消息 收发的流程图;
图 4为本发明实施例利用浏览器实现即时通信的系统的结构框图。 实施本发明的方式
为使本发明的目的、技术方案和优点更加清楚明白,以下举实施例, 并参照附图, 对本发明进一步详细说明。
本发明实施例提出一种利用浏览器实现即时通信的解决方案, 该方 案中浏览器利用与接入服务器建立的 HTTP链接向接入服务器发送消 息, 接入服务器将所述消息添加到上发队列中, 并检测下发队列中是否 存在需要下发给所述用户的消息, 若是, 则利用本次链接发送下发队列 中最前端的消息, 并在消息下发完毕后中断链接; 否则, 经预设时长后 中断链接, 浏览器在检测到链接已中断时, 重新建立与接入服务器的 HTTP链接, 从而达到通过浏览器与接入服务器之间不间断的短链接实 现即时通信的目的。
下面将结合各个附图对本发明实施例技术方案的具体实施过程进 行进一步详细的阐述。
请参阅图 1 , 该图为本发明实施例利用浏览器实现即时通信的方法 的主要实现原理流程图, 其主要实现过程为:
步骤 S10、 浏览器用户访问用于提供即时通信服务的网页, 通过浏 览器登录后台服务器, 从中获取联系人的资料信息并显示。
步骤 Sll、用户需要发送消息时, 浏览器利用 XHR对象与接入服务 器建立的 HTTP链接向接入服务器发送该消息, 并为此消息类型指定回 调函数。
步骤 S12、 接入服务器将浏览器发出的消息添加到上发队列中, 并 检测下发队列中是否存在需要下发给所述用户的消息, 若是, 执行步骤 S13、 步骤 S14, 否则, 执行步骤 S15、 步骤 S16。
步骤 S13、 接入服务器利用本次链接将下发队列中最前端的消息发 送给所述浏览器, 并在消息下发完毕后中断链接。
步骤 S14、 浏览器根据接收到的消息类型调用相应的回调函数处理 接收到的消息, 并在检测到链接已中断时, 重新建立与接入服务器的 HTTP链接。
步骤 S15、 接入服务器经预设时长后中断本次链接。
步骤 S16、 浏览器在检测到链接已中断时, 重新建立与接入服务器 的 HTTP链接。
以上介绍了本发明实施例利用浏览器进行即时通信的总体流程, 下 面将详细介绍浏览器登录即时通信后台服务器并获取联系人资料的详 细流程。
请参阅图 2, 该图为本发明中用户通过浏览器登录即时通信后台服 务器并获取联系人资料的流程图, 其主要实现过程为:
步骤 S20、 浏览器用户访问用于提供即时通信服务的网页, 接收用 户在所述网页中输入的用于登录即时通信后台服务器的用户标识及密 码。
步骤 S21、 浏览器运行所述网页中的 JS ( Java Script )脚本程序创建 XHR对象, 利用该 XHR对象与接入服务器建立 HTTP链接, 通过该链 接向接入服务器发送登录消息, 消息中携带有所述用户标识及密码, 同 时为此类型的消息指定相应的回调函数。 步骤 S22、 接入服务器将所述登录消息转换为后台服务器采用的协 议格式后, 将其发送给相应的后台服务器进行验证。
步骤 S23、 后台服务器对所述登录消息进行验证, 并将验证结果通 过验证响应消息发送给接入服务器, 接入服务器将验证响应消息转换为 HTTP协议格式后通过当前存在的 XHR对象与接入服务器建立的 HTTP 链接发送给浏览器, 由浏览器调用相应的回调函数处理该验证响应消 息, 在网页中显示险证结果。
步骤 S24、 浏览器判断收到的验证响应消息是否为验证通过消息, 若是, 执行步骤 S25, 否则, 流程结束。
步骤 S25、 浏览器判断当前是否存在空闲的 XHR对象, 若是, 浏览 器利用所述空闲的 XHR对象与接入服务器建立 HTTP链接, 否则, 浏 览器运行所述网页中的 JS脚本程序创建 XHR对象, 利用该 XHR对象 与接入服务器建立 HTTP链接, 通过所述建立的链接向接入服务器发送 联系人资料请求消息, 并为此消息类型指定回调函数。
步骤 S26、 接入服务器将所述联系人资料请求消息转换为后台服务 器采用的协议格式后, 将其发送给相应的后台服务器进行处理, 并将接 收到的联系人资料通过当前存在的 XHR 对象与接入服务器建立的 HTTP链接发送给浏览器。
步骤 S27、 浏览器判断接收到的联系人资料是否完整, 若是, 执行 步骤 S28, 否则, 返回步骤 S25。
步骤 S28、 浏览器调用相应的回调函数显示完整的联系人资料。 以上步骤中, XHR对象与接入服务器之间建立的 HTTP链接为短链 接, 接入服务器收到该链接承载的消息后, 检测本地是否存在待发送的 消息, 若存在, 通过本次链接将待发送的消息发送给浏览器后中断本次 链接, 若不存在, 则经过预定时长后中断本次链接, 浏览器在检测到链 接被中断后, 重新通过 XHR对象建立与接入服务器之间的链接。
下面将具体介绍用户登录后, 通过浏览器进行即时通信的具体过 程。
请参阅图 3, 该图为本发明实施例中用户利用浏览器与后台服务器 进行消息通信的流程图, 其主要实现过程为:
步骤 S30、 需要发送消息时, 浏览器判断当前是否存在空闲的 XHR 对象, 若是, 则利用该 XHR对象与接入服务器建立 HTTP链接, 否贝 ij , 运行所述网页中的 JS脚本程序创建 XHR对象, 利用该 XHR对象与接 入服务器建立 HTTP链接,通过所述建立的链接向接入服务器发送消息, 同时为此类型的消息指定对应的回调函数。
所述需要发送的消息为用户输入的即时消息或者预定的自动发出 的系统消息, 如心跳消息。
步骤 S31、 接入服务器将需要上发的消息转换为后台服务器采用的 协议格式后添加到上发队列中, 同时检测下发队列中是否存在需要下发 给所述用户的消息, 若存在, 执行步骤 S32, 否则, 执行步骤 S33。
接入服务器在收到后台服务器下发的消息时, 首先将该消息转换为 HTTP协议格式, 然后将其添加到目标用户对应的下发队列中。
步骤 S32、接入服务器利用本次链接发送下发队列中最前端的消息, 并在消息下发完毕后中断链接。
步骤 S33、 接入服务器经预设时长后中断链接。
步骤 S34、 浏览器调用相应的回调函数处理接收到的消息, 并在检 测到链接已中断时, 重新建立与接入服务器的 HTTP链接。
步骤 S35、 浏览器判断本地是否存在待发送的消息, 若是, 执行步 骤 S36, 否则, 执行步骤 S37。
步骤 S36、 浏览器利用所述重新建立的链接向接入服务器发送该消 步骤 S37、 浏览器利用所述重新建立的链接向接入服务器发送心跳 消息。
在上述过程中, 所述接入服务器实时检测下发队列中是否存在待发 送的消息, 若是, 则利用当前存在的 XHR对象与接入服务器建立的 HTTP链接将下发队列中最前端的消息发送给所述浏览器。
相应于本发明上述利用浏览器实现即时通信的方法, 本发明进而提 出了一种利用浏览器实现即时通信的系统, 请参阅图 4, 该图为本发明 利用浏览器实现即时通信的系统的结构框图, 其主要包括网页服务器 40、 浏览器模块 50和接入服务器 60; 其中,
网页服务器 40, 用于向浏览器模块 50提供用于即时通信服务的网 页;
浏览器模块 50, 设置在客户端侧, 用于从网页服务器 40中获取提 供即时通信服务的网页, 登录后台服务器, 并从中获取用户的联系人资 料信息; 利用 XHR对象与接入服务器建立的 HTTP链接向接入服务器 发送和接收即时消息, 并为该消息类型指定回调函数, 以及调用回调函 数处理接收到的消息, 并在检测到链接已中断时, 重新建立与接入服务 器的 HTTP链接;
接入服务器 60, 用于将浏览器模块 50发出的消息添加到上发队列 中, 并检测下发队列中是否存在需要下发给所述用户的消息, 若是, 利 用本次链接将下发队列中最前端的消息发送给所述浏览器模块 50,并在 消息下发完毕后中断链接, 否则。 经预设时长后中断链接。
其中, 所述浏览器模块 50具体包括:
网页元素获取子模块 501 , 用于从网页服务器中获取提供即时通信 服务的网页的页面元素; 链接建立子模块 502, 用于利用 XHR对象与接入服务器建立 HTTP 链接;
登录子模块 503, 用于登录后台服务器, 从中获取用户的联系人资 料信息, 并显示在所述网页中, 登录子模块 503登录及获取联系人资料 信息的具体过程可参见上述步骤 S20至步骤 S29, 不再赘述。
通信子模块 504, 用于利用所述建立的 HTTP链接向接入服务器 60 发送和接收消息, 并为该消息类型指定回调函数, 以及调用回调函数处 理接收到的消息, 并在检测到链接已中断时, 触发链接建立子模块 502 重新建立与接入服务器 60的 HTTP链接, 在所述 HTTP链接重新建立 后, 通信子模块 504检测本地是否存在待发送的消息, 若是, 向接入服 务器 60发送该消息, 否则, 向接入服务器 60发送心跳消息。
其中, 所述接入服务器 60具体包括:
格式转换模块 601 , 用于将需要上发的消息转换为后台服务器采用 的协议格式后添加到消息暂存模块 602的上发队列中, 以及将需要下发 的消息转换为浏览器模块 50采用的协议格式后添加到消息暂存模块 602 的下发队列中;
消息暂存模块 602, 用于对需要上发的消息及需要下发的消息进行 暂存;
消息上传模块 603 , 用于将上发队列中的消息依次发送给相应的后 台服务器进行处理;
检测模块 604, 用于检测下发队列中是否存在待发送的消息; 消息下发模块 605, 用于利用当前存在的 XHR对象与接入服务器
60建立的 HTTP链接将下发队列中最前端的即时消息发送给所述浏览器 模块 50。
以上所述可以看出, 本发明实施例通过浏览器, 利用 XHR对象与 接入服务器建立的 HTTP链接向接入服务器发送消息, 接入服务器将所 述消息添加到上发队列中, 并检测下发队列中是否存在需要下发给所述 用户的消息, 若是, 则利用本次链接发送下发队列中最前端的消息, 并 在消息下发完毕后中断链接; 否则, 经预设时长后中断链接, 浏览器在 检测到链接已中断时, 重新建立与接入服务器的 HTTP链接, 从而通过 浏览器与接入服务器之间不间断的短链接实现即时通信的目的。 离本发明的精神和范围。 这样, 倘若本发明的这些修改和变型属于本发 明权利要求及其等同技术的范围之内, 则本发明也意图包含这些改动和 变型在内。

Claims

权利要求书
1、 一种实现即时通信的方法, 其特征在于, 该方法包括: 浏览器通过网页登录即时通信后台服务器, 并通过接入服务器发送 和接收即时消息。
2、 如权利要求 1 所述的实现即时通信的方法, 其特征在于, 所述 浏览器通过网页登录即时通信后台服务器之后, 通过接入服务器发送和 接收即时消息之前, 进一步包括获取联系人资料信息的步骤。
3、 如权利要求 2所述的实现即时通信的方法, 其特征在于, 所述 获取联系人资料信息包括:
浏览器向接入服务器发送联系人资料请求消息, 并接收接入服务器 发来的联系人资料信息。
4、 如权利要求 3 所述的实现即时通信的方法, 其特征在于, 所述 接收接入服务器发来的联系人资料信息之后, 进一步包括:
判断接收到的联系人资料信息是否完整, 若不完整, 则再次执行向 接入服务器发送联系人资料请求消息, 并接收接入服务器发来的联系人 资料信息的步骤。
5、 如权利要求 1 所述的实现即时通信的方法, 其特征在于, 所述 通过网页登录即时通信后台服务器包括:
浏览器通过该网页接收用户输入的用户标识和密码; 并将用户标识 和密码通过登陆请求消息向接入服务器发送; 若接收到接入服务器返回 的验证成功的响应消息, 则成功登陆即时通信后台服务器。
6、 如权利要求 1 所述的实现即时通信的方法, 其特征在于, 所述 通过接入服务器发送和接收即时消息包括:
与接入服务器建立 HTTP链接, 并通过该 HTTP链接向接入月良务器 发送即时消息, 同时, 通过该 HTTP链接接收从接入服务器发送来的即 时消息。
7、 如权利要求 6所述的实现即时通信的方法, 其特征在于, 所述 与接入服务器建立 HTTP链接之后, 通过该 HTTP链接向接入服务器发 送即时消息之前, 进一步包括: 判断是否存在需要发送的即时消息, 若 在预定时间内收到用户输入的需要发送的即时消息, 则执行所述通过该 HTTP链接向接入服务器发送即时消息的步骤, 否则, 通过该 HTTP链 接向接入服务器发送心跳消息。
8、 如权利要求 6所述的实现即时通信的方法, 其特征在于, 所述 与接入月良务器建立 HTTP链接, 同时, 通过该 HTTP链接接收从接入服 务器发送来的即时消息, 包括: 浏览器在接收到接入服务器发来的即时 消息后, 所述与接入服务器建立的 HTTP链接将被接入服务器中断; 浏 览器在检测到与接入服务器建立的 HTTP链接被中断后, 再次执行与接 入服务器建立 HTTP链接, 并通过该 HTTP链接向接入服务器发送即时 消息, 同时, 通过该 HTTP链接接收从接入服务器发送来的即时消息的 步骤。
9、 一种实现即时通信的系统, 其特征在于, 包括网页服务器、 浏 览器模块和接入服务器;
所述网页服务器, 向浏览器模块提供用于即时通信服务的网页; 所述浏览器模块, 从网页服务器获取用于即时通信服务的网页, 通 过该网页登录即时通信后台服务器, 与接入服务器建立 HTTP链接, 并 通过该链接向接入服务器发送和接收即时消息;
所述接入服务器, 通过与浏览器模块建立的 HTTP连接接收浏览器 模块发来的即时消息, 并向即时通信后台服务器转发, 接收即时通信后 台服务器发来的即时消息, 并向浏览器模块转发。
10、 如权利要求 9所述的实现即时通信的系统, 其特征在于, 所述 浏览器模块具体包括: 网页元素获取子模块、 链接建立子模块、 登录子 模块和通信子模块;
所述网页元素获取子模块, 用于从网页服务器中获取提供即时通信 服务的网页的页面元素, 并发送给链接建立子模块;
所述链接建立子模块, 接收网页元素获取子模块发来的页面元素, 并利用该页面元素与接入服务器建立 HTTP链接;
所述登录子模块, 用于登录后台服务器;
所述通信子模块, 用于利用所述建立的 HTTP链接向接入服务器发 送消息和接收消息。
11、 如权利要求 10 所述的实现即时通信的系统, 其特征在于, 所 述登录子模块, 进一步用于接收用户输入的用户标识和密码; 并将用户 标识和密码通过登陆请求消息向接入服务器发送; 若接收到接入服务器 返回的验证成功的响应消息, 则成功登陆即时通信后台服务器; 向接入 服务器发送联系人资料请求消息, 并接收接入服务器发来的联系人资料 信息。
12、 如权利要求 10所述的实现即时通信的系统, 其特征在于, 所 述通信子模块, 接收消息完毕后, 进一步中断与接入服务器的 HTTP链 接; 若没有接收到所述即时消息, 则在预定时长后中断与接入服务器的 HTTP链接; 在在检测到链接已中断时, 触发链接建立子模块重新建立 与接入服务器的 HTTP链接, 在所述 HTTP链接重新建立后, 通信子模 块检测本地是否存在待发送的消息, 若是, 向接入服务器发送该消息, 否则, 向接入服务器发送心跳消息。
13、 如权利要求 10所述的实现即时通信的系统, 其特征在于, 所 述接入服务器具体包括: 格式转换模块、 消息暂存模块、 消息上传模块、 检测模块和消息下发模块;
所述格式转换模块, 用于接收浏览器发来的消息, 并转换为后台服 务器采用的协议格式后发送给消息暂存模块; 接收后台服务器发来的消 息, 并转换为浏览器模块采用的协议格式后发送给消息暂存模块; 所述消息暂存模块, 用于暂存从格式转换模块发来的消息; 所述消息上传模块, 用于将消息暂存模块中暂存的浏览器模块发来 的消息发送给后台服务器;
所述检测模块, 用于检测消息暂存模块中是否存在需要发送给浏览 器模块的的消息; 如有, 则向消息下发模块发送下发消息的命令; 所述消息下发模块, 用于接收检测模块发来的下发消息的命令, 利 用当前存在的 HTTP链接将消息暂存模块中需要发送给浏览器模块的消 息发送给所述浏览器模块。
14、 一种接入服务器, 其特征在于, 所述接入服务器包括: 格式转 换模块、 消息暂存模块、 消息上传模块、 检测模块和消息下发模块; 所述格式转换模块, 用于接收浏览器发来的消息, 并转换为后台服 务器采用的协议格式后发送给消息暂存模块; 接收后台服务器发来的消 息, 并转换为浏览器模块采用的协议格式后发送给消息暂存模块; 所述消息暂存模块, 用于暂存从格式转换模块发来的消息; 所述消息上传模块, 用于将消息暂存模块中暂存的浏览器模块发来 的消息发送给后台服务器;
所述检测模块, 用于检测消息暂存模块中是否存在需要发送给浏览 器模块的的消息; 如有, 则向消息下发模块发送下发消息的命令; 所述消息下发模块, 用于接收检测模块发来的下发消息的命令, 利用当 前存在的 HTTP链接将消息暂存模块中需要发送给浏览器模块的消息发 送给所述浏览器模块。
PCT/CN2007/071051 2006-12-19 2007-11-12 一种即时通信的方法、系统及装置 WO2008074244A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US12/485,532 US20090254628A1 (en) 2006-12-19 2009-06-16 Method, System And Apparatus For Instant Messaging

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CNB2006101622943A CN100521662C (zh) 2006-12-19 2006-12-19 一种利用浏览器实现即时通信的方法及系统
CN200610162294.3 2006-12-19

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US12/485,532 Continuation US20090254628A1 (en) 2006-12-19 2009-06-16 Method, System And Apparatus For Instant Messaging

Publications (2)

Publication Number Publication Date
WO2008074244A1 true WO2008074244A1 (zh) 2008-06-26
WO2008074244A8 WO2008074244A8 (zh) 2009-08-20

Family

ID=39405608

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2007/071051 WO2008074244A1 (zh) 2006-12-19 2007-11-12 一种即时通信的方法、系统及装置

Country Status (3)

Country Link
US (1) US20090254628A1 (zh)
CN (1) CN100521662C (zh)
WO (1) WO2008074244A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112637309A (zh) * 2020-12-16 2021-04-09 航天信息股份有限公司海外业务分公司 被管设备安全远程操控装置及方法

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101510896B (zh) * 2009-03-23 2012-05-23 北京佳讯飞鸿电气股份有限公司 一种基于Web的即时消息的实现方法
CN103297453B (zh) * 2012-02-24 2016-05-11 阿里巴巴集团控股有限公司 实现即时通讯的方法、浏览器端和系统
CN103312751A (zh) * 2012-03-14 2013-09-18 南京新与力文化传播有限公司 一种基于浏览器的即时通信方法
CN104009960B (zh) * 2013-02-22 2018-01-26 中兴通讯股份有限公司 一种实现手机客户端即时通信的方法及装置
CN105791363B (zh) * 2014-12-24 2019-03-08 北京奇虎科技有限公司 系统平台的会话方法和系统、及电子设备
CN104615771B (zh) * 2015-02-13 2018-12-21 广州华多网络科技有限公司 一种获取网页数据的方法及装置
CN107070772B (zh) * 2016-02-29 2020-06-09 飞救医疗科技(北京)有限公司 一种基于即时通信的协同工作中任务信息的提醒方法
CN106095886B (zh) * 2016-06-03 2020-10-09 腾讯科技(深圳)有限公司 一种数据处理方法及其装置
CN106790568A (zh) * 2016-12-27 2017-05-31 成都中科创达软件有限公司 一种基于html5的车载平台交互方法
CN107528769A (zh) * 2017-02-20 2017-12-29 天津转知汇网络技术有限公司 终端、服务端及即时通讯方法和系统
CN112653747A (zh) * 2020-12-17 2021-04-13 青岛以萨数据技术有限公司 基于b/s架构的通信方法、系统及存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002015500A2 (en) * 2000-08-14 2002-02-21 Co3I Limited System and method for messaging
CN1808983A (zh) * 2006-02-15 2006-07-26 阿里巴巴公司 一种实现即时通讯的方法及系统
US20060168543A1 (en) * 2005-01-27 2006-07-27 Microsoft Corporation Attachment browser

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6675196B1 (en) * 1999-01-08 2004-01-06 Amazon.Com, Inc. Universal protocol for enabling a device to discover and utilize the services of another device
US7171473B1 (en) * 1999-11-17 2007-01-30 Planet Exchange, Inc. System using HTTP protocol for maintaining and updating on-line presence information of new user in user table and group table
US6910063B1 (en) * 2000-06-28 2005-06-21 Microsoft Corporation System and method of enhancing web server throughput in single and multiple processor systems
AUPR459901A0 (en) * 2001-04-27 2001-05-24 Sharinga Networks Inc. Instant messaging
US6965765B2 (en) * 2001-05-17 2005-11-15 Palmsource, Inc. Transactional message-queue communication for wirelessly networked devices system and method
EP1400135A1 (en) * 2001-06-25 2004-03-24 Ram Jethanand Balani Method and device for effecting venue specific wireless communication
US7640293B2 (en) * 2002-07-17 2009-12-29 Research In Motion Limited Method, system and apparatus for messaging between wireless mobile terminals and networked computers
US20090125591A1 (en) * 2002-09-30 2009-05-14 Ficus Kirkpatrick Instant messaging proxy apparatus and method
US7568007B2 (en) * 2004-09-29 2009-07-28 International Business Machines Corporation System and method for supporting instant messaging in disconnected modes
US20060085509A1 (en) * 2004-10-15 2006-04-20 Nokia Corporation Server based constraint of mail folder content through filters
US7797732B2 (en) * 2004-11-04 2010-09-14 Topeer Corporation System and method for creating a secure trusted social network
WO2006073980A2 (en) * 2005-01-06 2006-07-13 Tervela, Inc. Hardware-based messaging appliance
US8676899B2 (en) * 2006-01-26 2014-03-18 International Business Machines Corporation Offline IM chat to avoid server connections
US20080040653A1 (en) * 2006-08-14 2008-02-14 Christopher Levine System and methods for managing presentation and behavioral use of web display content

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002015500A2 (en) * 2000-08-14 2002-02-21 Co3I Limited System and method for messaging
US20060168543A1 (en) * 2005-01-27 2006-07-27 Microsoft Corporation Attachment browser
CN1808983A (zh) * 2006-02-15 2006-07-26 阿里巴巴公司 一种实现即时通讯的方法及系统

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112637309A (zh) * 2020-12-16 2021-04-09 航天信息股份有限公司海外业务分公司 被管设备安全远程操控装置及方法
CN112637309B (zh) * 2020-12-16 2023-01-13 航天信息股份有限公司海外业务分公司 被管设备安全远程操控装置及方法

Also Published As

Publication number Publication date
WO2008074244A8 (zh) 2009-08-20
CN100521662C (zh) 2009-07-29
US20090254628A1 (en) 2009-10-08
CN101179518A (zh) 2008-05-14

Similar Documents

Publication Publication Date Title
WO2008074244A1 (zh) 一种即时通信的方法、系统及装置
US9300717B2 (en) Information transmission method and system, and browser on mobile terminal
US7177398B2 (en) Bi-directional messaging for an emergency services network
CA2664003C (en) Method and system for triggering internet applications using messages
US9591083B1 (en) Method and apparatus providing connection recovery for a chat client
US8019055B2 (en) Media instant messaging for mobile device
US8112410B2 (en) Method for searching across instant message systems and interconnecting server
WO2011137830A1 (zh) 一种业务分发平台消息推送方法、相关设备及系统
CN101707600B (zh) 基于web2.0实现多协议即时通信的系统及方法
CA2391709A1 (en) A method and system for releasing a voice response unit from a protocol session
EP2429161B1 (en) Background service process unit, call center position system and call control method thereof
US9635179B1 (en) Consumer care system
CN101599982A (zh) 手机信息浏览装置、系统及实现方法
WO2007112686A1 (fr) Système et procédé de communication instantanée basé sur wap
US20070127515A1 (en) Method and system for improving user confidence and experience in content purchasing via a service provider premises
US20120093147A1 (en) Method for providing internet services to a telephone user
CN101232379B (zh) 一种实现系统登录的方法、信息技术系统和通信系统
WO2015196818A1 (zh) 短消息发送方法及装置
WO2012122914A2 (zh) 基于ip的可视化语音邮件实现方法和系统
CN102447685A (zh) 基于ims的视频监控云镜控制方法、服务器及系统
WO2011020337A1 (zh) 座席和自动业务随路数据传送的ctiex、系统和方法
CN113542324A (zh) 一种消息推送方法和装置
KR101330721B1 (ko) Ivr 서비스 시스템 및 그 방법
CN115766823A (zh) 基于tcp实现终端app与服务器断线重连的方法及系统
CN107454580B (zh) 一种实现应用程序流量定向引导的方法和系统及移动终端

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 07817241

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 3433/CHENP/2009

Country of ref document: IN

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1)EPC

122 Ep: pct application non-entry in european phase

Ref document number: 07817241

Country of ref document: EP

Kind code of ref document: A1