WO2011015020A1 - 文件传输方法、***及客户端 - Google Patents

文件传输方法、***及客户端 Download PDF

Info

Publication number
WO2011015020A1
WO2011015020A1 PCT/CN2009/076001 CN2009076001W WO2011015020A1 WO 2011015020 A1 WO2011015020 A1 WO 2011015020A1 CN 2009076001 W CN2009076001 W CN 2009076001W WO 2011015020 A1 WO2011015020 A1 WO 2011015020A1
Authority
WO
WIPO (PCT)
Prior art keywords
instant messaging
messaging client
file
module
connection
Prior art date
Application number
PCT/CN2009/076001
Other languages
English (en)
French (fr)
Inventor
许培华
陆剑峰
黄河
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2011015020A1 publication Critical patent/WO2011015020A1/zh

Links

Classifications

    • 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 instant messaging technology, and in particular to a file transfer method, system and client. Background technique
  • File transfer is one of the basic functions of instant messaging services. This feature allows users to quickly transfer files instantly, making it easy to share files, pictures or other file resources.
  • the file transfer between the instant messaging clients needs to be uniformly transferred through the instant messaging server. Therefore, both the sender and the receiver are required to establish a link with the instant messaging server.
  • the sender first transfers the file to the instant messaging server, and the instant messaging server forwards the file content to the recipient.
  • the main object of the present invention is to provide a file transmission method, system and client, which can save instant messaging server resources and improve the performance of the instant messaging server.
  • a file transfer method comprising:
  • the first instant messaging client sends a request message for requesting file transmission to the second instant messaging client via the instant messaging server;
  • the first instant messaging client receives, by the instant messaging server, a message from the second instant messaging client that agrees to receive the file; the message that agrees to receive the file carries the information of the second instant messaging client;
  • the first instant messaging client directly establishes a connection based on the transmission control protocol TCP/Internet Protocol IP protocol with the second instant messaging client according to the information of the second instant messaging client, and after the connection is successful, the first instant messaging client directly Sending a file to the second instant messaging client.
  • the method further includes:
  • the first instant messaging client sends a file to the second instant messaging client via the instant messaging server.
  • the information of the second instant messaging client includes at least one of the following:
  • the IP address of the second instant messaging client and the port number of the second instant messaging client are the IP address of the second instant messaging client and the port number of the second instant messaging client.
  • a file transfer method includes:
  • the second instant messaging client receives the request message for requesting file transmission from the first instant messaging client via the instant messaging server, where the request message carries the information of the first instant messaging client;
  • the second instant messaging client directly establishes a connection based on the transmission control protocol TCP/Internet Protocol IP protocol with the first instant messaging client according to the information of the first instant messaging client, and after the connection is successful, the second instant messaging client directly Receive files from the first instant messaging client.
  • the method further includes: The second instant messaging client receives the file from the first instant messaging client via the instant messaging server.
  • the information of the first instant messaging client includes at least one of the following:
  • the IP address of the first instant messaging client and the port number of the first instant messaging client are the IP address of the first instant messaging client and the port number of the first instant messaging client.
  • a client comprising a sending module, a receiving module, a connecting module 56 and a file module;
  • a sending module configured to send, by using an instant messaging server, a request message for requesting file transmission to the destination instant messaging client;
  • a receiving module configured to receive, by the instant messaging server, a message from the destination instant messaging client that agrees to receive the file; the message that agrees to receive the file carries the information of the target instant messaging client;
  • connection module configured to directly perform a connection based on a transmission control protocol TCP/Internet Protocol IP protocol to the destination instant messaging client according to the information of the instant messaging client, and send a connection establishment notification to the file module;
  • a file module configured to send a file directly to the destination instant messaging client when receiving the connection establishment notification from the connection module and displaying that the connection is successful.
  • the file module is further configured to send a file to the destination instant messaging client via the instant messaging server when receiving the connection establishment notification from the connection module 56 as a connection failure.
  • a client including a first receiving module, a connecting module, and a second receiving module, where the first receiving module is configured to receive a request message for requesting file transmission from a source instant messaging client, where the request message is carried Information about the source instant messaging client;
  • connection module configured to directly establish a connection based on a transmission control protocol TCP/Internet Protocol IP protocol with the source instant messaging client according to the information of the source instant messaging client from the first receiving module, and send a connection establishment notification to the second receiving module 66.
  • the second receiving module is configured to directly receive the file from the source instant messaging client when receiving the connection establishment notification from the connection module to indicate that the connection is successful.
  • the second receiving module is further configured to receive, by the instant messaging server, the file from the source instant messaging client when receiving a connection establishment notification from the connection module 64 as a connection failure.
  • a file transfer system includes a first instant messaging client, a second instant messaging client, and an instant messaging server; wherein
  • the first instant messaging client and the second instant messaging client are customized PC terminals, respectively for communicating with the instant messaging server through a standard protocol;
  • An instant messaging server a server deployed on a network, that implements the processing logic of instant messaging.
  • the first instant messaging client or the second instant messaging client includes a sending module, a receiving module, a connecting module 56, and a file module;
  • a sending module configured to send, by using an instant messaging server, a request message for requesting file transmission to the destination instant messaging client;
  • a receiving module configured to receive, by the instant messaging server, a message from the destination instant messaging client that agrees to receive the file; the message that agrees to receive the file carries the information of the target instant messaging client;
  • connection module configured to directly perform a connection based on a transmission control protocol TCP/Internet Protocol IP protocol to the destination instant messaging client according to the information of the instant messaging client, and send a connection establishment notification to the file module;
  • a file module configured to send a file directly to the destination instant messaging client when receiving the connection establishment notification from the connection module and displaying that the connection is successful.
  • the file module is further configured to send a file to the destination instant messaging client via the instant messaging server when the connection establishment notification from the connection module is received as a connection failure.
  • the first instant messaging client or the second instant messaging client includes a first receiving module, a connecting module, and a second receiving module;
  • a first receiving module configured to receive a request message for requesting file transmission from a source instant messaging client, where the request message carries information of the source instant messaging client;
  • connection module configured to directly establish a connection based on a transmission control protocol TCP/Internet Protocol IP protocol with the source instant messaging client according to the information of the source instant messaging client from the first receiving module, and send a connection establishment notification to the second receiving module;
  • the second receiving module is configured to directly receive the file from the source instant messaging client when receiving the connection establishment notification from the connection module to indicate that the connection is successful.
  • the second receiving module is further configured to receive, by the instant messaging server, the file from the source instant messaging client when receiving a connection establishment notification from the connection module to display a connection failure.
  • the present invention solves the problem that the file transmission between the instant messaging clients in the same network environment in the related art still requires the server to be transferred, resulting in waste of server side resources and server performance degradation.
  • the problem which reduces the burden on the instant messaging server, improves the performance of the instant messaging server and the efficiency of file transfer.
  • FIG. 1 is a flow chart of an embodiment of a file transmission method 1 of the present invention.
  • FIG. 2 is a flow chart of an embodiment of a file transfer mode 2 of the present invention.
  • Figure 3 is a flow chart of a specific embodiment of the file transfer of the present invention.
  • FIG. 4 is a schematic diagram of an embodiment of a signaling interaction process of file transmission according to the present invention.
  • FIG. 5 is a schematic structural diagram of an embodiment of a client of the present invention
  • 6 is a schematic structural diagram of an embodiment of another client of the present invention
  • FIG. 7 is a schematic diagram of an embodiment of a system structure for file transmission according to the present invention.
  • the processing principle of the file transmission scheme of the present invention is as follows:
  • the first instant messaging client sends a request message for requesting file transmission to the second instant messaging client via the instant messaging server; the first instant messaging client receives via the instant messaging server
  • the message from the second instant messaging client agreeing to receive the file, wherein the message agreeing to receive the file carries the information of the second instant messaging client; the first instant messaging client directly and the second according to the information of the second instant messaging client
  • the instant messaging client establishes a connection based on the Transmission Control Protocol TCP/Internet Protocol IP protocol. If the connection is successful, the first instant messaging client directly sends the file to the second instant messaging client.
  • the network environment of the sender and the receiver can be determined, thereby selecting an appropriate file transmission mode, so that the files transmitted between users in the same network environment are still transited through the instant messaging server, but The sender and the receiver directly perform file transmission, thereby greatly improving the performance of the instant messaging server and the effect of the file transmission.
  • the steps illustrated in the flowchart of the figures may be performed in a computer system such as a set of computer executable instructions, and although the logical order is illustrated in the flowchart, in some cases The steps shown or described may be performed in an order different from that herein.
  • a file transfer method is provided, which can be implemented in two forms. The two methods are described in detail below.
  • Step 100 A first instant messaging client (ie, a sender) sends an instant message to an instant messaging server.
  • the second instant messaging client ie, the recipient
  • Step 101 The first instant messaging client receives, after the second instant messaging client receives the request message for the file transfer, receives, by the instant messaging server, a message from the second instant messaging client to agree to receive the file, where the file is agreed to receive the file.
  • the message carries the information of the second instant messaging client.
  • Step 102 After receiving the message of the second instant messaging client acknowledging the receipt of the file, the first instant messaging client directly contacts the second instant messaging client according to the information of the second instant messaging client carried in the agreed-upon file message. Establish a connection based on the Transmission Control Protocol (TCP)/Internet Protocol (IP). If the connection is successful, it means that the sender and the receiver are in the same network environment and can be directly connected. The first instant messaging client sends the file directly to the second instant messaging client over the established TCP/IP connection.
  • TCP Transmission Control Protocol
  • IP Internet Protocol
  • step 102 if the first instant messaging client fails to establish a connection with the second instant messaging client, the first instant messaging client sends the file to the second instant messaging client via the instant messaging server. That is, the first instant messaging client sends the file to the instant messaging server, and then the instant messaging server forwards the file to the second instant messaging client.
  • the information of the second instant messaging client carried in the information of the second instant messaging client may be network information of the second instant messaging client, for example, an IP address, and/or a port number.
  • Step 200 The second instant messaging client receives the request from the first instant messaging client via the instant messaging server. A request message for file transmission, where the request message carries information of the first instant messaging client.
  • the information of the first instant messaging client includes network information of the first instant messaging client, For example, IP address, and/or port number, etc.
  • Step 201 After receiving the request message of the file transfer of the first instant messaging client, the second instant messaging client directly establishes a TCP/IP-based connection with the first instant messaging client according to the information of the first instant messaging client. If the connection is successful, it means that the sender and the receiver are in the same network environment, and can directly connect, and the second instant messaging client directly receives the
  • step 201 after the second instant messaging client directly fails to establish a connection with the first instant messaging client, the first instant messaging client still sends the file to the instant messaging server, and the instant messaging server is sent to the second instant messaging client. Send File.
  • FIG. 3 is a flowchart of a specific embodiment of file transmission according to the present invention
  • FIG. 4 is a schematic diagram of an embodiment of a signaling interaction process for file transmission according to the present invention.
  • FIG. 3 is described below with reference to FIG. 4:
  • Step 300 Set two Instant messaging client, an instant messaging server; instant messaging server used to implement the relevant logic of instant messaging services.
  • the two instant messaging clients include the sender instant messaging client (the cartridge is called the sender) and the receiver instant messaging client (the cartridge is called the receiver), and the instant messaging client is the customized terminal, which can be combined with the instant messaging server. Communicate via standard protocols.
  • Step 301 The sender sends a request message requesting file transmission to the receiver via the instant messaging server.
  • Step 302 After receiving the request message for file transmission from the sender, the receiver sends a response message to the sender to agree to receive the file through the instant messaging server, and carries the information of the receiver in the message that agrees to receive the file.
  • the recipient's information includes the recipient's network information, such as the recipient's IP address, and/or the recipient's port number.
  • Step 303 After receiving the message from the recipient agreeing to receive the file, the sender agrees The network information in the message receiving the file directly establishes a connection based on the TCP/IP protocol with the receiver. If the connection is successful, it means that the sender and the receiver are in the same network environment, and can directly connect, and the sender directly establishes the file. The link is sent to the receiver; if the connection fails, the sender sends the file to the instant messaging server, and then forwards the file to the recipient through the instant messaging server.
  • FIG. 5 is a schematic structural diagram of an embodiment of a client of the present invention.
  • the client of the present invention includes a sending module 52, a receiving module 54, and a connecting module. 56 and file module 58, wherein
  • the sending module 52 is configured to send, by using an instant messaging server, a request message for requesting file transmission to the destination instant messaging client;
  • the receiving module 54 is coupled to the transmitting module 52 for receiving, via the instant messaging server, a message from the destination instant messaging client that agrees to receive the file.
  • the message that agrees to receive the file carries the information of the destination instant messaging client;
  • connection module 56 is connected to the receiving module 54 for receiving the message from the receiving module 54 to accept the file, and establishing the TCP/IP protocol based directly with the destination instant messaging client according to the information of the instant messaging client in the message. Connecting, sending a connection establishment notification to the file module 58;
  • the file module 58 is coupled to the connection module 56 for transmitting a file directly to the destination instant messaging client upon receiving a connection establishment notification from the connection module 56 indicating that the connection was successful.
  • the file module 58 is further configured to send a file to the destination instant messaging client via the instant messaging server upon receiving the connection establishment notification from the connection module 56 as a connection failure.
  • the information of the destination instant messaging client is the network information of the destination instant messaging client, including the IP address of the destination instant messaging client, and/or the port number of the destination instant messaging client.
  • FIG. 6 is another embodiment of the present invention.
  • a schematic structural diagram of an embodiment of a client, as shown in FIG. 6, includes a first receiving module 62, a connecting module 64, and a second receiving module 66, where
  • the first receiving module 62 is configured to receive a request message for requesting file transmission from the source instant messaging client, where the request message carries information of the active instant messaging client;
  • the connection module 64 is configured to establish a TCP/IP protocol-based connection with the source instant messaging client according to the information from the source instant messaging client of the first receiving module 62, and send a connection establishment notification to the second receiving module 66.
  • the second receiving module 66 is configured to directly receive the file from the source instant messaging client when receiving the connection establishment notification from the connection module 64 to indicate that the connection is successful.
  • the second receiving module 66 is further configured to receive the file from the source instant messaging client via the instant messaging server when receiving the connection establishment notification from the connection module 64 as the connection failure.
  • the information of the source instant messaging client includes network information of the source instant messaging client, such as the IP address of the source instant messaging client, and/or the port number of the source instant messaging client.
  • Embodiments of the present invention provide a system for file transmission in instant messaging.
  • 7 is a schematic diagram of an embodiment of a system structure for file transfer according to the present invention. As shown in FIG. 7, the system includes an instant messaging client 101, an instant messaging client 102, and an instant messaging server 103.
  • the instant messaging client 101 and the instant messaging client 102 are customized PC terminals, and communicate with the instant messaging server through a standard protocol; the instant messaging server 103 is a server deployed on the network, and is used to implement instant messaging processing logic.
  • the instant messaging client 101 and the instant messaging client 102 respectively correspond to the first instant messaging client and the second instant messaging client in the foregoing method embodiment, and the file transfer process in the system is the same as in the method embodiment, This will not be repeated here.
  • an appropriate file transmission mode can be automatically selected to prevent the instant messaging client of the sender and the instant messaging client of the receiver from being in the same network environment.
  • an appropriate file transmission mode can be automatically selected to prevent the instant messaging client of the sender and the instant messaging client of the receiver from being in the same network environment.
  • modules or steps of the present invention can be implemented by a general-purpose computing device, which can be concentrated on a single computing device or distributed over a network composed of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device, such that they may be stored in the storage device by the computing device, or they may be separately fabricated into individual integrated circuit modules, or they may be Multiple modules or steps are made into a single integrated circuit module. Thus, the invention is not limited to any specific combination of hardware and software.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本发明提供了一种文件传输方法及客户端,该方法包括:第一即时通讯客户端经由即时通讯服务器向第二即时通讯客户端发送用于请求文件传 输的请求消息;第一即时通讯客户端经由即时通讯服务器接收来自第二即时通讯客户端的同意接收文件的消息,其中,同意接收文件的消息中携带有第二即时通讯客户端的信息;第一即时通讯客户端根据第二即时通讯客户端的信息向第二即时通讯客户端直接进行基于传输控制协议TCP/互联网协议IP协议的连接,如果连接成功,则第一即时通讯客户端向第二即时通讯客户端直接发送文件。通过本发明,减轻了即时通讯服务器的负担,提高了即时通讯服务器的性能和文件传输的效率。

