CN1622553A - Internet standard file transmission protocol based file breakpoint upload method - Google Patents

Internet standard file transmission protocol based file breakpoint upload method Download PDF

Info

Publication number
CN1622553A
CN1622553A CN 200410101648 CN200410101648A CN1622553A CN 1622553 A CN1622553 A CN 1622553A CN 200410101648 CN200410101648 CN 200410101648 CN 200410101648 A CN200410101648 A CN 200410101648A CN 1622553 A CN1622553 A CN 1622553A
Authority
CN
China
Prior art keywords
file
ftp
server
data
ftp server
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.)
Pending
Application number
CN 200410101648
Other languages
Chinese (zh)
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.)
Peking University
Beijing Founder Electronics Co Ltd
Original Assignee
Peking University
Beijing Founder Electronics 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 Peking University, Beijing Founder Electronics Co Ltd filed Critical Peking University
Priority to CN 200410101648 priority Critical patent/CN1622553A/en
Publication of CN1622553A publication Critical patent/CN1622553A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]

Landscapes

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

Abstract

The present invention is one kind of file break-point upload method based on standard Internet file transfer protocol (FTP), belongs to the field of the application of standard Internet FTP. The method of the present invention selects partial content in the file to be uploaded as the file header transmitted to the FTP server before closing the data connection to the server, and then re-forms the data connection with the FTP server to transmit the residual file content block to the server and add to the file in the server. Compared with available technology, the present invention can reduce greatly the loss caused by interruption and re-uploading.

Description

