WO2007025474A1 - Network communication system and method for downloading the file - Google Patents

Network communication system and method for downloading the file Download PDF

Info

Publication number
WO2007025474A1
WO2007025474A1 PCT/CN2006/002226 CN2006002226W WO2007025474A1 WO 2007025474 A1 WO2007025474 A1 WO 2007025474A1 CN 2006002226 W CN2006002226 W CN 2006002226W WO 2007025474 A1 WO2007025474 A1 WO 2007025474A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
client
server
tpt
download
Prior art date
Application number
PCT/CN2006/002226
Other languages
French (fr)
Chinese (zh)
Inventor
Haijun Wu
Bin Fang
Ye Zhu
Yang Song
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 WO2007025474A1 publication Critical patent/WO2007025474A1/en

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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • 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/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • H04L67/125Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks involving control of end-device applications over a network
    • 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/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1074Peer-to-peer [P2P] networks for supporting data block transmission mechanisms
    • H04L67/1076Resource dissemination mechanisms or network resource keeping policies for optimal resource availability in the overlay network
    • 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/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1087Peer-to-peer [P2P] networks using cross-functional networking aspects
    • H04L67/1091Interfacing with client-server systems or between P2P systems

Definitions

  • the present invention relates to the field of network communication technologies, and in particular, to a network communication system and method for implementing file downloading. Background of the invention
  • file downloading is one of the main ways for users to obtain information from the communication network.
  • the client on the communication network can download the required data from the server through various communication protocols such as File Transfer Protocol (FTP) or Hypertext Transfer Protocol (HTTP).
  • FTP File Transfer Protocol
  • HTTP Hypertext Transfer Protocol
  • the client in the communication network such as client A and client B, can directly communicate with the server through a communication protocol such as FTP or HTTP, and download the data required by the server.
  • a communication protocol such as FTP or HTTP
  • the method for downloading data directly from the server by the client can effectively satisfy the downloading requirement of each client when the number of clients accessing the server is small at the same time, but is limited by the hardware processing capability of the server and the network bandwidth.
  • the processing capacity and network bandwidth of the server will be bottlenecked, resulting in slower download speeds of each client, especially when users enjoy online multimedia services provided by the communication network, such as online.
  • the slowdown in download speed will directly affect the quality of service for online multimedia services.
  • the present invention provides a network communication system and method for implementing file downloading, so that the download speed of the client in the communication network is not limited by the server processing capability and the network bandwidth bottleneck. Thus, even when the number of clients accessing the server at the same time is large, the speed at which users download files is not affected.
  • a further object of the present invention is to provide a method for downloading a file, so that the user can enjoy online multimedia services, such as listening to music online or watching videos online, and the like, which greatly satisfies the user's demand for online multimedia service quality.
  • the network communication system for implementing file downloading comprises: a peer-to-peer (P2P, Peer to Peer) server, a file server, a file description (TPT) server, and more than one client connected through a communication network.
  • P2P peer-to-peer
  • TPT file description
  • the P2P server is configured to advertise a downloadable file to the one or more clients, and process a login and logout operation of the client through the communication network, and return the file to the client when the client downloads the file.
  • the seed information corresponding to the file and the download configuration parameter; the file server is configured to store the file provided for downloading by the client;
  • the TPT server is configured to store a TPT file corresponding to the file downloaded by the client;
  • the one or more clients download the TPT file corresponding to the required file from the TPT server through the communication network, and query the P2P server for other client information and download configuration parameters of the file that has been downloaded in the communication network. And downloading the required files from the other client and/or the file server according to the TPT file and download configuration parameters.
  • the method for implementing file downloading according to the present invention includes:
  • the client downloads the TPT file corresponding to the file corresponding to the file according to the selected file name to the TPT server;
  • the client queries the peer P2P server according to the file identifier to correspond to the file. Seed information; the client information is returned to the client as seed information corresponding to the file;
  • the client establishes a connection with the clients according to other client information returned by the P2P server, and exchanges the fragmentation data of the required files from the clients.
  • the network communication system and method of the present invention combines the peer P2P technology with the existing download method, so that the client can directly download the required file directly from other clients in the communication network. In this way, on the one hand, it can save a lot of server and bandwidth consumption, on the other hand, it can speed up the downloading of data by the client, thereby greatly enhancing the user experience.
  • the method of the present invention can download the required fragment data directly from the file server while downloading the fragment data from other clients, so as to ensure the continuity of the fragment data downloaded from the communication network. And orderly, to achieve online multimedia services, but also to avoid the problem of slow download speed in the case of fewer seeds.
  • the method of the present invention provides accurate information for the seed management of the P2P server by recording the network type or firewall type of all the seeds that have downloaded the same file in the file grouping list, and can download according to the current seed management.
  • the client type of the file selects the optimal seed for the client, further ensuring the download speed of the client.
  • FIG. 1 is a schematic diagram of a client downloading data from a server in an existing network communication system
  • FIG. 2 is a schematic diagram of a client downloading data from a server in a network communication system according to a preferred embodiment of the present invention
  • FIG. 3 is a flowchart of a method for implementing multimedia file downloading according to a preferred embodiment of the present invention. Mode for carrying out the invention
  • a peer-to-peer Internet technology P2P technology is combined with a file downloading technology, and a mode in which a client downloads data from a single server is changed to a download mode in which data is directly exchanged between clients, thereby A bug that limits the number of clients that simultaneously download files due to server processing bottlenecks.
  • the file is divided into several parts, so that the client can simultaneously download different fragments of the same file from multiple clients or file servers in the communication network, and can further Guarantee the download speed of the client.
  • the client that needs to download data can directly download data from other clients in the communication network, the more the number of clients simultaneously downloading data in the communication network, the more concentrated the distribution, and the more effective the data interaction between them is. Ok, so you can greatly increase the download speed of the data.
  • the embodiment provides a network communication system.
  • the network communication system mainly includes: a P2P server, a file server, a TPT server, and more than one client.
  • the P2P server, the TPT server, and the file server are respectively connected to the one or more clients through a communication network, so as to implement information interaction between the client and the P2P server, the TPT server, and the file server; each client in the communication network
  • the terminal is also connected to other clients through a communication network to implement data exchange between clients.
  • the P2P server is mainly responsible for issuing a downloadable file, and processing, by the communication network, a request for login, logout, download, query seed, heartbeat maintenance, and the like of the client;
  • the file server is configured to store a file that is provided for download by the user;
  • the TPT server is configured to store a TPT file corresponding to each file that is provided for download by the user;
  • the one or more clients download the file corresponding to the required file from the TPT server through the communication network, and download the required file from other clients and/or file servers in the communication network according to the downloaded file.
  • Each piece of data is configured to store a TPT file corresponding to each file that is provided for download by the user;
  • the one or more clients download the file corresponding to the required file from the TPT server through the communication network, and download the required file from other clients and/or file servers in the communication network according to the downloaded file.
  • the client in the communication network can download the TPT file from the TPT server through HTTP, FTP or other various communication methods, and download the fragment data of the required file from the file server, or transmit the data.
  • the Control Protocol (TCP) or User Datagram Protocol (UDP) downloads the individual fragmentation data of the required files from other clients in the communication network.
  • the client In the process of downloading the file through the network communication system, the client first needs to select a file to be downloaded from the file published by the P2P server; then, download the TPT file corresponding to the file from the TPT server, and obtain relevant information of the file from the TPT server.
  • the file identifier of the file identifies the FileID, the number of fragmentation data, and the size of each fragmentation data, etc.; next, according to the related information, the P2P server is queried for other client information that is online and downloaded, that is, to the P2P.
  • the server queries the seed; after obtaining the seed, the client downloads the fragment data of the file from the queried seed, and at the same time, in order to ensure the continuity and order of each fragment data of the downloaded file, the client also The required fragmentation data can be downloaded from the file server at the same time.
  • the file downloading method of the present invention specifically includes the following steps:
  • A. Pre-release the files provided to the user for download on the P2P server, file server, and TPT server.
  • the release described in this step mainly includes:
  • a TPT file of each file is created according to a file to be downloaded to the user, and the created TPT file is uploaded to the TPT server;
  • the TPT file mainly includes the file identifier File1D corresponding to the TPT file, the number of fragmented data of the file, the size of each fragment data, the check value of each fragment data, and the TPT file itself. Check value and version number, etc.
  • the number of fragmented data and the size of the fragment of the file are determined by the size of the file corresponding to the TPT file and the type of service actually selected by the user. For example, if the music service is listened to online, the size of the fragmented data is usually 16K bytes, at this time, the number of fragmented data of the file is equal to the file size and the quotient of 16K bytes, and if the video service is online, the size of the fragmented data is usually 50K bytes, and the fragment of the file at this time The number of data is equal to the file size and the quotient of 50K bytes.
  • the file identifier File1D is a check value obtained by verifying the file name of the file, where the file identifier FileID, the check value of each fragment data, or the check value of the TPT file are used.
  • the verification algorithm can be a variety of commonly used verification algorithms, such as Hash operations and the like.
  • the file identifier File1D is a 32-bit integer value obtained after the HASH operation of the file name of the corresponding file.
  • the client downloads the TPT file corresponding to the file according to the file name to be downloaded to the TPT server;
  • the client may further parse the TPT file and verify the correctness of the downloaded TPT file. If the check is correct, proceed to step C. Otherwise, the user is prohibited from downloading the file and ending. .
  • the check is: Verify that the format and version of the TPT file are correct.
  • the checking may further include adopting a corresponding verification method, such as a HASH operation, The TPT file itself is verified.
  • the client logs in to the P2P server, and the P2P server returns a unique user identifier (UIN) to the client.
  • UIN unique user identifier
  • the UIN in the step is sequentially selected by the P2P server within a preset value range, and the value range is related to the maximum number of online users that the P2P server can support. For example, if a P2P server can have up to 100,000 online users, The value of UIN can range from 1 to 100,000.
  • the client After obtaining the UIN, the client sends a download request to the P2P server according to the file selected by the user, and carries the UIN of the client and the FileID of the file to be downloaded in the download request.
  • the P2P server checks whether the UIN of the client and the FilelD of the file to be downloaded are correct, and checks whether the file has been published. If UIN and FilelD are correct and the file has been published, step F is performed; otherwise, the client is notified that the file cannot be Download the file and finish.
  • the P2P server checks whether the FilelD of the file to be downloaded is correct.
  • the method of comparing the 32-bit integer value obtained by the HASH operation of the file name of the file to be downloaded is compared with FilelD. If the same, the verification is correct, otherwise the test is not performed. correct.
  • the P2P server adds the UIN of the client to the file grouping list corresponding to the file, and returns the download configuration parameter corresponding to the file to the client.
  • the file grouping list is to sort all the clients that have downloaded the published file, and the P2P server associates the information of all the clients that download the same file with the file, and associates the same file with the same file. All client information is recorded in the file group list corresponding to the file for the client to query.
  • the client information includes: a client address, a network type of a network where the client is located, or a firewall type.
  • the download configuration parameters corresponding to the file in the step mainly include: the number of threads started during download, the maximum speed limit/minimum speed limit for each thread uploading and downloading, the P2P upload speed limit, P2P Download the speed limit, the maximum number of connected clients, the interval between querying seeds, and the speed at which P2P downloads can be reduced.
  • the download speed from the file server and the speed at which the P2P download arrives can increase the download speed from the file server and the P2P upload limit. Speed percentage and so on.
  • the above configuration parameters are determined by the configuration file of the P2P server.
  • the configuration file usually includes two types: default configuration and special configuration.
  • the default configuration includes common configuration parameters for all files, and the special configuration only includes Special configuration parameters for some individual files. If the published file does not have a corresponding special configuration file, the P2P server returns the default configuration parameters to the client. If there is a corresponding special configuration file, the P2P server returns the default configuration parameters together with the special configuration parameters to the client. It should be noted that all configuration files of the P2P server can be dynamically updated, that is, they can be modified or updated while the P2P server is running.
  • the client After receiving the download configuration parameter corresponding to the file, the client sends its own UIN and FilelD of the file to be downloaded to the P2P server, and queries the P2P server for other client information for downloading the file, that is, queries the P2P server for the seed.
  • the client may further send the network type or firewall type of the client to the P2P server, and request the P2P server to query other client information having the same network type in the same group according to the network type of the client.
  • the P2P server returns information of other clients in the file group list corresponding to the file according to the UIN and FilelD from the client, that is, returns other seed messages to the client. If the client queries the seed, the client includes the network of the client. Type, the P2P server will further return the firewall-free public network or the client information with the corresponding firewall type to the client according to the network type or firewall type of the client, and return some other types of client information. In this way, the connectivity between the client and the seeds for data interaction is high, and the speed of data transmission will be faster. I.
  • the client attempts to establish a connection with the seed, and queries whether the file or the fragmentation data of the file exists in the seed, and if so, according to the TPT file and the obtained download configuration parameter
  • the seed exchange data, and each piece of data of the file to be downloaded is obtained.
  • the client will exchange the required fragment data from the seed by TCP/UDP.
  • the client After switching to each fragment data, the client further checks the exchanged fragment data according to the check value of each fragment data parsed from the TPT file downloaded in step B, if the verification If correct, the fragment data is received; otherwise, the fragment data is discarded.
  • the client since the slice data exchanged from the respective seeds is randomly arranged, in order to obtain a complete file, the client also needs to recombine the exchanged slice data into the files to be downloaded in order.
  • the fragment data exchanged by the above method is randomly arranged, only the client can obtain a correct and complete file after downloading all the fragment data of the file, which is to be a general file download service. Acceptable, but this will give the online multimedia industry For example, listening to music online or watching video programs online brings a large delay and affects the user experience.
  • the client in order to ensure the continuous ordering of the data fragments downloaded by the client, the client performs the fragment data exchange with the seed, and
  • the download configuration parameters returned by the P2P server start a common HTTP or FTP download mode, download the required fragment data from the file server, and ensure the continuity and order of the downloaded data fragments by the client through a certain algorithm and communication mechanism. .
  • the client of the user will preferentially use the HTTP download method to obtain the music playing process from the file server.
  • the required music file fragmentation data at the same time, for the music files that have not been played or the fragmentation data of the music files, can still be downloaded by P2P download.
  • the above download method not only speeds up the downloading process, but also reduces the load of the file server, and at the same time ensures the continuous ordering of the downloaded files.
  • the proportion of the client downloading the fragmented data from the file server is controlled by the download configuration parameter returned by the P2P server, and can be dynamically adjusted according to the actual situation, thereby ensuring that in most cases, most of the fragmented data is passed through Client exchanges are obtained, which can save a lot of server bandwidth resources.
  • the method described in the above preferred embodiment can support a large number of users to enjoy online multimedia services at the same time, such as listening to music online, or watching video programs online, which greatly satisfies the user's demand for online multimedia service quality.
  • the heartbeat signal is sent to the P2P server periodically, and the P2P server also periodically detects from all the logged in. If the heartbeat signal of the client does not receive the heartbeat signal, the corresponding client is kicked out and the resources allocated for the client are released. Source, and remove the client information from the associated file grouping list.
  • the client sends a logout request to the server, and then voluntarily quits.
  • the P2P server releases the resources allocated for the client and deletes the client information from the related file group list.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A network communication system for downloading the file includes: connecting peer to peer (P2P) server, file server, file description (TPT) server and at least one client via a communication network; the said at least one client downloads the TPT file corresponding to the required file from the said TPT server via the said communication network, queries the seed information corresponding to the said file to the said P2P server, and downloads the required file from the other client regarded as seed in the said communication network and/or the said file server according to the downloaded TPT file. By the said network communication system and method of the invention, the download speed of the client in the communication network is not limited by the server capability and network bandwidth bottleneck. Even though there are a great number of clients which access the network at the same time, the download speed is not affected by it.