Description

文件传输方法、 ***及客户端 技术领域
本发明涉及即时通讯技术, 具体而言, 涉及一种文件传输方法、 *** 及客户端。 背景技术
文件传输是即时通讯业务的基本功能之一, 该功能可以使用户快速实 现文件的即时传输, 从而方便的共享文件、 图片或其它的文件资源。
目前, 在即时通讯业务中, 即时通讯客户端间的文件传输都需要通过 即时通讯服务器统一中转, 因此, 要求发送方和接收方都要与即时通讯服 务器建立链路。 发送方先将文件传送到即时通讯服务器, 即时通讯服务器 再将文件内容转发给接收方。
在实际使用环境中, 当发送方与接收方位于同一网络环境时, 二者可 以通过直接进行连接来传输文件, 但是, 在这种环境下, 使用目前的即时 通讯业务, 仍然会通过即时通讯服务器中转进行文件传输, 从而造成即时 通讯服务器侧资源的浪费, 降低了即时通讯服务器的性能。 发明内容
本发明的主要目的在于提供一种文件传输方法、 ***及客户端, 能够 节约即时通讯服务器资源、 提高即时通讯服务器性能。
为了实现上述目的, 根据本发明的一个方面, 提供了一种文件传输方 法, 包括:
第一即时通讯客户端经由即时通讯服务器向第二即时通讯客户端发送 用于请求文件传输的请求消息; 第一即时通讯客户端经由即时通讯服务器接收来自第二即时通讯客户 端的同意接收文件的消息; 所述同意接收所述文件的消息中携带有第二即 时通讯客户端的信息;
第一即时通讯客户端根据第二即时通讯客户端的信息, 直接与第二即 时通讯客户端建立基于传输控制协议 TCP/互联网协议 IP协议的连接,并在 连接成功后, 第一即时通讯客户端直接向所述第二即时通讯客户端发送文 件。
在所述第一即时通讯客户端直接与所述第二即时通讯客户端建立连接 失败后, 还包括:
所述第一即时通讯客户端经由所述即时通讯服务器, 向所述第二即时 通讯客户端发送文件。
所述第二即时通讯客户端的信息至少包括以下之一:
所述第二即时通讯客户端的 IP地址、 所述第二即时通讯客户端的端口 号。
一种文件传输方法, 包括:
第二即时通讯客户端经由即时通讯服务器, 接收来自第一即时通讯客 户端的用于请求文件传输的请求消息, 其中, 所述请求消息中携带有第一 即时通讯客户端的信息;
第二即时通讯客户端根据第一即时通讯客户端的信息, 直接与第一即 时通讯客户端建立基于传输控制协议 TCP/互联网协议 IP协议的连接,并在 连接成功后, 第二即时通讯客户端直接接收来自第一即时通讯客户端的文 件。
在所述第二即时通讯客户端直接与第一即时通讯客户端建立连接失败 后, 还包括: 所述第二即时通讯客户端经由即时通讯服务器, 接收来自第一即时通 讯客户端的文件。
所述第一即时通讯客户端的信息至少包括以下之一:
所述第一即时通讯客户端的 IP地址、 所述第一即时通讯客户端的端口 号。
一种客户端, 包括发送模块、 接收模块、 连接模块 56和文件模块; 其 中,
发送模块, 用于经由即时通讯服务器, 向目的即时通讯客户端发送用 于请求文件传输的请求消息;
接收模块, 用于经由即时通讯服务器接收来自所述目的即时通讯客户 端的同意接收文件的消息; 所述同意接收所述文件的消息中携带有所述目 的即时通讯客户端的信息;
连接模块, 用于根据所述目的即时通讯客户端的信息向所述目的即时 通讯客户端直接进行基于传输控制协议 TCP/互联网协议 IP协议的连接,向 文件模块发送连接建立通知;
文件模块, 用于在接收到来自连接模块的连接建立通知显示为连接成 功时, 直接向所述目的即时通讯客户端发送文件。
所述文件模块, 还用于在接收到来自连接模块 56的连接建立通知显示 为连接失败时, 经由所述即时通讯服务器向目的即时通讯客户端发送文件。
一种客户端, 包括第一接收模块、 连接模块和第二接收模块; 其中, 第一接收模块, 用于接收来自源即时通讯客户端的用于请求文件传输 的请求消息; 所述请求消息中携带有所述源即时通讯客户端的信息;
连接模块, 用于根据来自第一接收模块的源即时通讯客户端的信息, 直接与源即时通讯客户端建立基于传输控制协议 TCP/互联网协议 IP协议的 连接, 向第二接收模块 66发送连接建立通知; 第二接收模块, 用于在接收到来自连接模块的连接建立通知显示为连 接成功时, 直接接收来自所述源即时通讯客户端的文件。
所述第二接收模块, 还用于在接收到来自连接模块 64的连接建立通知 显示为连接失败时, 经由所述即时通讯服务器接收来自所述源即时通讯客 户端的所述文件。
一种文件传输***, 包括第一即时通讯客户端、 第二即时通讯客户端 和即时通讯服务器; 其中,
第一即时通讯客户端和第二即时通讯客户端为定制 PC终端,分别用于 与即时通讯服务器通过标准协议进行通讯;
即时通讯服务器, 部署在网络上的服务器, 用于实现即时通讯的处理 逻辑。
所述第一即时通讯客户端或第二即时通讯客户端包括发送模块、 接收 模块、 连接模块 56和文件模块; 其中,
发送模块, 用于经由即时通讯服务器, 向目的即时通讯客户端发送用 于请求文件传输的请求消息;
接收模块, 用于经由即时通讯服务器接收来自所述目的即时通讯客户 端的同意接收文件的消息; 所述同意接收所述文件的消息中携带有所述目 的即时通讯客户端的信息;
连接模块, 用于根据所述目的即时通讯客户端的信息向所述目的即时 通讯客户端直接进行基于传输控制协议 TCP/互联网协议 IP协议的连接,向 文件模块发送连接建立通知;
文件模块, 用于在接收到来自连接模块的连接建立通知显示为连接成 功时, 直接向所述目的即时通讯客户端发送文件。
所述文件模块, 还用于在接收到来自连接模块的连接建立通知显示为 连接失败时, 经由所述即时通讯服务器向目的即时通讯客户端发送文件。 所述第一即时通讯客户端或第二即时通讯客户端包括第一接收模块、 连接模块和第二接收模块; 其中,
第一接收模块, 用于接收来自源即时通讯客户端的用于请求文件传输 的请求消息; 所述请求消息中携带有所述源即时通讯客户端的信息;
连接模块, 用于根据来自第一接收模块的源即时通讯客户端的信息, 直接与源即时通讯客户端建立基于传输控制协议 TCP/互联网协议 IP协议的 连接, 向第二接收模块发送连接建立通知;
第二接收模块, 用于在接收到来自连接模块的连接建立通知显示为连 接成功时, 直接接收来自所述源即时通讯客户端的文件。
所述第二接收模块, 还用于在接收到来自连接模块的连接建立通知显 示为连接失败时, 经由所述即时通讯服务器接收来自所述源即时通讯客户 端的所述文件。
通过本发明, 采用在客户端之间直接建立连接的方案, 解决了相关技 术中在同一网络环境下的即时通讯客户端之间进行文件传输仍需要服务器 中转而导致服务器侧资源浪费、 服务器性能降低的问题, 进而减轻了即时 通讯服务器的负担, 提高了即时通讯服务器的性能和文件传输的效率。 附图说明
此处所说明的附图用来提供对本发明的进一步理解, 构成本申请的一 部分, 本发明的示意性实施例及其说明用于解释本发明, 并不构成对本发 明的不当限定。 在附图中:
图 1是本发明文件传输方式一的实施例的流程图;
图 2是本发明文件传输方式二的实施例的流程图;
图 3是本发明文件传输具体的实施例的流程图;
图 4是本发明文件传输的信令交互流程的实施例的示意图;
图 5是本发明客户端的实施例的组成结构示意图; 图 6是本发明另一种客户端的实施例的组成结构示意图; 图 7是本发明文件传输的***结构的实施例的示意图。 具体实施方式
本发明文件传输方案的处理原则如下: 第一即时通讯客户端经由即时 通讯服务器, 向第二即时通讯客户端发送用于请求文件传输的请求消息; 第一即时通讯客户端经由即时通讯服务器, 接收来自第二即时通讯客户端 的同意接收文件的消息, 其中, 同意接收文件的消息中携带有第二即时通 讯客户端的信息; 第一即时通讯客户端根据第二即时通讯客户端的信息, 直接与第二即时通讯客户端建立基于传输控制协议 TCP/互联网协议 IP协议 的连接, 如果连接成功, 则第一即时通讯客户端直接向第二即时通讯客户 端发送文件。 通过本发明实施例, 在连接成功时, 可以判断出发送方与接 收方的网络环境, 从而选择合适的文件传输方式, 避免相同网络环境中的 用户间传输文件仍然通过即时通讯服务器中转, 而是发送方与接收方直接 进行文件传输, 从而极大地提高了即时通讯服务器的性能和文件传输的效 需要说明的是, 在不冲突的情况下, 本申请中的实施例及实施例中的 特征可以相互组合。 下面将参考附图并结合实施例来详细说明本发明。
在以下实施例中, 在附图的流程图示出的步骤可以在诸如一组计算机 可执行指令的计算机***中执行, 并且, 虽然在流程图中示出了逻辑顺序, 但是在某些情况下, 可以以不同于此处的顺序执行所示出或描述的步骤。
根据本发明的实施例, 提供了一种文件传输方法, 该方法可以通过两 种形式实现。 下面对分别对两种方式进行详细的描述。
方式一。
图 1是本发明文件传输方式一的实施例的流程图, 如图 1所示, 包括: 步骤 100: 第一即时通讯客户端(即发送方)经由即时通讯服务器, 向 第二即时通讯客户端 (即接收方)发送用于请求文件传输的请求消息。 步骤 101 : 第一即时通讯客户端, 在第二即时通讯客户端收到文件传输 的请求消息后, 经由即时通讯服务器接收来自第二即时通讯客户端的同意 接收文件的消息, 其中, 同意接收文件的消息中携带有第二即时通讯客户 端的信息。
步骤 102:第一即时通讯客户端接收到第二即时通讯客户端回复的同意 接收文件的消息后, 根据同意接收文件消息中携带的第二即时通讯客户端 的信息,直接与第二即时通讯客户端建立基于传输控制协议(TCP, Transfer Control Protocol ) /互联网十办议 ( IP, Internet Protocol )十办议的连接, 如果连 接成功, 则表示发送方与接收方在同一网络环境中, 可以直接连接, 第一 即时通讯客户端直接通过建立的 TCP/IP连接向第二即时通讯客户端发送文 件。
在步骤 102 中, 如果第一即时通讯客户端直接与第二即时通讯客户端 建立连接失败, 那么, 第一即时通讯客户端经由即时通讯服务器向第二即 时通讯客户端发送文件。 即第一即时通讯客户端将文件发送到即时通讯服 务器, 然后, 该即时通讯服务器再将该文件转发给第二即时通讯客户端。
优选地, 第二即时通讯客户端的信息中携带的第二即时通讯客户端的 信息, 该信息可以是第二即时通讯客户端的网络信息, 例如, IP地址、 和 / 或端口号等。
方式二。
图 2是本发明文件传输方式二的实施例的流程图, 如图 2所示, 包括: 步骤 200: 第二即时通讯客户端, 经由即时通讯服务器, 接收来自第一 即时通讯客户端的用于请求文件传输的请求消息, 其中, 请求消息中携带 有第一即时通讯客户端的信息。
第一即时通讯客户端的信息中包括第一即时通讯客户端的网络信息, 例如, IP地址、 和 /或端口号等。
步骤 201: 第二即时通讯客户端, 在接收到第一即时通讯客户端的文件 传输的请求消息后, 根据第一即时通讯客户端的信息直接与第一即时通讯 客户端建立基于 TCP/ IP协议的连接, 如果连接成功, 则表示发送方与接收 方在同一网络环境中, 可以直接连接, 第二即时通讯客户端直接接收来自
Figure imgf000010_0001
步骤 201 中, 在第二即时通讯客户端直接与第一即时通讯客户端建立 连接失败后, 第一即时通讯客户端仍然将文件发送到即时通讯服务器, 经 由即时通讯服务器向第二即时通讯客户端发送文件。
下面将结合实例对本发明实施例的实现过程进行详细描述。
图 3是本发明文件传输具体的实施例的流程图, 图 4是本发明文件传 输的信令交互流程的实施例的示意图, 下面结合图 4对图 3中进行描述: 步骤 300: 设置二个即时通讯客户端、 一个即时通讯服务器; 即时通讯 服务器用于实现即时通讯业务的相关逻辑。 其中, 二个即时通讯客户端包 括发送方即时通讯客户端 (筒称为发送方)和接收方即时通讯客户端 (筒 称为接收方), 即时通讯客户端为定制终端, 可以与即时通讯服务器通过标 准协议进行通讯。
步骤 301 : 发送方经由即时通讯服务器, 向接收方发送请求文件传输的 请求消息。
步骤 302: 接收方收到来自发送方的文件传输的请求消息后, 通过即时 通讯服务器给发送方回复同意接收文件的响应消息, 在同意接收文件的消 息中携带有接收方的信息。
优选地, 接收方的信息包括接收方的网络信息, 如接收方的 IP地址、 和 /或接收方的端口号。
步骤 303: 发送方收到来自接收方的同意接收文件的消息后,根据同意 接收文件的消息中的网络信息, 直接与接收方建立基于 TCP/ IP协议的连 接, 如果连接成功, 则表示发送方与接收方在同一网络环境中, 可以直接 连接, 发送方直接将文件通过建立的链路发送给接收方; 如果连接失败, 则发送方将文件发送到即时通讯服务器, 再通过即时通讯服务器将文件转 发给接收方。
根据本发明的实施例, 还提供了一种客户端, 图 5是本发明客户端的 实施例的组成结构示意图, 如图 5所示, 本发明客户端包括发送模块 52、 接收模块 54、 连接模块 56和文件模块 58, 其中,
发送模块 52, 用于经由即时通讯服务器, 向目的即时通讯客户端发送 用于请求文件传输的请求消息;
接收模块 54连接至发送模块 52,用于经由即时通讯服务器接收来自目 的即时通讯客户端的同意接收文件的消息。 其中, 同意接收文件的消息中 携带有目的即时通讯客户端的信息;
连接模块 56连接至接收模块 54 , 用于接收到来自接收模块 54的同意 接收文件的消息后, 根据消息中的目的即时通讯客户端的信息, 直接与目 的即时通讯客户端建立基于 TCP/ IP协议的连接, 向文件模块 58发送连接 建立通知;
文件模块 58连接至连接模块 56, 用于在接收到来自连接模块 56的连 接建立通知显示为连接成功时, 直接向目的即时通讯客户端发送文件。
文件模块 58 ,还用于在接收到来自连接模块 56的连接建立通知显示为 连接失败时, 经由即时通讯服务器向目的即时通讯客户端发送文件。
优选地, 目的即时通讯客户端的信息为目的即时通讯客户端的网络信 息, 包括目的即时通讯客户端的 IP地址、 和 /或目的即时通讯客户端的端口 号。
根据本发明的实施例, 还提供了另一种客户端, 图 6是本发明另一种 客户端的实施例的组成结构示意图, 如图 6所示, 包括第一接收模块 62、 连接模块 64和第二接收模块 66, 其中,
第一接收模块 62, 用于接收来自源即时通讯客户端的用于请求文件传 输的请求消息, 其中, 请求消息中携带有源即时通讯客户端的信息;
连接模块 64,用于根据来自第一接收模块 62的源即时通讯客户端的信 息, 直接与源即时通讯客户端建立基于 TCP/IP协议的连接, 向第二接收模 块 66发送连接建立通知;
第二接收模块 66,用于在接收到来自连接模块 64的连接建立通知显示 为连接成功时, 直接接收来自源即时通讯客户端的文件。
第二接收模块 66,还用于在接收到来自连接模块 64的连接建立通知显 示为连接失败时, 经由即时通讯服务器接收来自源即时通讯客户端的文件。
优选地, 源即时通讯客户端的信息包括源即时通讯客户端的网络信息, 如源即时通讯客户端的 IP地址、 和 /或源即时通讯客户端的端口号。
本发明实施例提供了一种即时通讯中文件传输的***。 图 7是本发明 文件传输的***结构的实施例的示意图, 如图 7所示, 该***包括即时通 讯客户端 101、 即时通讯客户端 102和即时通讯月良务器 103。
其中, 即时通讯客户端 101、 即时通讯客户端 102为定制 PC终端, 与 即时通讯服务器通过标准协议进行通讯; 即时通讯服务器 103是部署在网 络上的服务器, 用于实现即时通讯的处理逻辑。 即时通讯客户端 101 和即 时通讯客户端 102分别对应于上述方法实施例中第一即时通讯客户端和第 二即时通讯客户端, 在该***中的文件传输过程同方法实施例中的相同, 在此不再赘述。
综上所述, 通过本发明提供的上述实施例, 在即时通讯中进行文件传 输时, 可以自动选择合适的文件传输方式, 避免发送方即时通讯客户端与 接收方即时通讯客户端在同一网络环境下时, 仍然通过即时通讯服务器中 转方式进行文件传输, 而是直接通过发送方即时通讯客户端与接收方即时 通讯客户端直接连接的方式进行文件传输, 减轻了即时通讯服务器的负担, 提高了即时通讯服务器的性能和文件传输的效率。
显然, 本领域的技术人员应该明白, 上述的本发明的各模块或各步骤 可以用通用的计算装置来实现, 它们可以集中在单个的计算装置上, 或者 分布在多个计算装置所组成的网络上, 可选地, 它们可以用计算装置可执 行的程序代码来实现, 从而, 可以将它们存储在存储装置中由计算装置来 执行, 或者将它们分别制作成各个集成电路模块, 或者将它们中的多个模 块或步骤制作成单个集成电路模块来实现。 这样, 本发明不限制于任何特 定的硬件和软件结合。
以上所述仅为本发明的优选实施例而已, 并不用于限制本发明, 对于 本领域的技术人员来说, 本发明可以有各种更改和变化。 凡在本发明的精 神和原则之内, 所作的任何修改、 等同替换、 改进等, 均应包含在本发明 的保护范围之内。

