WO2018000647A1 - 文件下载方法、装置、终端及服务器 - Google Patents

文件下载方法、装置、终端及服务器 Download PDF

Info

Publication number
WO2018000647A1
WO2018000647A1 PCT/CN2016/101090 CN2016101090W WO2018000647A1 WO 2018000647 A1 WO2018000647 A1 WO 2018000647A1 CN 2016101090 W CN2016101090 W CN 2016101090W WO 2018000647 A1 WO2018000647 A1 WO 2018000647A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
data
terminal
fountain code
packets
Prior art date
Legal status (The legal status 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 status listed.)
Ceased
Application number
PCT/CN2016/101090
Other languages
English (en)
French (fr)
Inventor
陈翔
胡勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Le Holdings Beijing Co Ltd
LeTV Information Technology Beijing Co Ltd
Original Assignee
Le Holdings Beijing Co Ltd
LeTV Information Technology Beijing Co Ltd
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 Le Holdings Beijing Co Ltd, LeTV Information Technology Beijing Co Ltd filed Critical Le Holdings Beijing Co Ltd
Publication of WO2018000647A1 publication Critical patent/WO2018000647A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

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/40Support for services or applications
    • 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

Definitions

  • the present application relates to the field of computer technologies, and in particular, to a file downloading method, apparatus, terminal, and server.
  • P2P peer to peer, peer-to-peer
  • P2SP Peer to Server and Peer
  • the basic transmission mode of P2P or P2SP is to divide the file into blocks first, and then transfer them by block until the file is transmitted.
  • the "S" of P2SP refers to the server. P2SP effectively integrates the original isolated server with its mirrored resources and P2P resources.
  • the inventor finds that when data is transmitted between terminals or between a terminal and a server, if the network environment is bad, the data synchronization transmission may be failed, or repeated retransmission may be required to finally successfully complete the data transmission. . Therefore, in the case of a poor network environment, the reliability of data transmission in a P2P or P2SP network is poor.
  • the embodiment of the present invention provides a file downloading method, device, terminal, and server, which are used to solve the problem of low reliability of data transmission in a poor network environment in the prior art.
  • the embodiment of the present application provides a file downloading method, which is applicable to a terminal, and includes:
  • the data in the local file is encoded to generate the first fountain code data, including:
  • N is an integer greater than zero
  • the N coded packets constitute the first fountain code data
  • the foregoing method further includes:
  • the feedback information is sent by the terminal after receiving a preset number of the encoded packets, and the preset quantity is greater than the K.
  • the foregoing method further includes:
  • the M' is the number of original data packets obtained by grouping data in the process of generating the second fountain code data, and the M' is an integer greater than or equal to 2.
  • the foregoing method further includes:
  • S >S′, where S′ is the number of original data packets obtained by grouping the file data of the file to be downloaded in the process of generating fountain code data of the file data, where S′ is greater than Or an integer equal to 2.
  • the foregoing method further includes:
  • the foregoing method further includes:
  • the file data corresponding to the file identifier to be queried is stored locally, the file data of the file to be queried is encoded to generate corresponding fountain code data;
  • the sending by the terminal requesting to download the data in the terminal list, the first fountain code data, specifically:
  • the first fountain code data is sent to the terminal requesting to download the data in the terminal list by using a user datagram protocol UDP.
  • the embodiment of the present application further provides a file downloading method, which is applicable to a server, and includes:
  • the data in the file is encoded to generate fountain code data, wherein the fountain code
  • the data contains N coded packets, and N is an integer greater than zero;
  • the data in the file is encoded to generate fountain code data, including:
  • K is an integer greater than or equal to 2
  • N is an integer greater than zero
  • the foregoing method further includes:
  • the feedback information is sent by the terminal after receiving a preset number of the encoded packets, and the preset quantity is greater than the K.
  • the foregoing method further includes:
  • the query request is sent to other terminals in the network, where the query request carries The file identifier of the document;
  • the K is the number of original data packets obtained by grouping data in the process of generating the fountain code data, and the K is an integer greater than or equal to 2.
  • the sending, by the terminal, the N coded packets specifically:
  • the N coded packets are sent to the terminal using a User Datagram Protocol (UDP).
  • UDP User Datagram Protocol
  • the application also provides a file downloading device, which is applicable to a terminal, and includes:
  • An obtaining module configured to obtain a terminal list for downloading the same file
  • An encoding module configured to encode data stored in the local file to generate a first Fountain code data, wherein the first fountain code data includes N coded packets, and N is an integer greater than zero;
  • a sending module configured to send the N coded packets to a terminal in the terminal list that requests to download the data.
  • the encoding module includes:
  • a grouping unit configured to group data stored in the local file to obtain K original data packets
  • a coding unit configured to perform fountain code encoding on the K original data packets to generate N coded packets
  • K is an integer greater than or equal to 2
  • N is an integer greater than zero
  • the file downloading device mentioned above further includes:
  • the sending module is further configured to stop sending the N coded packets to the terminal after receiving the feedback information sent by the terminal;
  • the feedback information is sent by the terminal after receiving a preset number of the encoded packets, and the preset quantity is greater than the K.
  • the file downloading device mentioned above further includes:
  • a first receiving module configured to receive second fountain code data sent by the terminal
  • a first decoding module configured to decode data corresponding to the second fountain code data based on the received M coded packets included in the second fountain code data
  • the M' is the number of original data packets obtained by grouping data in the process of generating the second fountain code data, and the M' is an integer greater than or equal to 2.
  • the file downloading device mentioned above further includes:
  • the sending module is further configured to: when the data sent by the terminal in the terminal list is not received, send a download request to the server, where the download request carries a file identifier to be downloaded;
  • a second receiving module configured to receive the fountain code data of the file data corresponding to the file identifier to be downloaded sent by the server
  • a second decoding module configured to decode the file data of the file to be downloaded based on the S coded packets included in the fountain code data of the received file data
  • S >S′, where S′ is the number of original data packets obtained by grouping the file data of the file to be downloaded in the process of generating fountain code data of the file data, where S′ is greater than Or an integer equal to 2.
  • the second receiving module is further configured to receive scheduling information sent by the server, and send the file to the terminal specified by the scheduling information according to the scheduling information.
  • Fountain code data for data is further configured to receive scheduling information sent by the server, and send the file to the terminal specified by the scheduling information according to the scheduling information.
  • the file downloading device mentioned above further includes:
  • a third receiving module configured to receive a query request sent by the server, where the query request carries a file identifier to be queried;
  • the encoding module is further configured to: when the file data corresponding to the file identifier to be queried is locally stored, encode the file data of the file to be queried to generate corresponding fountain code data;
  • the sending module is further configured to send, to the server end, the fountain code data corresponding to the file to be queried.
  • the sending module is specifically configured to send, by using a user datagram protocol UDP, the first fountain code data to a terminal requesting to download the data in the terminal list.
  • the embodiment of the present application further provides a file downloading apparatus, which is applicable to a server, and includes:
  • a receiving module configured to receive a download request sent by the terminal, where the download request carries an identifier of the file
  • An encoding module configured to: when a terminal that stores a file corresponding to the file identifier does not exist in the network, and locally store the file corresponding to the file identifier, encode data in the file to generate fountain code data, where
  • the fountain code data includes N coded packets, and N is an integer greater than zero;
  • a sending module configured to send the N coded packets to the terminal.
  • the encoding module includes:
  • a grouping unit configured to group data in the file to obtain K original data packets
  • a coding unit configured to perform fountain code encoding on the K original data packets to generate N coded packets
  • K is an integer greater than or equal to 2
  • N is an integer greater than zero
  • the sending module is further configured to: after receiving the feedback information sent by the terminal, stop sending the N encoded packets to the terminal;
  • the feedback information is sent by the terminal after receiving a preset number of the encoded packets, and the preset quantity is greater than the K.
  • the file downloading device mentioned above further includes:
  • the sending module is further configured to send a query request to another terminal in the network when the terminal that stores the file corresponding to the file identifier does not exist in the network, and the file corresponding to the file identifier is not stored locally, where
  • the query request carries a file identifier of the file
  • the receiving module is further configured to: when the terminal that stores the file exists in the network, receive the fountain code data sent by the terminal;
  • a decoding module configured to decode data of the file based on the received L coded packets included in the fountain code data
  • the K is the number of original data packets obtained by grouping data in the process of generating the fountain code data, and the K is an integer greater than or equal to 2.
  • the sending module is specifically configured to send the N encoded packets to the terminal by using a User Datagram Protocol (UDP).
  • UDP User Datagram Protocol
  • the embodiment of the present application further provides a file downloading system, which is characterized in that it comprises a file downloading device suitable for a terminal and a file downloading device suitable for the server side;
  • the file downloading device suitable for the terminal is used for:
  • the file downloading device suitable for the server side is used for:
  • the data in the file is encoded to generate fountain code data, wherein the fountain code
  • the data contains N coded packets, and N is an integer greater than zero;
  • An embodiment of the present application provides a file download terminal, including at least one processor, and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor, The instructions are set as a file downloading method for performing the above-described one of the applications of the present application.
  • the embodiment of the present application further provides a non-transitory computer storage medium storing computer executable instructions for executing the file downloading method applicable to the terminal according to any of the above applications of the present application.
  • the embodiment of the present application provides a computer program product, comprising: a computer readable storage medium and computer program instructions embedded therein, when the program instructions are executed by a computer, causing the computer to execute the application Any of the above applies to the file downloading method of the terminal.
  • An embodiment of the present application provides a server, including at least one processor, and a memory communicatively coupled to the at least one processor, wherein the memory stores instructions executable by the at least one processor, The instructions are set to execute a file downloading method applicable to the server side of any of the above applications of the present application.
  • the embodiment of the present application further provides a non-transitory computer storage medium, which stores computer executable instructions, and the computer executable instructions are used to execute the file downloading method applicable to the server side according to any of the above applications.
  • the embodiment of the present application provides a computer program product, comprising: a computer readable storage medium and computer program instructions embedded therein, when the program instructions are executed by a computer, causing the computer to execute the application Any of the above applies to the server-side file download method.
  • the file downloading method, device, terminal and server provided by the embodiment of the present application encode the block data of the target file to be transmitted into the fountain code data, and continuously send the terminal to the terminal requesting the download based on the characteristics of the fountain code data. Until the receiving terminal sends the feedback information to stop, even if the network environment is poor, the partial coded packet is lost. Because the fountain code is continuously sent by the source, the receiving terminal can continue to receive and can receive the preset number of codes. The packet decodes the corresponding block data.
  • the technical solution provided by the embodiment of the present application improves the reliability of data transmission; in addition, since the receiving terminal only sends feedback information after receiving a preset number of coded packets, compared with In the prior art, as long as one transmission failure occurs, a retransmission request is fed back.
  • the embodiment of the present application reduces the transmission of feedback information in the channel by using the fountain code, which helps to improve the channel capacity and makes the network more robust.
  • FIG. 1 is a schematic structural diagram of an optional P2SP network according to an embodiment of the present disclosure
  • FIG. 2 is a schematic flowchart of a file downloading method according to Embodiment 1 of the present application;
  • FIG. 3 is a schematic flowchart of a file downloading method according to Embodiment 2 of the present application.
  • FIG. 4 is a schematic flowchart of a file downloading method according to Embodiment 3 of the present application.
  • FIG. 5 is a schematic flowchart of a file downloading method according to Embodiment 4 of the present application.
  • FIG. 6 is a schematic structural diagram of a file downloading apparatus according to Embodiment 6 of the present application.
  • FIG. 7 is a schematic structural diagram of a file downloading apparatus according to Embodiment 7 of the present application.
  • FIG. 8 is a schematic structural diagram of a file download terminal according to Embodiment 10 of the present application.
  • FIG. 9 is a schematic structural diagram of a file download server according to Embodiment 12 of the present application.
  • FIG. 1 An application scenario in which the file downloading method provided by the embodiment of the present application can be applied is first introduced in conjunction with FIG. 1 .
  • the file downloading method provided by the embodiment of the present application is applicable to P2P and P2SP networks.
  • P2SP adds a data source provider S (Server) based on the P2P architecture.
  • S data source provider
  • This data source distributes multimedia data to certain nodes in the network.
  • Other nodes can peer to peer network from other ways.
  • the node that has the data gets the multimedia data.
  • FIG. 1 is a schematic structural diagram of an optional P2SP network according to an embodiment of the present application.
  • the network architecture includes a server device 602 and a plurality of terminal devices 601. It is assumed that the network architecture includes three terminal devices A, B, and C, and the three terminal devices need to download the same file.
  • the server device stores a list of terminals that download the same file, and the list includes identifiers of the terminal device A, the terminal device B, and the terminal device C.
  • the server device After receiving the download request sent by the terminal device, the server device adds the identifier of the terminal device that sends the download request to the terminal list with the identifier of the file as the key key; or the server device
  • the identifier of the file carried in the download request the attribute of the file is obtained, the file fingerprint of the file is calculated, and the identifier of the terminal device that sends the download request is added to the terminal list with the fingerprint of the file as the keyword key.
  • the attributes of the file include but are not limited to: URL (Uniform Resource Locator, Uniform Resource Locator, BT (BitTorrent, BitTorrent) seed file, ed2k (eDonkey2000network, eDonkey 2000 network) link, etc.
  • the terminal device A stores the block data 1 of the target file
  • the terminal device B stores the block data 2 of the target file
  • the terminal device C stores the block data 3 of the target file.
  • the terminal device A can encode the block data 1 to generate the fountain code data; and then continuously distribute the plurality of codes in the fountain code data of the block data 1 to the terminal device B and the terminal device C requesting to download the target file in the terminal list. Grouping.
  • the terminal device B may perform the fountain code encoding of the local block data 2 and then distribute it to the terminal device A and the terminal device C; the terminal device C may encode the local block data 3 into the fountain code and then to the terminal device A and the terminal. Device B is distributed.
  • the terminal device may send a download request to the server device, and the server device at this time Equivalent to a terminal device in the network distributing the chunked data to the terminal device requesting to download the target file.
  • the server device may also send a query request to other terminal devices in the network. If the terminal device has this file in the network, then at this time, the server device acquires the file segmentation information and the block data from the terminal device storing the target file, and obtains the file segmentation information, like the normal terminal device.
  • the server device If the server device does not query the target file in the full P2SP network, the server device will obtain resources according to the information submitted by the terminal device submitting the request to other networks, such as BT, ed2k, and the like. If the server device still does not query the result in other networks, it will not be able to obtain the resource to the requesting terminal device, and the terminal device downloads the file according to the attribute of the target file.
  • networks such as BT, ed2k, and the like.
  • FIG. 2 is a schematic flowchart diagram of a file downloading method provided in Embodiment 1 of the present application.
  • the method provided by this embodiment is applicable to a terminal.
  • the execution body of the method provided in this embodiment may be a file downloading device, and the file downloading device may be a hardware entity or an application installed on the terminal device.
  • the method provided in the first embodiment includes:
  • Step 101 Obtain a terminal list for downloading the same file.
  • this step can be implemented by the following methods:
  • Step S11 Send a download request for downloading the file to the server.
  • Step S12 Receive a terminal list that is fed back by the server and uses the identifier of the file as a key.
  • the server-side device if the server-side device locally stores the file corresponding to the file identifier, the server-side device first obtains the attribute of the file according to the identifier of the file after receiving the download request. And calculating a fingerprint of the first object file according to the attribute.
  • the manner of generating a fingerprint can be implemented by referring to the existing manner, and is not described in this embodiment.
  • the attributes of the file include but are not limited to: URL, BT seed file, ed2k link, etc.
  • the server device queries that the terminal list with the fingerprint as the key is created locally, the identifier of the terminal is added to the terminal list; if the server device queries the local fingerprint, the fingerprint is For the terminal list of the key, a terminal list with the fingerprint as a key is created, and the identifier of the terminal is added to the terminal list. Finally, the terminal is fed back to the terminal with a list of terminals whose fingerprint is a key.
  • Step 102 Encode data stored in the local file to generate first fountain code data, where the first fountain code data includes N coded packets, and N is an integer greater than zero.
  • this step can be implemented as follows:
  • the data stored in the local file is grouped to obtain K original data packets.
  • the K original data packets are coded by fountain code to generate N coded packets.
  • K is an integer greater than or equal to 2
  • N is an integer greater than zero
  • the fountain code can be an LT code or a Raptor code.
  • the so-called fountain code means that any number of coded packets can be generated from k original data packets by using the code, and as long as any n (n ⁇ k) coded packets are known, all the originals can be successfully recovered by decoding. Data grouping.
  • the length of each input original data packet is L bits and the data unit of length L bits is divided into input original data packets.
  • Degree d indicates the number of original data packets selected each time in the fountain code encoding process.
  • Step 103 Send, by the terminal requesting to download the data in the terminal list, the N coded packets.
  • a UDP User Datagram Protocol
  • a UDP protocol may be used to send the N coded packets to a terminal requesting to download the data in the terminal list.
  • the UDP protocol can reduce the transmission amount of protocol data in the transmission process, and the data can be successfully and safely restored even if the data packet loss is encoded under the fountain code.
  • the transmitting end of the fountain code is randomly coded, and any number of encoded packets are generated by k original packets, and the transmitting end continuously transmits data without knowing whether the data packets are successfully received. package.
  • the receiving end receives any subset of k(1+ ⁇ ) coded packets, that is, it receives a slightly larger than the original k-worth N, it can be decoded with high probability (and ⁇ ). Related) Successfully restore all original groupings.
  • a single source node S such as a homologous source, continuously generates a fountain of water droplets (encoding packets), and continuously sends "water droplets" (representing data packets) to a plurality of buckets K (representing multiple receiving buffers), when water in a bucket When it is full (cache full), it sends a feedback to the source node.
  • Each time a water droplet is sent is a combination of some randomly selected packets in a frame. This combination can be linear or non-linear. Random selection ensures that the information sent each time is useful to the receiving node.
  • the bucket After filling the bucket (receiving a sufficient amount of water droplets), the bucket can be used for drinking (successful decoding) without having to care which drop of water (coded packet) flows into the bucket.
  • the source node After the source node receives the ACK of all the buckets, it sends a new frame, otherwise it continues to send the combined packet.
  • the technical solution provided by the embodiment of the present application encodes the block data of the target file to be transmitted into the fountain code data, and continuously sends the data to the terminal requesting the download based on the characteristics of the fountain code data until the terminal receives the feedback information. After stopping, even if the network packet environment is poor, part of the encoded packet is lost. Because the fountain code is continuously transmitted, the receiving terminal can continue to receive and can decode the corresponding block based on receiving the preset number of encoded packets. Data, it is obvious that the technical solution provided by the embodiment of the present application improves the reliability of data transmission; in addition, since the receiving terminal sends feedback information only after receiving a preset number of encoded packets, it is only once in the prior art. The transmission fails to feed back a retransmission request. The embodiment of the present application reduces the transmission of feedback information in the channel by using the fountain code, which helps to improve the channel capacity and make the network more robust.
  • FIG. 3 is a schematic flowchart diagram of a file downloading method provided in Embodiment 1 of the present application.
  • the method provided by this embodiment is applicable to a terminal.
  • the execution body of the method provided by this embodiment may be a file downloading device, and the file downloading device may be a hardware entity or an application program installed on the terminal terminal device.
  • the method provided in the second embodiment includes:
  • Step 201 Obtain a terminal list for downloading the same file.
  • Step 202 Encode data stored in the local file to generate a first fountain Code data, wherein the first fountain code data includes N coded packets, and N is an integer greater than zero.
  • Step 203 Send, by the terminal requesting to download the data in the terminal list, the N coded packets.
  • Step 204 After receiving the feedback information sent by the terminal, stop sending the N coded packets to the terminal.
  • the feedback information is sent by the terminal after receiving a preset number of the encoded packets, and the preset quantity is greater than the K.
  • the preset number may be equal to K(1+ ⁇ ), and ⁇ is a preset decoding overhead.
  • the decoding overhead can be artificially set. Of course, the larger the decoding overhead, the greater the probability of recovering all the original packets based on the received encoded packets. In the specific implementation, the technician can find a suitable decoding cost value according to multiple experiments.
  • Step 205 Receive second fountain code data sent by the terminal.
  • Step 206 Decode data corresponding to the second fountain code data based on the received M coded packets included in the second fountain code data.
  • M is the number of original data packets obtained by grouping data in the process of generating the second fountain code data
  • M' is an integer greater than or equal to 2.
  • M may be equal to M'(1+ ⁇ )
  • is a preset decoding overhead.
  • the decoding overhead can be artificially set. Of course, the larger the decoding overhead, the greater the probability of recovering all the original packets based on the received encoded packets.
  • the technician can find a suitable decoding cost value according to multiple experiments.
  • Step 207 If the data sent by the terminal in the terminal list cannot be received, send a download request to the server, where the download request carries the file identifier to be downloaded.
  • the terminal may not receive the data sent by the terminal in the terminal list, and the following may be the case:
  • the terminal successfully establishes a connection with at least one of all the terminals in the terminal list, but cannot receive the data sent by the terminal that successfully establishes the connection.
  • Step 208 Receive fountain code data of the file data corresponding to the file identifier to be downloaded sent by the server.
  • Step 209 Decode the file data of the file to be downloaded based on the S coded packets included in the fountain code data of the received file data.
  • S >S′, where S′ is the number of original data packets obtained by grouping the file data of the file to be downloaded in the process of generating fountain code data of the file data, where S′ is greater than Or an integer equal to 2.
  • S may be equal to S'(1+ ⁇ ), and ⁇ is a preset decoding overhead.
  • the decoding overhead can be artificially set. Of course, the larger the decoding overhead, the greater the probability of recovering all the original packets based on the received encoded packets. In the specific implementation, the technician can find a suitable decoding cost value according to multiple experiments.
  • Step 210 Receive scheduling information sent by the server, and send the fountain code data of the file data to the terminal specified by the scheduling information according to the scheduling information.
  • Step 211 Receive a query request sent by the server, where the query request carries a file identifier to be queried.
  • Step 212 If the file data corresponding to the file identifier to be queried is stored locally, the file data of the file to be queried is encoded to generate corresponding fountain code data.
  • Step 213 Send the fountain code data corresponding to the file to be queried to the server.
  • the technical solution provided by the embodiment of the present application encodes the block data of the target file to be transmitted into the fountain code data, and continuously sends the data to the terminal requesting the download based on the characteristics of the fountain code data until the terminal receives the feedback information. After stopping, even if the network packet environment is poor, part of the encoded packet is lost. Because the fountain code is continuously transmitted, the receiving terminal can continue to receive and can decode the corresponding block based on receiving the preset number of encoded packets. Data, it is obvious that the technical solution provided by the embodiment of the present application improves the reliability of data transmission; in addition, since the receiving terminal sends feedback information only after receiving a preset number of encoded packets, it is only once in the prior art. If the transmission fails, a retransmission request is fed back. The embodiment of the present application is reduced by the use of the fountain code. The transmission of feedback information in the channel helps to increase the channel capacity and make the network more robust.
  • FIG. 4 is a schematic flowchart diagram of a file downloading method provided in Embodiment 3 of the present application.
  • the method provided in this embodiment is applicable to a server.
  • the execution body of the method provided in this embodiment may be a file downloading device, and the file downloading device may be a hardware entity or an application installed on a server device.
  • the method provided in the third embodiment includes:
  • Step 301 Receive a download request sent by the terminal, where the download request carries an identifier of the file.
  • the download request may be sent by the terminal when it is unable to download the file corresponding to the identifier from another terminal in the network, such as a terminal in the terminal list that downloads the file, and of course It can be sent directly by the terminal.
  • the terminal may not receive the data sent by the terminal in the terminal list, and the following may be the case:
  • the terminal successfully establishes a connection with at least one of all the terminals in the terminal list, but cannot receive the data sent by the terminal that successfully establishes the connection.
  • Step 302 If there is no terminal in the network that stores the file corresponding to the file identifier, and locally stores the file corresponding to the file identifier, the data in the file is encoded to generate fountain code data, where The fountain code data includes N coded packets, and N is an integer greater than zero.
  • this step can be implemented by the following methods:
  • the data in the file is grouped to obtain K original data packets.
  • the K original data packets are coded by fountain code to generate N coded packets.
  • K is an integer greater than or equal to 2
  • N is an integer greater than zero
  • Step 303 Send the N coded packets to the terminal.
  • the technical solution provided by the embodiment of the present application encodes the block data of the target file to be transmitted into the fountain code data, and continuously sends the data to the terminal requesting the download based on the characteristics of the fountain code data until the terminal receives the feedback information. After stopping, even if the network packet environment is poor, part of the encoded packet is lost. Because the fountain code is continuously transmitted, the receiving terminal can continue to receive and can decode the corresponding block based on receiving the preset number of encoded packets. Data, it is obvious that the technical solution provided by the embodiment of the present application improves the reliability of data transmission; in addition, since the receiving terminal sends feedback information only after receiving a preset number of encoded packets, it is only once in the prior art. The transmission fails to feed back a retransmission request. The embodiment of the present application reduces the transmission of feedback information in the channel by using the fountain code, which helps to improve the channel capacity and make the network more robust.
  • FIG. 5 is a schematic flowchart diagram of a file downloading method provided in Embodiment 4 of the present application.
  • the method provided in this embodiment is applicable to a server.
  • the execution body of the method provided in this embodiment may be a file downloading device, and the file downloading device may be a hardware entity or an application installed on a server device.
  • the method provided in the fourth embodiment includes:
  • Step 401 Receive a download request sent by the terminal, where the download request carries an identifier of the file.
  • Step 402 If the terminal that stores the file corresponding to the file identifier does not exist in the network, and locally stores the file corresponding to the file identifier, the data in the file is encoded to generate fountain code data, where The fountain code data includes N coded packets, and N is an integer greater than zero.
  • Step 403 Send the N coded packets to the terminal.
  • the UDP protocol can be used to send the N coded packets to the terminal, and the UDP protocol can reduce the transmission amount of protocol data during the transmission process, even if there is data loss in the code guarantee of the fountain code. Can restore data smoothly and safely.
  • Step 404 After receiving the feedback information sent by the terminal, stop sending the N coded packets to the terminal.
  • the feedback information is sent by the terminal after receiving a preset number of the encoded packets, and the preset quantity is greater than the K.
  • the preset number may be equal to K(1+ ⁇ ), and ⁇ is a preset decoding overhead.
  • the decoding overhead can be artificially set. Of course, the larger the decoding overhead, the greater the probability of recovering all the original packets based on the received encoded packets. In the specific implementation, the technician can find a suitable decoding cost value according to multiple experiments.
  • Step 405 If the terminal that stores the file corresponding to the file identifier does not exist in the network, and the file corresponding to the file identifier is not stored locally, send a query request to other terminals in the network, where the query request is The file identifier carrying the file.
  • Step 406 If there is a terminal that stores the file in the network, receive the fountain code data sent by the terminal.
  • the network may include one of a P2SP network, a BT network, an ed2k network, or any other network.
  • Step 407 Decode data of the file based on the received L coded packets included in the fountain code data.
  • the K is the number of original data packets obtained by grouping data in the process of generating the fountain code data, and the K is an integer greater than or equal to 2.
  • the L may be equal to K(1+ ⁇ ), and ⁇ is a preset decoding overhead.
  • the decoding overhead can be artificially set. Of course, the larger the decoding overhead, the greater the probability of recovering all the original packets based on the received encoded packets. In the specific implementation, the technician can find a suitable decoding cost value according to multiple experiments.
  • Step 408 If there is no terminal that stores the file in the network, send a prompt message to the terminal that the file cannot be obtained.
  • the technical solution provided by the embodiment of the present application encodes the block data of the target file to be transmitted into the fountain code data, and continuously sends the data to the terminal requesting the download based on the characteristics of the fountain code data until the terminal receives the feedback information. After stopping, even if the network packet environment is poor, part of the encoded packet is lost. Because the fountain code is continuously transmitted, the receiving terminal can continue to receive and can decode the corresponding block based on receiving the preset number of encoded packets.
  • the technical solution provided by the embodiment of the present application improves the reliability of data transmission; in addition, since the receiving terminal only sends feedback information after receiving a preset number of encoded packets, as long as there is only one in the prior art In the case of a transmission failure, a retransmission request is fed back.
  • the embodiment of the present application reduces the transmission of feedback information in the channel by using the fountain code, which helps to improve the channel capacity and makes the network more robust.
  • FIG. 6 is a schematic structural diagram of a file downloading apparatus provided in Embodiment 5 of the present application.
  • the file downloading device may be a hardware entity or an application installed on the terminal device.
  • the terminal device may be any computer device, a notebook computer, a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), an in-vehicle computer, or the like.
  • the file downloading apparatus provided in the fifth embodiment includes: an obtaining module 501, an encoding module 502, and a sending module 503. among them,
  • the obtaining module 501 is configured to obtain a terminal list for downloading the same file.
  • the encoding module 502 is configured to encode the data stored in the local file to generate the first fountain code data, where the first fountain code data includes N coded packets, where N is an integer greater than zero;
  • the sending module 503 is configured to send, by the terminal requesting to download the data in the terminal list, the N coded packets.
  • the technical solution provided by the embodiment of the present application encodes the block data of the target file to be transmitted into the fountain code data, and continuously sends the data to the terminal requesting the download based on the characteristics of the fountain code data until the terminal receives the feedback information. After stopping, even if the network environment is poor, part of the encoded packet is lost. Because the fountain code is continuously sent, the receiving terminal can continue to connect. The receiving and decoding can decode the corresponding blocked data based on the received preset number of encoded packets. It is obvious that the technical solution provided by the embodiment of the present application improves the reliability of the data transmission; in addition, since the receiving terminal only receives the preset number of The feedback information is sent after the coding group is sent. Compared with the prior art, only one transmission failure is required to feed back a retransmission request. The embodiment of the present application reduces the transmission of feedback information in the channel by using the fountain code, which helps to improve. Channel capacity makes the network more robust.
  • file downloading device may implement the file downloading method provided in the first embodiment or the second embodiment.
  • file downloading method provided in the first embodiment or the second embodiment.
  • the sixth embodiment of the present application further describes the technical solution provided by the present application based on the file downloading apparatus provided in the foregoing fifth embodiment.
  • the file downloading device may be a hardware entity or an application installed on the terminal device.
  • the terminal device may be any computer device, a notebook computer, a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), an on-board computer, or the like.
  • the encoding module may be implemented by the following method.
  • the encoding module includes: a grouping unit and an encoding unit.
  • the grouping unit is configured to group the data stored in the local file to obtain K original data packets.
  • the coding unit is configured to perform fountain code encoding on the K original data packets to generate N coded packets. Where K is an integer greater than or equal to 2, and N is an integer greater than zero.
  • the sending module is further configured to stop sending the N encoded packets to the terminal after receiving the feedback information sent by the terminal, where the feedback information is that the terminal receives the pre- After the number of the encoded packets is set, the preset number is greater than the K.
  • the file downloading apparatus may further include: a first receiving module and a first decoding module.
  • the first receiving module is configured to receive the second fountain code data sent by the terminal, and the first decoding module is configured to decode the M encoded packets included in the received second fountain code data, and decode the Data corresponding to the second fountain code data; wherein M>M′, the M′ is the number of original data packets obtained by grouping the data in the process of generating the second fountain code data, wherein the M′ is An integer greater than or equal to 2.
  • file downloading device may further include:
  • the sending module is further configured to: when the data sent by the terminal in the terminal list is not received, send a download request to the server, where the download request carries a file identifier to be downloaded;
  • a second receiving module configured to receive the fountain code data of the file data corresponding to the file identifier to be downloaded sent by the server
  • a second decoding module configured to decode the file data of the file to be downloaded based on the S coded packets included in the fountain code data of the received file data
  • S >S′, where S′ is the number of original data packets obtained by grouping the file data of the file to be downloaded in the process of generating fountain code data of the file data, where S′ is greater than Or an integer equal to 2.
  • the second receiving module is further configured to receive scheduling information sent by the server, and send the fountain code data of the file data to the terminal specified by the scheduling information according to the scheduling information.
  • the file downloading apparatus may further include: a third receiving module, configured to receive a query request sent by the server, where the query request carries a file identifier to be queried;
  • the encoding module is further configured to: when the file data corresponding to the file identifier to be queried is locally stored, encode the file data of the file to be queried to generate corresponding fountain code data;
  • the sending module is further configured to send, to the server end, the fountain code data corresponding to the file to be queried.
  • a sending module configured to send, by using a user datagram protocol UDP, the first fountain code data to a terminal requesting to download the data in the terminal list.
  • the technical solution provided by the embodiment of the present application encodes the block data of the target file to be transmitted into the fountain code data, and continuously sends the data to the terminal requesting the download based on the characteristics of the fountain code data until the terminal receives the feedback information. Stop after, even in the case of poor network environment The part of the coded packet is lost, because the fountain code is continuously transmitted, the receiving terminal can continue to receive and can decode the corresponding block data based on the received preset number of encoded packets, and the technical solution provided by the embodiment of the present application is improved.
  • the reliability of the data transmission in addition, since the receiving terminal sends the feedback information only after receiving the preset number of encoded packets, the retransmission request is fed back as long as there is one transmission failure in the prior art.
  • the use of the fountain code reduces the transmission of feedback information in the channel, which helps to increase the channel capacity and make the network more robust.
  • file downloading device may implement the file downloading method provided in the first embodiment or the second embodiment.
  • file downloading method provided in the first embodiment or the second embodiment.
  • FIG. 7 is a schematic structural diagram of a file downloading apparatus provided in Embodiment 7 of the present application.
  • the file downloading apparatus provided in the seventh embodiment includes: a receiving module 701, an encoding module 702, and a sending module 703. among them,
  • the receiving module 701 is configured to receive a download request sent by the terminal, where the download request carries an identifier of the file;
  • the encoding module 702 is configured to: when the terminal that stores the file corresponding to the file identifier does not exist in the network, and locally store the file corresponding to the file identifier, encode the data in the file to generate the fountain code data, where
  • the fountain code data includes N coded packets, and N is an integer greater than zero;
  • the sending module 703 is configured to send the N coded packets to the terminal.
  • the technical solution provided by the embodiment of the present application encodes the block data of the target file to be transmitted into the fountain code data, and continuously sends the data to the terminal requesting the download based on the characteristics of the fountain code data until the terminal receives the feedback information. After stopping, even if the network packet environment is poor, part of the encoded packet is lost. Because the fountain code is continuously transmitted, the receiving terminal can continue to receive and can decode the corresponding block based on receiving the preset number of encoded packets. Data, it is obvious that the technical solution provided by the embodiment of the present application improves the reliability of data transmission; The feedback information is sent after receiving the preset number of coded packets, and the retransmission request is fed back as long as there is one transmission failure in the prior art. The embodiment of the present application reduces the feedback information in the channel by using the fountain code. The transmission helps to increase the channel capacity and make the network more robust.
  • file downloading device provided in this embodiment can implement the file downloading method provided in the third embodiment or the fourth embodiment.
  • file downloading method provided in the third embodiment or the fourth embodiment.
  • the eighth embodiment of the present application further describes the technical solution provided by the present application based on the file downloading apparatus provided in the foregoing seventh embodiment.
  • the eighth embodiment is based on the seventh embodiment of the present invention.
  • the encoding module may be implemented by the following method. Specifically, the encoding module includes: a grouping unit and an encoding unit.
  • the grouping unit is configured to group the data in the file to obtain K original data packets; the encoding unit is configured to perform the fountain code encoding on the K original data packets to generate N coded packets; wherein An integer greater than or equal to 2, N being an integer greater than zero.
  • the sending module is further configured to: after receiving the feedback information sent by the terminal, stop sending the N coded packets to the terminal; where the feedback information is that the terminal receives the preset The number of the encoded packets is sent, and the preset number is greater than the K.
  • the embodiment provides the file downloading apparatus, and further includes:
  • the sending module is further configured to send a query request to another terminal in the network when the terminal that stores the file corresponding to the file identifier does not exist in the network, and the file corresponding to the file identifier is not stored locally, where
  • the query request carries a file identifier of the file
  • the receiving module is further configured to: when the terminal that stores the file exists in the network, receive the fountain code data sent by the terminal;
  • a decoding module configured to decode data of the file based on the received L coded packets included in the fountain code data
  • the K is the data grouped in the process of generating the fountain code data The number of original data packets obtained, the K being an integer greater than or equal to two.
  • the sending module is specifically configured to send the N encoded packets to the terminal by using a user datagram protocol UDP.
  • the technical solution provided by the embodiment of the present application encodes the block data of the target file to be transmitted into the fountain code data, and continuously sends the data to the terminal requesting the download based on the characteristics of the fountain code data until the terminal receives the feedback information. After stopping, even if the network packet environment is poor, part of the encoded packet is lost. Because the fountain code is continuously transmitted, the receiving terminal can continue to receive and can decode the corresponding block based on receiving the preset number of encoded packets. Data, it is obvious that the technical solution provided by the embodiment of the present application improves the reliability of data transmission; in addition, since the receiving terminal sends feedback information only after receiving a preset number of encoded packets, it is only once in the prior art. The transmission fails to feed back a retransmission request. The embodiment of the present application reduces the transmission of feedback information in the channel by using the fountain code, which helps to improve the channel capacity and make the network more robust.
  • file downloading device provided in this embodiment can implement the file downloading method provided in the third embodiment or the fourth embodiment.
  • file downloading method provided in the third embodiment or the fourth embodiment.
  • a network system provided in Embodiment 9 of the present application includes a file downloading apparatus applicable to a terminal and a file downloading apparatus applicable to a server;
  • the file downloading device suitable for the terminal is used for:
  • the file downloading device suitable for the server side is used for:
  • the data in the file is encoded to generate fountain code data, wherein the fountain code data includes N coded packets, where N is an integer greater than zero;
  • the file downloading device applicable to the terminal may be a hardware entity or an application installed on the terminal device, and the file downloading device applicable to the server may be a hardware entity or an application installed on the server device.
  • the technical solution provided by the embodiment of the present application encodes the block data of the target file to be transmitted into the fountain code data, and continuously sends the data to the terminal requesting the download based on the characteristics of the fountain code data until the terminal receives the feedback information. After stopping, even if the network packet environment is poor, part of the encoded packet is lost. Because the fountain code is continuously transmitted, the receiving terminal can continue to receive and can decode the corresponding block based on receiving the preset number of encoded packets. Data, it is obvious that the technical solution provided by the embodiment of the present application improves the reliability of data transmission; in addition, since the receiving terminal sends feedback information only after receiving a preset number of encoded packets, it is only once in the prior art. The transmission fails to feed back a retransmission request. The embodiment of the present application reduces the transmission of feedback information in the channel by using the fountain code, which helps to improve the channel capacity and make the network more robust.
  • the file downloading device for the terminal included in the network system provided in this embodiment may implement the method provided in the foregoing Embodiment 1 or Embodiment 2.
  • the file downloading device for the server is included in the network system provided in this embodiment, and the method provided in the third embodiment or the fourth embodiment is implemented.
  • the specific process refer to the corresponding content in the foregoing embodiment. No longer.
  • FIG. 8 is a schematic structural diagram of a file download terminal according to Embodiment 10 of the present application, where the terminal may include:
  • One or more processors 801 and memory 802, one processor 801 is taken as an example in FIG.
  • the file downloading electronic device may further include: an input device 803 and an output device 804.
  • the processor 801, the memory 802, the input device 803, and the output device 804 can be connected by a bus or other means.
  • the memory 802 is used as a non-transitory computer readable storage medium for storing non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the file downloading method in the embodiment of the present application.
  • the processor 801 executes various functional applications and data processing of the server by running non-transitory software programs, instructions, and modules stored in the memory 802, that is, the method downloading method of the above method embodiment is implemented.
  • the memory 802 may include a storage program area and an storage data area, wherein the storage program area may store an operating system, an application required for at least one function; the storage data area may store data created according to usage of the file downloading device, and the like.
  • memory 802 can include high speed random access memory, and can also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device.
  • the memory 802 can optionally include memory remotely located relative to the processor 801 that can be connected to the processing device of the list item operation over a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • the input device 803 can receive the input numeric or character information and generate a key signal input related to user settings and function control of the file download device.
  • Output device 804 can include a display device such as a display screen.
  • the one or more modules are stored in the memory 802, and when executed by the one or more processors 801, perform a file download method in any of the above method embodiments.
  • the embodiment of the present application provides a non-volatile computer storage medium, where the computer storage medium stores computer-executable instructions, which can execute a file downloading method applicable to a terminal in any of the foregoing method embodiments.
  • FIG. 9 is a schematic structural diagram of a file download server according to Embodiment 12 of the present application, where the server may include:
  • One or more processors 901 and memory 902, one processor 901 is taken as an example in FIG.
  • the file downloading electronic device may further include: an input device 903 and an output device 904.
  • the processor 901, the memory 902, the input device 903, and the output device 904 can be connected by a bus or other means.
  • the memory 902 is used as a non-transitory computer readable storage medium for storing non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the file downloading method in the embodiment of the present application.
  • the processor 901 executes various functional applications and data processing of the server by running non-transitory software programs, instructions, and modules stored in the memory 902, that is, implementing the above-described method embodiment file downloading method.
  • the memory 902 may include a storage program area and an storage data area, wherein the storage program area may store an operating system, an application required for at least one function; the storage data area may store data created according to usage of the file downloading device, and the like.
  • memory 902 can include high speed random access memory, and can also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device.
  • the memory 902 can optionally include memory remotely located relative to the processor 901 that can be connected to the processing device of the list item operation over a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • the input device 903 can receive the input digital or character information and generate a key signal input related to user settings and function control of the file download device.
  • Output device 604 can include a display device such as a display screen.
  • the one or more modules are stored in the memory 902, and when executed by the one or more processors 901, execute the file download method in any of the above method embodiments.
  • the application embodiment provides a non-volatile computer storage medium storing computer-executable instructions that can execute a file downloading method applicable to a server side in any of the above-described embodiments of the method.
  • the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, ie may be located A place, or it can be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment. Those of ordinary skill in the art can understand and implement without deliberate labor.

