Android (a) ftp uploading efficient method

I. Introduction

(A) ftp transmission problems:

(1) single-threaded transfer of large files is very limited

Need to re-start after inefficient (2) transmission interrupted

(3) upload the file to the server when only one port operation, resulting in low transmission available.

(B) because the project needs to develop an SDK main features:

1. To provide fast upload and download function

2. Provide upload pictures video thumbnails

3. You can upload the configuration file to the server folder location

4. You can configure the server address port upload account information

5. You can update the file information

6. can batch download, upload, delete files

7. You can simulate folder store

8. Real-time updates transmission schedule and transmission speed

。。。

Today I want to share is how to improve ftp upload speed now, this program is not only for the ftp protocol, other protocols may also be performed in a similar train of thought, before development SDK I also find a lot of information and open source projects, also in my thinking Some share the find, but after extensive inquiries found that we were thinking not only a complete code, after a while I was trying to finally complete implementation of all the program code development, now also has access to several development project.

The following first introduced the idea of ​​the program:

The scheme is also referred to as uploading and downloading sections, the actual raw file is to cut a large number of segments, each segment transmission then all of the fragments with a thread and the like to transmit the command complete all fragments cut before the order can be spliced . In fact, this idea is a very simple file transfer with several threads at the same time, the difficulty of the program is how to slice, how HTTP, how splicing, how to control the entire bulk transfer. . .

As shown in FIG: This figure Upload configuration

Upload and download the same idea, but because of the server upload ftp protocol can not reason while simultaneously writing multiple copies of a file server by a thread, so it is necessary to simultaneously write multiple copies of different files to upload, and all other file transfer the combined first and then send commands to all servers will cut the completed file will merge file in the order of cutting, and other documents the merger is completed and then delete all files dismantled reserved merge files, and all work is completed represent upload will be over.

Android (two) ftp efficient download method: https://blog.csdn.net/zhuxingchong/article/details/87894996

Continued implementation code specific code. . .

 

 

 

Published 92 original articles · won praise 27 · views 90000 +

Guess you like

Origin blog.csdn.net/zhuxingchong/article/details/87867105