Claims

权利要求书
1、 一种文件传输方法, 其特征在于, 包括:
第一即时通讯客户端经由即时通讯服务器向第二即时通讯客户端发送 用于请求文件传输的请求消息;
第一即时通讯客户端经由即时通讯服务器接收来自第二即时通讯客户 端的同意接收文件的消息; 所述同意接收所述文件的消息中携带有第二即 时通讯客户端的信息;
第一即时通讯客户端根据第二即时通讯客户端的信息, 直接与第二即 时通讯客户端建立基于传输控制协议 TCP/互联网协议 IP协议的连接,并在 连接成功后, 第一即时通讯客户端直接向所述第二即时通讯客户端发送文 件。
2、 根据权利要求 1所述的文件传输方法, 其特征在于, 在所述第一即 时通讯客户端直接与所述第二即时通讯客户端建立连接失败后, 还包括: 所述第一即时通讯客户端经由所述即时通讯服务器, 向所述第二即时 通讯客户端发送文件。
3、 根据权利要求 1或 2所述的文件传输方法, 其特征在于, 所述第二 即时通讯客户端的信息至少包括以下之一:
所述第二即时通讯客户端的 IP地址、 所述第二即时通讯客户端的端口 号。
4、 一种文件传输方法, 其特征在于, 包括:
第二即时通讯客户端经由即时通讯服务器, 接收来自第一即时通讯客 户端的用于请求文件传输的请求消息, 其中, 所述请求消息中携带有第一 即时通讯客户端的信息;
第二即时通讯客户端根据第一即时通讯客户端的信息, 直接与第一即 时通讯客户端建立基于传输控制协议 TCP/互联网协议 IP协议的连接,并在 连接成功后, 第二即时通讯客户端直接接收来自第一即时通讯客户端的文 件。
5、 根据权利要求 4所述的文件传输方法, 其特征在于, 在所述第二即 时通讯客户端直接与第一即时通讯客户端建立连接失败后, 还包括:
所述第二即时通讯客户端经由即时通讯服务器, 接收来自第一即时通 讯客户端的文件。
6、 根据权利要求 4或 5所述的文件传输方法, 其特征在于, 所述第一 即时通讯客户端的信息至少包括以下之一:
所述第一即时通讯客户端的 IP地址、 所述第一即时通讯客户端的端口 号。
7、 一种客户端, 其特征在于, 包括发送模块、 接收模块、 连接模块 56 和文件模块; 其中,
发送模块, 用于经由即时通讯服务器, 向目的即时通讯客户端发送用 于请求文件传输的请求消息;
接收模块, 用于经由即时通讯服务器接收来自所述目的即时通讯客户 端的同意接收文件的消息; 所述同意接收所述文件的消息中携带有所述目 的即时通讯客户端的信息;
连接模块, 用于根据所述目的即时通讯客户端的信息向所述目的即时 通讯客户端直接进行基于传输控制协议 TCP/互联网协议 IP协议的连接,向 文件模块发送连接建立通知;
文件模块, 用于在接收到来自连接模块的连接建立通知显示为连接成 功时, 直接向所述目的即时通讯客户端发送文件。
8、 根据权利要求 7所述的客户端, 其特征在于, 所述文件模块, 还用 于在接收到来自连接模块 56的连接建立通知显示为连接失败时, 经由所述 即时通讯服务器向目的即时通讯客户端发送文件。
9、 一种客户端, 其特征在于, 包括第一接收模块、 连接模块和第二接 收模块; 其中,
第一接收模块, 用于接收来自源即时通讯客户端的用于请求文件传输 的请求消息; 所述请求消息中携带有所述源即时通讯客户端的信息;
连接模块, 用于根据来自第一接收模块的源即时通讯客户端的信息, 直接与源即时通讯客户端建立基于传输控制协议 TCP/互联网协议 IP协议的 连接, 向第二接收模块 66发送连接建立通知;
第二接收模块, 用于在接收到来自连接模块的连接建立通知显示为连 接成功时, 直接接收来自所述源即时通讯客户端的文件。
10、 根据权利要求 9所述的客户端, 其特征在于, 所述第二接收模块, 还用于在接收到来自连接模块 64的连接建立通知显示为连接失败时, 经由 所述即时通讯服务器接收来自所述源即时通讯客户端的所述文件。
11、 一种文件传输***, 其特征在于, 包括第一即时通讯客户端、 第 二即时通讯客户端和即时通讯服务器; 其中,
第一即时通讯客户端和第二即时通讯客户端为定制 PC终端,分别用于 与即时通讯服务器通过标准协议进行通讯;
即时通讯服务器, 部署在网络上的服务器, 用于实现即时通讯的处理 逻辑。
12、 根据权利要求 11所述的文件传输***, 其特征在于, 所述第一即 时通讯客户端或第二即时通讯客户端包括发送模块、 接收模块、 连接模块 56和文件模块; 其中,
发送模块, 用于经由即时通讯服务器, 向目的即时通讯客户端发送用 于请求文件传输的请求消息; 接收模块, 用于经由即时通讯服务器接收来自所述目的即时通讯客户 端的同意接收文件的消息; 所述同意接收所述文件的消息中携带有所述目 的即时通讯客户端的信息;
连接模块, 用于根据所述目的即时通讯客户端的信息向所述目的即时 通讯客户端直接进行基于传输控制协议 TCP/互联网协议 IP协议的连接,向 文件模块发送连接建立通知;
文件模块, 用于在接收到来自连接模块的连接建立通知显示为连接成 功时, 直接向所述目的即时通讯客户端发送文件。
13、 根据权利要求 12所述的客户端, 其特征在于, 所述文件模块, 还 用于在接收到来自连接模块的连接建立通知显示为连接失败时, 经由所述 即时通讯服务器向目的即时通讯客户端发送文件。
14、 根据权利要求 11所述的文件传输***, 其特征在于, 所述第一即 时通讯客户端或第二即时通讯客户端包括第一接收模块、 连接模块和第二 接收模块; 其中,
第一接收模块, 用于接收来自源即时通讯客户端的用于请求文件传输 的请求消息; 所述请求消息中携带有所述源即时通讯客户端的信息;
连接模块, 用于根据来自第一接收模块的源即时通讯客户端的信息, 直接与源即时通讯客户端建立基于传输控制协议 TCP/互联网协议 IP协议的 连接, 向第二接收模块发送连接建立通知;
第二接收模块, 用于在接收到来自连接模块的连接建立通知显示为连 接成功时, 直接接收来自所述源即时通讯客户端的文件。
15、根据权利要求 14所述的客户端,其特征在于,所述第二接收模块, 还用于在接收到来自连接模块的连接建立通知显示为连接失败时, 经由所 述即时通讯服务器接收来自所述源即时通讯客户端的所述文件。
PCT/CN2009/076001 2009-08-06 2009-12-24 文件传输方法、***及客户端 WO2011015020A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200910164198A CN101631127A (zh) 2009-08-06 2009-08-06 文件传输方法及客户端
CN200910164198.6 2009-08-06