Landscapes

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

Abstract

本申请实施例提供一种文件下载方法、装置及系统,涉及计算机技术领域。其中,所述方法适用于终端,其包括:获取下载同一文件的终端列表;将存储在本地的所述文件中的数据进行编码,生成第一喷泉码数据,其中,所述第一喷泉码数据中包含有N个编码分组,N为大于零的整数;向所述终端列表中请求下载所述数据的终端发送所述N个编码分组。本申请实施例提高了数据传输的可靠性;另外因采用了喷泉码减少了信道中反馈信息的传输,有助于提高信道容量,使得网络更加健壮。

Description

文件下载方法、装置、终端及服务器
交叉引用
本申请要求于2016年06月30日递交的中国专利局,申请号为201610509196.6的中国专利申请优先权,其全部内容通过引用被全部并入本申请。
技术领域
本申请涉及计算机技术领域,尤其涉及一种文件下载方法、装置、终端及服务器。
背景技术
随着计算机网络技术的发展,网络形成一种从集中式系统向分布式系统发展的趋势。P2P(peer to peer,对等网络)或P2SP(Peer to Server and Peer,点对服务器和点)网络随之诞生,它通过直接交换方式共享计算机资源和服务。
P2P或P2SP的基本传输模式都是把文件先分成块,再按块传输直到传完文件。P2SP除了包含P2P以外,P2SP的“S”是指服务器。P2SP有效地把原本孤立的服务器和其镜像资源以及P2P资源整合到了一起。
发明人在实现本申请的过程中发现:数据在终端之间或终端与服务器之间进行传输时,若网络环境恶劣,很可能导致数据同步传输失败,或者需要反复重传才能最终成功完成数据的传输。因此,在网络环境较差的情况下,P2P或P2SP网络中数据传输的可靠性较差。
发明内容
本申请实施例提供一种文件下载方法、装置、终端及服务器,用以解决现有技术中在恶劣的网络环境下数据传输可靠性较低的问题。
本申请实施例提供一种文件下载方法,适用于终端,包括:
获取下载同一文件的终端列表;
将存储在本地的所述文件中的数据进行编码,生成第一喷泉码数据,其中,所述第一喷泉码数据中包含有N个编码分组,N为大于零的整数;
向所述终端列表中请求下载所述数据的终端发送所述N个编码分组。
可选的,上述的方法中,所述将存储在本地的所述文件中的数据进行编码,生成第一喷泉码数据,包括:
将存储在本地的所述文件中的数据进行分组,得到K个原始数据分组;
对所述K个原始数据分组进行喷泉码编码,生成N个编码分组;
其中,K为大于或等于2的整数,N为大于零的整数,所述N个编码分组构成所述第一喷泉码数据。
可选的,上述的方法,还包括:
接收到所述终端发送的反馈信息后,停止向所述终端发送所述N个编码分组;
其中,所述反馈信息是所述终端在接收到预设数量的所述编码分组后发出的,所述预设数量大于所述K。
可选的,上述的方法,还包括:
接收终端发送的第二喷泉码数据;
基于接收到的所述第二喷泉码数据中包含的M个编码分组,解码出所述第二喷泉码数据对应的数据;
其中,M>M’,所述M’为在生成所述第二喷泉码数据过程中将数据进行分组后得到的原始数据分组的数量,所述M’为大于或等于2的整数。
可选的,上述的方法,还包括:
若无法接收到所述终端列表中的终端发送的数据,则向服务器端发送下载请求,所述下载请求中携带有欲下载文件标识;
接收所述服务器端发送的所述欲下载文件标识对应的文件数据的喷泉 码数据;
基于接收到的所述文件数据的喷泉码数据中包含的S个编码分组,解码出所述欲下载文件的文件数据;
其中,S>S’,所述S’为在生成所述文件数据的喷泉码数据过程中将所述欲下载文件的文件数据进行分组后得到的原始数据分组的数量,所述S’为大于或等于2的整数。
可选的,上述的方法,还包括:
接收所述服务器端发送的调度信息,并根据所述调度信息,向所述调度信息指定的终端发送所述文件数据的喷泉码数据。
可选的,上述的方法,还包括:
接收服务器端发送的查询请求,其中,所述查询请求中携带有欲查询文件标识;
若本地存储有所述欲查询文件标识对应的文件数据,则将所述欲查询文件的文件数据进行编码,生成对应的喷泉码数据;
向所述服务器端发送所述欲查询文件对应的喷泉码数据。
可选的,上述的方法中,所述向所述终端列表中请求下载所述数据的终端发送所述第一喷泉码数据,具体为:
采用用户数据报协议UDP向所述终端列表中请求下载所述数据的终端发送所述第一喷泉码数据。
本申请实施例还提供一种文件下载方法,适用于服务器端,包括:
接收终端发送的下载请求,其中,所述下载请求中携带有所述文件的标识;
若网络中不存在存储有所述文件标识对应的文件的终端,且本地存储所述文件标识对应的文件,则将所述文件中的数据进行编码,生成喷泉码数据,其中,所述喷泉码数据中包含有N个编码分组,N为大于零的整数;
向所述终端发送所述N个编码分组。
可选的,上述的方法中,所述将所述文件中的数据进行编码,生成喷泉码数据,包括:
将所述文件中的数据进行分组,得到K个原始数据分组;
对所述K个原始数据分组进行喷泉码编码,生成N个编码分组;
其中,K为大于或等于2的整数,N为大于零的整数。
可选的,上述的方法,还包括:
接收到所述终端发送的反馈信息后,停止向所述终端发送所述N个编码分组;
其中,所述反馈信息是所述终端在接收到预设数量的所述编码分组后发出的,所述预设数量大于所述K。
可选的,上述的方法,还包括:
若网络中不存在存储有所述文件标识对应的文件的终端,且本地未存储所述文件标识对应的文件,则向网络中的其他终端发送查询请求,其中,所述查询请求中携带有所述文件的文件标识;
若所述网络中存在有存储有所述文件的终端,则接收所述终端发送的喷泉码数据;
基于接收到的所述喷泉码数据中包含的L个编码分组,解码出所述文件的数据;
其中,L>K,所述K为在生成所述喷泉码数据过程中将数据进行分组后得到的原始数据分组的数量,所述K为大于或等于2的整数。
可选的,上述的方法中,所述向所述终端发送所述N个编码分组,具体为:
采用用户数据报协议UDP向所述终端发送所述N个编码分组。
本申请还提供了一种文件下载装置,适用于终端,包括:
获取模块,用于获取下载同一文件的终端列表;
编码模块,用于将存储在本地的所述文件中的数据进行编码,生成第一 喷泉码数据,其中,所述第一喷泉码数据中包含有N个编码分组,N为大于零的整数;
发送模块,用于向所述终端列表中请求下载所述数据的终端发送所述N个编码分组。
可选的,上述的文件下载装置中,所述编码模块,包括:
分组单元,用于将存储在本地的所述文件中的数据进行分组,得到K个原始数据分组;
编码单元,用于对所述K个原始数据分组进行喷泉码编码,生成N个编码分组;
其中,K为大于或等于2的整数,N为大于零的整数。
可选的,上述的文件下载装置,还包括:
所述发送模块,还用于在接收到所述终端发送的反馈信息后,停止向所述终端发送所述N个编码分组;
其中,所述反馈信息是所述终端在接收到预设数量的所述编码分组后发出的,所述预设数量大于所述K。
可选的,上述的文件下载装置,还包括:
第一接收模块,用于接收终端发送的第二喷泉码数据;
第一解码模块,用于基于接收到的所述第二喷泉码数据中包含的M个编码分组,解码出所述第二喷泉码数据对应的数据;
其中,M>M’,所述M’为在生成所述第二喷泉码数据过程中将数据进行分组后得到的原始数据分组的数量,所述M’为大于或等于2的整数。
可选的,上述的文件下载装置,还包括:
所述发送模块,还用于当无法接收到所述终端列表中的终端发送的数据时,向服务器端发送下载请求,所述下载请求中携带有欲下载文件标识;
第二接收模块,用于接收所述服务器端发送的所述欲下载文件标识对应的文件数据的喷泉码数据;
第二解码模块,用于基于接收到的所述文件数据的喷泉码数据中包含的S个编码分组,解码出所述欲下载文件的文件数据;
其中,S>S’,所述S’为在生成所述文件数据的喷泉码数据过程中将所述欲下载文件的文件数据进行分组后得到的原始数据分组的数量,所述S’为大于或等于2的整数。
可选的,上述的文件下载装置中,所述第二接收模块,还用于接收所述服务器端发送的调度信息,并根据所述调度信息,向所述调度信息指定的终端发送所述文件数据的喷泉码数据。
可选的,上述的文件下载装置,还包括:
第三接收模块,用于接收服务器端发送的查询请求,其中,所述查询请求中携带有欲查询文件标识;
所述编码模块,还用于当本地存储有所述欲查询文件标识对应的文件数据时,将所述欲查询文件的文件数据进行编码,生成对应的喷泉码数据;
所述发送模块,还用于向所述服务器端发送所述欲查询文件对应的喷泉码数据。
可选的,上述的文件下载装置中,所述发送模块,具体用于采用用户数据报协议UDP向所述终端列表中请求下载所述数据的终端发送所述第一喷泉码数据。
本申请实施例还提供了一种文件下载装置,适用于服务器端,包括:
接收模块,用于接收终端发送的下载请求,其中,所述下载请求中携带有所述文件的标识;
编码模块,用于当网络中不存在存储有所述文件标识对应的文件的终端,且本地存储所述文件标识对应的文件时,将所述文件中的数据进行编码,生成喷泉码数据,其中,所述喷泉码数据中包含有N个编码分组,N为大于零的整数;
发送模块,用于向所述终端发送所述N个编码分组。
可选的,上述的文件下载装置中,所述编码模块,包括:
分组单元,用于将所述文件中的数据进行分组,得到K个原始数据分组;
编码单元,用于对所述K个原始数据分组进行喷泉码编码,生成N个编码分组;
其中,K为大于或等于2的整数,N为大于零的整数。
可选的,上述的文件下载装置中,所述发送模块,还用于接收到所述终端发送的反馈信息后,停止向所述终端发送所述N个编码分组;
其中,所述反馈信息是所述终端在接收到预设数量的所述编码分组后发出的,所述预设数量大于所述K。
可选的,上述的文件下载装置,还包括:
所述发送模块,还用于当网络中不存在存储有所述文件标识对应的文件的终端,且本地未存储所述文件标识对应的文件时,向网络中的其他终端发送查询请求,其中,所述查询请求中携带有所述文件的文件标识;
所述接收模块,还用于当所述网络中存在有存储有所述文件的终端时,接收所述终端发送的喷泉码数据;
解码模块,用于基于接收到的所述喷泉码数据中包含的L个编码分组,解码出所述文件的数据;
其中,L>K,所述K为在生成所述喷泉码数据过程中将数据进行分组后得到的原始数据分组的数量,所述K为大于或等于2的整数。
可选的,上述的文件下载装置中,所述发送模块,具体用于采用用户数据报协议UDP向所述终端发送所述N个编码分组。
本申请实施例还提供的了一种文件下载系统,其特征在于,包括适用于终端的文件下载装置以及适用于服务器端的文件下载装置;其中,
所述适用于终端的文件下载装置用于:
获取下载同一文件的终端列表;
将存储在本地的所述文件中的数据进行编码,生成第一喷泉码数据,其中,所述第一喷泉码数据中包含有N个编码分组,N为大于零的整数;
向所述终端列表中请求下载所述数据的终端发送所述N个编码分组;
所述适用于服务器端的文件下载装置用于:
接收终端发送的下载请求,其中,所述下载请求中携带有所述文件的标识;
若网络中不存在存储有所述文件标识对应的文件的终端,且本地存储所述文件标识对应的文件,则将所述文件中的数据进行编码,生成喷泉码数据,其中,所述喷泉码数据中包含有N个编码分组,N为大于零的整数;
向所述终端发送所述N个编码分组。
本申请实施例提供一种文件下载终端,包括至少一个处理器,以及,与所述至少一个处理器通信连接的存储器;其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被设置为用于执行本申请上述任一项适用于终端的文件下载方法。
本申请实施例还提供了一种非暂态计算机存储介质,存储有计算机可执行指令,所述计算机可执行指令用于执行本申请上述任一项适用于终端的文件下载方法。
本申请实施例提供一种计算机程序产品,所述计算机程序产品包括计算机可读的存储介质和内嵌于其中的计算机程序指令,当所述程序指令被计算机执行时,使所述计算机执行本申请上述任一项适用于终端的文件下载方法。
本申请实施例提供一种服务器,包括至少一个处理器,以及,与所述至少一个处理器通信连接的存储器;其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被设置为用于执行本申请上述任一项适用于服务器端的文件下载方法。
本申请实施例还提供了一种非暂态计算机存储介质,存储有计算机可执行指令,所述计算机可执行指令用于执行本申请上述任一项适用于服务器端的文件下载方法。
本申请实施例提供一种计算机程序产品,所述计算机程序产品包括计算机可读的存储介质和内嵌于其中的计算机程序指令,当所述程序指令被计算机执行时,使所述计算机执行本申请上述任一项适用于服务器端的文件下载方法。
本申请实施例提供的文件下载方法、装置、终端及服务器,通过将待传输的目标文件的分块数据编码成喷泉码数据,并基于喷泉码数据的特点源源不断地向请求下载的终端发送,直到接收到终端发送反馈信息后停止,即便是在网络环境较差的情况下丢失部分编码分组,因为喷泉码是源源不断发送的,接收终端还是能继续接收并能基于接收到预设数量的编码分组解码出对应的分块数据,显然本申请实施例提供的技术方案提高了数据传输的可靠性;另外,由于接收终端只有在接收到预设数量的编码分组后才发出反馈信息,相较于现有技术中只要有一次传输失败就要反馈一次重传请求,本申请实施例因采用了喷泉码减少了信道中反馈信息的传输,有助于提高信道容量,使得网络更加健壮。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的一种可选的P2SP网络架构示意图;
图2为本申请实施例一提供的文件下载方法的流程示意图;
图3为本申请实施例二提供的文件下载方法的流程示意图;
图4为本申请实施例三提供的文件下载方法的流程示意图;
图5为本申请实施例四提供的文件下载方法的流程示意图;
图6为本申请实施例六提供的文件下载装置的结构示意图;
图7为本申请实施例七提供的文件下载装置的结构示意图;
图8为本申请实施例十提供的文件下载终端的结构示意图;
图9为本申请实施例十二提供的文件下载服务器的结构示意图。
具体实施方式
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
首先结合图1介绍本申请实施例提供的文件下载方法可以适用于的应用场景。
本申请实施例提供的所述文件下载方法可适用在P2P和P2SP网络中。其中,P2SP在P2P的架构基础上,加入了一个数据源提供者S(Server),由这个数据源将多媒体数据分发到网络中的某些节点,其他的一些节点可以对等网的方式从其他有数据的节点那获取多媒体数据。节点之间的数据共享,以均等的方式进行内容分发。下面以P2SP网络为例,对本申请提供的技术方案进行说明。
图1为本申请实施例提供的一种可选的P2SP网络架构示意图。如图1所示,该网络架构中包含有服务器端设备602以及多个终端设备601,假设该网络架构中包含有A、B、C三个终端设备,这三个终端设备需要下载同一文件。服务器端设备存储有下载同一文件的终端列表,该列表中包含有终端设备A、终端设备B和终端设备C的标识。具体的,服务器端设备在接收到终端设备发送的下载请求后,会将发送下载请求的终端设备的标识添加到以所述文件的标识为关键词key的终端列表中;或者,服务器端设备根据所述下载请求中携带的文件的标识,获取该文件的属性计算出文件的文件指纹,并将发送下载请求的终端设备的标识添加到以所述文件的指纹作为关键词key的终端列表中。其中,文件的属性包含但不限于:URL(Uniform  Resource Locator,统一资源定位符),BT(BitTorrent,比特洪流)种子文件,ed2k(eDonkey2000network,电驴2000网络)链接等。终端设备A、终端设备B和终端设备C在获取到终端列表后,这三个终端设备即可实现节点之间的数据共享,以均等的方式进行数据的分发,相互之间进行数据的交换,最终均达到下载完成目标文件的目的。
假设目标文件被分成3个分块数据,终端设备A存储有目标文件的分块数据1、终端设备B存储有目标文件的分块数据2、终端设备C存储有目标文件的分块数据3。终端设备A可将分块数据1进行编码,生成喷泉码数据;然后持续向终端列表中的请求下载目标文件的终端设备B和终端设备C分发分块数据1的喷泉码数据中的多个编码分组。同样的,终端设备B可将本地分块数据2进行喷泉码编码然后向终端设备A和终端设备C进行分发;终端设备C可将本地分块数据3进行喷泉码编码然后向终端设备A和终端设备B进行分发。
这里需要说明的是:若网络中不存在存储有目标文件的终端设备或因某些原因无法获取到其他终端设备发送的数据,则终端设备可向服务器端设备发送下载请求,服务器端设备此时相当于网络中的一个终端设备向请求下载目标文件的终端设备分发分块数据。同样的,若服务器端设备接收到终端设备发送的下载目标文件的下载请求后,查询本地无该目标文件时,服务器端设备也可向网络中其他终端设备发送查询请求。如果网络中存在终端设备有此文件,那么此时服务器端设备同普通的终端设备一样从存储有目标文件的终端设备处获取文件分块信息及分块数据,并将获取到的文件分块信息及分块数据返回给请求下载的终端设备。如果当服务器端设备在全P2SP网络中都没有查询到目标文件,那么服务器端设备将根据提交请求的终端设备所提交的信息,到其他网络,如BT、ed2k等网络中,获取资源。如果服务器端设备在其他网络中还是没有查询到结果,那么将向请求的终端设备发出无法获取该资源,由终端设备根据目标文件的属性自行下载此文件。
实施例一
图2示出了本申请实施例一提供的文件下载方法的流程示意图。本实施例提供的所述方法可适用于终端。本实施例提供的所述方法的执行主体可以是文件下载装置,所述文件下载装置可以是安装在终端设备上的硬件实体或应用程序。如图2所示,本实施例一提供的所述方法,包括:
步骤101、获取下载同一文件的终端列表。
具体的,本步骤可采用如下方法实现:
步骤S11、向服务器端发送下载所述文件的下载请求。
步骤S12、接收所述服务器端反馈的以所述文件的标识为关键词key的终端列表。
在P2SP网络中,若服务器端设备本地存储有所述文件标识对应的文件,则所述服务器端设备在接收到所述下载请求后,首先会根据所述文件的标识获取所述文件的属性,并根据所述属性计算所述第一目标文件的指纹。其中,指纹的生成方式可以参考现有方式实现,本实施例不赘述。文件的属性包含但不限于:URL,BT种子文件,ed2k链接等。然后,若服务器端设备查询到本地已创建有以所述指纹为关键词key的终端列表,则所述终端的标识添加到所述终端列表中;若服务器端设备查询本地无以所述指纹为key的终端列表,则创建以所述指纹为key的终端列表,并将所述终端的标识添加到所述终端列表中。最后向所述终端反馈以所述指纹为key的终端列表。
步骤102、将存储在本地的所述文件中的数据进行编码,生成第一喷泉码数据,其中,所述第一喷泉码数据中包含有N个编码分组,N为大于零的整数。
在具体实施时,本步骤可采用如下方法实现:
首先,将存储在本地的所述文件中的数据进行分组,得到K个原始数据分组。
然后,对所述K个原始数据分组进行喷泉码编码,生成N个编码分组。
其中,K为大于或等于2的整数,N为大于零的整数。
实际应用中,该喷泉码可以是LT码,也可以是Raptor码。
所谓的喷泉码,就是指使用该种编码可以由k个原始数据分组生成任意数量的编码分组,而只要知道其中任意n(n≥k)个编码分组,即可通过译码成功恢复出全部原始数据分组。
本实施例中,假设接收到的数据单元的长度为L比特,将长度为L比特的数据单元分割成个输入原始数据分组,则每个输入原始数据分组的长为。
定义:度d表示喷泉码编码过程中每次选取原始数据分组的个数。
喷泉码编码生成一个编码分组的具体过程如下:
1)随机(伪随机)选择一个度d;
2)从所有的原始数据分组中随机(伪随机)选取d个不同的输入数据分组;
3)将这d个不同输入数据分组模二和,生成一个编码分组。
假设已知n个编码分组,每个编码分组代表一个有k个未知输入的线性方程。则整个译码过程可以看作是n个方程联合求解k个未知数的线性方程组G×X=N,其中G是生成矩阵,大小为n×k,X为k×1的待求解原始数据分组向量,N为n×1的编码分组向量。当生成矩阵G列满秩即G的秩为k时,待求解原始数据分组X有唯一确定解。
步骤103、向所述终端列表中请求下载所述数据的终端发送所述N个编码分组。
在具体实施时,可采用UDP(User Datagram Protocol,用户数据报协议)协议向所述终端列表中请求下载所述数据的终端发送所述N个编码分组。本申请实施例采用UDP协议可以减少传输过程中的协议数据的传输量,即便存在数据丢包在喷泉码的编码保证下也能顺利的、安全的还原数据。
这里需要补充的是:在实际应用中,喷泉码的发送端随机编码,由k个原始分组生成任意数量的编码分组,发送端在不知道这些数据包是否被成功接收的情况下,持续发送数据包。而接收端只要收到k(1+ε)个编码分组的任意子集,即收到一个稍微大于原来k值得N,就可通过译码以高概率(和ε 有关)成功地恢复全部原始分组。
下面这个比喻形象地解释了这个过程。
单个源节点S如同源源不断产生水滴(编码分组)的喷泉,不停地向周围的多个桶K(表示多个接收端的缓存)发送"水滴"(表示数据包),当一个桶里的水满了以后(缓存满),它才向源节点发送一个反馈。每次发送的水滴是一帧里面随机选择的一些包组合起来的包,这种组合可以是线性的,也可以是非线性的,随机选择保证了每次发送的信息对接收节点是有用的。桶在装满水之后(接收足够数量的水滴),即可达到饮用(成功译码)的目的,而不必关心具体是哪一滴水(编码分组)流入桶中。当源节点收到所有桶的ACK以后,再发送新的一帧,否则继续发送组合包。
本申请实施例提供的技术方案,通过将待传输的目标文件的分块数据编码成喷泉码数据,并基于喷泉码数据的特点源源不断地向请求下载的终端发送,直到接收到终端发送反馈信息后停止,即便是在网络环境较差的情况下丢失部分编码分组,因为喷泉码是源源不断发送的,接收终端还是能继续接收并能基于接收到预设数量的编码分组解码出对应的分块数据,显然本申请实施例提供的技术方案提高了数据传输的可靠性;另外,由于接收终端只有在接收到预设数量的编码分组后才发出反馈信息,相较于现有技术中只要有一次传输失败就要反馈一次重传请求,本申请实施例因采用了喷泉码减少了信道中反馈信息的传输,有助于提高信道容量,使得网络更加健壮。
实施例二
图3示出了本申请实施例一提供的文件下载方法的流程示意图。本实施例提供的所述方法可适用于终端。本实施例提供的所述方法的执行主体可以是文件下载装置,所述文件下载装置可以是安装在终端终端设备上的硬件实体或应用程序。如图3所示,本实施例二提供的所述方法,包括:
步骤201、获取下载同一文件的终端列表。
步骤202、将存储在本地的所述文件中的数据进行编码,生成第一喷泉 码数据,其中,所述第一喷泉码数据中包含有N个编码分组,N为大于零的整数。
具体的编码过程可参见上述实施例一中的相应部分的内容,此处不再赘述。
步骤203、向所述终端列表中请求下载所述数据的终端发送所述N个编码分组。
步骤204、接收到所述终端发送的反馈信息后,停止向所述终端发送所述N个编码分组。
其中,所述反馈信息是所述终端在接收到预设数量的所述编码分组后发出的,所述预设数量大于所述K。在具体实施时,所述预设数量可以等于K(1+ε),ε为预设的译码开销。译码开销可人为设定,当然译码开销越大,基于接收到的编码分组恢复出全部原始分组的概率也就越大。在具体实施时,技术人员可根据多次试验找到较为合适的译码开销值。
步骤205、接收终端发送的第二喷泉码数据。
步骤206、基于接收到的所述第二喷泉码数据中包含的M个编码分组,解码出所述第二喷泉码数据对应的数据。
其中,M>M’,所述M’为在生成所述第二喷泉码数据过程中将数据进行分组后得到的原始数据分组的数量,所述M’为大于或等于2的整数。具体实施时,M可以等于M’(1+ε),ε为预设的译码开销。译码开销可人为设定,当然译码开销越大,基于接收到的编码分组恢复出全部原始分组的概率也就越大。在具体实施时,技术人员可根据多次试验找到较为合适的译码开销值。
步骤207、若无法接收到所述终端列表中的终端发送的数据,则向服务器端发送下载请求,所述下载请求中携带有欲下载文件标识。
在实际应用中,终端无法接收到所述终端列表中的终端发送的数据的情况可能有如下几种情况:
情况1,终端与终端列表中的所有终端均建立连接失败。
情况2,终端与终端列表中的所有终端中的至少一个终端成功建立了连接,但无法接收到所述成功建立连接的终端发送的数据。
步骤208、接收所述服务器端发送的所述欲下载文件标识对应的文件数据的喷泉码数据。
步骤209、基于接收到的所述文件数据的喷泉码数据中包含的S个编码分组,解码出所述欲下载文件的文件数据。
其中,S>S’,所述S’为在生成所述文件数据的喷泉码数据过程中将所述欲下载文件的文件数据进行分组后得到的原始数据分组的数量,所述S’为大于或等于2的整数。同样的,在具体实施时,S可以等于S’(1+ε),ε为预设的译码开销。译码开销可人为设定,当然译码开销越大,基于接收到的编码分组恢复出全部原始分组的概率也就越大。在具体实施时,技术人员可根据多次试验找到较为合适的译码开销值。
步骤210、接收所述服务器端发送的调度信息,并根据所述调度信息,向所述调度信息指定的终端发送所述文件数据的喷泉码数据。
步骤211、接收服务器端发送的查询请求,其中,所述查询请求中携带有欲查询文件标识。
步骤212、若本地存储有所述欲查询文件标识对应的文件数据,则将所述欲查询文件的文件数据进行编码,生成对应的喷泉码数据。
步骤213、向所述服务器端发送所述欲查询文件对应的喷泉码数据。
本申请实施例提供的技术方案,通过将待传输的目标文件的分块数据编码成喷泉码数据,并基于喷泉码数据的特点源源不断地向请求下载的终端发送,直到接收到终端发送反馈信息后停止,即便是在网络环境较差的情况下丢失部分编码分组,因为喷泉码是源源不断发送的,接收终端还是能继续接收并能基于接收到预设数量的编码分组解码出对应的分块数据,显然本申请实施例提供的技术方案提高了数据传输的可靠性;另外,由于接收终端只有在接收到预设数量的编码分组后才发出反馈信息,相较于现有技术中只要有一次传输失败就要反馈一次重传请求,本申请实施例因采用了喷泉码减少了 信道中反馈信息的传输,有助于提高信道容量,使得网络更加健壮。
实施例三
图4示出了本申请实施例三提供的文件下载方法的流程示意图。本实施例提供的所述方法可适用于服务器端。本实施例提供的所述方法的执行主体可以是文件下载装置,该文件下载装置可以是安装在服务器端设备上的硬件实体或应用程序。如图4所示,本实施例三提供的所述方法,包括:
步骤301、接收终端发送的下载请求,其中,所述下载请求中携带有所述文件的标识。
在具体实施时,所述下载请求可以是所述终端在无法从网络中其他终端(如下载所述文件的终端列表中的终端)中下载到所述标识对应的文件情况下发送的,当然也可以是所述终端直接发送的。
在实际应用中,终端无法接收到所述终端列表中的终端发送的数据的情况可能有如下几种情况:
情况1,终端与终端列表中的所有终端均建立连接失败。
情况2,终端与终端列表中的所有终端中的至少一个终端成功建立了连接,但无法接收到所述成功建立连接的终端发送的数据。
步骤302、若网络中不存在存储有所述文件标识对应的文件的终端,且本地存储所述文件标识对应的文件,则将所述文件中的数据进行编码,生成喷泉码数据,其中,所述喷泉码数据中包含有N个编码分组,N为大于零的整数。
具体的,本步骤可采用如下方法实现:
首先,将所述文件中的数据进行分组,得到K个原始数据分组。
然后,对所述K个原始数据分组进行喷泉码编码,生成N个编码分组。
其中,K为大于或等于2的整数,N为大于零的整数。
步骤303、向所述终端发送所述N个编码分组。
本申请实施例提供的技术方案,通过将待传输的目标文件的分块数据编码成喷泉码数据,并基于喷泉码数据的特点源源不断地向请求下载的终端发送,直到接收到终端发送反馈信息后停止,即便是在网络环境较差的情况下丢失部分编码分组,因为喷泉码是源源不断发送的,接收终端还是能继续接收并能基于接收到预设数量的编码分组解码出对应的分块数据,显然本申请实施例提供的技术方案提高了数据传输的可靠性;另外,由于接收终端只有在接收到预设数量的编码分组后才发出反馈信息,相较于现有技术中只要有一次传输失败就要反馈一次重传请求,本申请实施例因采用了喷泉码减少了信道中反馈信息的传输,有助于提高信道容量,使得网络更加健壮。
实施例四
图5示出了本申请实施例四提供的文件下载方法的流程示意图。本实施例提供的所述方法可适用于服务器端。本实施例提供的所述方法的执行主体可以是文件下载装置,该文件下载装置可以是安装在服务器端设备上的硬件实体或应用程序。如图5所示,本实施例四提供的所述方法,包括:
步骤401、接收终端发送的下载请求,其中,所述下载请求中携带有所述文件的标识。
步骤402、若网络中不存在存储有所述文件标识对应的文件的终端,且本地存储所述文件标识对应的文件,则将所述文件中的数据进行编码,生成喷泉码数据,其中,所述喷泉码数据中包含有N个编码分组,N为大于零的整数。
步骤403、向所述终端发送所述N个编码分组。
这里需要说明的是:可采用UDP协议向所述终端发送所述N个编码分组,采用UDP协议可以减少传输过程中的协议数据的传输量,即便存在数据丢包在喷泉码的编码保证下也能顺利的、安全的还原数据。
步骤404、接收到所述终端发送的反馈信息后,停止向所述终端发送所述N个编码分组。
其中,所述反馈信息是所述终端在接收到预设数量的所述编码分组后发出的,所述预设数量大于所述K。在具体实施时,所述预设数量可以等于K(1+ε),ε为预设的译码开销。译码开销可人为设定,当然译码开销越大,基于接收到的编码分组恢复出全部原始分组的概率也就越大。在具体实施时,技术人员可根据多次试验找到较为合适的译码开销值。
步骤405、若网络中不存在存储有所述文件标识对应的文件的终端,且本地未存储所述文件标识对应的文件,则向网络中的其他终端发送查询请求,其中,所述查询请求中携带有所述文件的文件标识。
步骤406、若所述网络中存在有存储有所述文件的终端,则接收所述终端发送的喷泉码数据。
这里需要说明的是所述网络可以包括P2SP网络、BT网络,ed2k网络等中的一种网络或任意多种网络。
步骤407、基于接收到的所述喷泉码数据中包含的L个编码分组,解码出所述文件的数据。
其中,L>K,所述K为在生成所述喷泉码数据过程中将数据进行分组后得到的原始数据分组的数量,所述K为大于或等于2的整数。所述L可以等于K(1+ε),ε为预设的译码开销。译码开销可人为设定,当然译码开销越大,基于接收到的编码分组恢复出全部原始分组的概率也就越大。在具体实施时,技术人员可根据多次试验找到较为合适的译码开销值。
步骤408、若所述网络中不存在有存储有所述文件的终端,则向所述终端发出无法获取所述文件的提示信息。
本申请实施例提供的技术方案,通过将待传输的目标文件的分块数据编码成喷泉码数据,并基于喷泉码数据的特点源源不断地向请求下载的终端发送,直到接收到终端发送反馈信息后停止,即便是在网络环境较差的情况下丢失部分编码分组,因为喷泉码是源源不断发送的,接收终端还是能继续接收并能基于接收到预设数量的编码分组解码出对应的分块数据,显然本申请实施例提供的技术方案提高了数据传输的可靠性;另外,由于接收终端只有在接收到预设数量的编码分组后才发出反馈信息,相较于现有技术中只要有 一次传输失败就要反馈一次重传请求,本申请实施例因采用了喷泉码减少了信道中反馈信息的传输,有助于提高信道容量,使得网络更加健壮。
需要说明的是:对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。
实施五
如图6示出了本申请实施例五提供的文件下载装置的结构示意图。为了便于说明,仅示出了与本申请实施例相关的部分,具体技术细节未揭示的,请参照本申请实施例方法部分。该文件下载装置可以是安装在终端设备上的硬件实体或应用程序。其中,所述终端设备可以是:计算机、笔记本计算机、手机、平板电脑、PDA(Personal Digital Assistant,个人数字助理)、POS(Point of Sales,销售终端)、车载电脑等任意终端设备。如图6所示,本实施例五提供的所述文件下载装置,包括:获取模块501、编码模块502及发送模块503。其中,
获取模块501用于获取下载同一文件的终端列表;
编码模块502用于将存储在本地的所述文件中的数据进行编码,生成第一喷泉码数据,其中,所述第一喷泉码数据中包含有N个编码分组,N为大于零的整数;
发送模块503用于向所述终端列表中请求下载所述数据的终端发送所述N个编码分组。
本申请实施例提供的技术方案,通过将待传输的目标文件的分块数据编码成喷泉码数据,并基于喷泉码数据的特点源源不断地向请求下载的终端发送,直到接收到终端发送反馈信息后停止,即便是在网络环境较差的情况下丢失部分编码分组,因为喷泉码是源源不断发送的,接收终端还是能继续接 收并能基于接收到预设数量的编码分组解码出对应的分块数据,显然本申请实施例提供的技术方案提高了数据传输的可靠性;另外,由于接收终端只有在接收到预设数量的编码分组后才发出反馈信息,相较于现有技术中只要有一次传输失败就要反馈一次重传请求,本申请实施例因采用了喷泉码减少了信道中反馈信息的传输,有助于提高信道容量,使得网络更加健壮。
这里需要说明的是:本实施例提供的所述文件下载装置可实现上述实施例一或实施例二中所提供的文件下载方法,具体的实现细节可参见上述内容,此处不再赘述。
实施六
本申请实施例六基于上述实施例五提供的文件下载装置对本申请提供的技术方案进行进一步的说明。为了便于描述,仅示出了与本申请实施例相关的部分,具体技术细节未揭示的,请参照本申请实施例方法部分。该文件下载装置可以是安装在终端设备上的硬件实体或应用程序。其中所述终端设备可以是:计算机、笔记本计算机、手机、平板电脑、PDA(Personal Digital Assistant,个人数字助理)、POS(Point of Sales,销售终端)、车载电脑等任意终端设备。本实施例六基于所述实施例五,提供的所述文件下载装置中,所述编码模块可采用如下方法实现。具体的,所述编码模块包括:分组单元和编码单元。其中,分组单元用于将存储在本地的所述文件中的数据进行分组,得到K个原始数据分组。编码单元用于对所述K个原始数据分组进行喷泉码编码,生成N个编码分组。其中,K为大于或等于2的整数,N为大于零的整数。
进一步的,所述的发送模块还可用于在接收到所述终端发送的反馈信息后,停止向所述终端发送所述N个编码分组;其中,所述反馈信息是所述终端在接收到预设数量的所述编码分组后发出的,所述预设数量大于所述K。
进一步的,所述文件下载装置还可包括:第一接收模块和第一解码模块。其中,第一接收模块,用于接收终端发送的第二喷泉码数据;第一解码模块,用于基于接收到的所述第二喷泉码数据中包含的M个编码分组,解码出所述 第二喷泉码数据对应的数据;其中,M>M’,所述M’为在生成所述第二喷泉码数据过程中将数据进行分组后得到的原始数据分组的数量,所述M’为大于或等于2的整数。
进一步的,所述文件下载装置还可包括:
所述发送模块,还用于当无法接收到所述终端列表中的终端发送的数据时,向服务器端发送下载请求,所述下载请求中携带有欲下载文件标识;
第二接收模块,用于接收所述服务器端发送的所述欲下载文件标识对应的文件数据的喷泉码数据;
第二解码模块,用于基于接收到的所述文件数据的喷泉码数据中包含的S个编码分组,解码出所述欲下载文件的文件数据;
其中,S>S’,所述S’为在生成所述文件数据的喷泉码数据过程中将所述欲下载文件的文件数据进行分组后得到的原始数据分组的数量,所述S’为大于或等于2的整数。
进一步的,所述第二接收模块,还用于接收所述服务器端发送的调度信息,并根据所述调度信息,向所述调度信息指定的终端发送所述文件数据的喷泉码数据。
进一步的,所述文件下载装置还可包括:第三接收模块,用于接收服务器端发送的查询请求,其中,所述查询请求中携带有欲查询文件标识;
所述编码模块,还用于当本地存储有所述欲查询文件标识对应的文件数据时,将所述欲查询文件的文件数据进行编码,生成对应的喷泉码数据;
所述发送模块,还用于向所述服务器端发送所述欲查询文件对应的喷泉码数据。
发送模块,用于采用用户数据报协议UDP向所述终端列表中请求下载所述数据的终端发送所述第一喷泉码数据。
本申请实施例提供的技术方案,通过将待传输的目标文件的分块数据编码成喷泉码数据,并基于喷泉码数据的特点源源不断地向请求下载的终端发送,直到接收到终端发送反馈信息后停止,即便是在网络环境较差的情况下 丢失部分编码分组,因为喷泉码是源源不断发送的,接收终端还是能继续接收并能基于接收到预设数量的编码分组解码出对应的分块数据,显然本申请实施例提供的技术方案提高了数据传输的可靠性;另外,由于接收终端只有在接收到预设数量的编码分组后才发出反馈信息,相较于现有技术中只要有一次传输失败就要反馈一次重传请求,本申请实施例因采用了喷泉码减少了信道中反馈信息的传输,有助于提高信道容量,使得网络更加健壮。
这里需要说明的是:本实施例提供的所述文件下载装置可实现上述实施例一或实施例二中所提供的文件下载方法,具体的实现细节可参见上述内容,此处不再赘述。
实施七
如图7示出了本申请实施例七提供的文件下载装置的结构示意图。如图7所示,本实施例七提供的所述文件下载装置,包括:接收模块701、编码模块702和发送模块703。其中,
接收模块701用于接收终端发送的下载请求,其中,所述下载请求中携带有所述文件的标识;
编码模块702用于当网络中不存在存储有所述文件标识对应的文件的终端,且本地存储所述文件标识对应的文件时,将所述文件中的数据进行编码,生成喷泉码数据,其中,所述喷泉码数据中包含有N个编码分组,N为大于零的整数;
发送模块703用于向所述终端发送所述N个编码分组。
本申请实施例提供的技术方案,通过将待传输的目标文件的分块数据编码成喷泉码数据,并基于喷泉码数据的特点源源不断地向请求下载的终端发送,直到接收到终端发送反馈信息后停止,即便是在网络环境较差的情况下丢失部分编码分组,因为喷泉码是源源不断发送的,接收终端还是能继续接收并能基于接收到预设数量的编码分组解码出对应的分块数据,显然本申请实施例提供的技术方案提高了数据传输的可靠性;另外,由于接收终端只有 在接收到预设数量的编码分组后才发出反馈信息,相较于现有技术中只要有一次传输失败就要反馈一次重传请求,本申请实施例因采用了喷泉码减少了信道中反馈信息的传输,有助于提高信道容量,使得网络更加健壮。
这里需要说明的是:本实施例提供的所述文件下载装置可实现上述实施例三或实施例四中所提供的文件下载方法,具体的实现细节可参见上述内容,此处不再赘述。
实施八
本申请实施例八基于上述实施例七提供的文件下载装置对本申请提供的技术方案进行进一步的说明。本实施例八基于所述实施例七,提供的所述文件下载装置中,所述编码模块可采用如下方法实现。具体的,所述编码模块包括:分组单元和编码单元。其中,分组单元用于将所述文件中的数据进行分组,得到K个原始数据分组;编码单元用于对所述K个原始数据分组进行喷泉码编码,生成N个编码分组;其中,K为大于或等于2的整数,N为大于零的整数。
进一步的,所述发送模块,还用于接收到所述终端发送的反馈信息后,停止向所述终端发送所述N个编码分组;其中,所述反馈信息是所述终端在接收到预设数量的所述编码分组后发出的,所述预设数量大于所述K。
进一步的,本实施例提供所述的文件下载装置,还包括:
所述发送模块,还用于当网络中不存在存储有所述文件标识对应的文件的终端,且本地未存储所述文件标识对应的文件时,向网络中的其他终端发送查询请求,其中,所述查询请求中携带有所述文件的文件标识;
所述接收模块,还用于当所述网络中存在有存储有所述文件的终端时,接收所述终端发送的喷泉码数据;
解码模块,用于基于接收到的所述喷泉码数据中包含的L个编码分组,解码出所述文件的数据;
其中,L>K,所述K为在生成所述喷泉码数据过程中将数据进行分组后 得到的原始数据分组的数量,所述K为大于或等于2的整数。
进一步的,本实施例提供的所述文件下载装置中,所述发送模块,具体用于采用用户数据报协议UDP向所述终端发送所述N个编码分组。
本申请实施例提供的技术方案,通过将待传输的目标文件的分块数据编码成喷泉码数据,并基于喷泉码数据的特点源源不断地向请求下载的终端发送,直到接收到终端发送反馈信息后停止,即便是在网络环境较差的情况下丢失部分编码分组,因为喷泉码是源源不断发送的,接收终端还是能继续接收并能基于接收到预设数量的编码分组解码出对应的分块数据,显然本申请实施例提供的技术方案提高了数据传输的可靠性;另外,由于接收终端只有在接收到预设数量的编码分组后才发出反馈信息,相较于现有技术中只要有一次传输失败就要反馈一次重传请求,本申请实施例因采用了喷泉码减少了信道中反馈信息的传输,有助于提高信道容量,使得网络更加健壮。
这里需要说明的是:本实施例提供的所述文件下载装置可实现上述实施例三或实施例四中所提供的文件下载方法,具体的实现细节可参见上述内容,此处不再赘述。
实施例九
如图1所示,本申请实施例九提供的一种网络系统包括适用于终端的文件下载装置以及适用于服务器端的文件下载装置;其中,
所述适用于终端的文件下载装置用于:
获取下载同一文件的终端列表;
将存储在本地的所述文件中的数据进行编码,生成第一喷泉码数据,其中,所述第一喷泉码数据中包含有N个编码分组,N为大于零的整数;
向所述终端列表中请求下载所述数据的终端发送所述N个编码分组;
所述适用于服务器端的文件下载装置用于:
接收终端发送的下载请求,其中,所述下载请求中携带有所述文件的标识;
若本地存储所述文件标识对应的文件,则将所述文件中的数据进行编码,生成喷泉码数据,其中,所述喷泉码数据中包含有N个编码分组,N为大于零的整数;
向所述终端发送所述N个编码分组。
其中,所述适用于终端的文件下载装置可以是安装在终端设备上的硬件实体或应用程序,所述适用于服务器端的文件下载装置可以是安装在服务器端设备上的硬件实体或应用程序。
本申请实施例提供的技术方案,通过将待传输的目标文件的分块数据编码成喷泉码数据,并基于喷泉码数据的特点源源不断地向请求下载的终端发送,直到接收到终端发送反馈信息后停止,即便是在网络环境较差的情况下丢失部分编码分组,因为喷泉码是源源不断发送的,接收终端还是能继续接收并能基于接收到预设数量的编码分组解码出对应的分块数据,显然本申请实施例提供的技术方案提高了数据传输的可靠性;另外,由于接收终端只有在接收到预设数量的编码分组后才发出反馈信息,相较于现有技术中只要有一次传输失败就要反馈一次重传请求,本申请实施例因采用了喷泉码减少了信道中反馈信息的传输,有助于提高信道容量,使得网络更加健壮。
这里需要说明的是:本实施例提供的所述网络系统中包含的适用于终端的文件下载装置可实现上述实施例一或实施例二提供的所述方法,具体的过程可参见上述实施例中的相应内容,此处不再赘述。本实施例提供的所述网络系统中包含的适用于服务器端的文件下载装置可实现上述实施例三或实施例四提供的所述方法,具体的过程可参见上述实施例中的相应内容,此处不再赘述。
实施例十
本申请实施例提供一种文件下载终端,如图8所示。图8为本申请实施例十提供的文件下载终端的结构示意图,该终端可以包括:
一个或多个处理器801以及存储器802,图8中以一个处理器801为例。
文件下载电子设备还可以包括:输入装置803和输出装置804。
处理器801、存储器802、输入装置803和输出装置804可以通过总线或者其他方式连接。
存储器802作为一种非暂态计算机可读存储介质,可用于存储非暂态软件程序、非暂态计算机可执行程序以及模块,如本申请实施例中的文件下载方法对应的程序指令/模块。处理器801通过运行存储在存储器802中的非暂态软件程序、指令以及模块,从而执行服务器的各种功能应用以及数据处理,即实现上述方法实施例文件下载方法。
存储器802可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据文件下载装置的使用所创建的数据等。此外,存储器802可以包括高速随机存取存储器,还可以包括非暂态存储器,例如至少一个磁盘存储器件、闪存器件、或其他非暂态固态存储器件。在一些实施例中,存储器802可选包括相对于处理器801远程设置的存储器,这些远程存储器可以通过网络连接至列表项操作的处理装置。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
输入装置803可接收输入的数字或字符信息,以及产生与文件下载装置的用户设置以及功能控制有关的键信号输入。输出装置804可包括显示屏等显示设备。
所述一个或者多个模块存储在所述存储器802中,当被所述一个或者多个处理器801执行时,执行上述任意方法实施例中的文件下载方法。
实施例十一
本申请实施例提供了一种非易失性计算机存储介质,所述计算机存储介质存储有计算机可执行指令,该计算机可执行指令可执行上述任意方法实施例中适用于终端的文件下载方法。
实施例十二
本申请实施例提供一种文件下载服务器,如图9所示。图9为本申请实施例十二提供的文件下载服务器的结构示意图,,该服务器可以包括:
一个或多个处理器901以及存储器902,图9中以一个处理器901为例。
文件下载电子设备还可以包括:输入装置903和输出装置904。
处理器901、存储器902、输入装置903和输出装置904可以通过总线或者其他方式连接。
存储器902作为一种非暂态计算机可读存储介质,可用于存储非暂态软件程序、非暂态计算机可执行程序以及模块,如本申请实施例中的文件下载方法对应的程序指令/模块。处理器901通过运行存储在存储器902中的非暂态软件程序、指令以及模块,从而执行服务器的各种功能应用以及数据处理,即实现上述方法实施例文件下载方法。
存储器902可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据文件下载装置的使用所创建的数据等。此外,存储器902可以包括高速随机存取存储器,还可以包括非暂态存储器,例如至少一个磁盘存储器件、闪存器件、或其他非暂态固态存储器件。在一些实施例中,存储器902可选包括相对于处理器901远程设置的存储器,这些远程存储器可以通过网络连接至列表项操作的处理装置。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
输入装置903可接收输入的数字或字符信息,以及产生与文件下载装置的用户设置以及功能控制有关的键信号输入。输出装置604可包括显示屏等显示设备。
所述一个或者多个模块存储在所述存储器902中,当被所述一个或者多个处理器901执行时,执行上述任意方法实施例中的文件下载方法。
实施例十三
申请实施例提供了一种非易失性计算机存储介质,所述计算机存储介质存储有计算机可执行指令,该计算机可执行指令可执行上述任意方法实施例中适用于服务器端的文件下载方法。
上述产品可执行本申请实施例所提供的方法,具备执行方法相应的功能模块和有益效果。未在本实施例中详尽描述的技术细节,可参见本申请实施例所提供的方法。
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。
最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。