Description

实现文件下载的网络通信系统及方法  Network communication system and method for realizing file download
技术领域 Technical field
本发明涉及到网络通信技术领域, 特别涉及到实现文件下载的网络 通信系统及方法。 发明背景  The present invention relates to the field of network communication technologies, and in particular, to a network communication system and method for implementing file downloading. Background of the invention
随着通信网络的不断发展, 用户可以从通信网络中获得越来越多有 用的信息。其中,文件下载是用户从通信网络获取信息的主要方式之一。 目前, 通信网络上的客户端可以通过文件传输协议 ( FTP , File Transfer Protocol )或超文本传输协议 ( HTTP, HyperText Transfer Protocol )等多 种通信协议从月良务器下载所需要的数据, 其工作原理如图 1所示。 在图 With the continuous development of communication networks, users can obtain more and more useful information from communication networks. Among them, file downloading is one of the main ways for users to obtain information from the communication network. At present, the client on the communication network can download the required data from the server through various communication protocols such as File Transfer Protocol (FTP) or Hypertext Transfer Protocol (HTTP). The principle is shown in Figure 1. In the picture
1 中, 通信网絡中的客户端, 如客户端 A、 客户端 B 客户端 F 均可以通过 FTP或 HTTP等通信协议直接与服务器进行通信,从该服务 器下载自身需要的数据。这样一来,就可以实现通信网络中数据的共享, 极大地节省系统的资源。 In 1, the client in the communication network, such as client A and client B, can directly communicate with the server through a communication protocol such as FTP or HTTP, and download the data required by the server. In this way, the sharing of data in the communication network can be realized, and the resources of the system are greatly saved.
上述客户端直接从服务器下载数据的方法在同时接入到服务器的客 户端数目较少的情况下可以有效地满足各个客户端的下载需求, 但是, 受到服务器自身硬件处理能力以及网络带宽的限制, 在同时接入服务器 的客户端数目超过一定数量时, 服务器的处理能力及网络带宽将会出现 瓶颈, 导致各个客户端的下载速度变慢, 特别是在用户享受通信网络提 供的在线多媒体业务时, 例如在线收听音乐或在线收看视频节目时, 下 载速度的减慢将直接影响在线多媒体业务的服务质量。 发明内容 The method for downloading data directly from the server by the client can effectively satisfy the downloading requirement of each client when the number of clients accessing the server is small at the same time, but is limited by the hardware processing capability of the server and the network bandwidth. When the number of clients accessing the server exceeds a certain number, the processing capacity and network bandwidth of the server will be bottlenecked, resulting in slower download speeds of each client, especially when users enjoy online multimedia services provided by the communication network, such as online. When listening to music or watching video programs online, the slowdown in download speed will directly affect the quality of service for online multimedia services. Summary of the invention
为了解决上述技术问题, 本发明提供了一种实现文件下载的网络通 信系统及方法, 使得通信网络中客户端的下载速度不受服务器处理能力 和网絡带宽瓶颈的限制。 这样, 即使在同时接入服务器的客户端数目很 多时, 用户下载文件的速度也不会受到影响。  In order to solve the above technical problem, the present invention provides a network communication system and method for implementing file downloading, so that the download speed of the client in the communication network is not limited by the server processing capability and the network bandwidth bottleneck. Thus, even when the number of clients accessing the server at the same time is large, the speed at which users download files is not affected.
本发明进一步的目的在于提供一种文件的下载方法, 使用户可以享 受在线多媒体业务, 例如在线收听音乐或在线收看视频等等, 极大地满 足用户对在线多媒体业务服务质量的需求。  A further object of the present invention is to provide a method for downloading a file, so that the user can enjoy online multimedia services, such as listening to music online or watching videos online, and the like, which greatly satisfies the user's demand for online multimedia service quality.
本发明所述实现文件下载的网络通信系统包括: 通过通信网络连接 的对等(P2P, Peer to Peer )服务器、 文件服务器、 文件描述(TPT )服 务器以及一个以上的客户端。  The network communication system for implementing file downloading according to the present invention comprises: a peer-to-peer (P2P, Peer to Peer) server, a file server, a file description (TPT) server, and more than one client connected through a communication network.
其中, 所述 P2P服务器用于向所述一个以上的客户端公布可下载的 文件, 并通过所述通信网络处理客户端的登陆、 退出操作, 并在客户端 下载文件时, 向客户端返回与该文件对应的种子信息及下载配置参数; 所述文件服务器用于存储提供给客户端下载的文件;  The P2P server is configured to advertise a downloadable file to the one or more clients, and process a login and logout operation of the client through the communication network, and return the file to the client when the client downloads the file. The seed information corresponding to the file and the download configuration parameter; the file server is configured to store the file provided for downloading by the client;
所述 TPT服务器用于存储提供给客户端下载的文件对应的 TPT文 件;  The TPT server is configured to store a TPT file corresponding to the file downloaded by the client;
所述一个以上的客户端通过所述通信网络从所述 TPT服务器下载所 需文件对应的 TPT文件,向所述 P2P服务器查询通信网络中已下载自身 所需文件的其他客户端信息及下载配置参数,并根据所所述 TPT文件及 下载配置参数从所述其他客户端和 /或所述文件服务器下载所需的文件。  The one or more clients download the TPT file corresponding to the required file from the TPT server through the communication network, and query the P2P server for other client information and download configuration parameters of the file that has been downloaded in the communication network. And downloading the required files from the other client and/or the file server according to the TPT file and download configuration parameters.
本发明所述实现文件下载的方法, 包括:  The method for implementing file downloading according to the present invention includes:
在选择需要下载的文件后,客户端根据所选择的文件名到 TPT服务 器上下载与该文件对应的、 包含该文件标识的 TPT文件;  After selecting the file to be downloaded, the client downloads the TPT file corresponding to the file corresponding to the file according to the selected file name to the TPT server;
所述客户端根据所述文件标识向对等 P2P服务器查询与该文件对应 的种子信息; 户端信息作为该文件对应的种子信息返回给所述客户端; The client queries the peer P2P server according to the file identifier to correspond to the file. Seed information; the client information is returned to the client as seed information corresponding to the file;
所述客户端根据 P2P服务器返回的其他客户端信息与这些客户端建 立连接, 并从这些客户端交换所需文件的各个分片数据。  The client establishes a connection with the clients according to other client information returned by the P2P server, and exchanges the fragmentation data of the required files from the clients.
由此可以看出, 本发明所述的网络通信系统和方法通过将对等 P2P 技术与现有下载方法相结合, 使得客户端可以直接从通信网络中的其他 客户端直接下载所需的文件, 这样一来, 一方面可以大量节省服务器和 带宽消耗, 另一方面也能够加快客户端下载数据的速度, 从而极大地增 强了用户的体验。  It can be seen that the network communication system and method of the present invention combines the peer P2P technology with the existing download method, so that the client can directly download the required file directly from other clients in the communication network. In this way, on the one hand, it can save a lot of server and bandwidth consumption, on the other hand, it can speed up the downloading of data by the client, thereby greatly enhancing the user experience.
另外, 本发明所述的方法在从其他客户端下载分片数据的同时, 还 可以从文件服务器直接下载所需的分片数据, 这样不仅可以保证从通信 网络中下载的分片数据的连续性和有序性, 实现在线多媒体业务, 还可 以避免在种子较少的情况下, 下载速度较慢的问题。  In addition, the method of the present invention can download the required fragment data directly from the file server while downloading the fragment data from other clients, so as to ensure the continuity of the fragment data downloaded from the communication network. And orderly, to achieve online multimedia services, but also to avoid the problem of slow download speed in the case of fewer seeds.
再者, 本发明所述的方法通过在所述文件分组列表中记录已下载同 一文件的所有种子的网络类型或防火墙类型, 为 P2P服务器的种子管理 提供了准确的信息, 并且可以根据当前要下载该文件的客户端类型为该 客户端选择最优的种子, 进一步保证该客户端的下载速度。 附图简要说明  Furthermore, the method of the present invention provides accurate information for the seed management of the P2P server by recording the network type or firewall type of all the seeds that have downloaded the same file in the file grouping list, and can download according to the current seed management. The client type of the file selects the optimal seed for the client, further ensuring the download speed of the client. BRIEF DESCRIPTION OF THE DRAWINGS
图 1为现有网络通信系统中客户端从服务器下载数据的示意图; 图 2为本发明一个优选实施例所述网络通信系统中客户端从服务器 下载数据的示意图;  1 is a schematic diagram of a client downloading data from a server in an existing network communication system; FIG. 2 is a schematic diagram of a client downloading data from a server in a network communication system according to a preferred embodiment of the present invention;
图 3为本发明一个优选实施例所述实现多媒体文件下载的方法流程 实施本发明的方式 FIG. 3 is a flowchart of a method for implementing multimedia file downloading according to a preferred embodiment of the present invention; Mode for carrying out the invention
为使发明的目的、 技术方案及优点更加清楚明白, 以下参照附图并 举实施例, 对本发明作进一步详细说明。  The present invention will be further described in detail below with reference to the accompanying drawings and embodiments.
在本发明的一个优选实施例中, 将对等互联网技术 P2P技术与文件 下载技术相结合, 并将客户端从单一服务器下载数据的模式改变为客户 端之间直接交换数据的下载模式, 因而可以改变由于服务器的处理瓶颈 而限制同时下载文件的客户端数目的缺陷。  In a preferred embodiment of the present invention, a peer-to-peer Internet technology P2P technology is combined with a file downloading technology, and a mode in which a client downloads data from a single server is changed to a download mode in which data is directly exchanged between clients, thereby A bug that limits the number of clients that simultaneously download files due to server processing bottlenecks.
另外, 本实施例通过将容量较大的文件进行分片, 即将文件划分成 若干部分, 使得客户端可以同时从通信网络中的多个客户端或文件服务 器下载同一文件的不同分片,可以进一步保证客户端的下载速度。 同时, 由于需要下载数据的客户端可以从通信网络中的其它客户端直接下载 数据, 因此, 通信网络中同时下载数据的客户端数目越多, 分布越集中, 它们之间数据交互的效果就越好, 从而可以大大提高数据的下载速度。  In addition, in this embodiment, by dividing a file with a large capacity into pieces, the file is divided into several parts, so that the client can simultaneously download different fragments of the same file from multiple clients or file servers in the communication network, and can further Guarantee the download speed of the client. At the same time, since the client that needs to download data can directly download data from other clients in the communication network, the more the number of clients simultaneously downloading data in the communication network, the more concentrated the distribution, and the more effective the data interaction between them is. Ok, so you can greatly increase the download speed of the data.
基于上述思想, 本实施例提供了一种网络通信系统, 该网络通信系 统如图 2所示, 主要包括: P2P服务器、 文件服务器、 TPT服务器以及 一个以上的客户端。 所述 P2P服务器、 TPT服务器以及文件服务器分别 通过通信网络连接到所述一个以上的客户端, 以实现客户端到所述 P2P 服务器、 TPT服务器以及文件服务器的信息交互; 通信网络中的每个客 户端也通过通信网络连接到其它的客户端, 以实现客户端之间的数据交 换。  Based on the above idea, the embodiment provides a network communication system. As shown in FIG. 2, the network communication system mainly includes: a P2P server, a file server, a TPT server, and more than one client. The P2P server, the TPT server, and the file server are respectively connected to the one or more clients through a communication network, so as to implement information interaction between the client and the P2P server, the TPT server, and the file server; each client in the communication network The terminal is also connected to other clients through a communication network to implement data exchange between clients.
其中, 所述 P2P服务器主要负责可下载文件的发布, 通过所述通信 网络处理客户端的登陆、 退出、 下载、 查询种子、 心跳维护等请求; 所述文件服务器用于存储提供给用户下载的文件;  The P2P server is mainly responsible for issuing a downloadable file, and processing, by the communication network, a request for login, logout, download, query seed, heartbeat maintenance, and the like of the client; the file server is configured to store a file that is provided for download by the user;
所述 TPT服务器用于存储对应各个提供给用户下载的文件对应的 TPT文件; 所述一个以上的客户端通过所述通信网络从 TPT服务器下载所需文 件对应的 ΤΡΤ文件, 并根据所下载的 ΤΡΤ文件从所述通信网络中的其 他客户端和 /或文件服务器下载所需文件的各个分片数据。 The TPT server is configured to store a TPT file corresponding to each file that is provided for download by the user; The one or more clients download the file corresponding to the required file from the TPT server through the communication network, and download the required file from other clients and/or file servers in the communication network according to the downloaded file. Each piece of data.
在文件下载的过程中, 通信网络中的客户端可以通过 HTTP、 FTP 或其它多种通信方式从 TPT服务器下载 TPT文件, 以及从所述文件服 务器下载所需文件的各个分片数据, 或者通过传输控制协议(TCP )或 用户数据报协议(UDP )从所迷通信网络中的其他客户端下载所需文件 的各个分片数据。  During the file downloading process, the client in the communication network can download the TPT file from the TPT server through HTTP, FTP or other various communication methods, and download the fragment data of the required file from the file server, or transmit the data. The Control Protocol (TCP) or User Datagram Protocol (UDP) downloads the individual fragmentation data of the required files from other clients in the communication network.
在通过上述网络通信系统下载文件的过程中, 客户端首先需要从 P2P服务器发布的文件中选择需要下载的文件; 然后, 从 TPT服务器下 载该文件对应的 TPT文件, 从中获得该文件的相关信息, 例如该文件的 文件标识 FileID、 分片数据的数目以及每个分片数据的大小等等; 接下 来, 根据这些相关信息向 P2P服务器查询其它在线并下载了该文件的客 户端信息, 即向 P2P服务器查询种子; 在获得了种子之后, 该客户端将 从查询到的种子下载该文件的各个分片数据, 同时, 为了保证所下载文 件各个分片数据的连续性和有序性, 客户端还可以同时从所述文件服务 器下载所需的分片数据。  In the process of downloading the file through the network communication system, the client first needs to select a file to be downloaded from the file published by the P2P server; then, download the TPT file corresponding to the file from the TPT server, and obtain relevant information of the file from the TPT server. For example, the file identifier of the file identifies the FileID, the number of fragmentation data, and the size of each fragmentation data, etc.; next, according to the related information, the P2P server is queried for other client information that is online and downloaded, that is, to the P2P. The server queries the seed; after obtaining the seed, the client downloads the fragment data of the file from the queried seed, and at the same time, in order to ensure the continuity and order of each fragment data of the downloaded file, the client also The required fragmentation data can be downloaded from the file server at the same time.
下面将通过具体的实施例详细描述本发明所述实现文件下载的方 法。 如图 3所示, 本发明所述的文件下载方法具体包括以下步骤:  The method of implementing file downloading of the present invention will be described in detail below through specific embodiments. As shown in FIG. 3, the file downloading method of the present invention specifically includes the following steps:
A、 预先在 P2P服务器、 文件服务器以及 TPT服务器发布提供给用 户下载的文件。  A. Pre-release the files provided to the user for download on the P2P server, file server, and TPT server.
该步驟所述的发布主要包括:  The release described in this step mainly includes:
首先, 根据即将提供给用户下载的文件制作每个文件的 TPT文件, 并将制作好的 TPT文件上传到所述 TPT服务器;  First, a TPT file of each file is created according to a file to be downloaded to the user, and the created TPT file is uploaded to the TPT server;
然后, 将提供给用户下载的文件上传至所述文件服务器; 最后, 在所述 P2P服务器上公布即将提供给用户下载的文件, 供用 户通过客户端进行下载查询。 Then, uploading the file provided to the user for uploading to the file server; Finally, the file to be downloaded to the user is published on the P2P server for the user to download and query through the client.
其中, 所述 TPT文件主要包含了该 TPT文件所对应的文件标识 FilelD、 该文件的分片数据数目和每个分片数据的大小、 每个分片数据 的校验值及该 TPT文件自身的校验值和版本号等等。  The TPT file mainly includes the file identifier File1D corresponding to the TPT file, the number of fragmented data of the file, the size of each fragment data, the check value of each fragment data, and the TPT file itself. Check value and version number, etc.
所述文件的分片数据数目和分片大小是由该 TPT文件所对应文件的 大小以及用户实际选择的业务类型来确定的, 例如, 如果是在线收听音 乐业务, 则分片数据的大小通常为 16K字节, 此时该文件的分片数据数 目等于文件大小与 16K字节的商, 而如果是在线收看视频业务, 则分片 数据的大小通常为 50K字节,此时该文件的分片数据数目等于文件大小 与 50K字节的商。  The number of fragmented data and the size of the fragment of the file are determined by the size of the file corresponding to the TPT file and the type of service actually selected by the user. For example, if the music service is listened to online, the size of the fragmented data is usually 16K bytes, at this time, the number of fragmented data of the file is equal to the file size and the quotient of 16K bytes, and if the video service is online, the size of the fragmented data is usually 50K bytes, and the fragment of the file at this time The number of data is equal to the file size and the quotient of 50K bytes.
另外, 所述文件标识 FilelD就是对该文件的文件名进行校验后得到 的校验值, 其中, 计算文件标识 FileID、 每个分片数据的校验值或 TPT 文件的校验值所采用的校验算法可以是多种常用的校验算法, 例如哈什 ( HASH )运算等等。 例如, 在本发明的一个优选实施例中, 所述文件 标识 FilelD就是所对应文件的文件名经过 HASH运算后的得到的 32位 整型值。  In addition, the file identifier File1D is a check value obtained by verifying the file name of the file, where the file identifier FileID, the check value of each fragment data, or the check value of the TPT file are used. The verification algorithm can be a variety of commonly used verification algorithms, such as Hash operations and the like. For example, in a preferred embodiment of the present invention, the file identifier File1D is a 32-bit integer value obtained after the HASH operation of the file name of the corresponding file.
B、 在用户通过客户端从已发布的文件中选择需要下载的文件时, 该客户端根据所要下载的文件名到 TPT服务器上下载与该文件对应的 TPT文件;  B. When the user selects a file to be downloaded from the published file through the client, the client downloads the TPT file corresponding to the file according to the file name to be downloaded to the TPT server;
在下载得到 TPT文件后, 所述客户端还可以进一步解析该 TPT文 件,并检验所下载 TPT文件的正确性,若检验正确,则继续执行步骤 C, 否则, 禁止该用户下载所述文件并结束。  After downloading the TPT file, the client may further parse the TPT file and verify the correctness of the downloaded TPT file. If the check is correct, proceed to step C. Otherwise, the user is prohibited from downloading the file and ending. .
这里, 所述检验为: 检验该 TPT文件的格式和版本是否正确。  Here, the check is: Verify that the format and version of the TPT file are correct.
所述检验还可以进一步包括采用相应的校验方法,例如 HASH运算, 对该 TPT文件本身进行校验。 The checking may further include adopting a corresponding verification method, such as a HASH operation, The TPT file itself is verified.
C、 所述客户端登陆 P2P服务器, P2P服务器返回一个唯一的用户 标识(UIN )到所述客户端。  C. The client logs in to the P2P server, and the P2P server returns a unique user identifier (UIN) to the client.
该步驟所述 UIN是 P2P服务器在预先设定的数值范围内顺序选择出 来的,该数值范围与 P2P服务器最多可以支持的在线用户数有关,例如, 若一台 P2P服务器最多可以 10万在线用户, 则 UIN的取值范围可以是 1 ~ 100000。  The UIN in the step is sequentially selected by the P2P server within a preset value range, and the value range is related to the maximum number of online users that the P2P server can support. For example, if a P2P server can have up to 100,000 online users, The value of UIN can range from 1 to 100,000.
D、 客户端获得 UIN后, 根据用户选择下载的文件, 向 P2P服务器 发出下载请求,在所述下载请求中携带该客户端的 UIN及所要下载文件 的 FileID。  D. After obtaining the UIN, the client sends a download request to the P2P server according to the file selected by the user, and carries the UIN of the client and the FileID of the file to be downloaded in the download request.
E、 P2P服务器检验该客户端的 UIN及所要下载文件的 FilelD是否 正确, 同时检查该文件是否已经发布过, 若 UIN及 FilelD正确且该文件 已经发布过, 则执行步骤 F; 否则, 通知客户端无法下载该文件并结束。  E. The P2P server checks whether the UIN of the client and the FilelD of the file to be downloaded are correct, and checks whether the file has been published. If UIN and FilelD are correct and the file has been published, step F is performed; otherwise, the client is notified that the file cannot be Download the file and finish.
该步骤所述 P2P服务器检验所要下载文件的 FilelD是否正确的方法 为将所要下载文件的文件名经过 HASH运算后得到的 32位整型值与 FilelD进行比较, 如果相同, 则检验正确, 否则检验不正确。  In this step, the P2P server checks whether the FilelD of the file to be downloaded is correct. The method of comparing the 32-bit integer value obtained by the HASH operation of the file name of the file to be downloaded is compared with FilelD. If the same, the verification is correct, otherwise the test is not performed. correct.
F、 P2P服务器将该客户端的 UIN加入到该文件对应的文件分组列 表当中, 同时返回该文件对应的下载配置参数给客户端。  F. The P2P server adds the UIN of the client to the file grouping list corresponding to the file, and returns the download configuration parameter corresponding to the file to the client.
所述文件分组列表筒单来说就是将已经将下载所发布文件的所有客 户端进行分类整理, P2P服务器会把下载同一文件的所有客户端的信息 与该文件进行关联, 并将关联到同一文件的所有客户端信息记录在该文 件对应的文件分组列表中, 供客户端进行查询。 所述客户端信息包括: 客户端地址、 客户端所在网络的网络类型或防火墙类型等等。  The file grouping list is to sort all the clients that have downloaded the published file, and the P2P server associates the information of all the clients that download the same file with the file, and associates the same file with the same file. All client information is recorded in the file group list corresponding to the file for the client to query. The client information includes: a client address, a network type of a network where the client is located, or a firewall type.
该步骤所述文件对应的下载配置参数主要包括: 下载时启动的线程 个数、 每个线程的上传和下载最大限速 /最小限速、 P2P上传限速、 P2P 下载限速、 最多连接的客户端数目、 查询种子的间隔时间、 P2P下载到 达什么速度时可以降低从文件服务器的下载速度、 P2P下载到达什么速 度时可以提升从文件服务器的下载速度、 P2P上传限速百分比等等。 The download configuration parameters corresponding to the file in the step mainly include: the number of threads started during download, the maximum speed limit/minimum speed limit for each thread uploading and downloading, the P2P upload speed limit, P2P Download the speed limit, the maximum number of connected clients, the interval between querying seeds, and the speed at which P2P downloads can be reduced. The download speed from the file server and the speed at which the P2P download arrives can increase the download speed from the file server and the P2P upload limit. Speed percentage and so on.
上述这些配置参数是由 P2P服务器的配置文件决定的, 所述配置文 件通常包括默认配置和特殊配置两种类型, 其中, 默认配置包含了针对 所有文件的通用配置参数, 而特殊配置只包含了针对某些个别文件的特 殊配置参数。 如果所发布的文件没有对应的特殊配置文件, 则 P2P服务 器会向客户端返回默认配置参数, 如果有对应的特殊配置文件, 则 P2P 服务器会将默认配置参数和特殊配置参数一起返回客户端。 需要说明的 是, P2P服务器的所有配置文件是可以动态更新的, 即可以在 P2P服务 器运行时进行修改或更新。  The above configuration parameters are determined by the configuration file of the P2P server. The configuration file usually includes two types: default configuration and special configuration. The default configuration includes common configuration parameters for all files, and the special configuration only includes Special configuration parameters for some individual files. If the published file does not have a corresponding special configuration file, the P2P server returns the default configuration parameters to the client. If there is a corresponding special configuration file, the P2P server returns the default configuration parameters together with the special configuration parameters to the client. It should be noted that all configuration files of the P2P server can be dynamically updated, that is, they can be modified or updated while the P2P server is running.
G、 客户端收到该文件对应的下载配置参数后, 发送自身的 UIN及 所要下载文件的 FilelD到 P2P服务器,向 P2P服务器查询其它下载该文 件的客户端信息, 即向 P2P服务器查询种子。  G. After receiving the download configuration parameter corresponding to the file, the client sends its own UIN and FilelD of the file to be downloaded to the P2P server, and queries the P2P server for other client information for downloading the file, that is, queries the P2P server for the seed.
客户端在发送查询种子请求时, 还可以进一步发送该客户端的网络 类型或防火墙类型到所述 P2P服务器,请求 P2P服务器根据该客户端的 网络类型查询同一分组中具有相同网絡类型的其它客户端信息。  When sending the query seed request, the client may further send the network type or firewall type of the client to the P2P server, and request the P2P server to query other client information having the same network type in the same group according to the network type of the client.
H、 P2P服务器根据来自该客户端的 UIN、 FilelD返回该文件所对应 文件分组列表中其它客户端的信息, 即向所述客户端返回其它种子信 若客户端查询种子的请求中包含了该客户端的网络类型, 则 P2P服 务器将进一步根据该客户端的网络类型或防火墙类型尽量向客户端返 回无防火墙的公网或者具有相应防火墙类型的客户端信息, 同时返回一 部分其他类型的客户端信息。 这样一来, 所述客户端和这些种子进行数 据交互时的连通性就很高, 同时数据传输的速度也将更快。 I、 所述客户端尝试与所述种子建立连接, 并查询这些种子中是否存 在自身所需的文件或该文件的分片数据, 如果有, 则根据 TPT文件以及 所获得的下载配置参数与所述种子交换数据, 得到所要下载文件的各个 分片数据。 H. The P2P server returns information of other clients in the file group list corresponding to the file according to the UIN and FilelD from the client, that is, returns other seed messages to the client. If the client queries the seed, the client includes the network of the client. Type, the P2P server will further return the firewall-free public network or the client information with the corresponding firewall type to the client according to the network type or firewall type of the client, and return some other types of client information. In this way, the connectivity between the client and the seeds for data interaction is high, and the speed of data transmission will be faster. I. The client attempts to establish a connection with the seed, and queries whether the file or the fragmentation data of the file exists in the seed, and if so, according to the TPT file and the obtained download configuration parameter The seed exchange data, and each piece of data of the file to be downloaded is obtained.
在该步骤中, 所述客户端将通过 TCP/UDP方式从所述种子交换所 需的各个分片数据。  In this step, the client will exchange the required fragment data from the seed by TCP/UDP.
在交换到每个分片数据后, 客户端还将进一步根据从步骤 B所下载 TPT文件中解析得到的每个分片数据的校验值对交换来的分片数据进行 校验, 如果校验正确, 则接收所述分片数据; 否则, 丟弃所述分片数据。  After switching to each fragment data, the client further checks the exchanged fragment data according to the check value of each fragment data parsed from the TPT file downloaded in step B, if the verification If correct, the fragment data is received; otherwise, the fragment data is discarded.
在该步骤中, 由于从各个种子交换来的分片数据是随机排列的, 因 此, 为了得到完整的文件, 客户端还需要将交换来的分片数据重新按照 顺序组合成所要下载的文件。  In this step, since the slice data exchanged from the respective seeds is randomly arranged, in order to obtain a complete file, the client also needs to recombine the exchanged slice data into the files to be downloaded in order.
从上述过程可以看出, 采用 P2P技术后, 可以有效地解决服务器的 瓶颈问题, 同时由于所有在线的客户端都会将自身下载的文件共享给通 信网络的其他客户端, 因此, 在通常情况下通信网络中将会有足够的种 子存在, 并且下载同一文件的客户端数目越多, 分布越集中, 它们之间 数据交互的效果就越好, 这样, 使得一台服务器可以支持大量用户同时 下载, 并且能够保证所有用户的下载速度。  It can be seen from the above process that after adopting P2P technology, the bottleneck problem of the server can be effectively solved, and at the same time, since all online clients share the files downloaded by themselves to other clients of the communication network, communication under normal conditions is There will be enough seeds in the network, and the more clients download the same file, the more concentrated the distribution, the better the data interaction between them, so that one server can support a large number of users to download at the same time, and Can guarantee the download speed of all users.
另外 , 通过在所述文件分组列表中记录已下载同一文件的所有种子 的网络类型或防火墙类型,为 P2P服务器的种子管理提供了准确的信息, 并且可以根据当前要下载该文件的客户端类型为该客户端选择最优的 种子, 进一步保证该客户端的下载速度。  In addition, by recording the network type or firewall type of all the seeds that have downloaded the same file in the file grouping list, accurate information is provided for the seed management of the P2P server, and the type of the client according to the current file to be downloaded may be The client selects the optimal seed to further guarantee the download speed of the client.
但是, 由于上述方法交换来的分片数据是随机排列的, 因此, 只有 客户端在下载了文件的所有分片数据之后,才能获得正确、完整的文件, 这对一般的文件下载业务来将是可以接受的, 但是这会给在线多媒体业 务, 例如在线收听音乐或在线收看视频节目等, 带来较大的延时, 影响 用户的体验。 However, since the fragment data exchanged by the above method is randomly arranged, only the client can obtain a correct and complete file after downloading all the fragment data of the file, which is to be a general file download service. Acceptable, but this will give the online multimedia industry For example, listening to music online or watching video programs online brings a large delay and affects the user experience.
因此, 在本发明的一个优选实施例中, 为了保证客户端所下载数据 分片的连续有序, 客户端在与种子进行分片数据交换的同时, 也会根据 Therefore, in a preferred embodiment of the present invention, in order to ensure the continuous ordering of the data fragments downloaded by the client, the client performs the fragment data exchange with the seed, and
P2P服务器返回的下载配置参数启动常见的 HTTP或 FTP下载方式, 从 文件服务器上下载需要的分片数据, 并通过一定的算法和通讯机制保证 客户端所下载数据分片的连续性和有序性。 The download configuration parameters returned by the P2P server start a common HTTP or FTP download mode, download the required fragment data from the file server, and ensure the continuity and order of the downloaded data fragments by the client through a certain algorithm and communication mechanism. .
例如, 在线收听音乐的过程中, 对于用于正在收听的音乐, 如果该 音乐文件还没有下载完全, 则该用户的客户端会优先使用 HTTP下载的 方式, 从文件服务器获得该音乐播放过程中所需的音乐文件分片数据, 同时, 对于尚未播放的音乐文件或者音乐文件的分片数据, 仍可以采用 P2P下载的方式来下载。  For example, in the process of listening to music online, for the music being used for listening, if the music file has not been downloaded completely, the client of the user will preferentially use the HTTP download method to obtain the music playing process from the file server. The required music file fragmentation data, at the same time, for the music files that have not been played or the fragmentation data of the music files, can still be downloaded by P2P download.
上述这种下载方法, 既加快了下载的速度, 减少了文件服务器的负 荷, 同时又保证了所下载文件的连续有序。  The above download method not only speeds up the downloading process, but also reduces the load of the file server, and at the same time ensures the continuous ordering of the downloaded files.
其中, 客户端从文件服务器下载分片数据的比例由 P2P服务器返回 的下载配置参数控制, 并可以根据实际情况进行动态调整, 从而保证在 绝大多数情况下, 多数的分片数据是通过与其他客户端交换获得的, 从 而可以节省大量的服务器带宽资源。  The proportion of the client downloading the fragmented data from the file server is controlled by the download configuration parameter returned by the P2P server, and can be dynamically adjusted according to the actual situation, thereby ensuring that in most cases, most of the fragmented data is passed through Client exchanges are obtained, which can save a lot of server bandwidth resources.
上述优选实施例所述的方法可以支持大量用户同时享受在线多媒体 业务, 例如在线收听音乐, 或在线收看视频节目, 极大地满足用户对在 线多媒体业务服务质量的需求。  The method described in the above preferred embodiment can support a large number of users to enjoy online multimedia services at the same time, such as listening to music online, or watching video programs online, which greatly satisfies the user's demand for online multimedia service quality.
在本发明所述的方法中,为了维护客户端与 P2P服务器之间的连接, 一旦客户端登陆 P2P服务器, 就会定时发送心跳信号到 P2P服务器, 同 时 P2P服务器也会定时检测来自所有已登陆的客户端的心跳信号, 如超 时未接收到心跳信号, 则踢出对应的客户端, 释放为该客户端分配的资 源, 并从相关的文件分组列表中删除该客户端信息。 In the method of the present invention, in order to maintain the connection between the client and the P2P server, once the client logs in to the P2P server, the heartbeat signal is sent to the P2P server periodically, and the P2P server also periodically detects from all the logged in. If the heartbeat signal of the client does not receive the heartbeat signal, the corresponding client is kicked out and the resources allocated for the client are released. Source, and remove the client information from the associated file grouping list.
另外, 在线多媒体业务结束后, 例如在用户收听完音乐或收看完视 频节目后, 客户端会向 Ρ2Ρ服务器发送登出 (Logout )请求, 然后主动 退出。 在收到客户端的 Logout请求后, P2P服务器随即释放为客户端分 配的资源, 并从相关的文件分组列表中删除该客户端信息。  In addition, after the online multimedia service ends, for example, after the user listens to the music or watches the video program, the client sends a logout request to the server, and then voluntarily quits. After receiving the Logout request from the client, the P2P server releases the resources allocated for the client and deletes the client information from the related file group list.