Publications (1)

Publication Number Publication Date
WO2011015020A1 true WO2011015020A1 (zh) 2011-02-10

Family

ID=41576072

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2009/076001 WO2011015020A1 (zh) 2009-08-06 2009-12-24 文件传输方法、***及客户端

Country Status (2)

Country Link
CN (1) CN101631127A (zh)
WO (1) WO2011015020A1 (zh)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102255940A (zh) * 2011-03-22 2011-11-23 苏州阔地网络科技有限公司 一种设置优先级的批量处理的文件传输方法及***
CN103391241A (zh) * 2013-07-17 2013-11-13 厦门亿联网络技术股份有限公司 一种在即时通讯工具中传送普通文件和截图的传输方法及***
CN103746975A (zh) * 2013-12-26 2014-04-23 小米科技有限责任公司 一种数据传输方法、装置及移动终端
CN103812947B (zh) * 2014-02-28 2017-03-15 深圳市创梦天地科技有限公司 数据交互***及方法
CN105187301A (zh) * 2015-09-08 2015-12-23 北京元心科技有限公司 即时通信的文件传输方法以及***
CN105827514A (zh) * 2016-05-06 2016-08-03 中南大学 一种基于云存储的即时通讯数据传输***及方法
CN107786588A (zh) * 2016-08-25 2018-03-09 北京京东尚科信息技术有限公司 Pc与移动设备之间传输文件的方法和***
CN109309611B (zh) * 2017-07-26 2021-09-28 深圳艾派网络科技股份有限公司 多终端点对点文件传输中文件接收互斥实现方法和***
CN109525628B (zh) * 2017-09-20 2021-09-07 北京国双科技有限公司 Http请求调试方法、装置和***

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1578278A (zh) * 2003-07-01 2005-02-09 微软公司 即时消息的传输***
CN1719811A (zh) * 2004-07-09 2006-01-11 腾讯科技(深圳)有限公司 一种移动网络中即时通讯的路由方法
EP1986381A1 (en) * 2006-02-15 2008-10-29 Alibaba Group Holding Limited A method and system for implementing instant communication

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1578278A (zh) * 2003-07-01 2005-02-09 微软公司 即时消息的传输***
CN1719811A (zh) * 2004-07-09 2006-01-11 腾讯科技(深圳)有限公司 一种移动网络中即时通讯的路由方法
EP1986381A1 (en) * 2006-02-15 2008-10-29 Alibaba Group Holding Limited A method and system for implementing instant communication