A kind of document breaking point upload method based on the Internet Standard file transfer protocol (FTP)
Technical field
The invention belongs to Internet Standard file transfer protocol (FTP) application, be specifically related to a kind of document breaking point upload method based on the Internet Standard file transfer protocol (FTP).
Background technology
FTP (File Transfer Protocol) is normative document host-host protocol (RFC959), be at TCP (Transmission Control Protocol, transmission control protocol)/IP (InternetProtocol, Internet Protocol) a kind of public standard agreement of transfer files in the environment, generally the application layer at OSI/RM (Open Systems Interconnection Reference Model, Open System Interconnection reference model) realizes.FTP is the main method of shared file and transfer files on the present internet, by the application of FTP, can easily telefile be conducted interviews and manage, and provide the agreement support for high-efficiency reliable transfer files between the network host.File Transfer Protocol provides the basic command of a REST by name to support the follow-up biography of interruption of file download process, but does not provide the file loading process to interrupt the basic command of follow-up biography.
The File Transfer Protocol model is a kind of typical C/S (Client-Server, client-server) structure, is made of one or more ftp clients and a ftp server, and concrete structure as shown in Figure 1.Will set up two kinds during swap file between ftp client and the ftp server and be connected, a kind of is that order connects, and another kind is that data connect.It is both sides' communication and the channel that exchanges that order connects, and the response message that FTP basic command that client is sent and server return transmits by this channel.It is that both sides carry out the channel that file transmits that data connect, upload or the downloaded files data transmit by this channel, factor is divided into aggressive mode and Passive Mode with the file transfer mode again according to the difference that connects the initiator simultaneously, aggressive mode is meant that initiating data by ftp server connects, and Passive Mode is meant that initiating data by ftp client connects.
File Transfer Protocol provides tens basic commands to be used for the control between ftp client and the ftp server and alternately, these basic commands comprise USER, PASS, PORT, PASV, STOR, STOU, APPE, RETR, REST or the like.The order that ftp client sends all transmits in order is connected with the information that ftp server is replied, and follows request-response mechanism, and its basic reciprocal process is summarized as follows:
(1) ftp client sends basic FTP control command to ftp server;
(2) ftp server is at first carried out this order, and the execution result with order returns to ftp client then;
(3) execution result information returned of ftp client resolution server, and then determine next step operation.
The file loading process that present widely used ftp client is realized is an example with passive transmission mode, the active transmission mode class seemingly, principle is identical, concrete steps are as follows:
(1) ftp client utilizes socket (Socket) to be connected with ICP/IP protocol and target ftp server foundation order;
(2) ftp client sends FTP user's name, command format be USER xxxx r n, xxxx is meant user name herein;
(3) ftp client sends FTP user's password, command format be PASS xxxx r n, xxxx is meant user cipher herein;
(4) ftp client is provided with data transfer format, if with binary format transmit file order be TYPE i r n;
(5) ftp client send PASV r the n order, and from the answer of ftp server, retrieve the IP address and the interim open port numbers of server;
(6) ftp client send STOR xxxx r the n order, wherein the parameter x xxx of STOR back is meant the filename that will create on server;
(7) ftp client is created a socket (Socket) again, utilizes ftp server returns in the step (5) IP address and transient port number to set up data with server and is connected;
(8) ftp client utilizes the data connection that local file is sent on the ftp server, closes this data after file transmits and finishes and connects;
(9) the ftp client shutdown command connects, and so far a file loading process finishes.
Fig. 2 has provided the file loading process that present widely used ftp client is realized.
Can finish the function of file loading under the situation that above-mentioned present general ftp file upload method is enough stable at network, network speed is enough fast and file size is moderate smoothly, if but in the process that file transmits, interrupt because of various reasons, then ftp server can be deleted the blocks of files that uploads on the server as illegal file, therefore can't recover the interrupt spot, so just have to upload again whole file next time.Because Internet environment is very complicated, the also faster or slower of speed that different user enters the Internet, and the file uploaded of user is very big sometimes, therefore use the possibility that interruption takes place in the method transport process that general ftp file is uploaded at present also just very big, but in have no progeny and must upload whole file again, therefore make troubles to the Internet user, particularly in the internet environment complexity, easily interrupt, data transmission bauds is slow and transmit under the situation that file is huge, the transmission time is long, this deficiency embodies more obviously.
Do not find any relevant documentation, document, patent at present, write down the breakpoint upload method of describing among the present invention.
Summary of the invention
At the defective that exists in the prior art, the objective of the invention is to utilize existing File Transfer Protocol basic command and specific control technology, realize the function that ftp client still can continue to upload next time from breakpoint when a preceding file loading process is interrupted.
For reaching above purpose, the technical solution used in the present invention is: a kind of document breaking point upload method based on the Internet Standard file transfer protocol (FTP) may further comprise the steps:
(1) ftp client utilizes socket to be connected with ICP/IP protocol and target ftp server foundation order;
(2) ftp client successively sends username and password to ftp server, thus the login ftp server;
(3) after the login, the ftp client data transfer format is set to binary format;
(4) ftp client is a Passive Mode with data transmission mode setting, and retrieves the interim open port numbers that data are connected that is used to set up of the IP address of ftp server and its from the return information of ftp server;
(5) ftp client sends a file loading order to ftp server;
(6) ftp client is created a socket again, utilizes ftp server returns in this socket and the step (4) IP address and transient port number to set up data with ftp server and is connected;
(7) set up after the data connection, ftp client selects partial content as file header earlier from the file that needs are uploaded, send it to the ftp server end, closing these data then connects, server can be thought that current file has normally transmitted and was through with this moment, thereby can be kept at server end to this document head as legitimate files, the file that is equivalent to upload has stayed a counterfoil on ftp server, upload for follow-up file appending and possible breakpoint to lay the foundation; Transmitting file header another one reason to ftp server is that the FTP basic agreement is not provided at the basic command that the ftp server end is created empty file; If interrupt when transmitting file header, then need to upload again this document head, but because file header is very little, so even the consumed time that retransfers also can ignore;
(8) repeating step (3) and step (4);
(9) ftp client sends the order of appending file upload to ftp server, and filename herein is identical with filename in the step (5);
(10) ftp client is created a socket again, utilizes to set up data once more between ftp server returns in this socket and the step (8) IP address and transient port number and the ftp server and be connected;
(11) ftp client is divided into several blocks of files with file body, file body is meant that the file that need upload removes part remaining behind the file header, then blocks of files is sent to server end and is appended in the file that is present in ftp server, all divide block movement to finish until the residue content, closing these data then connects, if when piecemeal append file body, interrupt, need upload the blocks of files that interruption takes place this moment again, but because the time that a just fritter file of loss transmits, so also can ignore the influence of whole file;
(12) the ftp client shutdown command connects, and so far a file loading process finishes.
Further, the data-transmission mode of ftp client also can be set to aggressive mode in the step (4), and other steps are the same.
In the step (7) selected file header size for the 0.1k byte to the 1k byte, when in the step (11) file body being carried out piecemeal, the big or small 1k byte of each blocks of files arrives the 16k byte.
Effect of the present invention is: can drop to the loss that repeats to upload that is caused owing to interruption in the document transmission process minimum in the breakpoint transmission in ftp client realization file loading process under the prerequisite that does not change existing File Transfer Protocol.
Description of drawings
Fig. 1 is a File Transfer Protocol model schematic diagram;
Fig. 2 is the current ftp client file loading realization flow figure that generally uses;
Fig. 3 is the applied ftp client file loading of the present invention realization flow figure;
Fig. 4 is that the applied ftp client of the present invention interrupts the realization flow figure that laggard style of writing part breakpoint is uploaded.
Embodiment
Below in conjunction with accompanying drawing the present invention being done a description that goes on foot, is example with the Passive Mode, and aggressive mode is similar, and the principle of the two is consistent:
(1) if carrying out the implementation process that ftp file uploads, ftp client utilization the present invention is described in detail as follows:
1) ftp client is created local socket, uses the open port of ICP/IP protocol and target ftp server, and the general acquiescence of port is 21, also may be other, sets up order and connects;
2) ftp client successively send USER xxxx r n and PASS xxxx r the n order username and password is sent to the ftp server end with the login ftp server, herein USER xxxx r xxxx in the n order be meant user name, PASS xxxx r xxxx in the n order be meant user cipher;
3) after the login, ftp client is used the TYPE order data transfer format is set, if with binary format transmit file the order of sending be TYPE i r n;
4) ftp client send PASV r the n order, treat ftp server provide reply that the back retrieves from return information that the IP address of ftp server and its open temporarily be used to set up the port numbers that data are connected;
5) ftp client sends STOR xxxx r n order, shows to ftp server and will initiate the file loading process one time, and the parameter x xxx of STOR back is meant the filename that will create on server;
6) ftp client is created a socket again, utilizes ftp server returns in the step 4) IP address and transient port number to be connected with setting up data between this socket and the server;
7) ftp client elder generation taking-up size from the file that needs are uploaded is the file header of 1K byte, then this document head data is utilized data to connect and is sent to the ftp server end, closes this data then and connects.If desired the actual volume of file upload smaller or equal to the 1K byte then file uploaded and finished, directly jump to step 13); If the file volume is greater than the 1K byte, because connecting, data normally closed by client, therefore service end just thinks that file uploaded end, so also normally closed the file part that uploads on the server, though at this file of ftp client is imperfect, disabled, but at this file of ftp server is complete, legal, the file that is equivalent to be uploaded has stayed a counterfoil on ftp server, upload for follow-up file appending and possible breakpoint to lay the foundation;
8) ftp client sends the TYPE order once more data transfer format is set, and step is with 3);
9) ftp client send once more PASV T n order and get access to IP address and the interim open port numbers that ftp server returns, step is with 4);
10) ftp client sends APPE xxxx r n order, shows to ftp server and will initiate the process that file appending is uploaded, and the parameter x xxx of APPE back is meant filename, and this document name is identical with filename in the step 5);
11) ftp client is created a socket again, utilizes ftp server returns in the step 9) IP address and transient port number to be connected with setting up data between this socket and the server;
12) ftp client is that unit is divided into several blocks of files with file body with the 16K byte, file body is meant that the file that need upload removes the part of file header remainder, then blocks of files is utilized the data of setting up in the step 11) to connect data are sent to the ftp server end, all data until file body all transmit end, close these data this moment and connect;
13) the ftp client shutdown command connects, and so far a file loading process finishes.
Said process specific implementation flow chart is referring to Fig. 3.
(2), can realize as follows that then the breakpoint of file uploads if ftp client is adopting the present invention to carry out interrupting in the process of file upload:
1) ftp client is created local socket, uses the open port of ICP/IP protocol and target ftp server, and the general acquiescence of port is 21, also may be other, sets up order and connects;
2) ftp client successively send USER xxxx r n and PASS xxxx r the n order username and password is sent to the ftp server end with the login ftp server, herein USER xxxx r xxxx in the n order be meant user name, PASS xxxx r xxxx in the n order be meant user cipher;
3) if last the interruption occurs in the process of file upload head, the whole file that then retransfers, realization flow is seen Fig. 3;
4) if last interrupt occurring in the process that the file body piecemeal appends, then ftp client at first to ftp server send SIZE xxxx r the n order, xxxx need carry out the filename that breakpoint is uploaded herein, from the information that ftp server returns, retrieve file destination then and uploaded to file volume on the server, suppose that this volume is the X byte;
5) ftp client is used the TYPE order data transfer format is set, if with binary format transmit file the order of sending be TYPE i r n;
6) ftp client send PASV r the n order, treat ftp server provide reply that the back retrieves from return information that the IP address of ftp server and its open temporarily be used to set up the port numbers that data are connected;
7) ftp client sends APPE xxxx r n order, and xxxx need carry out the filename that breakpoint is uploaded herein, shows to ftp server and will initiate the process that file appending is uploaded;
8) ftp client is created a socket again, utilizes ftp server returns in the step 6) IP address and transient port number to be connected with setting up data between this socket and the server;
9) ftp client the X numerical value that obtains in the step 4) as the document misregistration value, the file read pointer of local file is displaced to X byte place, be that unit continues from file reading of data and utilize the data of setting up in the step 8) to connect data are sent to the ftp server end with the 16K byte then, all remaining datas until file all transmit end, close these data this moment and connect;
10) the ftp client shutdown command connects, and so far the breakpoint upload process of a file finishes.
Above-mentioned document breaking point upload process flow chart is referring to Fig. 4.