Claims

权利要求书 Claim
1、一种实现文件下载的网络通信系统, 其特征在于, 该网络通信系 统包括: 通过通信网络相互连接的对等互联网技术 P2P服务器、 文件服 务器、 文件描述 TPT服务器以及一个以上的客户端;  A network communication system for implementing file downloading, characterized in that the network communication system comprises: a peer-to-peer Internet technology P2P server, a file server, a file description TPT server and more than one client connected to each other through a communication network;
其中, 所述 P2P服务器用于向所述一个以上的客户端公布可下载的 文件, 并通过所述通信网络处理客户端的登陆、 退出操作, 并在客户端 下载文件时, 向客户端返回与该文件对应的种子信息及下载配置参数; 所述文件服务器用于存储提供给客户端下载的文件;  The P2P server is configured to advertise a downloadable file to the one or more clients, and process a login and logout operation of the client through the communication network, and return the file to the client when the client downloads the file. The seed information corresponding to the file and the download configuration parameter; the file server is configured to store the file provided for downloading by the client;
所述 TPT服务器用于存储提供给客户端下载的文件对应的 TPT文 件;  The TPT server is configured to store a TPT file corresponding to the file downloaded by the client;
所述一个以上的客户端通过所述通信网絡从所述 TPT服务器下载所 需文件对应的 TPT文件,向所述 P2P服务器查询通信网络中已下载自身 所需文件的其他客户端信息及下载配置参数,并根据所所述 TPT文件及 下载配置参数从所述其他客户端和 /或所述文件服务器下载所需的文件。  The one or more clients download the TPT file corresponding to the required file from the TPT server through the communication network, and query the P2P server for other client information and download configuration parameters of the file that has been downloaded in the communication network. And downloading the required files from the other client and/or the file server according to the TPT file and download configuration parameters.
2、根据权利要求 1所述的网络通信系统, 其特征在于, 所述一个以 上的客户端通过超文本传输协议 HTTP或文件传输协议 FTP从 TPT服 务器下载所需文件对应的 TPT文件。  The network communication system according to claim 1, wherein the one or more clients download the TPT file corresponding to the required file from the TPT server through the Hypertext Transfer Protocol HTTP or the File Transfer Protocol FTP.
3、根据权利要求 1或 2所述的网络通信系统, 其特征在于, 所述一 个以上的客户端通过传输控制协议 TCP或用户数据报协议 UDP从通信 网络中的其他客户端下载所需的文件或通过 HTTP或 FTP从所述文件服 务器下载所需的文件。  The network communication system according to claim 1 or 2, wherein the one or more clients download the required files from other clients in the communication network through the Transmission Control Protocol TCP or the User Datagram Protocol UDP. Or download the required files from the file server via HTTP or FTP.
4、 一种实现文件下载的方法, 其特征在于, 所述方法包括: 在选择需要下载的文件后, 客户端根据所选择的文件名到文件描述 TPT服务器上下载与该文件对应的、 包含该文件标识的 TPT文件; 所述客户端 居所述文件标识向对等 P2P服务器查询与该文件对应 的种子信息; 户端信息作为该文件对应的种子信息返回给所述客户端; A method for downloading a file, the method comprising: after selecting a file to be downloaded, the client downloads the file corresponding to the file according to the selected file name to the file description, and includes the file The TPT file identified by the file; The client queries the peer P2P server for the seed information corresponding to the file; the client information is returned to the client as the seed information corresponding to the file;
所述客户端根据 P2P服务器返回的其他客户端信息与这些客户端建 立连接, 并从这些客户端交换所需文件的各个分片数据。  The client establishes a connection with the clients according to other client information returned by the P2P server, and exchanges the fragmentation data of the required files from the clients.
5、根据权利要求 4所述的方法, 其特征在于, 所述选择需要下载的 文件包括:  The method according to claim 4, wherein the selecting the file to be downloaded comprises:
根据即将提供给客户端下载的文件制作每个文件对应的 TPT文件, 并将制作好的 TPT文件上传到 TPT服务器;  Make a TPT file corresponding to each file according to the file to be downloaded to the client, and upload the created TPT file to the TPT server;
将提供给客户端下载的文件上传至文件服务器;  Upload the file provided to the client for upload to the file server;
在 P2P服务器上公布即将提供给客户端下载的文件, 供客户端进行 下载查询及选择。  The file to be downloaded to the client is published on the P2P server for the client to download and query.
6、根据权利要求 4所述的方法, 其特征在于, 在查询与所述文件对 应的种子信息之前, 进一步包括:  The method according to claim 4, further comprising: before querying the seed information corresponding to the file, further comprising:
所述客户端登陆所述 P2P服务器, 获取该客户端的用户标识; 所述 P2P月良务器根据用户标识将该客户端加入到该文件标识对应的 文件分组列表中。  The client logs in to the P2P server to obtain the user identifier of the client; the P2P server adds the client to the file grouping list corresponding to the file identifier according to the user identifier.
7、 根据权利要求 4所述的方法, 其特征在于, 所述 TPT文件进一 步包括所对应文件的分片数据数目和每个分片数据的大小、 每个分片数 据的校验值及该 TPT文件的校验值和版本号;  The method according to claim 4, wherein the TPT file further includes a number of pieces of data of the corresponding file, a size of each piece of data, a check value of each piece of data, and the TPT. The check value and version number of the file;
所述客户端下载 TPT文件后进一步包括: 检验所下载 TPT文件的 格式和版本是否正确, 如果检验正确, 则继续执行查询该文件所对应种 子信息的操作; 否则, 禁止该用户下载所述文件并结束;  After the client downloads the TPT file, the method further includes: checking whether the format and version of the downloaded TPT file are correct, and if the check is correct, continuing to perform the operation of querying the seed information corresponding to the file; otherwise, the user is prohibited from downloading the file and End;
在客户端从通信网络中的其他客户端交换到分片数据后, 进一步根 据每个分片数据的校验值对交换到的分片数据进行校验, 如果校验正 确, 则接收; 否则, 丟弃该分片数据。 After the client exchanges data from other clients in the communication network to the fragmented data, further roots The switched fragment data is verified according to the check value of each fragment data, and if the verification is correct, it is received; otherwise, the fragment data is discarded.
8、 根据权利要求 7 所述的方法, 其特征在于, 所述校验采用哈希 HASH运算。  8. The method according to claim 7, wherein the verification uses a hash HASH operation.
9、根据权利要求 4所述的方法, 其特征在于, 在所述客户端向所述 P2P服务器查询与所述文件对应的种子信息之后进一步包括:  The method according to claim 4, further comprising: after the client queries the P2P server for the seed information corresponding to the file, further comprising:
P2P服务器检验该客户端的用户标识及所要下载文件的文件标识是 否正确, 同时检查该文件是否已经发布过, 若所述客户端标识以及文件 标识均正确且该文件已经发布过, 则返回与所述文件对应的种子信息; 否则, 通知客户端无法下载该文件并结束。  The P2P server verifies that the user identifier of the client and the file identifier of the file to be downloaded are correct, and checks whether the file has been advertised. If the client identifier and the file identifier are correct and the file has been advertised, the P2P server returns The seed information corresponding to the file; otherwise, the notification client cannot download the file and ends.
10、 根据权利要求 9所述的方法, 其特征在于, 所述检验所要下载 文件的文件标识是否正确为:将所要下载文件的文件名经过 HASH运算 后得到的 32位整型值与所述文件标识进行比较, 如果相同, 则检验正 确, 否则检验不正确。  The method according to claim 9, wherein the file identifier of the file to be downloaded is correct: a 32-bit integer value obtained by HASH operation of the file name of the file to be downloaded and the file The indicators are compared. If they are the same, the test is correct, otherwise the test is incorrect.
11、根据权利要求 4所述的方法,其特征在于,在客户端向所述 P2P 服务器请求与所述文件对应的种子信息时, 进一步发送该客户端的网络 类型或防火墙类型到所述 P2P服务器;  The method according to claim 4, wherein when the client requests the seed information corresponding to the file to the P2P server, the network type or firewall type of the client is further sent to the P2P server;
在返回与所述文件对应的种子信息时, P2P服务器将进一步根据该 客户端的网络类型或防火墙类型将该文件分组列表中与所述客户端具 有相同网络类型或防火墙类型的客户端信息发送给所述客户端。  When returning the seed information corresponding to the file, the P2P server further sends the client information with the same network type or firewall type in the file grouping list to the client according to the network type or firewall type of the client. Said client.
12、 根据权利要求 4所述的方法, 其特征在于, 在返回与所述文件 对应的种子信息时, 所述 P2P服务器进一步将与所述文件对应文件的下 载配置参数返回所述客户端;  The method according to claim 4, wherein, when returning the seed information corresponding to the file, the P2P server further returns a download configuration parameter of the file corresponding to the file to the client;
所述交换所需文件的各个分片数据为: 所述客户端根据 P2P服务器 返回的下载配置参数从所述其他客户端交换得到所需文件的各个分片 数据。 Each piece of fragmentation data of the file required for the exchange is: the client exchanges the pieces of the required file from the other client according to the download configuration parameter returned by the P2P server. Data.
13、根据权利要求 12所述的方法, 其特征在于, 所述的下载配置参 数是由 P2P服务器的配置文件决定的, 主要包括: 下载时启动的线程个 数、 每个线程的上传和下载最大限速 /最小限速、 P2P上传限速、 P2P下 载限速、 最多连接的客户端数目、 查询种子的间隔时间、 P2P下载到达 什么速度时可以降低从所述文件服务器下载的速度、 P2P下载到达什么 速度时可以提升从所述文件服务器下载的速度、 P2P上传限速百分比。  The method according to claim 12, wherein the downloading configuration parameter is determined by a configuration file of the P2P server, and mainly includes: the number of threads started when downloading, and the maximum uploading and downloading of each thread. Speed limit/minimum speed limit, P2P upload speed limit, P2P download speed limit, maximum number of connected clients, query seed interval, and speed of P2P download arrival can reduce the speed of download from the file server, P2P download arrival At what speed, the speed of downloading from the file server and the percentage of P2P upload speed limit can be increased.
14、 根据权利要求 4所述的方法, 其特征在于, 在所述客户端交换 得到所有的分片数据后进一步包括: 将交换来的分片数据按照顺序重新 组合成所要下载的文件。  The method according to claim 4, wherein after the client exchanges all the fragment data, the method further comprises: reorganizing the exchanged fragment data into the file to be downloaded in order.
15、根据权利要求 13所述的方法, 其特征在于, 在所述客户端在与 所述其他客户端进行分片数据交换的同时, 进一步从文件服务器上下载 需要的分片数据。  The method according to claim 13, wherein the client further downloads the required fragment data from the file server while performing the fragment data exchange with the other client.
16、 根据权利要求 4所述的方法, 其特征在于, 所述方法进一步包 括:  The method according to claim 4, wherein the method further comprises:
在客户端在登陆 P2P服务器之后,定时发送心跳信号到 P2P服务器; P2P服务器定时检测来自所有已登陆的客户端的心跳信号, 如超时 未接收到心跳信号,则踢出对应的客户端,幹放为该客户端分配的资源, 并从相关的文件分组列表中删除该客户端信息。  After the client logs in to the P2P server, the heartbeat signal is sent to the P2P server periodically. The P2P server periodically detects the heartbeat signal from all the logged-in clients. If the heartbeat signal is not received after the timeout, the corresponding client is kicked out. The client allocates resources and removes the client information from the associated file grouping list.
17、 如权利要求 4或 6所述的方法, 其特征在于, 所述方法进一步 包括: P2P服务器在收到客户端的退出请求后, 幹放为客户端分配的资 源, 并从相关的文件分组列表中删除该客户端信息。  The method according to claim 4 or 6, wherein the method further comprises: after receiving the exit request from the client, the P2P server releases the resource allocated for the client, and lists the related file from the group Delete the client information.
PCT/CN2006/002226 2005-09-02 2006-08-30 Network communication system and method for downloading the file WO2007025474A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN 200510095833 CN100527672C (en) 2005-09-02 2005-09-02 Network communication system and method realizing file downloading
CN200510095833.1 2005-09-02