Also Published As

Publication number Publication date
CN101631127A (zh) 2010-01-20

Similar Documents

Publication Publication Date Title
WO2011015020A1 (zh) 文件传输方法、***及客户端
US7155487B2 (en) Method, system and article of manufacture for data distribution over a network
EP1892887B1 (en) Communication method between communication devices and communication apparatus
WO2013097401A1 (zh) 浏览器客户端与后端服务器直通的方法、网关和通信***
WO2008040248A1 (fr) Procédé et système de transmission de courrier électronique et serveur de courrier électronique poussé
WO2009074035A1 (fr) Système, appareil et procédé de transmission de fichiers
WO2008064591A1 (fr) Procédé, système et dispositif pour augmenter la capacité d'un système de services de messagerie multimédia
US7039710B2 (en) Method and apparatus for providing multi-client support in a SIP-enabled terminal
WO2011006324A1 (zh) 文件传输方法及终端
US8060640B2 (en) Combining SIP requests with SIP responses
US20160241664A1 (en) Method, device, and system for redirecting data by using service proxy
WO2012034309A1 (zh) Nat网络中sip终端间文件传输的方法、终端及***
CN111683158B (zh) 一种实现同步请求响应的mqtt协议通信方法
WO2011029248A1 (zh) 一种实现多协议接入的方法及接口平台
CN113162989A (zh) 一种基于MQTT-WebSocket的消息收发方法
EP1678886A1 (en) Method and devices for relayed peer-to-peer communications between terminals in mobile networks
US8156209B1 (en) Aggregation devices processing keep-alive messages of point-to-point sessions
US20070091872A1 (en) Peer-to-peer connection establishment
US7564848B2 (en) Method for the establishing of connections in a communication system
WO2013120325A1 (zh) 浏览器与浏览器直通的方法、装置和通信***
JP2001142829A (ja) サーバおよび周辺装置とクライアントコンピュータに接続されるサーバからイベントメッセージを通信するための方法
CN111385068B (zh) 数据传输方法、装置、电子设备及通信***
CN110771117B (zh) 一种采用面向id的网络的会话层通信
WO2013152614A1 (zh) 一种基于应用层数据的网络接入***和方法
JP2004254039A (ja) メール通信中継システム、メール通信中継装置、メール通信中継方法及びメール通信中継用プログラム

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: 09847998

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 09847998

Country of ref document: EP

Kind code of ref document: A1