Claims (33)

  1. 一种文件下载方法,适用于终端,其特征在于,包括:
    获取下载同一文件的终端列表;
    将存储在本地的所述文件中的数据进行编码,生成第一喷泉码数据,其中,所述第一喷泉码数据中包含有N个编码分组,N为大于零的整数;
    向所述终端列表中请求下载所述数据的终端发送所述N个编码分组。
  2. 根据权利要求1所述的方法,其特征在于,所述将存储在本地的所述文件中的数据进行编码,生成第一喷泉码数据,包括:
    将存储在本地的所述文件中的数据进行分组,得到K个原始数据分组;
    对所述K个原始数据分组进行喷泉码编码,生成N个编码分组;
    其中,K为大于或等于2的整数,N为大于零的整数,所述N个编码分组构成所述第一喷泉码数据。
  3. 根据权利要求2所述的所述方法,其特征在于,还包括:
    接收到所述终端发送的反馈信息后,停止向所述终端发送所述N个编码分组;
    其中,所述反馈信息是所述终端在接收到预设数量的所述编码分组后发出的,所述预设数量大于所述K。
  4. 根据权利要求1~3中所述的方法,其特征在于,还包括:
    接收终端发送的第二喷泉码数据;
    基于接收到的所述第二喷泉码数据中包含的M个编码分组,解码出所述第二喷泉码数据对应的数据;
    其中,M>M’,所述M’为在生成所述第二喷泉码数据过程中将数据进行分组后得到的原始数据分组的数量,所述M’为大于或等于2的整数。
  5. 根据权利要求1~3所述的方法,其特征在于,还包括:
    若无法接收到所述终端列表中的终端发送的数据,则向服务器端发送下 载请求,所述下载请求中携带有欲下载文件标识;
    接收所述服务器端发送的所述欲下载文件标识对应的文件数据的喷泉码数据;
    基于接收到的所述文件数据的喷泉码数据中包含的S个编码分组,解码出所述欲下载文件的文件数据;
    其中,S>S’,所述S’为在生成所述文件数据的喷泉码数据过程中将所述欲下载文件的文件数据进行分组后得到的原始数据分组的数量,所述S’为大于或等于2的整数。
  6. 根据权利要求5所述的方法,其特征在于,还包括:
    接收所述服务器端发送的调度信息,并根据所述调度信息,向所述调度信息指定的终端发送所述文件数据的喷泉码数据。
  7. 根据权利要求1~3中任一项所述的方法,其特征在于,还包括:
    接收服务器端发送的查询请求,其中,所述查询请求中携带有欲查询文件标识;
    若本地存储有所述欲查询文件标识对应的文件数据,则将所述欲查询文件的文件数据进行编码,生成对应的喷泉码数据;
    向所述服务器端发送所述欲查询文件对应的喷泉码数据。
  8. 根据权利要求1~3中任一项所述的方法,其特征在于,所述向所述终端列表中请求下载所述数据的终端发送所述第一喷泉码数据,具体为:
    采用用户数据报协议UDP向所述终端列表中请求下载所述数据的终端发送所述第一喷泉码数据。
  9. 一种文件下载方法,适用于服务器端,其特征在于,包括:
    接收终端发送的下载请求,其中,所述下载请求中携带有所述文件的标识;
    若网络中不存在存储有所述文件标识对应的文件的终端,且本地存储所述文件标识对应的文件,则将所述文件中的数据进行编码,生成喷泉码数据, 其中,所述喷泉码数据中包含有N个编码分组,N为大于零的整数;
    向所述终端发送所述N个编码分组。
  10. 根据权利要求9所述的方法,其特征在于,所述将所述文件中的数据进行编码,生成喷泉码数据,包括:
    将所述文件中的数据进行分组,得到K个原始数据分组;
    对所述K个原始数据分组进行喷泉码编码,生成N个编码分组;
    其中,K为大于或等于2的整数,N为大于零的整数。
  11. 根据权利要求10所述的方法,其特征在于,还包括:
    接收到所述终端发送的反馈信息后,停止向所述终端发送所述N个编码分组;
    其中,所述反馈信息是所述终端在接收到预设数量的所述编码分组后发出的,所述预设数量大于所述K。
  12. 根据权利要求9~11中任一项所述的方法,其特征在于,还包括:
    若网络中不存在存储有所述文件标识对应的文件的终端,且本地未存储所述文件标识对应的文件,则向网络中的其他终端发送查询请求,其中,所述查询请求中携带有所述文件的文件标识;
    若所述网络中存在有存储有所述文件的终端,则接收所述终端发送的喷泉码数据;
    基于接收到的所述喷泉码数据中包含的L个编码分组,解码出所述文件的数据;
    其中,L>K,所述K为在生成所述喷泉码数据过程中将数据进行分组后得到的原始数据分组的数量,所述K为大于或等于2的整数。
  13. 根据权利要求9~11中任一项所述的方法,其特征在于,所述向所述终端发送所述N个编码分组,具体为:
    采用用户数据报协议UDP向所述终端发送所述N个编码分组。
  14. 一种文件下载装置,其特征在于,包括:
    获取模块,用于获取下载同一文件的终端列表;
    编码模块,用于将存储在本地的所述文件中的数据进行编码,生成第一喷泉码数据,其中,所述第一喷泉码数据中包含有N个编码分组,N为大于零的整数;
    发送模块,用于向所述终端列表中请求下载所述数据的终端发送所述N个编码分组。
  15. 根据权利要求14所述的装置,其特征在于,所述编码模块,包括:
    分组单元,用于将存储在本地的所述文件中的数据进行分组,得到K个原始数据分组;
    编码单元,用于对所述K个原始数据分组进行喷泉码编码,生成N个编码分组;
    其中,K为大于或等于2的整数,N为大于零的整数,所述N个编码分组构成所述第一喷泉码数据。
  16. 根据权利要求15所述的装置,其特征在于,还包括:
    所述发送模块,还用于在接收到所述终端发送的反馈信息后,停止向所述终端发送所述N个编码分组;
    其中,所述反馈信息是所述终端在接收到预设数量的所述编码分组后发出的,所述预设数量大于所述K。
  17. 根据权利要求14~16中任一项所述的装置,其特征在于,还包括:
    第一接收模块,用于接收终端发送的第二喷泉码数据;
    第一解码模块,用于基于接收到的所述第二喷泉码数据中包含的M个编码分组,解码出所述第二喷泉码数据对应的数据;
    其中,M>M’,所述M’为在生成所述第二喷泉码数据过程中将数据进行分组后得到的原始数据分组的数量,所述M’为大于或等于2的整数。
  18. 根据权利要求14~16中任一项所述的装置,其特征在于,还包括:
    所述发送模块,还用于当无法接收到所述终端列表中的终端发送的数据 时,向服务器端发送下载请求,所述下载请求中携带有欲下载文件标识;
    第二接收模块,用于接收所述服务器端发送的所述欲下载文件标识对应的文件数据的喷泉码数据;
    第二解码模块,用于基于接收到的所述文件数据的喷泉码数据中包含的S个编码分组,解码出所述欲下载文件的文件数据;
    其中,S>S’,所述S’为在生成所述文件数据的喷泉码数据过程中将所述欲下载文件的文件数据进行分组后得到的原始数据分组的数量,所述S’为大于或等于2的整数。
  19. 根据权利要求18所述的装置,其特征在于,
    所述第二接收模块,还用于接收所述服务器端发送的调度信息,并根据所述调度信息,向所述调度信息指定的终端发送所述文件数据的喷泉码数据。
  20. 根据权利要求14~16中任一项所述的文件下载装置,其特征在于,还包括:
    第三接收模块,用于接收服务器端发送的查询请求,其中,所述查询请求中携带有欲查询文件标识;
    所述编码模块,还用于当本地存储有所述欲查询文件标识对应的文件数据时,将所述欲查询文件的文件数据进行编码,生成对应的喷泉码数据;
    所述发送模块,还用于向所述服务器端发送所述欲查询文件对应的喷泉码数据。
  21. 根据权利要求14~16中任一项所述的装置,其特征在于,所述发送模块,具体用于采用用户数据报协议UDP向所述终端列表中请求下载所述数据的终端发送所述第一喷泉码数据。
  22. 一种文件下载装置,其特征在于,包括:
    接收模块,用于接收终端发送的下载请求,其中,所述下载请求中携带有所述文件的标识;
    编码模块,用于当网络中不存在存储有所述文件标识对应的文件的终 端,且本地存储所述文件标识对应的文件时,将所述文件中的数据进行编码,生成喷泉码数据,其中,所述喷泉码数据中包含有N个编码分组,N为大于零的整数;
    发送模块,用于向所述终端发送所述N个编码分组。
  23. 根据权利要求22所述的装置,其特征在于,所述编码模块,包括:
    分组单元,用于将所述文件中的数据进行分组,得到K个原始数据分组;
    编码单元,用于对所述K个原始数据分组进行喷泉码编码,生成N个编码分组;
    其中,K为大于或等于2的整数,N为大于零的整数。
  24. 根据权利要求23所述的装置,其特征在于,
    所述发送模块,还用于接收到所述终端发送的反馈信息后,停止向所述终端发送所述N个编码分组;
    其中,所述反馈信息是所述终端在接收到预设数量的所述编码分组后发出的,所述预设数量大于所述K。
  25. 根据权利要求22~24中任一项所述的装置,其特征在于,还包括:
    所述发送模块,还用于当网络中不存在存储有所述文件标识对应的文件的终端,且本地未存储所述文件标识对应的文件时,向网络中的其他终端发送查询请求,其中,所述查询请求中携带有所述文件的文件标识;
    所述接收模块,还用于当所述网络中存在有存储有所述文件的终端时,接收所述终端发送的喷泉码数据;
    解码模块,用于基于接收到的所述喷泉码数据中包含的L个编码分组,解码出所述文件的数据;
    其中,L>K,所述K为在生成所述喷泉码数据过程中将数据进行分组后得到的原始数据分组的数量,所述K为大于或等于2的整数。
  26. 根据权利要求22~24中任一项所述的装置,其特征在于,
    所述发送模块,具体用于采用用户数据报协议UDP向所述终端发送所 述N个编码分组。
  27. 一种文件下载系统,其特征在于,包括上述权利要求14~21中任一项所述的文件下载装置以及上述权利要求22~26中任一项所述的文件下载装置。
  28. 一种终端,其特征在于,包括:
    至少一个处理器;以及,
    与所述至少一个处理器通信连接的存储器;其中,
    所述存储器存储有可被所述一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行权利要求1-8任一所述方法。
  29. 一种服务器,其特征在于,包括:
    至少一个处理器;以及,
    与所述至少一个处理器通信连接的存储器;其中,
    所述存储器存储有可被所述一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行权利要求9-13任一所述方法。
  30. 一种非暂态计算机可读存储介质,其特征在于,所述非暂态计算机可读存储介质存储计算机指令,当所述计算机可执行指令被终端执行时,使所述终端执行权利要求1-8任一所述方法。
  31. 一种非暂态计算机可读存储介质,其特征在于,所述非暂态计算机可读存储介质存储计算机指令,当所述计算机可执行指令被服务器执行时,使所述服务器执行权利要求9-13任一所述方法。
  32. 一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算程序,所述计算机程序包括程序指令,当所述程序指令被终端执行时,使所述终端执行权利要求1-8任一所述方法。
  33. 一种计算机程序产品,所述计算机程序产品包括存储在非暂态 计算机可读存储介质上的计算程序,所述计算机程序包括程序指令,当所述程序指令被服务器执行时,使所述服务器执行权利要求9-13任一所述方法。
