Search

CN-115766701-B - Decentralizing downloading method for shared large file

CN115766701BCN 115766701 BCN115766701 BCN 115766701BCN-115766701-B

Abstract

The invention provides a method for decentralizing and downloading shared large files, which comprises the steps of deploying Transmission software in a server and each user terminal, adopting the software in the server to seed files to be downloaded to generate seed files, virtually dividing the files to be downloaded into virtual blocks with equal sizes, writing index information and Hash verification codes of the virtual blocks into the seed files, enabling the user terminals to access the server, adopting the respective Transmission software to analyze the seed files, obtaining the index information and the Hash verification codes, downloading corresponding file fragments from the files to be downloaded, adopting the file fragments as seeds to generate seed fragment files, enabling the user terminals to access other user terminals, analyzing the seed fragment files of other user terminals through the Transmission software of the user terminals, and downloading the corresponding file fragments. The invention extends the uploading from only the server to the user terminal, namely the user terminal is the downloading and is also the uploading, thus realizing the decentralization of the downloading.

Inventors

  • ZHANG HUI
  • LIU JIANBIN
  • XU JINYUAN

Assignees

  • 福建升腾资讯有限公司

Dates

Publication Date
20260508
Application Date
20221009

Claims (7)

  1. 1. The method for decentralizing downloading of the shared large file is characterized by comprising the following steps: S1, deploying a Transmission software in a server and each user terminal, and seeding a file to be downloaded by adopting the Transmission software in the server to generate a seed file; S2, virtually dividing the file to be downloaded into virtual blocks with the same size, and writing index information and Hash verification codes of the virtual blocks into the seed file; S3, the user terminal accesses the server, analyzes the seed file by adopting respective Transmission software, acquires the index information and the Hash verification code, finds the corresponding virtual block according to the index information, downloads the corresponding file fragment from the file to be downloaded according to the Hash verification code, and generates a seed fragment file by seeding the file fragment; S4, the user terminal accesses other user terminals, analyzes the seed fragment files in the other user terminals through the Transmission software of the user terminal and downloads the corresponding file fragments; The step S1 further includes: Deploying OpenTracker software and Apache software in the server, wherein the OpenTracker software is used for providing Tracker services, and the Apache software is used for providing Web services; The steps S2 and S3 further comprise: publishing the seed file to the Tracker service and the Web service; the step S3 specifically comprises the following steps: s31, the server acquires a request for downloading the file to be downloaded, which is initiated by the current user terminal, and returns the seed file to the current user terminal through the Web service; s32, analyzing the seed file by the current user terminal to acquire the index information, the Hash verification code, the Tracker information and the file information; S33, the current user terminal sends a connection request to the Tracker service according to the Tracker information, wherein a request message comprises a Hash check code, and the Hash check code is generated by randomly selecting one from the Hash check codes according to the acquired index information by the current user terminal; S34, the Tracker service finds the corresponding virtual block from the index information through the Hash verification code, acquires the corresponding Hash verification code, analyzes the file information through the Hash verification code, acquires the corresponding file fragment in the file to be downloaded, and sends the file fragment to the current user terminal; S35, the current user terminal acquires the file fragments, and adopts the Transmission software of the current user terminal as seed to generate the seed fragment file.
  2. 2. The method for decentralizing download of a large file as recited in claim 1, wherein the steps S1 and S2 further comprise: and storing the IP addresses and the routing information of the server and the user terminals into the Tracker service.
  3. 3. The method for decentralizing download of a large file as recited in claim 1, wherein the step S2 further comprises: And storing the address information and the service setting information of the Tracker service as Tracker information into the seed file, and calculating the file to be downloaded according to a BitTorrent protocol to obtain file information.
  4. 4. The method for decentralizing download of a large file as recited in claim 1, wherein the step S34 further comprises: And the Tracker service records the file information and the downloading progress of the file fragments downloaded/seeded by the user terminal currently and maps the file information and the downloading progress to the IP address and the routing information of the user terminal.
  5. 5. The method for decentralizing download of a large file as recited in claim 4, wherein the step S4 specifically comprises the steps of: s41, the Tracker service returns a list of other user terminals participating in downloading and seed production to the user terminal currently requesting downloading; S42, the current user terminal sends a request to other user terminals in the list, inquires about downloading/seeding progress, and distributes the downloading tasks of the different file fragments to be downloaded to the corresponding user terminals for parallel downloading according to the returned downloading/seeding progress; S43, each user terminal in the list finishes downloading the corresponding file fragment and seed the file to obtain the seed fragment file, and the seed fragment file is returned to the current user terminal; S44, analyzing the seed fragment files returned from each user terminal in the list by the current user terminal through the Transmission software of the current user terminal, and obtaining the corresponding file fragments.
  6. 6. The method for decentralizing download of a large shared file as recited in claim 1, wherein the files to be downloaded include user shared files, out-link shared files, and group files.
  7. 7. The method of claim 1, wherein the virtual block size is an integer power of 2K.