Claims (4)

1. document breaking point upload method based on the Internet Standard file transfer protocol (FTP) may further comprise the steps:
(1) ftp client utilizes socket to be connected with ICP/IP protocol and target ftp server foundation order;
(2) ftp client successively sends username and password to ftp server, thus the login ftp server;
(3) after the login, the ftp client data transfer format is set to binary format;
(4) ftp client is a Passive Mode with data transmission mode setting, and retrieves the interim open port numbers that data are connected that is used to set up of the IP address of ftp server and its from the return information of ftp server;
(5) ftp client sends a file loading order to ftp server;
(6) ftp client is created a socket again, utilizes ftp server returns in this socket and the step (4) IP address and transient port number to set up data with ftp server and is connected;
(7) set up after the data connection, ftp client selects partial content as file header earlier from the file that needs are uploaded, and sends it to the ftp server end, closes this data then and connects;
(8) repeating step (3) and step (4);
(9) ftp client sends the order of appending file upload to ftp server, and filename herein is identical with filename in the step (5);
(10) ftp client is created a socket again, utilizes to set up data once more between ftp server returns in this socket and the step (8) IP address and transient port number and the ftp server and be connected;
(11) ftp client is divided into several blocks of files with file body, file body is meant that the file that need upload removes part remaining behind the file header, then blocks of files is sent to server end and is appended in the file that is present in ftp server, all divide block movement to finish until the residue content, closing these data then connects, if when piecemeal append file body, interrupt, need upload the blocks of files that interruption takes place this moment again, but because the time that a just fritter file of loss transmits, so also can ignore the influence of whole file;
(12) the ftp client shutdown command connects, and so far a file loading process finishes.
2. a kind of document breaking point upload method based on the Internet Standard file transfer protocol (FTP) as claimed in claim 1 is characterized in that: the data-transmission mode of ftp client also can be set to aggressive mode in the step (4), and other steps are the same.
3. a kind of document breaking point upload method based on the Internet Standard file transfer protocol (FTP) as claimed in claim 1 or 2 is characterized in that: selected file header size arrives the 1k byte for the 0.1k byte in the step (7).
4. a kind of document breaking point upload method based on the Internet Standard file transfer protocol (FTP) as claimed in claim 3 is characterized in that: when in the step (11) file body being carried out piecemeal, the size of each blocks of files for the 1k byte to the 16k byte.
CN 200410101648 2004-12-20 2004-12-20 Internet standard file transmission protocol based file breakpoint upload method Pending CN1622553A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200410101648 CN1622553A (en) 2004-12-20 2004-12-20 Internet standard file transmission protocol based file breakpoint upload method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200410101648 CN1622553A (en) 2004-12-20 2004-12-20 Internet standard file transmission protocol based file breakpoint upload method

