WO2011006324A1 - 文件传输方法及终端 - Google Patents

文件传输方法及终端 Download PDF

Info

Publication number
WO2011006324A1
WO2011006324A1 PCT/CN2009/075129 CN2009075129W WO2011006324A1 WO 2011006324 A1 WO2011006324 A1 WO 2011006324A1 CN 2009075129 W CN2009075129 W CN 2009075129W WO 2011006324 A1 WO2011006324 A1 WO 2011006324A1
Authority
WO
WIPO (PCT)
Prior art keywords
terminal
file
direct connection
server
connection channel
Prior art date
Application number
PCT/CN2009/075129
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 WO2011006324A1 publication Critical patent/WO2011006324A1/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/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/1066Session management
    • H04L65/1101Session protocols
    • H04L65/1104Session initiation protocol [SIP]

Definitions

  • the present invention relates to the field of file transmission, and in particular to a file transmission method and terminal. Background technique
  • IP Internet Protocol
  • IMS Internet Multimedia Subsystem
  • SIP terminals perform file transmission based on Session Initiation Protocol (SIP), Message Session Relay Protocol (MSRP), and Session Description Protocol (SDP). Specifically, first, The session negotiation is performed through the request signaling (invite), and the media information negotiation is performed through the SDP. If the session negotiation is successful, a transmission channel is established between the file sender and the server, and between the server and the file receiver, and then, the MSRP is utilized. The protocol first transfers the file from the sender to the server and then from the server to the receiver. It can be seen that the transfer file must be transited by the intermediate server. In the case of the current network bandwidth becoming increasingly tight, especially when transferring large files, the transmission mode will occupy a large amount of network bandwidth for a long time, and the transmission speed is affected by the server performance and Network bandwidth has a large impact. Summary of the invention
  • the present invention has been made in view of the problem that the transmission of files between different SIP terminals in the related art requires a large amount of network bandwidth for a long time and is greatly affected by server performance and network bandwidth. Therefore, the main purpose of the present invention is to An improved file transfer scheme is provided to solve at least one of the above problems.
  • a file transfer method is provided.
  • the file transmission method includes: the first terminal transmits a file transmission request to the second terminal via the server; the first terminal receives the response message sent by the second terminal in response to the file transmission request via the server; the first terminal or the second terminal initiates Establishing a direct connection channel between the first terminal and the second terminal for file transmission.
  • the method further includes: if the direct connection channel establishment fails, the first terminal uses the message session relay protocol channel to perform file transmission with the second terminal via the server. .
  • the first terminal or the second terminal initiates the establishment of the direct connection channel
  • the first terminal or the second terminal determines whether the first terminal and the second terminal belong to the same subnet, and if it is determined that the first terminal and the second terminal belong to the same sub
  • the network initiates the establishment of a direct connection channel.
  • the first terminal uses the message session relay protocol channel to perform file transmission with the second terminal via the server.
  • the method further includes: transmitting, by the first terminal and the second terminal, the file transmission by using the established direct connection channel, the method includes: the first terminal sends a file handshake message through the direct connection channel, and receives the second handshake from the second terminal through the direct connection channel. A confirmation message; the first terminal sends a file to the second terminal through the direct connection channel.
  • the method further includes: if the operation fails, the first terminal establishes and uses the message session relay protocol channel to perform file transmission with the second terminal via the server, where the operation failure includes at least one of the following situations: The terminal fails to send the file handshake message, the first terminal fails to receive the confirmation message, and the first terminal fails to send the file to the second terminal.
  • the file transmission request carries the identifier information of the first terminal
  • the response message carries the identifier information of the second terminal, where the identifier information of the first terminal and the identifier information of the second terminal at least include: an IP address, a port number.
  • a terminal is provided.
  • the terminal includes: a sending module, configured to send a file transfer request to the destination terminal via the server; a receiving module, configured to receive, by the server, a response message sent by the destination terminal in response to the file transfer request; and a control module, configured to control initiate establishment
  • the terminal further includes: a second transmission module, configured to use the message session relay protocol channel by using the message session relay protocol channel if the terminal and the destination terminal belong to different subnets or when the control module fails to initiate the establishment of the direct connection channel
  • the server performs file transmission with the destination terminal; the control module is specifically configured to: when the terminal and the destination terminal belong to the same subnet, control initiates establishment of a direct connection channel.
  • the first transmission module includes: a sending submodule, configured to send a file handshake message through a direct connection channel; a receiving submodule, configured to receive an acknowledgement message from the destination terminal through the direct connection channel; and a transmission submodule, configured to pass The direct connection channel sends a file to the destination terminal; the second transmission module is further configured to: when the operation fails, the terminal establishes and uses the message session relay protocol channel to perform file transmission via the server with the destination terminal, where the operation failure includes at least the following One: The terminal fails to send the file handshake message, the terminal fails to receive the confirmation message, and the terminal fails to send the file to the destination terminal.
  • the SIP terminal used in the same local area network transmits files through the direct connection channel, which solves the problem that the transmission of files between different SIP terminals requires a server to transit for a long time and occupies a large amount of network bandwidth and is affected by server performance and network bandwidth.
  • the larger problem is that the SIP terminal transmitting files in the same local area network are not directly transmitted through the server transfer, thereby improving the transmission speed and reducing the burden on the server.
  • FIG. 1 is a flow chart of a file transfer method according to an embodiment of the present invention.
  • FIG. 2 is a schematic diagram of a node of an IMS service according to an embodiment of the present invention
  • 3 is a schematic diagram of an IMS service networking according to an embodiment of the present invention
  • FIG. 5 is a structural block diagram of a terminal according to an embodiment of the present invention.
  • FIG. 6 is a structural block diagram of a terminal according to an embodiment of the present invention. detailed description
  • the SIP terminal uses the MSRP channel mode of the server to perform file transmission, and the SIP terminal in the same subnet does not effectively support the file transmission.
  • a file transmission scheme is provided.
  • the file transmission mode of the solution uses the priority channel to try to connect directly. If the direct connection channel fails to be established, the MSRP channel is enabled.
  • the specific processing principle is as follows: The first terminal sends a file transmission to the second terminal via the server.
  • the file transfer request carries the identifier information of the first terminal
  • the first terminal receives, by the server, a response message that is sent by the second terminal in response to the file transfer request, where the response message carries the identifier information of the second terminal
  • the first terminal or the second terminal initiates establishing a direct connection channel between the first terminal and the second terminal for 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.
  • FIG. 1 is a flowchart of a file transmission method according to an embodiment of the present invention. As shown in FIG. 1, the method includes the following steps S102 to S106:
  • Step S102 the first terminal (terminal A) sends a file transmission request to the second terminal (terminal B) via the server.
  • Step S104 The first terminal receives, by the server, a response message sent by the second terminal in response to the file transmission request.
  • the file transmission request carries the identification information of the first terminal
  • the response message carries the identification information of the second terminal.
  • the identification information of the terminal may be an IP address and a port number.
  • Step S102 and step S104 are the information exchanged by the terminal A and the terminal B through the server S and the respective IP addresses and ports.
  • Step S106 The first terminal or the second terminal initiates establishing a direct connection channel between the first terminal and the second terminal for file transmission. That is, terminal A and terminal B try to connect directly to the channel.
  • step S106 if the direct connection channel fails to be established, the first terminal uses the MSRP channel to perform file transfer with the second terminal via the server, and the file transfer using the MSRP channel includes the following steps:
  • the terminal A and the terminal B perform the session negotiation through the Invite (sdp). If the session negotiation is successful, the terminal A and the terminal B respectively establish an MSRP channel with the server S.
  • Step S202 If the MSRP channel between the terminal A and the server S and the MSRP channel between the terminal B and the server S are successfully established, the MSRP channel is used for file transmission.
  • Step S203 After the MSRP channel is successfully transmitted, the terminal A and the terminal B respectively release the MSRP channel and the session between the server and the server S.
  • the first terminal or the second terminal may determine whether the first terminal and the second terminal belong to the same subnet, and if it is determined that the first terminal and the second terminal belong to the same subnet, initiate a direct connection channel; The terminal and the second terminal belong to different subnets, and the first terminal uses the MSRP channel to perform file transmission with the second terminal via the server.
  • Step S301 The first terminal sends a file handshake message through the direct connection channel.
  • Step S302 The first terminal receives an acknowledgement message from the second terminal by using a direct connection channel.
  • Step S303 The first terminal sends a file to the second terminal by using a direct connection channel.
  • the first terminal establishes and uses the message session relay protocol channel to perform file transfer with the second terminal via the server.
  • FIG. 2 is a schematic diagram of a node of an IMS service according to an embodiment of the present invention.
  • the SIP terminal A is connected to the SIP terminal B through an application server (Application Server, abbreviated as AS).
  • AS Application Server
  • 3 is a schematic diagram of an IMS service networking according to an embodiment of the present invention.
  • terminal A and terminal B are in the same subnet, and terminal C is connected to the Internet (Internet) / intranet (Intranet), and The router is connected to the local area network connecting terminal A and terminal B.
  • Internet Internet
  • IP intranet
  • the router is connected to the local area network connecting terminal A and terminal B.
  • FIG. 4 is a specific flowchart of a file transmission method according to an embodiment of the present invention. As shown in FIG. 4, the process includes the following steps S401 to S425:
  • Step S401 The terminal A sends a file transfer request to the terminal B through the server, where the request includes the file identifier and the IP address and port of the terminal A (address A: port A).
  • Step S402 After receiving the file transmission request sent by the terminal A, the terminal B sends a file receiving response message to the terminal A through the server, where the response message includes the operation type of the file transmission request of the terminal B and the IP address of the terminal B. Port (address B: port B).
  • Step S403 After responding to the file transfer request, the terminal B opens the listening port (ie, port B). Step S404, after receiving the response message of the terminal B, the terminal A actively attempts to establish a direct connection channel to the terminal B.
  • Step S405 if the direct connection channel is successfully established, the terminal A starts to use the direct connection channel to send.
  • File handshake information contains the file identifier that has been negotiated before.
  • Step S406 After receiving the file handshake information of the terminal A, the terminal B makes a logical judgment on the information, and then sends a confirmation message to the terminal A through the direct connection channel.
  • Step S407 After receiving the confirmation information of the terminal B, the terminal A starts to use the direct connection channel to send the file content to the terminal B.
  • Step S408 After successfully sending the file, the terminal A actively closes the direct connection channel.
  • the direct connection channel is a Transfer Control Protocol (TCP) protocol connection.
  • TCP Transfer Control Protocol
  • the MSRP transmission channel is enabled, and the enabling the MSRP transmission channel for file transmission includes steps S409 to S425:
  • step S409 the terminal A sends a request (the invite M command to the server, the request carries the SDP1, and the server forwards the SDP1 to the terminal B through the invite signaling.
  • Step S410 After receiving the invite (SDP1), the terminal B sends a response message 200OK (SDP2) to the server.
  • step S411 the server sends an acknowledgement message ACK to the terminal B in response to 200 OK (SDP2).
  • step S412 After receiving the confirmation information sent by the server, the terminal B actively requests the server to establish a connection.
  • Step S413 the MSRP channel between the terminal B and the server is successfully established.
  • Step S414 the server sends a response message 200OK (SDP2) to the terminal A.
  • Step S415 after receiving the 200 OK (SDP2) message, the terminal A sends a confirmation message ACK to the server.
  • Step S416 After the server receives the acknowledgement information ACK, the terminal A actively requests the server to establish a link.
  • Step S417 the MSRP channel between the terminal A and the server is successfully established.
  • Step S419 After receiving the content of the file sent by the terminal A, the server forwards the file content to the terminal B.
  • Step S420 the terminal A sends the file content successfully.
  • Step S421 the terminal B receives the file content successfully.
  • Step S422 the terminal B actively disconnects the MSRP channel between the server and the server S.
  • Step S423 the terminal B sends a release message (bye message) to the server to release the session.
  • Step S424 the server sends a release message (bye message) to the terminal A to release the session.
  • Step S425 the terminal A actively disconnects the MSRP channel between the server and the server.
  • FIG. 5 is a structural block diagram of a terminal according to an embodiment of the present invention. As shown in FIG. 5, the terminal includes a sending module 52, a receiving module 54, a control module 56, and a first Transmission module 58, which is described in detail below.
  • the sending module 52 is configured to send a file transfer request to the destination terminal via the server, and the receiving module 54 is connected to the sending module 52, configured to receive, by the server, a response message sent by the destination terminal in response to the file transfer request, and connect to the receiving module 54.
  • the control initiates a direct connection between the terminal and the destination terminal; the first transmission module 58 is connected to the control module 56 for file transmission through the direct connection channel.
  • the file transmission request carries the identification information of the first terminal
  • the response message carries the identification information of the second terminal.
  • the identification information of the terminal may be an IP address and a port number.
  • FIG. 6 is a structural block diagram of a terminal according to an embodiment of the present invention.
  • the terminal further includes: a second transmission module 62.
  • the second transmission module 62 is connected to the control module 56 for establishing a direct connection when the terminal and the destination terminal belong to different subnets or the control module 56
  • a message session relay protocol channel is used to perform file transfer via the server with the destination terminal.
  • the control module 56 is specifically configured to: when the terminal and the destination terminal belong to the same subnet, control initiates establishing a direct connection channel.
  • the first transmission module 58 includes: a transmission submodule 582, a receiving submodule 584, and a transmission submodule 586.
  • the submodule is described in detail below.
  • a sending submodule 582 configured to send a file handshake message through the direct connection channel
  • the receiving submodule 584 is connected to the sending submodule 582, configured to receive an acknowledgement message from the destination terminal through the direct connection channel
  • the transmission submodule 586 is connected to the receiving submodule 584, configured to send a file to the destination terminal through the direct connection channel.
  • the second transmission module is connected to the transmitting submodule 582, the receiving submodule 584, and the transmitting submodule
  • the 586 is further configured to: when the operation fails, the terminal establishes and uses the message session relay protocol channel to perform file transmission with the destination terminal, where the operation failure includes at least one of the following: the terminal fails to send the file handshake message, and the terminal receives The confirmation message failed, and the terminal failed to send the file to the destination terminal.
  • the channel for file transmission is dynamically selected for the network topology structure of the SIP terminal in the same local area network, that is, if two SIP terminals are in the same local area network, the TCP direct connection channel can be realized.
  • it does not need to be transmitted through the MSRP channel of the server relay, thereby effectively utilizing the network topology structure, improving the file transmission rate, reducing the occupation of the network bandwidth, and reducing the load on the server, achieving high efficiency and low efficiency. Consumes transfer files and supports breakpoint retransmission.
  • 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 modes Blocks or steps are made in a single integrated circuit module. Thus, the invention is not limited to any specific combination of hardware and software.

Description

文件传输方法及终端 技术领域
本发明涉及文件传输领域, 具体而言, 涉及一种文件传输方法及终端。 背景技术
在网络协议 ( Internet Protocol , IP ) 多媒体子系统 ( IP Multimedia Subsystem, IMS ) 业务中, 文件传输功能提供了一种不同用户之间即时传 输文件的方式, 能够实现文档、 图片和多媒体文件的共享。
目前, SIP终端均基于会话初始化协议( Session Initiation Protocol, SIP ) 和消息会话中继协议(Message Session Relay Protocol, MSRP )以及会话描 述协议( Session Description Protocol, SDP )进行文件传输, 具体地, 首先, 通过请求信令(invite )进行会话协商, 通过 SDP进行媒体信息协商, 如果 会话协商成功, 则在文件发送方和服务器之间、 以及服务器和文件接收方 之间分别建立传输通道, 然后, 利用 MSRP协议先将文件从发送方传输到 服务器, 再从服务器中转至接收方。 由此可见, 传输文件必须经过中间服 务器的中转, 在当前网络带宽日趋紧张的情况下, 特别是在传输大文件时, 该种传输方式会长时间占用大量网络带宽, 并且传输速度受服务器性能和 网络带宽影响较大。 发明内容
针对相关技术中不同的 SIP终端之间传输文件需要服务器中转而造成 的长时间占用大量网络带宽及受服务器性能和网络带宽影响较大的问题而 提出本发明, 为此, 本发明的主要目的在于提供一种改进文件传输方案, 以解决上述问题至少之一。 为了实现上述目的, 根据本发明的一个方面, 提供了一种文件传输方 法。
根据本发明的文件传输方法包括: 第一终端经由服务器向第二终端发 送文件传输请求; 第一终端经由服务器接收第二终端响应于文件传输请求 发送的响应消息; 第一终端或第二终端发起建立第一终端和第二终端之间 的用于进行文件传输的直连通道。
优选地, 在第一终端或第二终端发起建立直连通道之后, 上述方法还 包括: 如果直连通道建立失败, 则第一终端使用消息会话中继协议通道经 由服务器同第二终端进行文件传输。
优选地, 第一终端或第二终端发起建立直连通道包括: 第一终端或第 二终端判断第一终端和第二终端是否属于同一子网, 如果判断第一终端和 第二终端属于同一子网, 则发起建立直连通道。
优选地, 如果判断第一终端和第二终端属于不同的子网, 则第一终端 使用消息会话中继协议通道经由服务器同第二终端进行文件传输。
优选地, 上述方法还包括: 第一终端和第二终端通过建立的直连通道 进行文件传输, 包括: 第一终端通过直连通道发送文件握手消息, 并通过 直连通道接收来自第二终端的确认消息; 第一终端通过直连通道向第二终 端发送文件。
优选地, 上述方法还包括: 在操作失败的情况下, 第一终端建立并使 用消息会话中继协议通道经由服务器同第二终端进行文件传输, 其中, 操 作失败至少包括以下情况之一: 第一终端发送文件握手消息失败、 第一终 端接收确认消息失败、 第一终端向第二终端发送文件失败。
优选地, 文件传输请求中携带有第一终端的标识信息, 响应消息中携 带有第二终端的标识信息, 其中, 第一终端的标识信息和第二终端的标识 信息至少包括: IP地址、 端口号。 为了实现上述目的, 根据本发明的另一方面, 提供了一种终端。
根据本发明的终端包括: 发送模块, 用于经由服务器向目的终端发送 文件传输请求; 接收模块, 用于经由服务器接收目的终端响应于文件传输 请求发送的响应消息; 控制模块, 用于控制发起建立终端和目的终端之间 直连通道; 第一传输模块, 用于通过直连通道进行文件传输。
优选地, 上述终端还包括: 第二传输模块, 用于在终端和目的终端属 于不同的子网的情况下或在控制模块发起建立直连通道失败的情况下, 使 用消息会话中继协议通道经由服务器同目的终端进行文件传输; 控制模块 具体用于, 在终端和目的终端属于同一子网的情况下, 控制发起建立直连 通道。
优选地, 上述第一传输模块包括: 发送子模块, 用于通过直连通道发 送文件握手消息; 接收子模块, 用于通过直连通道接收来自目的终端的确 认消息; 传输子模块, 用于通过直连通道向目的终端发送文件; 第二传输 模块还用于, 在操作失败的情况下, 终端建立并使用消息会话中继协议通 道经由服务器同目的终端进行文件传输, 其中, 操作失败至少包括以下之 一: 终端发送文件握手消息失败、 终端接收确认消息失败、 终端向目的终 端发送文件失败。
通过本发明, 釆用在同一局域网的 SIP终端通过直连通道进行传输文 件, 解决了不同的 SIP终端之间传输文件需要服务器中转而造成的长时间 占用大量网络带宽及受服务器性能和网络带宽影响较大的问题, 使在同一 局域网内的 SIP终端传输文件不通过服务器中转而直接传输, 从而提高了 传输速度, 减轻了服务器的负担。 附图说明
图 1是根据本发明实施例的文件传输方法的流程图;
图 2是根据本发明实施例的 IMS业务的节点的示意图; 图 3是根据本发明实施例的 IMS业务组网的示意图;
图 4是根据本发明实施例的文件传输方法具体的流程图;
图 5是根据本发明实施例的终端的结构框图;
图 6是根据本发明实施例的终端具体的结构框图。 具体实施方式
考虑到相关技术中, 在 IMS 环境下 SIP 终端都是釆用服务器中转的 MSRP通道方式进行文件传输,而对于同处一个子网内的 SIP终端进行文件 传输缺乏有效支持的问题, 本发明实施例提供了一种文件传输方案, 该方 案的文件传输方式釆用优先尝试直连通道, 如果直连通道建立失败则启用 MSRP通道, 具体处理原则如下: 第一终端经由服务器向第二终端发送文 件传输请求, 其中, 文件传输请求中携带有第一终端的标识信息; 第一终 端经由服务器接收第二终端响应于文件传输请求发送的响应消息, 其中, 响应消息中携带有第二终端的标识信息; 第一终端或第二终端发起建立第 一终端和第二终端之间的用于进行文件传输的直连通道。
需要说明的是, 在不冲突的情况下, 本申请中的实施例及实施例中的 特征可以相互组合。 下面将参考附图并结合实施例来详细说明本发明。
在以下实施例中, 在附图的流程图示出的步骤可以在诸如一组计算机 可执行指令的计算机系统中执行, 并且, 虽然在流程图中示出了逻辑顺序, 但是在某些情况下, 可以以不同于此处的顺序执行所示出或描述的步骤。
方法实施例
根据本发明的实施例, 提供了一种文件传输方法, 图 1 是根据本发明 实施例的文件传输方法的流程图,如图 1所示,该方法包括如下的步骤 S102 至步骤 S106:
步骤 S102, 第一终端 (终端 A )经由服务器向第二终端 (终端 B )发 送文件传输请求。 步骤 S104, 第一终端经由服务器接收第二终端响应于文件传输请求发 送的响应消息。
优选地,在步骤 S102中,文件传输请求中携带有第一终端的标识信息, 在步骤 S104中, 响应消息中携带有第二终端的标识信息。
优选地, 终端的标识信息可以是 IP地址及端口号。
步骤 S102和步骤 S104为终端 A和终端 B通过服务器 S交换文件传输 的信息以及各自的 IP地址和端口。
步骤 S106, 第一终端或第二终端发起建立第一终端和第二终端之间的 用于进行文件传输的直连通道。 即, 终端 A和终端 B先尝试直连通道。
在步骤 S106中, 如果直连通道建立失败, 则第一终端使用 MSRP通道 经由服务器同第二终端进行文件传输, 使用 MSRP通道进行文件传输包括 如下步骤:
步骤 S201 , 终端 A和终端 B通过 Invite ( sdp )进行会话协商, 会话协 商成功的话, 终端 A和终端 B分别和 Λ良务器 S建立 MSRP通道。
步骤 S202, 终端 A和服务器 S之间的 MSRP通道以及终端 B和服务 器 S之间的 MSRP通道均建立成功的话, 开始使用 MSRP通道进行文件传 输。
步骤 S203 ,使用 MSRP通道传输成功后,终端 A和终端 B分别释放和 服务器 S之间的 MSRP通道以及会话。
优选地, 第一终端或第二终端可以判断第一终端和第二终端是否属于 同一子网, 如果判断第一终端和第二终端属于同一子网, 则发起建立直连 通道; 如果判断第一终端和第二终端属于不同的子网, 则第一终端使用 MSRP通道经由服务器同第二终端进行文件传输。
在直连通道建立之后, 第一终端和第二终端通过建立的直连通道进行 文件传输, 包括如下的步骤: 步骤 S301 , 第一终端通过直连通道发送文件握手消息。
步骤 S302, 第一终端通过直连通道接收来自第二终端的确认消息。 步骤 S303 , 第一终端通过直连通道向第二终端发送文件。
如果上述步骤 S301至步骤 S303中任何一个步骤失败, 第一终端建立 并使用消息会话中继协议通道经由服务器同第二终端进行文件传输。
下面将结合实例对本发明实施例的实现过程进行详细描述。
图 2是根据本发明实施例的 IMS业务的节点的示意图, 如图 2所示, SIP终端 A通过应用服务器(Application Server, 简称为 AS )连接至 SIP 终端 B。 图 3是根据本发明实施例的 IMS业务组网的示意图, 如图 3所示, 终端 A和终端 B处于同一子网内, 终端 C连接至因特网 ( Internet ) /内联 网 (Intranet ), 并通过路由器与连接终端 A和终端 B的局域网相连。 由于 终端 A和终端 B在同一局域网内, 终端 A和终端 B进行文件传输时, 启用 直连通道; 由于终端 A和终端 C处于不同的子网内, 则终端 A和终端 C进 行文件传输时, 需要启用 MSRP通道。
图 4是根据本发明实施例的文件传输方法具体的流程图, 如图 4所示, 该流程包括如下步骤 S401至步骤 S425:
步骤 S401 , 终端 A通过服务器发送文件传输请求给终端 B, 其中, 该 请求中包含文件标识和终端 A的 IP地址和端口 (地址 A: 端口 A )。
步骤 S402, 终端 B通过服务器接收到终端 A发送的文件传输请求后, 通过服务器向终端 A发送文件接收响应消息, 该响应消息中包含终端 B对 文件传输请求的操作类型以及终端 B的 IP地址和端口 (地址 B: 端口 B )。
步骤 S403 ,终端 B在响应文件传输请求后,打开监听端口(即端口 B )。 步骤 S404,终端 A接收到终端 B的响应消息后,主动向终端 B尝试建 立直连通道。
步骤 S405 , 如果直连通道建立成功, 则终端 A开始使用直连通道发送 文件握手信息, 该握手信息含有前面已经协商的文件标识。
步骤 S406, 终端 B在接收到终端 A的文件握手信息后, 对该信息做逻 辑判断后, 通过直连通道向终端 A发送确认信息。
步骤 S407 , 终端 A在接收到终端 B的确认信息后, 开始使用直连通道 向终端 B发送文件内容。
步骤 S408, 终端 A发送文件成功后, 主动关闭直连通道。
优选地, 上述直连通道为传输控制协议 ( Transfer Control Protocol, TCP )协议连接。
优选地, 如果步骤 S404、 步骤 S405、 步骤 S406、 步骤 S407中任何一 个步骤失败, 则启用 MSRP传输通道, 其中, 启用 MSRP传输通道进行文 件传输包括步骤 S409至步骤 S425:
步骤 S409,终端 A发送请求( invite M言令给服务器,请求中携带 SDP1, 服务器通过 invite信令将 SDP1转发给终端 B。
步骤 S410, 终端 B 接收到 invite(SDPl)后, 向服务器发送响应消息 200OK ( SDP2 )。
步骤 S411 , 服务器对终端 B响应 200OK ( SDP2 )发送确认信息 ACK。 步骤 S412, 终端 B在接收到服务器发送的确认信息后主动向服务器请 求建立连接。
步骤 S413 , 终端 B和服务器之间的 MSRP通道建立成功。
步骤 S414, 服务器向终端 A发送响应消息 200OK(SDP2)。
步骤 S415, 终端 A在接收到 200OK ( SDP2 ) 消息后, 向服务器发确 认信息 ACK。
步骤 S416, 在服务器接收到确认信息 ACK后, 终端 A主动向服务器 请求建链。
步骤 S417, 终端 A和服务器之间的 MSRP通道建立成功。 步骤 S418 , 在 MSRP通道建立成功之后, 终端 A开始向服务器发送文 件内容。
步骤 S419 , 服务器在接收到终端 A发送的文件内容后, 向终端 B转发 文件内容。
步骤 S420, 终端 A发送文件内容成功。
步骤 S421 , 终端 B接收文件内容成功。
步骤 S422, 终端 B主动断开和 Λ良务器 S之间的 MSRP通道。
步骤 S423 , 终端 B向服务器发送释放消息 (bye消息)释放会话。 步骤 S424, 服务器向终端 A发送释放消息 (bye消息)释放会话。 步骤 S425 , 终端 A主动断开和服务器之间的 MSRP通道。
装置实施例
根据本发明的实施例, 提供了一种终端, 图 5是根据本发明实施例的 终端的结构框图, 如图 5所示, 该终端包括发送模块 52、 接收模块 54、 控 制模块 56、 第一传输模块 58, 下面对该结构进行详细的描述。
发送模块 52, 用于经由服务器向目的终端发送文件传输请求,; 接收模 块 54连接至发送模块 52 ,用于经由服务器接收目的终端响应于文件传输请 求发送的响应消息; 连接至接收模块 54 , 用于控制发起建立终端和目的终 端之间直连通道; 第一传输模块 58连接至控制模块 56, 用于通过直连通道 进行文件传输。
优选地, 文件传输请求中携带有第一终端的标识信息, 响应消息中携 带有第二终端的标识信息。
优选地, 终端的标识信息可以是 IP地址及端口号。
图 6是根据本发明实施例的终端具体的结构框图, 如图 6所示, 上述 终端还包括: 第二传输模块 62。 该第二传输模块 62连接至控制模块 56 , 用于在该终端和目的终端属于不同的子网的情况下或控制模块 56建立直连 通道失败的情况下, 使用消息会话中继协议通道经由服务器同目的终端进 行文件传输。 控制模块 56具体用于, 在该终端和目的终端属于同一子网的 情况下, 控制发起建立直连通道。
如图 6所示,第一传输模块 58包括:发送子模块 582、接收子模块 584、 传输子模块 586, 下面对上述子模块进行详细描述。
发送子模块 582 , 用于通过直连通道发送文件握手消息; 接收子模块 584连接至发送子模块 582, 用于通过直连通道接收来自目的终端的确认消 息; 传输子模块 586连接至接收子模块 584, 用于通过直连通道向目的终端 发送文件。
第二传输模块连接至发送子模块 582、 接收子模块 584 和传输子模块
586, 还用于在操作失败的情况下, 终端建立并使用消息会话中继协议通道 经由服务器同目的终端进行文件传输, 其中, 操作失败至少包括以下之一: 终端发送文件握手消息失败、 终端接收确认消息失败、 终端向目的终端发 送文件失败。
综上所述, 通过上述实施例, 对于在同一局域网 SIP终端所处的网络 拓朴结构而动态选择文件传输的通道, 即, 如果两台 SIP终端同处一个局 域网内, 能够实现 TCP直连通道的话, 就不需通过服务器中转的 MSRP通 道进行传输了, 从而有效利用了网络拓朴结构, 提高了文件传输的速率, 减少对网络带宽的占用, 也减轻了服务器的负荷, 实现了高效、 低耗的传 输文件, 且支持断点续传。
显然, 本领域的技术人员应该明白, 上述的本发明的各模块或各步骤 可以用通用的计算装置来实现, 它们可以集中在单个的计算装置上, 或者 分布在多个计算装置所组成的网络上, 可选地, 它们可以用计算装置可执 行的程序代码来实现, 从而, 可以将它们存储在存储装置中由计算装置来 执行, 或者将它们分别制作成各个集成电路模块, 或者将它们中的多个模 块或步骤制作成单个集成电路模块来实现。 这样, 本发明不限制于任何特 定的硬件和软件结合。
以上所述仅为本发明的优选实施例而已, 并不用于限制本发明, 对于 本领域的技术人员来说, 本发明可以有各种更改和变化。 凡在本发明的精 神和原则之内, 所作的任何修改、 等同替换、 改进等, 均应包含在本发明 的保护范围之内。

Claims

权利要求书
1.一种文件传输方法, 其特征在于, 包括:
第一终端经由服务器向第二终端发送文件传输请求;
所述第一终端经由服务器接收所述第二终端响应于所述文件传输请求 发送的响应消息;
所述第一终端或所述第二终端发起建立所述第一终端和所述第二终端 之间的用于进行文件传输的直连通道;
所述第一终端和所述第二终端通过建立的所述直连通道进行文件传 输。
2.根据权利要求 1 所述的方法, 其特征在于, 若所述第一终端或所述 第二终端发起建立所述直连通道失败, 则所述第一终端使用消息会话中继 协议通道经由所述服务器同所述第二终端进行文件传输。
3.根据权利要求 1或 2所述的方法, 其特征在于, 所述第一终端或所 述第二终端发起建立所述直连通道的步骤具体为:
所述第一终端或所述第二终端判断所述第一终端和所述第二终端是否 属于同一子网, 如果判断所述第一终端和所述第二终端属于同一子网, 则 发起建立所述直连通道; 否则所述第一终端使用消息会话中继协议通道经 由所述服务器同所述第二终端进行文件传输。
4.根据权利要求 3 所述的方法, 其特征在于, 所述第一终端和所述第 二终端通过建立的所述直连通道进行文件传输的步骤具体为:
所述第一终端通过所述直连通道发送文件握手消息, 并通过所述直连 通道接收来自所述第二终端的确认消息;
所述第一终端通过所述直连通道向所述第二终端发送文件。
5.根据权利要求 3所述的方法, 其特征在于, 该方法还包括: 在所述第一终端发送所述文件握手消息失败、 或所述第一终端接收所 述确认消息失败、 或所述第一终端向所述第二终端发送所述文件失败时, 所述第一终端建立并使用消息会话中继协议通道经由所述服务器同所述第 二终端进行文件传输。
6.根据权利要求 5 所述的方法, 其特征在于, 所述文件传输请求中携 带有所述第一终端的标识信息; 所述响应消息中携带有所述第二终端的标 识信息; 其中, 所述第一终端的标识信息和所述第二终端的标识信息至少 包括以下信息: IP地址、 端口号。
7.—种终端, 其特征在于, 该终端包括:
发送模块, 用于经由服务器向目的终端发送文件传输请求;
接收模块, 用于经由所述服务器接收所述目的终端响应于所述文件传 输请求发送的响应消息;
控制模块, 用于控制发起建立所述终端和所述目的终端之间直连通道; 第一传输模块, 用于通过所述直连通道进行文件传输。
8 根据权利要求 7所述的终端, 其特征在于, 该终端还包括: 第二传输模块, 用于在所述终端和所述目的终端属于不同的子网的情 况下、 或在所述控制模块发起建立所述直连通道失败的情况下、 或所述第 一传输模块传输文件失败的情况下, 使用消息会话中继协议通道经由所述 服务器同所述目的终端进行文件传输;
所述控制模块, 具体用于在所述终端和所述目的终端属于同一子网的 情况下, 控制发起建立所述直连通道。
9.根据权利要求 8所述的终端, 其特征在于, 所述第一传输模块包括: 发送子模块, 用于通过所述直连通道发送文件握手消息;
接收子模块, 用于通过所述直连通道接收来自所述目的终端的确认消 息;
传输子模块, 用于通过所述直连通道向所述目的终端发送文件; 所述第一传输模块传输文件失败的情况包括: 所述终端发送所述文件 握手消息失败、 或所述终端接收所述确认消息失败、 或所述终端向所述目 的终端发送所述文件失败。
PCT/CN2009/075129 2009-07-14 2009-11-25 文件传输方法及终端 WO2011006324A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200910158992.X 2009-07-14
CNA200910158992XA CN101605138A (zh) 2009-07-14 2009-07-14 文件传输方法及终端

Publications (1)

Publication Number Publication Date
WO2011006324A1 true WO2011006324A1 (zh) 2011-01-20

Family

ID=41470692

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2009/075129 WO2011006324A1 (zh) 2009-07-14 2009-11-25 文件传输方法及终端

Country Status (2)

Country Link
CN (1) CN101605138A (zh)
WO (1) WO2011006324A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017185925A1 (zh) * 2016-04-28 2017-11-02 深圳市先河系统技术有限公司 一种访问网站的方法、客户端及局域网内服务器

Families Citing this family (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102137348B (zh) * 2010-11-11 2014-10-08 华为技术有限公司 一种文件传输方法、终端和系统
CN102256113B (zh) * 2011-08-03 2013-05-08 浙江宇视科技有限公司 媒体流转发的控制方法和控制装置
CN102523346B (zh) * 2011-12-15 2013-12-25 广州市动景计算机科技有限公司 跨设备文件传输方法、装置、中转服务器及设备
CN102983942B (zh) * 2012-11-28 2019-05-28 北京百度网讯科技有限公司 数据传输方法及设备
CN104518948B (zh) * 2013-09-27 2018-03-30 北京新媒传信科技有限公司 好友推荐方法及装置
WO2016070370A1 (zh) * 2014-11-06 2016-05-12 北京安奇智联科技有限公司 基于二维码和网络适配的移动终端和web终端互连的方法
CN104683349A (zh) * 2015-03-12 2015-06-03 西安酷派软件科技有限公司 融合通信方法、终端、服务器和融合通信系统
CN106713373A (zh) * 2015-07-13 2017-05-24 中兴通讯股份有限公司 文件的发送方法及装置
CN105187301A (zh) * 2015-09-08 2015-12-23 北京元心科技有限公司 即时通信的文件传输方法以及系统
CN106572134A (zh) * 2015-10-09 2017-04-19 腾讯科技(深圳)有限公司 一种文件传输方法、装置和系统
CN105872039A (zh) * 2016-03-29 2016-08-17 乐视控股(北京)有限公司 终端设备间传输文件的方法、终端设备及文件传输系统
CN105847274A (zh) * 2016-04-27 2016-08-10 努比亚技术有限公司 终端设备及其文件传输方法
CN105871706A (zh) * 2016-06-13 2016-08-17 珠海佳米科技有限公司 文件传输方法及系统
CN106454975A (zh) * 2016-09-14 2017-02-22 广东欧珀移动通信有限公司 一种热点网络切换方法及终端设备
CN107426828B (zh) * 2017-07-03 2021-01-08 Oppo广东移动通信有限公司 数据传输方法、装置及移动终端
CN107613031A (zh) * 2017-11-08 2018-01-19 杭州亿方云网络科技有限公司 一种文件传输系统
CN108390941A (zh) * 2018-03-20 2018-08-10 浙江臻善科技股份有限公司 端对端实时文件传输方法、系统及第一终端和第二终端
CN108881378A (zh) * 2018-05-02 2018-11-23 象翌微链科技发展有限公司 一种文件的传输方法、系统及设备
CN110581866B (zh) * 2018-06-07 2022-09-23 中国电信股份有限公司 文件传输方法和ip多媒体子系统ims网络终端
CN109039904B (zh) * 2018-08-01 2020-12-22 武汉绿色网络信息服务有限责任公司 一种应用路由方法和装置
CN114503780A (zh) * 2020-01-02 2022-05-13 Oppo广东移动通信有限公司 建立终端连接的方法及装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004086247A1 (en) * 2003-03-28 2004-10-07 Freechal Inc. P2p service method
CN1867132A (zh) * 2006-02-15 2006-11-22 华为技术有限公司 进行点到点的文件传输的用户终端及其传输方法
WO2007094584A1 (en) * 2006-02-17 2007-08-23 Nhn Corporation P2p file transmission system and method
CN101202979A (zh) * 2006-12-15 2008-06-18 深圳市杰普林数码科技限公司 一种手机间互传文件的方法

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100566340C (zh) * 2007-07-25 2009-12-02 中国科学院沈阳计算技术研究所有限公司 支持p2p媒体传输的sip软交换系统及其实现方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004086247A1 (en) * 2003-03-28 2004-10-07 Freechal Inc. P2p service method
CN1867132A (zh) * 2006-02-15 2006-11-22 华为技术有限公司 进行点到点的文件传输的用户终端及其传输方法
WO2007094584A1 (en) * 2006-02-17 2007-08-23 Nhn Corporation P2p file transmission system and method
CN101202979A (zh) * 2006-12-15 2008-06-18 深圳市杰普林数码科技限公司 一种手机间互传文件的方法

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017185925A1 (zh) * 2016-04-28 2017-11-02 深圳市先河系统技术有限公司 一种访问网站的方法、客户端及局域网内服务器

Also Published As

Publication number Publication date
CN101605138A (zh) 2009-12-16

Similar Documents

Publication Publication Date Title
WO2011006324A1 (zh) 文件传输方法及终端
CN112911027B (zh) 用于建立媒体会话的方法和装置
WO2012034309A1 (zh) Nat网络中sip终端间文件传输的方法、终端及系统
US20050066038A1 (en) Session control system, communication terminal and servers
US20090154408A1 (en) Method and apparatus for transmitting sip data of idle mode ue in a mobile communication system
CN107612931B (zh) 多点会话方法及多点会话系统
WO2007093087A1 (fr) Procédé de synchronisation d'état de connexion dans des communications de données et nœud de communication affecté
WO2007036160A1 (fr) Appareil, systeme et procede assurant la communication entre un client et un serveur
WO2014019451A1 (zh) 一种快速通知cgn异常的方法、设备及系统
WO2011038637A1 (zh) 端到端呼叫的实现方法、端到端呼叫终端及系统
WO2024000937A1 (zh) 一种支持终端移动接入的多模态网络控制系统和方法
WO2017157144A1 (zh) 基于SIP over TCP/TLS的通信方法及相关装置
KR20150002870A (ko) 클라이언트­관련 보안 연관에 대한 페일오버 기능성
CN110875914B (zh) 一种基于共享会话链路传输消息的方法及装置
WO2011015020A1 (zh) 文件传输方法、系统及客户端
US20120002665A1 (en) Telephone Exchange Apparatus and Telephone Terminal and a Control Method Used for a Telephone System
US20110196975A1 (en) Method and device for the bidirectional address conversion in sip-controlled data streams between ipv4 and ipv6 data terminals
WO2007131417A1 (fr) Procédé, système et dispositif de traitement de services supplémentaires
WO2011054257A1 (zh) 一种优化媒体路径的建立方法和实现该方法的信令网关
WO2010121521A1 (zh) 实现业务连续性的方法、系统、msc服务器及会话终端
CN107454178B (zh) 数据传输方法及装置
WO2007009339A1 (fr) Méthode de transmission de message et appareil reposant sur le protocole dua
JP2012090025A (ja) 通信装置
JP5840575B2 (ja) マルチホーム通信方法およびシステム
JP5659826B2 (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: 09847249

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

Country of ref document: EP

Kind code of ref document: A1