PCT/CN2016/101090 2016-06-30 2016-09-30 文件下载方法、装置、终端及服务器 Ceased WO2018000647A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610509196.6A CN105979003A (zh) 2016-06-30 2016-06-30 文件下载方法、装置及系统
CN201610509196.6 2016-06-30

Publications (1)

Publication Number Publication Date
WO2018000647A1 true WO2018000647A1 (zh) 2018-01-04

Family

ID=56953643

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/101090 Ceased WO2018000647A1 (zh) 2016-06-30 2016-09-30 文件下载方法、装置、终端及服务器

Country Status (2)

Country Link
CN (1) CN105979003A (zh)
WO (1) WO2018000647A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110943801A (zh) * 2019-11-13 2020-03-31 哈尔滨工程大学 基于关键信息反馈的数字喷泉码传输方法
CN111597389A (zh) * 2019-02-21 2020-08-28 上海微电子装备(集团)股份有限公司 一种数据的处理方法、装置,设备及存储介质
CN115484253A (zh) * 2022-08-12 2022-12-16 视联动力信息技术股份有限公司 一种数据传输方法、装置、终端设备和存储介质

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105979003A (zh) * 2016-06-30 2016-09-28 乐视控股(北京)有限公司 文件下载方法、装置及系统
CN118715528A (zh) * 2021-12-31 2024-09-27 卡特默瑞有限公司 用于在遗传物质中嵌入数据的设备和方法

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101510783A (zh) * 2009-03-26 2009-08-19 北京理工大学 一种基于有限域的多进制喷泉编码和译码方法
CN101515842A (zh) * 2009-04-03 2009-08-26 北京理工大学 一种基于喷泉编码的部分协作信息传输方法
CN101553036A (zh) * 2009-05-19 2009-10-07 北京理工大学 一种基于喷泉编码的随机接入方法
CN102684817A (zh) * 2011-03-10 2012-09-19 万鑫明 一种基于数字喷泉码的云存储体系结构及服务提供方法
US20140294118A1 (en) * 2013-04-01 2014-10-02 Korea University Research And Business Foundation Apparatus and method for transmitting data using fountain code in wireless communication system
CN105680990A (zh) * 2016-01-13 2016-06-15 北京理工大学 一种基于喷泉编码的区域信息共享方法
CN105979003A (zh) * 2016-06-30 2016-09-28 乐视控股(北京)有限公司 文件下载方法、装置及系统

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103856560B (zh) * 2014-02-19 2017-03-15 东莞中山大学研究院 一种基于编码耦合的p2p流媒体调度系统及方法
CN105262564A (zh) * 2015-09-09 2016-01-20 哈尔滨工业大学深圳研究生院 一种分布式喷泉码的二维度分布设计方法

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101510783A (zh) * 2009-03-26 2009-08-19 北京理工大学 一种基于有限域的多进制喷泉编码和译码方法
CN101515842A (zh) * 2009-04-03 2009-08-26 北京理工大学 一种基于喷泉编码的部分协作信息传输方法
CN101553036A (zh) * 2009-05-19 2009-10-07 北京理工大学 一种基于喷泉编码的随机接入方法
CN102684817A (zh) * 2011-03-10 2012-09-19 万鑫明 一种基于数字喷泉码的云存储体系结构及服务提供方法
US20140294118A1 (en) * 2013-04-01 2014-10-02 Korea University Research And Business Foundation Apparatus and method for transmitting data using fountain code in wireless communication system
CN105680990A (zh) * 2016-01-13 2016-06-15 北京理工大学 一种基于喷泉编码的区域信息共享方法
CN105979003A (zh) * 2016-06-30 2016-09-28 乐视控股(北京)有限公司 文件下载方法、装置及系统

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111597389A (zh) * 2019-02-21 2020-08-28 上海微电子装备(集团)股份有限公司 一种数据的处理方法、装置,设备及存储介质
CN111597389B (zh) * 2019-02-21 2024-02-06 上海微电子装备(集团)股份有限公司 一种数据的处理方法、装置,设备及存储介质
CN110943801A (zh) * 2019-11-13 2020-03-31 哈尔滨工程大学 基于关键信息反馈的数字喷泉码传输方法
CN115484253A (zh) * 2022-08-12 2022-12-16 视联动力信息技术股份有限公司 一种数据传输方法、装置、终端设备和存储介质