Publications (1)

Publication Number Publication Date
CN1622553A true CN1622553A (en) 2005-06-01

Family

ID=34766786

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200410101648 Pending CN1622553A (en) 2004-12-20 2004-12-20 Internet standard file transmission protocol based file breakpoint upload method

Country Status (1)

Country Link
CN (1) CN1622553A (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101951410A (en) * 2010-10-13 2011-01-19 国电南瑞科技股份有限公司 Method for automatically and remotely upgrading embedded terminal
CN102096772A (en) * 2011-01-30 2011-06-15 北京恒华伟业科技股份有限公司 Smart client system of power transmission and transformation project
CN101064910B (en) * 2006-04-24 2011-08-31 上海信息安全基础设施研究中心 Call control based terminal-to-terminal breakpoint transmission method
CN102291443A (en) * 2011-08-02 2011-12-21 杭州士兰微电子股份有限公司 Method for processing application layer data in embedded network communication
CN102421090A (en) * 2010-09-28 2012-04-18 上海实龙电力设备有限公司 Software updating method of wireless communication product
CN102497395A (en) * 2011-11-30 2012-06-13 北京京航计算通讯研究所 Breakpoint unloading application control method
CN102789477A (en) * 2011-05-19 2012-11-21 巴比禄股份有限公司 File managing apparatus for processing an online storage service
CN102801754A (en) * 2011-05-24 2012-11-28 英业达集团(天津)电子技术有限公司 Method and system for breakpoint transmission
CN101453478B (en) * 2007-11-28 2013-07-03 新奥特(北京)视频技术有限公司 Integrity checking method in document transmission
CN103684712A (en) * 2012-09-14 2014-03-26 百度在线网络技术(北京)有限公司 Method, device and network disc for quickly resuming file transmission
CN105187509A (en) * 2015-08-13 2015-12-23 深圳市广和通无线股份有限公司 Method for uploading data of wireless communication module supporting continuous transmission
CN106254507A (en) * 2016-08-29 2016-12-21 苏州蓝海彤翔系统科技有限公司 File transfer control method and system
CN109286688A (en) * 2018-11-28 2019-01-29 深圳市元征科技股份有限公司 A kind of data download method and device

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101064910B (en) * 2006-04-24 2011-08-31 上海信息安全基础设施研究中心 Call control based terminal-to-terminal breakpoint transmission method
CN101453478B (en) * 2007-11-28 2013-07-03 新奥特(北京)视频技术有限公司 Integrity checking method in document transmission
CN102421090A (en) * 2010-09-28 2012-04-18 上海实龙电力设备有限公司 Software updating method of wireless communication product
CN101951410A (en) * 2010-10-13 2011-01-19 国电南瑞科技股份有限公司 Method for automatically and remotely upgrading embedded terminal
CN102096772A (en) * 2011-01-30 2011-06-15 北京恒华伟业科技股份有限公司 Smart client system of power transmission and transformation project
CN102096772B (en) * 2011-01-30 2012-11-21 北京恒华伟业科技股份有限公司 Smart client system of power transmission and transformation project
CN102789477A (en) * 2011-05-19 2012-11-21 巴比禄股份有限公司 File managing apparatus for processing an online storage service
CN102801754A (en) * 2011-05-24 2012-11-28 英业达集团(天津)电子技术有限公司 Method and system for breakpoint transmission
CN102291443A (en) * 2011-08-02 2011-12-21 杭州士兰微电子股份有限公司 Method for processing application layer data in embedded network communication
CN102497395A (en) * 2011-11-30 2012-06-13 北京京航计算通讯研究所 Breakpoint unloading application control method
CN103684712A (en) * 2012-09-14 2014-03-26 百度在线网络技术(北京)有限公司 Method, device and network disc for quickly resuming file transmission
CN103684712B (en) * 2012-09-14 2017-04-05 百度在线网络技术(北京)有限公司 Method, device and Dropbox that the fast quick-recovery of file is retransmitted
CN105187509A (en) * 2015-08-13 2015-12-23 深圳市广和通无线股份有限公司 Method for uploading data of wireless communication module supporting continuous transmission
CN106254507A (en) * 2016-08-29 2016-12-21 苏州蓝海彤翔系统科技有限公司 File transfer control method and system
CN109286688A (en) * 2018-11-28 2019-01-29 深圳市元征科技股份有限公司 A kind of data download method and device

Similar Documents

Publication Publication Date Title
CN1622553A (en) Internet standard file transmission protocol based file breakpoint upload method
CN1969525A (en) Communication server, method and systems, for reducing transportation volumes over communication networks
CN1922826A (en) Tunneling service method and system
CN1881916A (en) Method and apparatus for realizing communication between communication equipments
CN1968227A (en) System and method for enabling wireless access gateway to support transparent agent
CN1494296A (en) Defining network path transmission unit
CN1921438A (en) Method for realizing acceleration between networks by using proxy
CN101068155A (en) Coordinate connection stream media direct broadcasting system and collection server thereof
CN1242548A (en) Quality of service improvement of internet real-time media transmission by transmitting redundant voice/media frames
CN1881945A (en) Improved distributed kernel operating system
CN101136929B (en) Internet small computer system interface data transmission method and apparatus
CN101064890A (en) Mobile terminal and method for transmitting voice message during use of mobile messenger service
CN101035140A (en) File transmission system based on the SIP and MSRP and its method
CN1745533A (en) Transmission control method in an ARQ system
CN1926840A (en) Address and port number abstraction when setting up a connection between at least two computational devices
CN1742469A (en) Methods and devices for transmitting data between storage area networks
CN1115843C (en) Radio data communication equipment and its method
CN1633796A (en) Modifications to TCP/IP for broadcast or wireless networks
CN1788420A (en) Arrangement for application message decompression
CN1741504A (en) Flow controlling method based on application and network equipment for making applied flow control
CN1758654A (en) Method for set-up direct link tunnel for user terminal and its communication method and server
CN1875573A (en) System for providing tunnel service capable of data communication between different types of networks
CN1208936C (en) Data transmitting appts. and data receiving appts.
CN105357302A (en) Method and device for breakpoint transmission of network data packages
CN1933451A (en) Interplate communicating method and interface plate

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Open date: 20050601