Publications (1)

Publication Number Publication Date
WO2007025474A1 true WO2007025474A1 (en) 2007-03-08

Family

ID=37808471

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2006/002226 WO2007025474A1 (en) 2005-09-02 2006-08-30 Network communication system and method for downloading the file

Country Status (2)

Country Link
CN (1) CN100527672C (en)
WO (1) WO2007025474A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108833552A (en) * 2018-06-22 2018-11-16 邓德雄 P2P content distribution system in promiscuous mode
CN114039971A (en) * 2021-11-11 2022-02-11 北京神舟航天软件技术股份有限公司 Large file concurrent transmission method based on file flow in BS mode
CN114520807A (en) * 2022-02-24 2022-05-20 深圳壹账通智能科技有限公司 File uploading and downloading method and device, computer equipment and storage medium

Families Citing this family (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100556129C (en) * 2006-08-22 2009-10-28 腾讯科技(深圳)有限公司 A kind of equity connects flow medium live system and device
CN101146107B (en) * 2007-09-27 2011-10-12 深圳市迅雷网络技术有限公司 A method and device for data download
CN101163156B (en) * 2007-09-27 2010-07-21 腾讯科技(深圳)有限公司 Method, client terminal and system of obtaining network resource
CN101141482B (en) * 2007-09-29 2012-01-18 腾讯科技(深圳)有限公司 Network resource management system and method
CN101170371B (en) * 2007-11-30 2010-12-29 中兴通讯股份有限公司 A client data request optimization method and system in P2P order
CN101471855B (en) * 2007-12-29 2012-12-12 华为终端有限公司 Communication equipment and application method and system thereof
CN101945089B (en) * 2009-07-03 2015-08-19 北京中企开源信息技术有限公司 The distributing method of digital movie bag and publishing system
CN101631141B (en) * 2009-08-19 2012-07-04 腾讯科技(深圳)有限公司 P2P system and network resource management method in same
CN102025444A (en) * 2009-09-09 2011-04-20 腾讯科技(深圳)有限公司 Resource publishing method, resource downloading method and data verification system
CN102055786B (en) * 2009-11-06 2014-12-24 腾讯科技(深圳)有限公司 File download method and server, download client and system adopting same
CN101795399B (en) * 2010-03-10 2016-04-13 深圳市同洲电子股份有限公司 A kind of monitoring agent system, vehicle-mounted monitoring equipment and vehicle-mounted digital supervisory control system
CN101840345A (en) * 2010-05-06 2010-09-22 深圳市九洲电器有限公司 Configuration parameter-identifying method, system and embedded equipment
CN103164502A (en) * 2011-09-13 2013-06-19 吉菲斯股份有限公司 Management of online content in a network
CN103023937A (en) * 2011-09-26 2013-04-03 北大方正集团有限公司 Method and system for distributing network files
CN102882799B (en) * 2012-09-13 2017-09-01 曙光信息产业(北京)有限公司 The controllable clustered deploy(ment) configuration System and method for of flow
CN103491102A (en) * 2013-09-30 2014-01-01 天脉聚源(北京)传媒科技有限公司 Method, system and device for monitoring stability of internet audio and video
CN103716719B (en) * 2013-12-02 2017-03-08 乐视云计算有限公司 A kind of method for down loading of multimedia file and user terminal
CN105227680A (en) * 2015-10-26 2016-01-06 广东佳学信息科技有限公司 A kind of smart machine file download Validity control method
CN105635277A (en) * 2015-12-30 2016-06-01 北京京东尚科信息技术有限公司 Upgrade packet providing method and device and client side upgrade method and device
CN106657383B (en) * 2017-01-12 2021-03-19 腾讯科技(深圳)有限公司 Data downloading method and related equipment
CN111343225B (en) * 2018-12-19 2024-04-09 三六零科技集团有限公司 File processing method and device
CN110062280A (en) * 2019-04-23 2019-07-26 湖南快乐阳光互动娱乐传媒有限公司 P2P-oriented video cache management and playing method, system and medium
CN110333947B (en) * 2019-05-23 2023-06-16 深圳市腾讯网域计算机网络有限公司 Method, device, equipment and medium for loading subcontracting resources of game application
CN113051456A (en) * 2021-05-11 2021-06-29 北京字节跳动网络技术有限公司 Request processing method and device, electronic equipment and computer readable medium
CN115567547A (en) * 2022-08-18 2023-01-03 网易(杭州)网络有限公司 Mirror image distribution method, system and equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
KONG B. ET AL.: "Analysis and Improvement of BitTorrent", COMPUTER ENGINEERING, vol. 30, December 2004 (2004-12-01), pages 257 - 259, XP008077846 *
WANG J.: "Research of BitTorrent Downloading Technology", SCIENCE MOSAIC, February 2005 (2005-02-01), pages 26 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108833552A (en) * 2018-06-22 2018-11-16 邓德雄 P2P content distribution system in promiscuous mode
CN114039971A (en) * 2021-11-11 2022-02-11 北京神舟航天软件技术股份有限公司 Large file concurrent transmission method based on file flow in BS mode
CN114520807A (en) * 2022-02-24 2022-05-20 深圳壹账通智能科技有限公司 File uploading and downloading method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN1925403A (en) 2007-03-07
CN100527672C (en) 2009-08-12

Similar Documents

Publication Publication Date Title
WO2007025474A1 (en) Network communication system and method for downloading the file
US11758013B2 (en) Methods and systems for caching data communications over computer networks
US8090813B2 (en) Methods and apparatus for data transfer
US10491657B2 (en) Network acceleration method, apparatus and device based on router device
Kreitz et al. Spotify--large scale, low latency, P2P music-on-demand streaming
EP2084881B1 (en) System and methods for Peer-to-Peer Media Streaming
US9325786B2 (en) Peer-to-peer interactive media-on-demand
US20080016201A1 (en) Methods and apparatus for transferring data
WO2009115026A1 (en) System, client-side and method for downloading and playing multimedia files
KR102110421B1 (en) System and method for delivering an audio-visual content to a client device
US7764683B2 (en) Reliable multicast operating system (OS) provisioning
WO2013075578A1 (en) System and method for offline download of network resource file
WO2008025294A1 (en) A stream media live system, device and method of peer to peer connection
WO2012000429A1 (en) Method, server and terminal for audio and video on demand
WO2017161757A1 (en) Method and system for distributing streaming media file
Marciniak et al. Small is not always beautiful
US20150058420A1 (en) Method for broadcasting a piece of content in an it network
Bertinat et al. Goalbit: The first free and open source peer-to-peer streaming network
KR101145608B1 (en) Method for preventing of torrent traffic in network
Erman Extending bittorrent for streaming applications
CN104506897B (en) Weighted random data block selection method in P2P live broadcast stream media systems
KR101364927B1 (en) Method for preventing of torrent traffic in network
US20230044756A1 (en) Resource download in peer-to-peer networks
Yang et al. A novel on-demand streaming service based on improved BitTorrent
Pack Automatic Transition to Peer-to-Peer Download

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application
WWE Wipo information: entry into national phase

Ref document number: 750/CHENP/2008

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) OF 150708

122 Ep: pct application non-entry in european phase

Ref document number: 06775543

Country of ref document: EP

Kind code of ref document: A1