Also Published As

Publication number Publication date
CN105979003A (zh) 2016-09-28

Similar Documents

Publication Publication Date Title
US11297140B2 (en) Point of presence based data uploading
EP1612982B1 (en) Content distribution using network coding
US20060224760A1 (en) Method and system for providing streaming content in a peer-to-peer network with network coding
US7702917B2 (en) Data transfer using hyper-text transfer protocol (HTTP) query strings
CN111625593B (zh) 基于区块链的数据处理方法、装置、计算机设备
WO2018000647A1 (zh) 文件下载方法、装置、终端及服务器
WO2018076760A1 (zh) 基于区块链的交易事务处理方法、系统、电子装置及存储介质
CN106603198A (zh) 具有网络编码的区块链分布式存储方法及系统
CN109951546B (zh) 基于智能合约的事务请求处理方法、装置、设备和介质
CN109934691B (zh) 一种竞拍的数据处理方法、竞拍客户端及系统
CN115348278A (zh) 区块链的分布式存储方法
US12199965B2 (en) Quantum block-chained authentication system and methods for data transmission passing through P2P networks
US20240372563A1 (en) Event-driven data transmission using codebooks with protocol adaption
WO2023091903A1 (en) Scalable media file transfer
US8140849B2 (en) Security for network coding file distribution
CN107181774B (zh) 分布式数据中心之间的数据移动
CN112307504B (zh) 一种安全多方计算方法、装置、电子设备及存储介质
WO2017166481A1 (zh) 进行跨区域的文件分享的方法及系统
CN113051456A (zh) 请求处理方法、装置、电子设备和计算机可读介质
CN115118727B (zh) 分布式计算架构的数据传输方法、装置、设备及存储介质
CN117134913A (zh) 一种设备影子的处理方法、装置、电子设备及介质
CN108768952A (zh) 一种流媒体传输方法、客户端、服务器和存储介质
CN114138906A (zh) 交易存储和区块执行方法、设备和存储介质
CN108574882B (zh) 一种视频传输方法和装置
JP6410563B2 (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: 16907043

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

Country of ref document: EP

Kind code of ref document: A1