Description

Decentralizing downloading method for shared large file Technical Field The invention relates to the technical field of file downloading, in particular to a method for decentralizing downloading of a shared large file. Background In cloud document 3.0 service, document data is stored on the server, the server serves as a unique file providing source to provide file downloading service for the terminal, and the specific scheme is shown in fig. 1, and the arrow points to the direction of file stream transmission. However, the server is used as the only provider of file resources, and the terminal downloads large files from the server at the same time, which causes great bandwidth pressure on the server and also has low file downloading efficiency. Disclosure of Invention The invention aims to solve the technical problem of providing a method for decentralizing download of a shared large file, which expands an uploader from a server only to a user terminal, namely the user terminal is a downloader and is an uploader at the same time, thereby realizing decentralization download. In order to solve the technical problems, the invention adopts the following technical scheme: A method for decentralizing and downloading a shared large file comprises the following steps: S1, deploying a Transmission software in a server and each user terminal, and seeding a file to be downloaded by adopting the Transmission software in the server to generate a seed file; S2, virtually dividing the file to be downloaded into virtual blocks with the same size, and writing index information and Hash verification codes of the virtual blocks into the seed file; S3, the user terminal accesses the server, analyzes the seed file by adopting respective Transmission software, acquires the index information and the Hash verification code, finds the corresponding virtual block according to the index information, downloads the corresponding file fragment from the file to be downloaded according to the Hash verification code, and generates a seed fragment file by seeding the file fragment; S4, the user terminal accesses other user terminals, analyzes the seed fragment files in the other user terminals through the Transmission software of the user terminal and downloads the corresponding file fragments. The invention has the beneficial effects that the invention provides a shared large file decentralization downloading method, which comprises the steps of deploying Transmisson software providing BT seed making function in a server and each user terminal, carrying out BT seed making on a complete file to be downloaded in the server to generate a seed file, carrying out virtual partitioning on the file to be downloaded, storing index information of the virtual partitioning and a Hash verification code into the seed file, wherein the index information and the Hash verification code are virtual partitioning, and each actual block file is not generated on a hard disk, so that the seed file can be directly used as an index of the file to be downloaded while the memory occupation of the server is effectively reduced; and then when the user terminal needs to download the file to be downloaded, the seed file is obtained, the file fragments of the file to be downloaded are correspondingly downloaded according to the index information and the Hash verification code, and the downloaded file fragments are respectively subjected to BT (binary tree) seed production by using Transmisson software of the user terminal so as to be shared for other user terminals to download, namely, each user terminal is used as an uploading and downloading person of the file, so that sharing and decentralizing downloading of the file to be downloaded is realized, IO pressure and network bandwidth pressure of a server are greatly reduced, the pressure is dispersed to other user terminals, resources of the user terminal are fully utilized, file downloading efficiency is improved, and downloading time is greatly reduced. Drawings FIG. 1 is a diagram of file transfer in the prior art; FIG. 2 is a flowchart of a method for decentralizing download of a shared large file according to an embodiment of the present invention; FIG. 3 is a flowchart of seed production and release in a method for decentralizing download of shared large files according to an embodiment of the present invention; FIG. 4 is a timing diagram of a user terminal downloading a file segment in a method for decentralizing a shared large file according to an embodiment of the present invention; Fig. 5 is a schematic diagram of file transmission in a method for decentralizing download of a shared large file according to an embodiment of the present invention. Detailed Description In order to describe the technical contents, the achieved objects and effects of the present invention in detail, the following description will be made with reference to the embodiments in conjunction with the accompanying drawings. Before this, t