CN107707590A - System, the method and device of data transfer - Google Patents

System, the method and device of data transfer Download PDF

Info

Publication number
CN107707590A
CN107707590A CN201610649622.6A CN201610649622A CN107707590A CN 107707590 A CN107707590 A CN 107707590A CN 201610649622 A CN201610649622 A CN 201610649622A CN 107707590 A CN107707590 A CN 107707590A
Authority
CN
China
Prior art keywords
data
file
upload
interruption position
client
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
CN201610649622.6A
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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201610649622.6A priority Critical patent/CN107707590A/en
Publication of CN107707590A publication Critical patent/CN107707590A/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 discloses a kind of system of data transfer, method and device, is related to Internet technical field, can solve the problem that in existing upload file processes the problem of wasting flow, upper transfer efficiency is low be present.The system of the present invention includes:Client and server;Wherein, the client, which is used to obtain, uploads interruption position, and the original position of this data to be uploaded is determined according to the upload interruption position, carries the original position and continues upper transmitting file from the original position;The server is used to receive the original position that the client continues data and this upload data uploaded according to the upload interruption position, and according to the original position and the data message received, shortage of data scope is determined, the shortage of data scope is sent to the client;The client is additionally operable to receive the shortage of data scope that the server is sent, and uploads missing data corresponding to the shortage of data scope to the server.

Description

System, the method and device of data transfer
Technical field
The present invention relates to Internet technical field, more particularly to a kind of system of data transfer, method and device.
Background technology
With the development of Internet technology, people can not only be such as clear from the data that interconnection net side quick obtaining needs Look at webpage, download file and viewing video etc., additionally it is possible to upload data to interconnection net side, realize resource-sharing, such as upload Video of paper, the instrument oneself write and shooting etc.., usually can be because on user end to server during transmitting file The reason such as exhaust for network failure, terminal power to occur to upload the phenomenon interrupted, it is therefore desirable to carry out from file beginning again Pass, upload less efficient.
In order to improve transfer efficiency on file, prior art proposes a kind of method of breakpoint transmission:Before file upload, Client is first cut into slices file, is then started a thread order and is uploaded file fragmentation, or starts multiple threads simultaneously Upload different file fragmentations;It is normal in network recovery if network interruption occurs during some file fragmentation is uploaded Afterwards, the file fragmentation for interrupting and being uploaded when occurring is uploaded again, without having uploaded successful file fragmentation, so as to reduce The data volume of re-transmission, and then improve transfer efficiency on file.However, the file point uploaded during due to being interrupted for network Piece, a part of data may be successfully uploaded, so when being retransmitted to whole file fragmentation, partial data weight be present Situation about uploading again.Therefore, the mode of existing breakpoint transmission is still in the presence of the low phenomenon of transfer efficiency on waste flow, file.
The content of the invention
In view of this, the present invention provides a kind of system of data transfer, method and device, can solve the problem that existing upper transmitting file During exist and waste flow, the problem of upper transfer efficiency is low.
In a first aspect, the invention provides a kind of system of data transfer, the system includes:Client and server; Wherein,
If the client is used to communicate to connect during upper transmitting file to interrupt, according to the data sent Information, it is determined that upload interruption position, and after the communication connection recovers normal, the upload interruption position is carried from described The disconnected opening position of crossing continues to upload the file;
Interrupted if the server is used for the communication connection during the file is received, basis has connect The data message of receipts, it is determined that receiving interruption position, and after the communication connection recovers normal, receive the upload interruption position And continue the file uploaded at the upload interruption position;
The server is additionally operable to, according to the reception interruption position and the upload interruption position, judge whether Uploaded but do not uploaded successful missing data, if missing data be present, according to it is described reception interruption position and it is described on The shortage of data scope that interruption position determines missing data is passed, the shortage of data scope is sent to the client;
The client is additionally operable to receive the shortage of data scope, and uploads the shortage of data model to the server Enclose corresponding missing data.
Second aspect, the invention provides a kind of method of data transfer, methods described is applied to server side, the side Method includes:
After communication connection is established with client, the file that the client uploads is received;
If the communication connection is interrupted during the file is received, the data message that basis has received, It is determined that receive interruption position;
After the communication connection recovers normal, upload interruption position that the client uploads is received and from described The disconnected opening position of crossing continues the file uploaded, and the upload interruption position is that the client is true according to the data message sent Position fixed, corresponding with the reception interruption position;
According to the reception interruption position and the upload interruption position, judge whether to have uploaded but do not upload into The missing data of work(;
If missing data be present, missing data is determined according to the reception interruption position and the upload interruption position Shortage of data scope;
The shortage of data scope is sent to the client, so that the client is according to the shortage of data scope Upload the missing data.
The third aspect, the invention provides a kind of method of data transfer, methods described is applied to client-side, the side Method includes:
After communication connection is established with server, to the server up transfer file;
If the communication connection is interrupted during the file is uploaded, the data message that basis has been sent, It is determined that upload interruption position;
After the communication connection recovers normal, carry the upload interruption position and continue at the upload interruption position Upload the file;
Receive number that the server is sent, being determined according to the upload interruption position and the data message received According to range of loss;
Missing data corresponding to the shortage of data scope is uploaded to the server.
Fourth aspect, the invention provides a kind of device of data transfer, described device is applied to server side, the dress Put including:
Receiving unit, for after communication connection is established with client, receiving the file that the client uploads;
Determining unit, for the communication connection to be interrupted during the file is received when the receiving unit When, according to the data message received, it is determined that receiving interruption position;
The receiving unit, it is additionally operable to after the communication connection recovers normal, receives the upload that the client uploads Interruption position and the file for continuing upload at the upload interruption position, the upload interruption position is the client root Position being determined according to the data message sent, corresponding with the reception interruption position;
Judging unit, for according to the reception interruption position and the upload interruption position, judging whether Upload but do not upload successful missing data;
The determining unit, it is additionally operable to when the judged result of the judging unit is has missing data, according to described Receive interruption position and the shortage of data scope for uploading interruption position and determining missing data;
Transmitting element, the shortage of data scope for the determining unit to be determined are sent to the client, with Toilet states client and uploads the missing data according to the shortage of data scope.
5th aspect, the invention provides a kind of device of data transfer, described device is applied to client-side, the dress Put including:
Uploading unit, for server establish communication connection after, to the server up transfer file;
Determining unit, for the communication connection to be interrupted during the file is uploaded when the uploading unit When, according to the data message sent, it is determined that uploading interruption position;
The uploading unit is additionally operable to after the communication connection recovers normal, carries the upload interruption position from described Upload and continue to upload the file at interruption position;
Receiving unit, for receive it is that the server is sent, according to the upload interruption position and the number received It is believed that the shortage of data scope that breath determines;
The uploading unit is additionally operable to the shortage of data scope for uploading the receiving unit to the server and receiving Corresponding missing data.
6th aspect, the invention provides a kind of system of data transfer, the system includes:Client and server; Wherein,
The client, which is used to obtain, uploads interruption position, and determines this number to be uploaded according to the upload interruption position According to original position, carry the original position and continue upper transmitting file from the original position;
The server is used to receive data and sheet that the client continues to upload according to the upload interruption position The secondary original position for uploading data, and according to the original position and the data message received, shortage of data scope is determined, The shortage of data scope is sent to the client;
The client is additionally operable to receive the shortage of data scope that the server is sent, and uploads institute to the server State missing data corresponding to shortage of data scope.
7th aspect, the invention provides a kind of method of data transfer, methods described is applied to server side, the side Method includes:
Receive client and continue the data of upload and the original position of this upload data according to interruption position is uploaded;
According to the original position and the data message received, shortage of data scope is determined;
The shortage of data scope is sent to the client, so that the client is according to the shortage of data scope Upload missing data.
Eighth aspect, the invention provides a kind of method of data transfer, methods described is applied to client-side, the side Method includes:
Obtain and upload interruption position;
The original position of this data to be uploaded is determined according to the upload interruption position;
Carry the original position and continue upper transmitting file from the original position;
The shortage of data scope that the reception server is sent;
Missing data corresponding to the shortage of data scope is uploaded to the server.
9th aspect, the invention provides a kind of device of data transfer, described device is applied to server side, the dress Put including:
Receiving unit, the data and this upload data for continuing to upload according to interruption position is uploaded for receiving client Original position;
Determining unit, for the original position received according to the receiving unit and the data message received, Determine shortage of data scope;
Transmitting element, the shortage of data scope for the determining unit to be determined are sent to the client, with Toilet states client and uploads missing data according to the shortage of data scope.
Tenth aspect, the invention provides a kind of device of data transfer, described device is applied to client-side, the dress Put including:
Acquiring unit, interruption position is uploaded for obtaining;
Determining unit, the upload interruption position for being obtained according to the acquiring unit determine this data to be uploaded Original position;
Uploading unit, continue for carrying the original position that the determining unit obtains from the original position Transmitting file;
Receiving unit, the shortage of data scope sent for the reception server;
The uploading unit is additionally operable to the shortage of data scope for uploading the receiving unit to the server and receiving Corresponding missing data.
Tenth on the one hand, and the invention provides a kind of system of data transfer, the system includes:Client and service Device;Wherein,
The server is used to, according to receiving interruption position and uploading interruption position, judge whether to have uploaded but not Successful missing data is uploaded, if missing data be present, according to the reception interruption position and the upload interruption position The shortage of data scope of missing data is determined, and the shortage of data scope is sent to the client;
The client is used to receive the shortage of data scope, and uploads the shortage of data scope to the server Corresponding missing data.
12nd aspect, the invention provides a kind of method of data transfer, methods described is applied to server side, described Method includes:
According to receiving interruption position and uploading interruption position, judge whether to have uploaded but do not upload successful missing Data;
If missing data be present, missing data is determined according to the reception interruption position and the upload interruption position Shortage of data scope;
The shortage of data scope is sent to client, so that the client uploads according to the shortage of data scope The missing data.
13rd aspect, the invention provides a kind of method of data transfer, methods described is applied to client-side, described Method includes:
The shortage of data scope that the reception server is sent;
Missing data corresponding to the shortage of data scope is uploaded to the server.
Fourteenth aspect, the invention provides a kind of device of data transfer, described device is applied to server side, described Device includes:
Judging unit, for according to receiving interruption position and uploading interruption position, judging whether to have uploaded but not Upload successful missing data;
Determining unit, for when the judging unit judged result for missing data be present when, according in the reception Disconnected position and the shortage of data scope for uploading interruption position and determining missing data;
Transmitting element, the shortage of data scope for the determining unit to be determined is sent to client, with toilet State client and the missing data is uploaded according to the shortage of data scope.
15th aspect, the invention provides a kind of device of data transfer, described device is applied to client-side, described Device includes:
Receiving unit, the shortage of data scope sent for the reception server;
Uploading unit, for uploading missing data corresponding to the shortage of data scope to the server.
By above-mentioned technical proposal, system, the method and device of data transfer provided by the invention, can be obtained by client Take and upload interruption position, and the original position of this data to be uploaded is determined according to the upload interruption position, carry the start bit Put from the original position and continue upper transmitting file;Continue what is uploaded according to the upload interruption position when server receives client After the original position of data and this upload data, server can be believed according to the original position and the data received Breath, determines shortage of data scope, and shortage of data scope is sent into client, so that client is according in shortage of data scope Pass missing data.It follows that the whole file uploaded when being interrupted with needing again uplink to be connected in the prior art Burst is compared, and client of the invention only need to again upload and upload but not upload successful data, on again Biography has uploaded successful any data, so as to reduce the data volume of re-transmission, and so that is not present in the data that server receives The data repeated, and then save flow, improve the efficiency of file upload.
Described above is only the general introduction of technical solution of the present invention, in order to better understand the technological means of the present invention, And can be practiced according to the content of specification, and in order to allow above and other objects of the present invention, feature and advantage can Become apparent, below especially exemplified by the embodiment of the present invention.
Brief description of the drawings
By reading the detailed description of hereafter preferred embodiment, it is various other the advantages of and benefit it is common for this area Technical staff will be clear understanding.Accompanying drawing is only used for showing the purpose of preferred embodiment, and is not considered as to the present invention Limitation.And in whole accompanying drawing, identical part is denoted by the same reference numerals.In the accompanying drawings:
Fig. 1 shows a kind of system schematic of data transfer provided in an embodiment of the present invention.
Fig. 2 shows a kind of flow chart of the method for data transfer provided in an embodiment of the present invention;
Fig. 3 shows the flow chart of the method for another data transfer provided in an embodiment of the present invention;
Fig. 4 shows a kind of interaction figure of the method for data transfer provided in an embodiment of the present invention;
Fig. 5 shows the breakpoint transmission schematic diagram provided in the prior art;
Fig. 6 shows breakpoint transmission schematic diagram provided in an embodiment of the present invention;
Fig. 7 shows a kind of composition frame chart of the device of data transfer provided in an embodiment of the present invention;
Fig. 8 shows the composition frame chart of the device of another data transfer provided in an embodiment of the present invention;
Fig. 9 shows the composition frame chart of the device of another data transfer provided in an embodiment of the present invention;
Figure 10 shows the composition frame chart of the device of another data transfer provided in an embodiment of the present invention;
Figure 11 shows the flow chart of the method for another data transfer provided in an embodiment of the present invention;
Figure 12 shows the flow chart of the method for another data transfer provided in an embodiment of the present invention;
Figure 13 shows the composition frame chart of the device of another data transfer provided in an embodiment of the present invention;
Figure 14 shows the composition frame chart of the device of another data transfer provided in an embodiment of the present invention;
Figure 15 shows the composition frame chart of the device of another data transfer provided in an embodiment of the present invention;
Figure 16 shows the flow chart of the method for another data transfer provided in an embodiment of the present invention;
Figure 17 shows the flow chart of the method for another data transfer provided in an embodiment of the present invention;
Figure 18 shows the composition frame chart of the device of another data transfer provided in an embodiment of the present invention;
Figure 19 shows the composition frame chart of the device of another data transfer provided in an embodiment of the present invention.
Embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although the disclosure is shown in accompanying drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here Limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure Completely it is communicated to those skilled in the art.
The embodiments of the invention provide a kind of system of data transfer, as shown in figure 1, system includes:The kimonos of client 11 Business device 12;Wherein,
If client 11 is used to communicate to connect during upper transmitting file to interrupt, according to the data letter sent Breath, it is determined that upload interruption position, and after communication connection recovers normal, carry upload interruption position from upload at interruption position after Continuous upper transmitting file;
If server 12 is used to communicate to connect during file is received to interrupt, according to the data letter received Breath, it is determined that receive interruption position, and after communication connection recovers normal, receive and upload interruption position and from uploading interruption position Continue the file uploaded in place;
Server 12 is additionally operable to, according to receiving interruption position and uploading interruption position, judge whether to have uploaded but not Successful missing data is uploaded, if missing data be present, missing is determined according to receiving interruption position and uploading interruption position The shortage of data scope of data, shortage of data scope is sent to client 11;
Client 11 is additionally operable to receive shortage of data scope, and uploads missing corresponding to shortage of data scope to server 12 Data.
The system of data transfer provided by the invention, can be after server and client establish communication connection, server Receive the file that client uploads;When communication connection is interrupted during receiving this document, server can basis The data message received, it is determined that receiving interruption position;After communication connection recovers normal, server receives what client uploaded Upload terminal location and the file for continuing to upload from the upload extreme positions, the reception that then server determines according to itself The upload interruption position that interruption position and client determine, judges whether to have uploaded but does not upload successful missing number According to when it is determined that missing data be present, server determines the number of missing data according to interruption position and upload interruption position is received Client is sent to according to range of loss, and by the shortage of data scope, so that client will be corresponding according to the shortage of data scope Missing data be uploaded to server.It follows that on when being interrupted with needing again uplink to be connected in the prior art The whole file fragmentation passed is compared, and client of the invention only need to again upload and upload but do not uploaded successful data, Successful any data have been uploaded without uploading again, so as to reduce the data volume of re-transmission, and have caused what server received The data repeated are not present in data, and then saves flow, improve the efficiency of file upload.
Further, the embodiments of the invention provide a kind of method of data transfer, this method to be mainly used in server Side, as shown in Fig. 2 this method mainly includes:
201st, after communication connection is established with client, the file that client uploads is received.
When client desires access to server, it is necessary to send communication connection request to server, and receiving service After the communication connection response that device is sent, successful connection is determined;After server and client establish communication connection, client can be with Being uploaded to server needs the file that uploads, and in order to allow server to identify which file the file of upload is, client While file data is uploaded, the file identification for unique mark file can be also uploaded.Wherein, file identification can be by visitor Family end is directly distributed, and can also be distributed indirectly by server.Server is that the specific implementation of file distribution file identification can Think:Client first sends file identification distribution request before upper transmitting file to server;Server receives this document mark Can be that file to be uploaded is randomly assigned a file identification after knowing distribution request, can also be according to default allocation rule, to treat Upper transmitting file distributes a file identification, such as is followed successively by different clients file to be uploaded according to order from small to large and enters Line number.
It should be noted that agreement used in being communicated between client and server can be HTTP (Hypertext Transfer Protocol, HTTP), such as HTTP2.0, or other agreements, do not limit herein.
Interrupted if the 202, being communicated to connect during file is received, according to the data message received, it is determined that Receive interruption position.
Specifically, on user end to server during transmitting file, may be consumed because of network failure, terminal power The reason such as most causes the communication connection between client and server to interrupt.After recovering normal for the ease of communication connection, Determine whether to upload again when client continues upper transmitting file and uploaded but do not uploaded successful data, server is it is determined that logical After letter connection is interrupted, it can determine to receive interruption position according to the data message on this document having been received by present, When interrupting, the offset of the data that receive for the last time in whole file, subsequently to be continued according to client The data message of upload determines whether there is missing data.
It should be noted that in actual applications, client and server judges whether communicate to connect (i.e. network connection) Normal method has a variety of.For example, after client and server establish connection, client regularly can be sent to server side Heartbeat packet, to indicate that it is online, server also can reply a response message after receiving heartbeat packet to client, to indicate it Receive heartbeat packet;If server does not receive the heartbeat packet of client transmission in preset time period, server determines to connect Interruption is connect, if server is over time, and can enough receives the heartbeat packet of client transmission, then server determines that connection is extensive It is multiple normal;If client does not receive the response message of server return in preset time period, client is determined in connection Disconnected, if client is over time, and can enough receives the response message of server return, then client determines that connection recovers Normally.
203rd, after communication connection recovers normal, upload interruption position that client uploads is received and from uploading interrupt bit Continue the file uploaded in the place of putting.
Wherein, it is that client determines according to the data message sent, with receiving interruption position pair to upload interruption position The position answered, i.e., communication connection interrupt when, client last time to server send data in whole file Offset.After communication connection is interrupted, client can determine to upload interruption position according to the data message sent, After connection to be communicated recovers normal, the upload interruption position can be carried and continue to upload this document at the upload interruption position.
204th, according to receiving interruption position and uploading interruption position, judge whether to have uploaded but do not upload successfully Missing data.
Specifically, server may determine that whether reception interruption position and upload interruption position are identical;If receive interrupt bit Put identical with uploading interruption position, it is determined that receive and missing data is not present between interruption position and upload interruption position;If connect It is different from uploading interruption position to receive interruption position, it is determined that receive between interruption position and upload interruption position and missing number be present According to.
If missing data the 205, be present, the number of missing data is determined according to interruption position and upload interruption position is received According to range of loss.
When server, which determines to receive, missing data be present between interruption position and upload interruption position, server can be true The shortage of data scope of the fixed missing data is " (receiving interruption position, upload interruption position) ".If for example, receive interruption position For 50KB, upload interruption position is 54KB, then shortage of data scope is (50KB, 54KB).
206th, shortage of data scope is sent to client, so that client uploads missing number according to shortage of data scope According to.
In actual applications, during the entire process of upper transmitting file, communication connection may occur once to interrupt incessantly, therefore There may be multiple shortage of data scopes.In this case, server can be just vertical with one data range of loss of every determination The shortage of data notice for carrying shortage of data scope is sent to client, so that client is continued based on upload interruption position While uploading follow-up data, separately start a thread, upload missing data;It can also be uploaded in last data of file After success, all shortage of data scopes are disposably sent to client, is concentrated so as to client and uploads the data lacked.
You need to add is that the mode for the breakpoint transmission that the embodiment of the present invention is provided not only goes for upper transmitting file Scene in, can be applicable to download file scene in.
The method of data transfer provided in an embodiment of the present invention, can after server and client establish communication connection, Server receives the file that client uploads;When communication connection is interrupted during receiving this document, server can The data message received with basis, it is determined that receiving interruption position;After communication connection recovers normal, server receives client The upload terminal location of upload and the file for continuing to upload from the upload extreme positions, then server is according to itself determination The upload interruption position for receiving interruption position and client and determining, judge whether to have uploaded but do not upload and successfully lack Data are lost, when it is determined that missing data be present, server determines missing data according to interruption position and upload interruption position is received Shortage of data scope, and the shortage of data scope is sent to client, so that client will according to the shortage of data scope Corresponding missing data is uploaded to server.It follows that interrupted with needing again uplink to be connected in the prior art Shi Shangchuan whole file fragmentation is compared, and client of the invention only need to again upload and upload but not upload successful data i.e. Can, successful any data have been uploaded without uploading again, so as to reduce the data volume of re-transmission, and server have been received Data in be not present repeat data, and then save flow, improve file upload efficiency.
Further, in order that server is when communication connection is interrupted, it can quickly and accurately determine to receive and interrupt Position, the embodiments of the invention provide following processing method:From starting to receive the data that client uploads, server will be from this The file fragment that secondary communication connection recovers to receive between normally interrupting to communication connection next time is (including from starting to connect Receive data file fragment for receiving between interrupting for the first time) and the missing data that receives every time corresponding to file Fragment is respectively written into different storage address;By storage address, the start bit of each file fragment corresponding to each file fragment Put and each the corresponding relation between the size of file fragment is stored into index file corresponding to file, wherein, from this The original position that communication connection recovers the file fragment received between normally being interrupted to communication connection next time is logical for this Letter connection occurs to upload interruption position corresponding to interruption.
Specifically, when server initially receives the data of client upload, data storage that server will receive To the first storage address, an index file is then generated, by the first storage address, the original position of the first file fragment (i.e. 0) store into index file;When communication connection is interrupted for the first time, server is by the first file fragment received Size is stored into index file;After communication connection recovers normal, server continues to the data of client upload, and will Then second of data storage received updates index file, i.e., by the second storage address, the second file to the second storage address The original position (the upload interruption position interrupted for the first time) of fragment is stored into index file;If server determines for the first time Interrupt and occur to missing data between first time the interruption ends be present, then shortage of data notice can be issued to client, this In the case of, server can also receive the missing data of client upload, and after missing data is received, server will can lack Data storage is lost to the 3rd storage address, then updates index file, i.e., by the 3rd storage address, the original position of missing data (the reception interruption position interrupted for the first time) and the size of missing data are stored into index file.According to above-mentioned storage side Each communication connection is recovered the file fragment that is received between normally being interrupted to communication connection next time and often by formula successively File fragment corresponding to the secondary missing data received is respectively written into different storage address, and corresponding renewal index file, with Just the foundation for judging to receive interruption position is provided for interruption next time, and ff approach is provided for subsequent download file.
After index file is obtained, server can quickly and accurately determine to receive interruption position, tool using index file Body determines that method is:Server according to stored in index file from last time communication connection recover normally to this communication link sending and receiving The original position of file fragment and the size of file fragment received between raw interruption, determine that this is interrupted in corresponding receive Disconnected position.Wherein, interruption position=last time communication connection is received to recover to receive between normally interrupting to this communication connection File fragment original position+file fragment size.
Exemplary, if last time communication connection recovers the file piece received between normally being interrupted to this communication connection The original position of section is 100KB, and the size of file fragment is 200KB, then receiving interruption position corresponding to this interruption is 300KB。
Further, in order to further improve transfer efficiency on file, client can carry out burst processing to whole file, Then start multiple threads while upload multiple file fragmentations, and above-mentioned breakpoint transmission is respectively adopted for each file fragmentation Mode is uploaded.Specifically, after client carries out burst processing to file, server can receive client upload simultaneously Multiple file fragmentations mark and each file fragmentation mark corresponding to file fragmentation;Then distinguish for each file fragmentation Perform above-mentioned steps 102-106.Wherein, the upload interruption position in each file fragmentation and reception interruption position can be at this Offset in file fragmentation.
It should be noted that because after burst processing is carried out to file, each file fragmentation is regarded one by client New file is uploaded to server, so server can be directed to each file fragmentation during each file fragmentation is received Index file corresponding to generation respectively, the upload information for separate records respective file burst.For example, if client is by file File fragmentation 1, file fragmentation 2, file fragmentation 3 and file fragmentation 4 are cut into, then subsequent server can generate corresponding respectively Index file, i.e. the manipulative indexing file 1 of file fragmentation 1, the manipulative indexing file 2 of file fragmentation 2, the manipulative indexing of file fragmentation 3 text Part 3 and the manipulative indexing file 4 of file fragmentation 4.
Further, after file uploads successfully, other clients may need to download this document.In actual applications, Downloading the specific implementation of this document can be:Server receives the download request for the download file that client is sent;Obtain Index file corresponding to file;If index file corresponding to file is one, according to the file fragment recorded in index file The sequencing of original position and the storage address of respective file fragment, be successively read each file fragment, and according to Reading order carries out file splicing;If index file corresponding to file is at least two, the order identified based on file fragmentation, The sequencing of the original position of the file fragment recorded successively in the index file according to corresponding to file identification and corresponding text The storage address of part fragment, each file fragment is read, and file splicing is carried out according to reading order;By spliced file It is sent to client.
Exemplary, client needs corresponding 2 index files of file downloaded, wherein, the respective file point of index file 1 Piece 1, particular content is as shown in table 1, and the respective file burst 2 of index file 2, particular content is as shown in table 2.In this case, Server can first be successively read address 4, address in address 1 in index file 1, address 3, the data in address 2, index file 2 6th, the data in address 5, then these data is spliced according to reading order, spliced file is finally sent to visitor Family end.
Table 1
Storage address Original position File size
Address 1 0 50KB
Address 2 60KB 100KB
Address 3 50KB 10KB
Table 2
Storage address Original position File size
Address 4 0 49KB
Address 5 59KB 50KB
Address 6 49KB 10KB
Further, a kind of data transfer is additionally provided according to the method shown in Fig. 2, an alternative embodiment of the invention Method, this method are mainly used in client-side, as shown in figure 3, this method mainly includes:
301st, after communication connection is established with server, to server up transfer file.
Referred in the step 201 of above-described embodiment, in order that obtaining server identifies which file the file of upload is, Client can also upload the file identification for unique mark file while file data is uploaded.
Interrupted if the 302, being communicated to connect during upper transmitting file, according to the data message sent, it is determined that Upload interruption position.
Wherein, it is the number that client last time is sent to server when communicating to connect to interrupt to upload interruption position According to the offset in whole file.Since client to server up transfer file, client can real-time biography recorded thereon Latest position, therefore when communication connection interrupt when, client can according to record upload latest position, it is determined that upload Interruption position.
303rd, after recovery normally is communicated to connect, it is literary that upload is continued in carrying upload interruption position at upload interruption position Part.
After communication connection recovers normal, client not only can continue to upload file data from uploading at interruption position, together When can will also upload interruption position and be sent to server, so that server is according to uploading interruption position and the data that have received are believed Breath, which determines whether there is, has uploaded but has not uploaded successful missing data.
304th, the reception server send, lacked according to the data for uploading interruption position and the data message that has received determines It is out of normal activity and encloses.
Wherein, the tool for the shortage of data scope that server determines according to upload interruption position and the data message received Body implementation will not be repeated here as described in above-mentioned step 302-305.
305th, missing data corresponding to shortage of data scope is uploaded to server.
After client receives shortage of data scope, a new thread can be started immediately and upload missing number to server According to, can also question paper last data uploaded after, all numbers for will being received in whole file upload procedure Server is sequentially or simultaneously uploaded to according to range of loss.
The method of data transfer provided in an embodiment of the present invention, can after client and server establish communication connection, Transmitting file on user end to server;Interrupted if being communicated to connect during this document is uploaded, client can root According to the data message sent, it is determined that uploading interruption position;After communication connection recovers normal, carry the upload interruption position from Continue to upload this document at the upload interruption position, then the reception server send, interruption position and connect according to uploading The shortage of data scope that the data message of receipts determines, and missing data corresponding to the shortage of data scope is uploaded to server. It follows that compared with the whole file fragmentation uploaded when needing again uplink connection to interrupt in the prior art, this The client of invention only need to again be uploaded and upload but not upload successful data, and success has been uploaded without uploading again Any data, so as to reduce the data volume of re-transmission, and cause the data repeated are not present in data that server receives, enter And save flow, improve the efficiency of file upload.
Further, refer to that, in order to accelerate transfer efficiency on file, client first can be entered to file in the above-described embodiments Row burst, then start multiple threads, while upload multiple bursts.Therefore, above-mentioned steps 301 can be refined as:Client root According to default burst rule, burst processing is carried out to file, obtains different file fragmentations;According to the phase of file fragmentation hereof It is file fragmentation add file segmental identification to position;Simultaneously multiple file fragmentation marks and each text are sent to server File fragmentation corresponding to part segmental identification.
Wherein, it can be to divide equally to preset burst rule, or non-to divide equally.In addition, the number that thread starts can root Depending on the load capacity of terminal at that time.
In actual applications, the method based on above-mentioned breakpoint transmission, during a file is uploaded, client and clothes The specific interactive mode being engaged between device can be with as shown in figure 4, wherein, the file ID (Identity, identity number) in figure For file identification.
Exemplary, as shown in figure 5, in the prior art, when client is needed to server up transfer file, will first treat The file cutting of biography is N number of file fragmentation, and then order uploads each file fragmentation to server;If uploading file fragmentation M During (when being such as uploaded to position C by position A) communication connection interrupt, then client need from the A of position again Whole file fragmentation M is uploaded, (is uploaded untill disposably whole file fragmentation M is uploaded successfully in whole file fragmentation M During do not interrupt).It follows that because when interrupting, file has been successfully uploaded at the C of position, if on again Pass whole file fragmentation M, then need to repeat to upload AC this segment data, thus can produce waste flow, transfer efficiency is low on file Problem.
In order to solve the above technical problems, as shown in fig. 6, client to before server up transfer file, first please to server A file identification (or client oneself distribution file identification) is sought, then carries starting of this document mark from whole file Start to upload data to server side (at i.e. 0) at the A of position;, can should after server receives the data flow of this upload In data flow write-in file 1, and index file corresponding to this document mark is established, by the address of file 1 and to rise Beginning, position A was write in the index file;When communication connection interrupt when, client according to the data message sent, it is determined that This upload interruption position interrupted is C, therefore after communication connection recovers normal, client can carry position C at the C of position Continue to upload data;Server can write the data of reception in file 3 after the data uploaded at the C of position are received, Simultaneously in the size of file 1, the address of file 3 and original position C write-in index files;In addition, server can also basis It is B that the original position of file 1 and the size of file 1, which determine to receive interruption position, and B<C, therefore server is determined in this It is disconnected missing data to be present, and shortage of data scope is (B, C), thus shortage of data scope is issued to client, so as to client Upload missing data;After server receives missing data, missing data can be write in file 2, and by the ground of file 2 In location, original position B and the size of file 2 write-in index file.It follows that the present invention client need to only upload again it is scarce Data BC is lost, successful any data has been uploaded without uploading again, so as to reduce the data volume of re-transmission, and has caused server The data repeated are not present in the data received, and then saves flow, improve the efficiency of file upload.
Further, a kind of data transfer is additionally provided according to the method shown in Fig. 2, an alternative embodiment of the invention Device, the device are mainly used in server side, as shown in fig. 7, the device mainly include receiving unit 41, determining unit 42, Judging unit 43 and transmitting element 44.Wherein,
Receiving unit 41, for after communication connection is established with client, receiving the file that client uploads;
Determining unit 42, for when receiving unit 41 during receiving file communication connection interrupt when, according to The data message received, it is determined that receiving interruption position;
Receiving unit 41, be additionally operable to after communication connection recovers normal, receive upload interruption position that client uploads with And continue the file uploaded at upload interruption position, it is that client determines according to the data message sent to upload interruption position , with receiving the corresponding position in interruption position;
Judging unit 43, for according to receive interruption position and upload interruption position, judge whether to have uploaded but Successful missing data is not uploaded;
Determining unit 42, it is additionally operable to, when the judged result of judging unit 43 is has missing data, interrupt according to receiving Position and upload interruption position determine the shortage of data scope of missing data;
Transmitting element 44, the shortage of data scope for determining unit 42 to be determined is sent to client, so as to client Missing data is uploaded according to shortage of data scope.
Further, as shown in figure 8, the device also includes:
Writing unit 45, for that from starting to receive the data that client uploads, will recover normal from this communication connection To communication connection next time interrupt between file corresponding to the file fragment received and the missing data that receives every time Fragment is respectively written into different storage address;
Memory cell 46, for by storage address corresponding to each file fragment, the original position of each file fragment with And the corresponding relation between the size of each file fragment is stored into index file corresponding to file, wherein, from this communication The original position for the file fragment that connection recovers to receive between normally interrupting to communication connection next time is this communication link Sending and receiving life uploads interruption position corresponding to interrupting.
Further, determining unit 42 be used for according to stored in index file from last time communication connection recover normally to this The original position of file fragment and the size of file fragment that secondary communication connection receives between interrupting, determine this interruption Corresponding reception interruption position.
Further, receiving unit 41 is used for after client carries out burst processing to file, while receives in client File fragmentation corresponding to the multiple file fragmentations mark and each file fragmentation mark passed;
Determining unit 42 be used for when receiving unit 41 during receiving file fragmentation communicate to connect interrupt when, root According to the data message of the file fragmentation received, it is determined that the reception interruption position relative to file fragmentation.
Further, receiving unit 41 is additionally operable to after file uploads successfully, receives the download file that client is sent Download request;
As shown in figure 8, the device also includes:
Acquiring unit 47, for obtaining index file corresponding to file;
When processing unit 48 for index file corresponding to the file that is obtained when acquiring unit 47 is one, according to index The sequencing of the original position of the file fragment recorded in file and the storage address of respective file fragment, it is successively read every One file fragment, and carry out file splicing according to reading order;
Processing unit 48, when index file corresponding to the file for being additionally operable to obtain when acquiring unit 47 is at least two, base In the order of file fragmentation mark, the original position of the file fragment recorded successively in the index file according to corresponding to file identification Sequencing and respective file fragment storage address, read each file fragment, and enter style of writing according to reading order Part splices;
Transmitting element 44 is additionally operable to 48 spliced file of processing unit being sent to client.
Further, as shown in figure 8, judging unit 43 includes:
Judge module 431, for judging whether reception interruption position and upload interruption position are identical;
Determining module 432, for reception interruption position and interruption position phase is uploaded for the judged result when judge module 431 Meanwhile missing data is not present between interruption position and upload interruption position it is determined that receiving;
Determining module 432 is additionally operable to when the judged result of judge module 431 is reception interruption position and upload interruption position When different, missing data be present it is determined that receiving between interruption position and upload interruption position.
The device of data transfer provided in an embodiment of the present invention, can after server and client establish communication connection, Server receives the file that client uploads;When communication connection is interrupted during receiving this document, server can The data message received with basis, it is determined that receiving interruption position;After communication connection recovers normal, server receives client The upload terminal location of upload and the file for continuing to upload from the upload extreme positions, then server is according to itself determination The upload interruption position for receiving interruption position and client and determining, judge whether to have uploaded but do not upload and successfully lack Data are lost, when it is determined that missing data be present, server determines missing data according to interruption position and upload interruption position is received Shortage of data scope, and the shortage of data scope is sent to client, so that client will according to the shortage of data scope Corresponding missing data is uploaded to server.It follows that interrupted with needing again uplink to be connected in the prior art Shi Shangchuan whole file fragmentation is compared, and client of the invention only need to again upload and upload but not upload successful data i.e. Can, successful any data have been uploaded without uploading again, so as to reduce the data volume of re-transmission, and server have been received Data in be not present repeat data, and then save flow, improve file upload efficiency.
Further, a kind of data transfer is additionally provided according to the method shown in Fig. 3, an alternative embodiment of the invention Device, the device are mainly used in client-side, as shown in figure 9, the device mainly includes:Uploading unit 51, determining unit 52 And receiving unit 53.Wherein,
Uploading unit 51, for server establish communication connection after, to server up transfer file;
Determining unit 52, for when uploading unit 51 during upper transmitting file communication connection interrupt when, according to The data message sent, it is determined that uploading interruption position;
Uploading unit 51 is additionally operable to after recovery normally is communicated to connect, and is carried and is uploaded interruption position at upload interruption position Continue upper transmitting file;
Receiving unit 53 sending, according to uploading interruption position and the data message that has received for the reception server The shortage of data scope of determination;
Uploading unit 51 is additionally operable to missing number corresponding to the shortage of data scope of the reception of transmit/receive unit on server 53 According to.
Further, as shown in Figure 10, uploading unit 51 includes:
Processing module 511, for according to default burst rule, carrying out burst processing to file, obtaining different file point Piece;
Add module 512, for the relative position of the file fragmentation that is obtained according to processing module 511 hereof, for text Part burst add file segmental identification;
Uploading module 513, for uploading multiple file fragmentation marks and each file fragmentation mark to server simultaneously Corresponding file fragmentation.
The device of data transfer provided in an embodiment of the present invention, can after client and server establish communication connection, Transmitting file on user end to server;Interrupted if being communicated to connect during this document is uploaded, client can root According to the data message sent, it is determined that uploading interruption position;After communication connection recovers normal, carry the upload interruption position from Continue to upload this document at the upload interruption position, then the reception server send, interruption position and connect according to uploading The shortage of data scope that the data message of receipts determines, and missing data corresponding to the shortage of data scope is uploaded to server. It follows that compared with the whole file fragmentation uploaded when needing again uplink connection to interrupt in the prior art, this The client of invention only need to again be uploaded and upload but not upload successful data, and success has been uploaded without uploading again Any data, so as to reduce the data volume of re-transmission, and cause the data repeated are not present in data that server receives, enter And save flow, improve the efficiency of file upload.
Further, an alternative embodiment of the invention additionally provides a kind of system of data transfer, and the system includes:Visitor Family end and server;Wherein,
Client, which is used to obtain, uploads interruption position, and the starting of this data to be uploaded is determined according to upload interruption position Position, carry original position and continue upper transmitting file from original position;
Server is used to receiving client, and according to uploading, the data that upload are continued in interruption position and this uploads data Original position, and according to original position and the data message received, determine shortage of data scope, shortage of data scope is sent out Give client;
Client is additionally operable to the shortage of data scope of the reception server transmission, and uploads shortage of data scope pair to server The missing data answered.
The system of data transfer provided in an embodiment of the present invention, it can be obtained by client and upload interruption position, and according to The original position that interruption position determines this data to be uploaded is uploaded, original position is carried and continues to upload text from original position Part;Then the starting of data and this upload data that client continues to upload according to upload interruption position is received by server Position, and according to original position and the data message received, determine shortage of data scope, shortage of data scope is sent to Client;The shortage of data scope finally sent by client the reception server, and upload shortage of data scope pair to server The missing data answered.It follows that the whole text uploaded when being interrupted with needing again uplink to be connected in the prior art Part burst is compared, and client of the invention only need to again upload and upload but not upload successful data, without again Successful any data have been uploaded, so as to reduce the data volume of re-transmission, and so that have not been deposited in the data that server receives In the data repeated, and then save flow, improve the efficiency of file upload.
Further, an alternative embodiment of the invention additionally provides a kind of method of data transfer, and this method mainly should For server side, as shown in figure 11, this method mainly includes:
601st, receive client and continue the data of upload and the start bit of this upload data according to interruption position is uploaded Put.
After server and client establish communication connection, client can upload the file for needing to upload to server, And in order to allow server to identify which file the file of upload is, client is while file data is uploaded, also in meeting Pass the file identification for unique mark file.Wherein, file identification can directly be distributed by client, can also be by server Distribution indirectly.Agreement used in being communicated between client and server can be HTTP, such as HTTP2.0, or its His agreement, is not limited herein.
On client is received during transmitting file, the reason such as can usually exhaust because of network failure, terminal power makes The communication connection obtained between client and server is interrupted, and during broken communication connection, client can not be sent out Any data, server can not also receive any data;After communication connection recovers normal, client can be according to itself Upper transmitting file is continued in the interruption position that the data message of transmission determines, i.e., after communication connection recovers normal, server can connect Receive client and continue the data of upload and the original position of this upload data according to interruption position is uploaded.
It should be noted that server receive client this upload data original position can be upload interrupt bit Put, can also or be any position after interruption position is uploaded.Wherein, no matter original position is to upload interrupt bit Put, or upload the position after interruption position, because follow-up data from the position are not transmitted across, so being not in The phenomenon of data has been sent out in repetition.Also, if original position has sent to upload interruption position when this interruption is not present But when not sending successful data, client passes data without mending;If original position is the position after upload interruption position, No matter this is interrupted with the presence or absence of having sent but not sent successful data, and client, which is required to mend, passes data, i.e., at least needs Benefit passes and (uploads interruption position, original position) data in the range of this.
602nd, according to original position and the data message received, shortage of data scope is determined.
This step can be specifically refined as:
(1) according to the data message received, it is determined that receiving interruption position.
Wherein it is determined that the opportunity for receiving interruption position, which can be communication connection, occurs Interruption period between The following article, communication connection is also thought After recovering normal.
(2) by the difference between original position and reception interruption position, shortage of data scope is determined.
Specifically, first judge whether original position is identical with receiving interruption position;If original position is with receiving interruption position It is identical, then server determine this interrupt be not present uploaded but do not uploaded successful missing data;If original position is with receiving Interruption position is different, then server determines that this interruption has missing data, and the shortage of data scope of missing data is (to connect Receive interruption position, original position).
603rd, shortage of data scope is sent to client, so that client uploads missing number according to shortage of data scope According to.
The specific implementation of this step is consistent with above-mentioned steps 206, will not be repeated here.
The method of data transfer provided in an embodiment of the present invention, it can be communicated on client is received during transmitting file In the case that connection is interrupted, after communication connection recovers normal, client is first received according to uploading on interruption position continues The original position of the data of biography and this upload data, then according to original position and the data message received, it is determined that Shortage of data scope, shortage of data scope is finally sent to client, so that client will be right according to the shortage of data scope The missing data answered is uploaded to server.It follows that when being interrupted with needing again uplink to be connected in the prior art The whole file fragmentation uploaded is compared, and client of the invention only need to again upload and upload but not upload successful data i.e. Can, successful any data have been uploaded without uploading again, so as to reduce the data volume of re-transmission, and server have been received Data in be not present repeat data, and then save flow, improve file upload efficiency.
Further, from above-described embodiment, the key that server determines whether there is missing data is to be uploaded Interruption position and reception interruption position, so accurately and rapidly determining that upload interruption position and reception interruption position are of crucial importance. In order that server can quickly and accurately determine to receive interruption position, server can be from when communication connection is interrupted The data for starting to receive client upload rise, and will normally be communicated to connect from this communication connection recovery to next time between interrupting File fragment corresponding to the file fragment received and the missing data received every time is respectively written into different storage address; By between the size of storage address, the original position of each file fragment and each file fragment corresponding to each file fragment Corresponding relation store into index file corresponding to file.
Further, after index file is created, according to the data message received, it is determined that receiving the specific of interruption position Implementation can be:Recover according to being stored in index file from last time communication connection in normally occurring to this communication connection The original position of file fragment and the size of file fragment received between disconnected, determine that this receives interrupt bit corresponding to interrupting Put.
Further, an alternative embodiment of the invention additionally provides a kind of method of data transfer, and this method is applied to Client-side, as shown in figure 12, this method mainly include:
701st, obtain and upload interruption position.
After client and server establish communication connection, client is intended to server up transfer file, can first determine to treat The file identification of upper transmitting file, then carry transmitting file on file identification.On user end to server during transmitting file, often Communication connection can be often caused to interrupt because of reasons such as network failure, terminal fault, server failures, so that client Data can not be sent out, server can not receive external data, only after communication connection recovers normal, can just continue to transmit Data.In order that obtain client after server knows interruption recovery uploads data since where, so that server is according to itself The data message of reception judge client whether since receive interruption position at upload data, so as to judge whether to omit Data, client is interrupted every time recover after need the current original position for uploading data reporting service when uploading data Device.And in order to avoid client repeats to upload data, it is necessary to which first determination upload interruption position, just can determine that this to be uploaded Beginning position.
Wherein, uploading interruption position is determined according to the data message sent, and uploads interruption position determination During opportunity can be broken communication connection, or upload is interrupted after recovery normally.
702nd, the original position of this data to be uploaded is determined according to upload interruption position.
This step can be specifically refined as:Interruption position will be uploaded and be defined as original position;Or it will be located to upload and interrupt Any position after position is defined as original position.
Need to illustrate, no matter original position is uploads the position after interruption position, or upload interruption position, The data for repeating to upload are not present in the data for continuing to upload from original position, and are not made due to there may be certain interruption Sent into data but do not sent successful situation, upload missing can be reduced so interruption position will be uploaded and be set to original position The number of data, so as to improve upper transfer efficiency.
703rd, carry original position and continue upper transmitting file from original position.
Specifically, after each communication disruption recovers normal, client is when to server up transfer file, except based on certainly The interruption position that body judges continues to upload outside data, also the original position of the file fragment uploaded every time can be reported into service Device, the file fragment original position uploaded according to client so as to server are come compared with the interruption position that itself judges Judge whether missing data.
704th, the shortage of data scope that the reception server is sent.
Wherein, shortage of data scope can be by server according to the original position received and the data message received And obtain, i.e., after server receives the original position of client upload, first determined according to the data message received in reception Disconnected position, then by the difference between original position and reception interruption position, determine shortage of data scope.
It should be noted that because server may issue shortage of data scope for Current interrupt in time, it is also possible to After last data of file are received, property issues shortage of data scope caused by all interruptions again, so client The shortage of data scope disposably received may only have one, it is also possible to have multiple.
705th, missing data corresponding to shortage of data scope is uploaded to server.
Wherein, in order to enable the server to know which segment data the missing data that client uploads belongs to, so as to follow-up During other client downloads this documents, file data order is avoided to be disturbed, client is uploading shortage of data model to server Corresponding to enclosing during missing data, shortage of data scope can be carried, can also only carry the original position of shortage of data scope.
The method of data transfer provided in an embodiment of the present invention, can during to server up transfer file communication link In the case that sending and receiving life is interrupted, client, which first obtains, uploads interruption position, determines that this is to be uploaded further according to interruption position is uploaded The original position of data, and carry original position and continue upper transmitting file from original position, finally receiving server transmission Shortage of data scope after, missing data corresponding to the shortage of data scope can be uploaded to server.It follows that with showing There is the whole file fragmentation uploaded when needing again uplink connection to interrupt in technology to compare, client of the invention is only It need to again upload and upload but do not uploaded successful data, successful any data have been uploaded without uploading again, from And reduce the data volume retransmitted, and cause the data repeated are not present in the data that receive of server, so save flow, Improve the efficiency of file upload.
Further, a kind of data transfer is additionally provided according to the method shown in Figure 11, an alternative embodiment of the invention Device, the device is mainly used in server side, and as shown in figure 13, the device mainly includes:Receiving unit 81, determining unit 82 and transmitting element 83.Wherein,
Receiving unit 81, data and this upload number for continuing to upload according to interruption position is uploaded for receiving client According to original position;
Determining unit 82, for the original position received according to receiving unit 81 and the data message received, it is determined that Shortage of data scope;
Transmitting element 83, the shortage of data scope for determining unit 82 to be determined is sent to client, so as to client Missing data is uploaded according to shortage of data scope.
Further, original position is upload interruption position, or is any position after interruption position is uploaded.
Further, as shown in figure 14, determining unit 82 includes:
First determining module 821, the data message received for basis, it is determined that receiving interruption position;
Second determining module 822, for by the difference between original position and reception interruption position, determining shortage of data Scope.
Further, as shown in figure 14, the device also includes:
Writing unit 84, for that from starting to receive the data that client uploads, will recover normal from this communication connection To communication connection next time interrupt between file corresponding to the file fragment received and the missing data that receives every time Fragment is respectively written into different storage address;
Memory cell 85, for by storage address corresponding to each file fragment, the original position of each file fragment with And the corresponding relation between the size of each file fragment is stored into index file corresponding to file.
Further, as shown in figure 14, the first determining module 821 be used for according to stored in index file from last time communicate Connection recovers the original position of file fragment received between normally being interrupted to this communication connection and file fragment Size, determine that this receives interruption position corresponding to interrupting.
Further, if receiving unit 81 is used on client is received during transmitting file in communication connection generation It is disconnected, then after communication connection recovers normal, receive data and start bit that client continues to upload according to interruption position is uploaded Put.
The device of data transfer provided in an embodiment of the present invention, it can be communicated on client is received during transmitting file In the case that connection is interrupted, after communication connection recovers normal, client is first received according to uploading on interruption position continues The original position of the data of biography and this upload data, then according to original position and the data message received, it is determined that Shortage of data scope, shortage of data scope is finally sent to client, so that client will be right according to the shortage of data scope The missing data answered is uploaded to server.It follows that when being interrupted with needing again uplink to be connected in the prior art The whole file fragmentation uploaded is compared, and client of the invention only need to again upload and upload but not upload successful data i.e. Can, successful any data have been uploaded without uploading again, so as to reduce the data volume of re-transmission, and server have been received Data in be not present repeat data, and then save flow, improve file upload efficiency.
Further, a kind of data transfer is additionally provided according to the method shown in Figure 12, an alternative embodiment of the invention Device, the device is applied to client-side, and as shown in figure 15, the device mainly includes:Acquiring unit 91, determining unit 92, Uploading unit 93 and receiving unit 94.Wherein,
Acquiring unit 91, interruption position is uploaded for obtaining;
Determining unit 92, the upload interruption position for being obtained according to acquiring unit 91 determine rising for this data to be uploaded Beginning position;
Uploading unit 93, the original position for carrying the acquisition of determining unit 92 continue upper transmitting file from original position;
Receiving unit 94, the shortage of data scope sent for the reception server;
Uploading unit 93 is additionally operable to missing number corresponding to the shortage of data scope of the reception of transmit/receive unit on server 94 According to.
Further, determining unit 92 is used to upload interruption position being defined as original position, or will be located at upper crossing Any position after disconnected position is defined as original position.
Further, determining unit 92 is additionally operable to before obtaining and uploading interruption position, according to the data message sent, It is determined that upload interruption position.
Further, shortage of data scope by server according to the original position received and the data message received And obtain.
Further, if acquiring unit is used to communicate to connect during to server up transfer file to interrupt, After communication connection recovers normal, obtain and upload interruption position.
The device of data transfer provided in an embodiment of the present invention, can during to server up transfer file communication link In the case that sending and receiving life is interrupted, client, which first obtains, uploads interruption position, determines that this is to be uploaded further according to interruption position is uploaded The original position of data, and carry original position and continue upper transmitting file from original position, finally receiving server transmission Shortage of data scope after, missing data corresponding to the shortage of data scope can be uploaded to server.It follows that with showing There is the whole file fragmentation uploaded when needing again uplink connection to interrupt in technology to compare, client of the invention is only It need to again upload and upload but do not uploaded successful data, successful any data have been uploaded without uploading again, from And reduce the data volume retransmitted, and cause the data repeated are not present in the data that receive of server, so save flow, Improve the efficiency of file upload.
Further, an alternative embodiment of the invention additionally provides a kind of system of data transfer, and changing system includes:Visitor Family end and server;Wherein,
Server is used to, according to receiving interruption position and uploading interruption position, judge whether to have uploaded but not upload Successful missing data, if missing data be present, missing data is determined according to receiving interruption position and uploading interruption position Shortage of data scope, and shortage of data scope is sent to client;
Client is used to receive shortage of data scope, and uploads missing data corresponding to shortage of data scope to server.
The system of data transfer provided in an embodiment of the present invention, interruption position and upload interrupt bit can be received obtaining Postpone, first according to receiving interruption position and uploading interruption position, judge whether to have uploaded but do not upload successful missing Data, when it is determined that missing data be present, server determines missing data further according to interruption position and upload interruption position is received Shortage of data scope, the shortage of data scope is finally sent to client, so that client is according to the shortage of data scope Corresponding missing data is uploaded to server.It follows that with needing again uplink to be connected in generation in the prior art The whole file fragmentation uploaded when disconnected is compared, and client of the invention only need to again upload and upload but do not uploaded successful data , successful any data have been uploaded without uploading again, so as to reduce the data volume of re-transmission, and server have been received To data in be not present repeat data, and then save flow, improve file upload efficiency.
Further, an alternative embodiment of the invention additionally provides a kind of method of data transfer, and this method mainly should For server side, as shown in figure 16, this method mainly includes:
1001st, according to receiving interruption position and uploading interruption position, judge whether to have uploaded but do not upload success Missing data.
Wherein, it can be that server is according to the number received in the case that communication connection is interrupted to receive interruption position It is believed that the interruption position that breath determines, it can be that client is according in the case that communication connection is interrupted to upload interruption position The interruption position that the data message of transmission determines.
Server judges whether that the concrete methods of realizing of missing data can be:Judge to receive interruption position with uploading Whether interruption position is identical;If it is identical with uploading interruption position to receive interruption position, it is determined that receives interruption position and upper crossing Missing data is not present between disconnected position;If it is different from uploading interruption position to receive interruption position, it is determined that receives interruption position Missing data be present between upload interruption position.
If missing data the 1002, be present, missing data is determined according to receiving interruption position and uploading interruption position Shortage of data scope.
When server determines to have missing data, data are true between can receiving interruption position and uploading interruption position It is set to missing data, " (receiving interruption position, upload interruption position) " is defined as shortage of data scope.
1003rd, shortage of data scope is sent to client, so that client uploads missing number according to shortage of data scope According to.
The specific implementation of this step is consistent with above-mentioned steps 206, will not be repeated here.
The method of data transfer provided in an embodiment of the present invention, interruption position and upload interrupt bit can be received obtaining Postpone, first according to receiving interruption position and uploading interruption position, judge whether to have uploaded but do not upload successful missing Data, when it is determined that missing data be present, server determines missing data further according to interruption position and upload interruption position is received Shortage of data scope, the shortage of data scope is finally sent to client, so that client is according to the shortage of data scope Corresponding missing data is uploaded to server.It follows that with needing again uplink to be connected in generation in the prior art The whole file fragmentation uploaded when disconnected is compared, and client of the invention only need to again upload and upload but do not uploaded successful data , successful any data have been uploaded without uploading again, so as to reduce the data volume of re-transmission, and server have been received To data in be not present repeat data, and then save flow, improve file upload efficiency.
Further, an alternative embodiment of the invention additionally provides a kind of method of data transfer, and this method mainly should For client-side, as shown in figure 17, this method mainly includes:
1101st, the shortage of data scope that the reception server is sent.
Wherein, shortage of data may range from the model that server obtains according to interruption position and upload interruption position is received Enclose, i.e., shortage of data may range from " (receiving interruption position, upload interruption position) ".It can be communication link to receive interruption position In the case that sending and receiving life is interrupted, interruption position that server determines according to the data message that has received, upload interruption position can be with For communication connection interrupt in the case of, client according to sent data message determination interruption position.When upper crossing During the interruption position that disconnected position determines for client, after communication connection recovers normal, client is based on upload interruption position Continue upload data when, can also by upload interruption position report server, so as to server according to upload interruption position with And receive interruption position and determine shortage of data scope.
1102nd, missing data corresponding to shortage of data scope is uploaded to server.
In order to enable the server to know the position of missing data that client uploaded in whole file, client When uploading missing data to server, this original position for uploading data can be carried, or carry shortage of data Scope.
The method of data transfer provided in an embodiment of the present invention, it is capable of the shortage of data scope of the reception server transmission, and Missing data corresponding to shortage of data scope is uploaded to server, so that server obtains complete file data.Thus may be used Know, it is of the invention compared with the whole file fragmentation uploaded when needing again uplink connection to interrupt in the prior art Client only need to again upload and upload but do not uploaded successful data, without upload again uploaded successfully it is any Data, so as to reduce the data volume of re-transmission, and cause the data repeated are not present in data that server receives, and then save Flow, the efficiency for improving file upload.
Further, a kind of data transfer is additionally provided according to the method shown in Figure 16, an alternative embodiment of the invention Device, the device is applied to server side, and as shown in figure 18, the device mainly includes:Judging unit 121, determining unit 122 And transmitting element 123.Wherein,
Judging unit 121, for according to receive interruption position and upload interruption position, judge whether to have uploaded but Successful missing data is not uploaded;
Determining unit 122, for when the judged result of judging unit 121 is has missing data, being interrupted according to receiving Position and upload interruption position determine the shortage of data scope of missing data;
Transmitting element 123, the shortage of data scope for determining unit 122 to be determined is sent to client, so as to client End uploads missing data according to shortage of data scope.
Further, judging unit 121 is used to judge whether reception interruption position and upload interruption position are identical;Work as reception When interruption position is identical with uploading interruption position, missing number is not present between interruption position and upload interruption position it is determined that receiving According to;When receiving interruption position with uploading interruption position difference, exist it is determined that receiving between interruption position and upload interruption position Missing data.
The device of data transfer provided in an embodiment of the present invention, interruption position and upload interrupt bit can be received obtaining Postpone, first according to receiving interruption position and uploading interruption position, judge whether to have uploaded but do not upload successful missing Data, when it is determined that missing data be present, server determines missing data further according to interruption position and upload interruption position is received Shortage of data scope, the shortage of data scope is finally sent to client, so that client is according to the shortage of data scope Corresponding missing data is uploaded to server.It follows that with needing again uplink to be connected in generation in the prior art The whole file fragmentation uploaded when disconnected is compared, and client of the invention only need to again upload and upload but do not uploaded successful data , successful any data have been uploaded without uploading again, so as to reduce the data volume of re-transmission, and server have been received To data in be not present repeat data, and then save flow, improve file upload efficiency.
Further, a kind of data transfer is additionally provided according to the method shown in Figure 17, an alternative embodiment of the invention Device, the device is applied to client-side, and as shown in figure 19, the device mainly includes:Receiving unit 131 and uploading unit 132.Wherein,
Receiving unit 132, the shortage of data scope sent for the reception server;
Uploading unit 132, for uploading missing data corresponding to shortage of data scope to server.
Further, shortage of data scope is obtained by server according to receiving interruption position and uploading interruption position.
The device of data transfer provided in an embodiment of the present invention, it is capable of the shortage of data scope of the reception server transmission, and Missing data corresponding to shortage of data scope is uploaded to server, so that server obtains complete file data.Thus may be used Know, it is of the invention compared with the whole file fragmentation uploaded when needing again uplink connection to interrupt in the prior art Client only need to again upload and upload but do not uploaded successful data, without upload again uploaded successfully it is any Data, so as to reduce the data volume of re-transmission, and cause the data repeated are not present in data that server receives, and then save Flow, the efficiency for improving file upload.
In the above-described embodiments, the description to each embodiment all emphasizes particularly on different fields, and does not have the portion being described in detail in some embodiment Point, it may refer to the associated description of other embodiment.
It is understood that the correlated characteristic in the above method, device and system can be referred to mutually.It is in addition, above-mentioned " first ", " second " in embodiment etc. are to be used to distinguish each embodiment, and do not represent the quality of each embodiment.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit, the corresponding process in preceding method embodiment is may be referred to, will not be repeated here.
Algorithm and display be not inherently related to any certain computer, virtual system or miscellaneous equipment provided herein. Various general-purpose systems can also be used together with teaching based on this.As described above, required by constructing this kind of system Structure be obvious.In addition, the present invention is not also directed to any certain programmed language.It should be understood that it can utilize various Programming language realizes the content of invention described herein, and the description done above to language-specific is to disclose this hair Bright preferred forms.
In the specification that this place provides, numerous specific details are set forth.It is to be appreciated, however, that the implementation of the present invention Example can be put into practice in the case of these no details.In some instances, known method, structure is not been shown in detail And technology, so as not to obscure the understanding of this description.
Similarly, it will be appreciated that in order to simplify the disclosure and help to understand one or more of each inventive aspect, Above in the description to the exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes In example, figure or descriptions thereof.However, the method for the disclosure should be construed to reflect following intention:I.e. required guarantor The application claims of shield features more more than the feature being expressly recited in each claim.It is more precisely, such as following Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore, Thus the claims for following embodiment are expressly incorporated in the embodiment, wherein each claim is in itself Separate embodiments all as the present invention.
Those skilled in the art, which are appreciated that, to be carried out adaptively to the module in the equipment in embodiment Change and they are arranged in one or more equipment different from the embodiment.Can be the module or list in embodiment Member or component be combined into a module or unit or component, and can be divided into addition multiple submodule or subelement or Sub-component.In addition at least some in such feature and/or process or unit exclude each other, it can use any Combination is disclosed to all features disclosed in this specification (including adjoint claim, summary and accompanying drawing) and so to appoint Where all processes or unit of method or equipment are combined.Unless expressly stated otherwise, this specification (including adjoint power Profit requires, summary and accompanying drawing) disclosed in each feature can be by providing the alternative features of identical, equivalent or similar purpose come generation Replace.
In addition, it will be appreciated by those of skill in the art that although some embodiments described herein include other embodiments In included some features rather than further feature, but the combination of the feature of different embodiments means in of the invention Within the scope of and form different embodiments.For example, in the following claims, embodiment claimed is appointed One of meaning mode can use in any combination.
The all parts embodiment of the present invention can be realized with hardware, or to be run on one or more processor Software module realize, or realized with combinations thereof.It will be understood by those of skill in the art that it can use in practice Microprocessor or digital signal processor (DSP) come realize the system of data transfer according to embodiments of the present invention, method and The some or all functions of some or all parts in device.The present invention is also implemented as being used to perform being retouched here The some or all equipment or program of device (for example, computer program and computer program product) for the method stated. Such program for realizing the present invention can store on a computer-readable medium, or can have one or more signal Form.Such signal can be downloaded from internet website and obtained, either provide on carrier signal or with it is any its He provides form.
It should be noted that the present invention will be described rather than limits the invention for above-described embodiment, and ability Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims, Any reference symbol between bracket should not be configured to limitations on claims.Word "comprising" does not exclude the presence of not Element or step listed in the claims.Word "a" or "an" before element does not exclude the presence of multiple such Element.The present invention can be by means of including the hardware of some different elements and being come by means of properly programmed computer real It is existing.In if the unit claim of equipment for drying is listed, several in these devices can be by same hardware branch To embody.The use of word first, second, and third does not indicate that any order.These words can be explained and run after fame Claim.

Claims (39)

1. a kind of system of data transfer, it is characterised in that the system includes:Client and server;Wherein,
If the client is used to communicate to connect during upper transmitting file to interrupt, according to the data letter sent Breath, it is determined that uploading interruption position, and after the communication connection recovers normal, the upload interruption position is carried from the upload Continue to upload the file at interruption position;
Interrupted if the server is used for the communication connection during the file is received, according to what is received Data message, it is determined that receive interruption position, and after the communication connection recovers normal, receive the upload interruption position and Continue the file uploaded at the upload interruption position;
The server is additionally operable to, according to the reception interruption position and the upload interruption position, judge whether on Pass but do not upload successful missing data, if missing data be present, according to the reception interruption position and the upper crossing Disconnected position determines the shortage of data scope of missing data, and the shortage of data scope is sent into the client;
The client is additionally operable to receive the shortage of data scope, and uploads the shortage of data scope pair to the server The missing data answered.
2. a kind of method of data transfer, methods described is applied to server side, it is characterised in that methods described includes:
After communication connection is established with client, the file that the client uploads is received;
If the communication connection is interrupted during the file is received, according to the data message received, it is determined that Receive interruption position;
After the communication connection recovers normal, upload interruption position that the client uploads is received and from the upper crossing Disconnected opening position continues the file uploaded, and the interruption position that uploads is that the client determines according to the data message sent , with the corresponding position in the reception interruption position;
According to the reception interruption position and the upload interruption position, judge whether to have uploaded but do not upload successfully Missing data;
If missing data be present, according to the reception interruption position and the number for uploading interruption position and determining missing data According to range of loss;
The shortage of data scope is sent to the client, so that the client uploads according to the shortage of data scope The missing data.
3. according to the method for claim 2, it is characterised in that methods described also includes:
From starting to receive the data that the client uploads, it will recover from this communication connection normally to next communication link sending and receiving It is raw interrupt between file fragment corresponding to the file fragment received and the missing data that receives every time be respectively written into difference Storage address;
By the size of storage address, the original position of each file fragment and each file fragment corresponding to each file fragment Between corresponding relation store into index file corresponding to the file, wherein, recover from this communication connection normally under The original position for the file fragment that secondary communication connection receives between interrupting occurs corresponding to interruption for this communication connection Upload interruption position.
4. according to the method for claim 3, it is characterised in that according to the data message received, it is determined that receiving interrupt bit Put including:
According to stored in the index file from last time communication connection recover normally to this communication connection interrupt between The size of the original position of the file fragment of reception and the file fragment, determine that this receives interrupt bit corresponding to interrupting Put.
5. according to the method for claim 3, it is characterised in that receiving the file that the client uploads includes:
After the client carries out burst processing to the file, while receive multiple file fragmentations that the client uploads File fragmentation corresponding to mark and each file fragmentation mark;
If the communication connection is interrupted during the file is received, according to the data message received, it is determined that Receiving interruption position includes:
If the communication connection is interrupted during file fragmentation is received, according to the file fragmentation received Data message, it is determined that the reception interruption position relative to the file fragmentation.
6. according to the method for claim 5, it is characterised in that after the file uploads successfully, methods described also includes:
Receive the download request for the download file that client is sent;
Obtain index file corresponding to the file;
If index file corresponding to the file is one, according to the start bit of the file fragment recorded in the index file The sequencing and the storage address of respective file fragment put, are successively read each file fragment, and according to reading order Carry out file splicing;
If index file corresponding to the file is at least two, based on the order of file fragmentation mark, successively according to The sequencing of the original position of the file fragment recorded in index file corresponding to file identification and respective file fragment Storage address, each file fragment is read, and file splicing is carried out according to reading order;
Spliced file is sent to client.
7. according to the method any one of claim 2-6, it is characterised in that according to the reception interruption position and institute State and upload interruption position, judging whether to have uploaded but not uploading successful missing data includes:
Judge whether the reception interruption position and the upload interruption position are identical;
If the reception interruption position is identical with the upload interruption position, it is determined that the reception interruption position and the upload Missing data is not present between interruption position;
If the reception interruption position is different from the upload interruption position, it is determined that the reception interruption position and the upload Missing data between interruption position be present.
8. a kind of method of data transfer, methods described is applied to client-side, it is characterised in that methods described includes:
After communication connection is established with server, to the server up transfer file;
If the communication connection is interrupted during the file is uploaded, according to the data message sent, it is determined that Upload interruption position;
After the communication connection recovers normal, carry the upload interruption position and continue to upload at the upload interruption position The file;
Data that the server is sent, determining according to the upload interruption position and the data message received are received to lack It is out of normal activity and encloses;
Missing data corresponding to the shortage of data scope is uploaded to the server.
9. according to the method for claim 8, it is characterised in that include to the server up transfer file:
According to default burst rule, burst processing is carried out to the file, obtains different file fragmentations;
It is the file fragmentation add file segmental identification according to relative position of the file fragmentation in the file;
Simultaneously file fragmentation corresponding to multiple file fragmentation marks and each file fragmentation mark is uploaded to the server.
10. a kind of device of data transfer, described device is applied to server side, it is characterised in that described device includes:
Receiving unit, for after communication connection is established with client, receiving the file that the client uploads;
Determining unit, for when the receiving unit is when the communication connection is interrupted during receiving the file, According to the data message received, it is determined that receiving interruption position;
The receiving unit, it is additionally operable to after the communication connection recovers normal, receives the upload that the client uploads and interrupt Position and the file for continuing upload at the upload interruption position, the upload interruption position is the client according to Position that the data message of transmission determines, corresponding with the reception interruption position;
Judging unit, for according to the reception interruption position and the upload interruption position, judging whether to have uploaded But successful missing data is not uploaded;
The determining unit, it is additionally operable to when the judged result of the judging unit is has missing data, according to the reception Interruption position and the shortage of data scope for uploading interruption position and determining missing data;
Transmitting element, the shortage of data scope for the determining unit to be determined is sent to the client, with toilet State client and the missing data is uploaded according to the shortage of data scope.
11. device according to claim 10, it is characterised in that described device also includes:
Writing unit, for from starting to receive the data that the client uploads, will recover from this communication connection normally to File piece corresponding to the file fragment received and the missing data that receives every time between communication connection next time is interrupted Section is respectively written into different storage address;
Memory cell, for by storage address corresponding to each file fragment, the original position of each file fragment and each Corresponding relation between the size of file fragment is stored into index file corresponding to the file, wherein, from this communication link The original position for connecing the file fragment for recovering to be received between normally being interrupted to communication connection next time communicates to connect for this Generation uploads interruption position corresponding to interrupting.
12. device according to claim 11, it is characterised in that the receiving unit is used in the client to described After file carries out burst processing, while receive multiple file fragmentations mark and each file fragmentation mark that the client uploads File fragmentation corresponding to knowledge;
The determining unit is for when the receiving unit, the communication connection to be interrupted during file fragmentation is received When, according to the data message of the file fragmentation received, it is determined that the reception interruption position relative to the file fragmentation.
13. device according to claim 12, it is characterised in that the receiving unit be additionally operable to the file upload into After work(, the download request for the download file that client is sent is received;
Described device also includes:
Acquiring unit, for obtaining index file corresponding to the file;
When processing unit for index file corresponding to the file that is obtained when the acquiring unit is one, according to described The sequencing of the original position of the file fragment recorded in index file and the storage address of respective file fragment, read successively Each file fragment is taken, and file splicing is carried out according to reading order;
The processing unit, index file corresponding to the file for being additionally operable to obtain when the acquiring unit are at least two When, based on the order of file fragmentation mark, the file fragment recorded successively in the index file according to corresponding to the file identification The sequencing of original position and the storage address of respective file fragment, read each file fragment, and according to reading Order carries out file splicing;
The transmitting element is additionally operable to the spliced file of the processing unit being sent to client.
14. according to the device any one of claim 10-13, it is characterised in that the judging unit includes:
Judge module, for judging whether the reception interruption position and the upload interruption position are identical;
Determining module, for being the reception interruption position and the upload interruption position when the judged result of the judge module When identical, determine that missing data is not present between the reception interruption position and the upload interruption position;
The determining module is additionally operable to when the judged result of the judge module is the reception interruption position and the upper crossing During disconnected position difference, determine missing data be present between the reception interruption position and the upload interruption position.
15. a kind of device of data transfer, described device is applied to client-side, it is characterised in that described device includes:
Uploading unit, for server establish communication connection after, to the server up transfer file;
Determining unit, for when the uploading unit is when the communication connection is interrupted during uploading the file, According to the data message sent, it is determined that uploading interruption position;
The uploading unit is additionally operable to after the communication connection recovers normal, carries the upload interruption position from the upload Continue to upload the file at interruption position;
Receiving unit, for receive it is that the server is sent, believed according to the upload interruption position and the data received Cease the shortage of data scope determined;
The shortage of data scope that the uploading unit is additionally operable to upload the receiving unit reception to the server is corresponding Missing data.
16. device according to claim 15, it is characterised in that the uploading unit includes:
Processing module, for according to default burst rule, carrying out burst processing to the file, obtaining different file fragmentations;
Add module, for the relative position of the file fragmentation that is obtained according to the processing module in the file, it is The file fragmentation add file segmental identification;
Uploading module, for being uploaded to the server simultaneously, multiple file fragmentations identify and each file fragmentation mark is corresponding File fragmentation.
17. a kind of system of data transfer, it is characterised in that the system includes:Client and server;Wherein,
The client, which is used to obtain, uploads interruption position, and determines this data to be uploaded according to the upload interruption position Original position, carry the original position and continue upper transmitting file from the original position;
The server be used for receive the client according to it is described upload interruption position continue upload data and this The original position of data is passed, and according to the original position and the data message received, shortage of data scope is determined, by institute State shortage of data scope and be sent to the client;
The client is additionally operable to receive the shortage of data scope that the server is sent, and uploads the number to the server According to missing data corresponding to range of loss.
18. a kind of method of data transfer, methods described is applied to server side, it is characterised in that methods described includes:
Receive client and continue the data of upload and the original position of this upload data according to interruption position is uploaded;
According to the original position and the data message received, shortage of data scope is determined;
The shortage of data scope is sent to the client, so that the client uploads according to the shortage of data scope Missing data.
19. according to the method for claim 18, it is characterised in that the original position is the upload interruption position, or Person is any position after the upload interruption position.
20. according to the method for claim 18, it is characterised in that believed according to the original position and the data received Breath, determines that shortage of data scope includes:
According to the data message received, it is determined that receiving interruption position;
By the original position and the difference received between interruption position, the shortage of data scope is determined.
21. according to the method for claim 20, it is characterised in that methods described also includes:
From starting to receive the data that the client uploads, it will recover from this communication connection normally to next communication link sending and receiving It is raw interrupt between file fragment corresponding to the file fragment received and the missing data that receives every time be respectively written into difference Storage address;
By the size of storage address, the original position of each file fragment and each file fragment corresponding to each file fragment Between corresponding relation store into index file corresponding to the file.
22. according to the method for claim 21, it is characterised in that according to the data message received, interrupted it is determined that receiving Position includes:
According to stored in the index file from last time communication connection recover normally to this communication connection interrupt between The size of the original position of the file fragment of reception and the file fragment, determine that this receives interrupt bit corresponding to interrupting Put.
23. the method according to any one of claim 18 to 22, it is characterised in that receive client and interrupted according to upload The data uploaded and this original position for uploading data are continued in position to be included:
Interrupted if being communicated to connect on client is received during transmitting file, recover normal in the communication connection Afterwards, receive the client and the data of upload and the original position are continued according to the upload interruption position.
24. a kind of method of data transfer, methods described is applied to client-side, it is characterised in that methods described includes:
Obtain and upload interruption position;
The original position of this data to be uploaded is determined according to the upload interruption position;
Carry the original position and continue upper transmitting file from the original position;
The shortage of data scope that the reception server is sent;
Missing data corresponding to the shortage of data scope is uploaded to the server.
25. according to the method for claim 24, it is characterised in that determine that this is to be uploaded according to the upload interruption position The original position of data includes:
The upload interruption position is defined as the original position;
Or any position after the upload interruption position is defined as the original position.
26. according to the method for claim 24, it is characterised in that include before upload interruption position is obtained:
According to the data message sent, it is determined that uploading interruption position.
27. according to the method for claim 24, it is characterised in that the shortage of data scope is by the server according to connecing The original position received and the data message that has received and obtain.
28. the method according to any one of claim 24 to 27, it is characterised in that obtaining upload interruption position includes:
Interrupted if being communicated to connect during to server up transfer file, after the communication connection recovers normal, Obtain the upload interruption position.
29. a kind of device of data transfer, described device is applied to server side, it is characterised in that described device includes:
Receiving unit, continue the data of upload and rising for this upload data according to interruption position is uploaded for receiving client Beginning position;
Determining unit, for the original position received according to the receiving unit and the data message received, it is determined that Shortage of data scope;
Transmitting element, the shortage of data scope for the determining unit to be determined is sent to the client, with toilet State client and missing data is uploaded according to the shortage of data scope.
30. device according to claim 29, it is characterised in that the determining unit includes:
First determining module, the data message received for basis, it is determined that receiving interruption position;
Second determining module, for by the original position and the difference received between interruption position, determining the number According to range of loss.
31. a kind of device of data transfer, described device is applied to client-side, it is characterised in that described device includes:
Acquiring unit, interruption position is uploaded for obtaining;
Determining unit, the upload interruption position for being obtained according to the acquiring unit determine rising for this data to be uploaded Beginning position;
Uploading unit, continue upload text from the original position for carrying the original position that the determining unit obtains Part;
Receiving unit, the shortage of data scope sent for the reception server;
The shortage of data scope that the uploading unit is additionally operable to upload the receiving unit reception to the server is corresponding Missing data.
32. device according to claim 31, it is characterised in that the determining unit is used for the upload interruption position It is defined as the original position, or any position after the upload interruption position is defined as the start bit Put.
33. a kind of system of data transfer, it is characterised in that the system includes:Client and server;Wherein,
The server is used to, according to receiving interruption position and uploading interruption position, judge whether to have uploaded but not upload Successful missing data, if missing data be present, determined according to the reception interruption position and the upload interruption position The shortage of data scope of missing data, and the shortage of data scope is sent to the client;
The client is used to receive the shortage of data scope, and uploads the shortage of data scope to the server and correspond to Missing data.
34. a kind of method of data transfer, methods described is applied to server side, it is characterised in that methods described includes:
According to receiving interruption position and uploading interruption position, judge whether to have uploaded but do not upload successful missing number According to;
If missing data be present, according to the reception interruption position and the number for uploading interruption position and determining missing data According to range of loss;
The shortage of data scope is sent to client, so that the client is according to uploading the shortage of data scope Missing data.
35. according to the method for claim 34, it is characterised in that according to reception interruption position and interruption position is uploaded, Judging whether to have uploaded but not uploading successful missing data includes:
Judge whether the reception interruption position and the upload interruption position are identical;
If the reception interruption position is identical with the upload interruption position, it is determined that the reception interruption position and the upload Missing data is not present between interruption position;
If the reception interruption position is different from the upload interruption position, it is determined that the reception interruption position and the upload Missing data between interruption position be present.
36. a kind of method of data transfer, methods described is applied to client-side, it is characterised in that methods described includes:
The shortage of data scope that the reception server is sent;
Missing data corresponding to the shortage of data scope is uploaded to the server.
37. according to the method for claim 36, it is characterised in that the shortage of data scope is by the server according to connecing Receive interruption position and upload interruption position and obtain.
38. a kind of device of data transfer, described device is applied to server side, it is characterised in that described device includes:
Judging unit, for according to receiving interruption position and uploading interruption position, judging whether to have uploaded but not uploading Successful missing data;
Determining unit, for when the judging unit judged result for missing data be present when, according to the reception interrupt bit Put and the interruption position that uploads determines the shortage of data scope of missing data;
Transmitting element, the shortage of data scope for the determining unit to be determined is sent to client, so as to the visitor Family end uploads the missing data according to the shortage of data scope.
39. a kind of device of data transfer, described device is applied to client-side, it is characterised in that described device includes:
Receiving unit, the shortage of data scope sent for the reception server;
Uploading unit, for uploading missing data corresponding to the shortage of data scope to the server.
CN201610649622.6A 2016-08-09 2016-08-09 System, the method and device of data transfer Pending CN107707590A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610649622.6A CN107707590A (en) 2016-08-09 2016-08-09 System, the method and device of data transfer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610649622.6A CN107707590A (en) 2016-08-09 2016-08-09 System, the method and device of data transfer

Publications (1)

Publication Number Publication Date
CN107707590A true CN107707590A (en) 2018-02-16

Family

ID=61169085

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610649622.6A Pending CN107707590A (en) 2016-08-09 2016-08-09 System, the method and device of data transfer

Country Status (1)

Country Link
CN (1) CN107707590A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110636340A (en) * 2019-09-30 2019-12-31 普联技术有限公司 Video file uploading method and storage device
CN113395353A (en) * 2021-06-30 2021-09-14 北京字节跳动网络技术有限公司 File downloading method and device, storage medium and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101184055A (en) * 2007-12-11 2008-05-21 腾讯科技(深圳)有限公司 Method and device of delivering, receiving, transmitting off-line files
CN102761614A (en) * 2012-06-29 2012-10-31 浪潮(北京)电子信息产业有限公司 Method and system for realizing breakpoint resume of network data transmission
CN102970104A (en) * 2012-10-24 2013-03-13 北京经纬恒润科技有限公司 Method for acquiring data and server
CN103986779A (en) * 2014-05-29 2014-08-13 沈文策 Application data transmission method, device and terminal equipment
US9305069B2 (en) * 2010-02-09 2016-04-05 Google Inc. Method and system for uploading data into a distributed storage system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101184055A (en) * 2007-12-11 2008-05-21 腾讯科技(深圳)有限公司 Method and device of delivering, receiving, transmitting off-line files
US9305069B2 (en) * 2010-02-09 2016-04-05 Google Inc. Method and system for uploading data into a distributed storage system
CN102761614A (en) * 2012-06-29 2012-10-31 浪潮(北京)电子信息产业有限公司 Method and system for realizing breakpoint resume of network data transmission
CN102970104A (en) * 2012-10-24 2013-03-13 北京经纬恒润科技有限公司 Method for acquiring data and server
CN103986779A (en) * 2014-05-29 2014-08-13 沈文策 Application data transmission method, device and terminal equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘维: "《精通MATLAB与CC++混合程序设计》", 31 July 2015 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110636340A (en) * 2019-09-30 2019-12-31 普联技术有限公司 Video file uploading method and storage device
CN110636340B (en) * 2019-09-30 2021-11-09 普联技术有限公司 Video file uploading method, storage device, terminal device and storage medium
CN113395353A (en) * 2021-06-30 2021-09-14 北京字节跳动网络技术有限公司 File downloading method and device, storage medium and electronic equipment
WO2023273725A1 (en) * 2021-06-30 2023-01-05 北京字节跳动网络技术有限公司 File downloading method and apparatus, storage medium and electronic device

Similar Documents

Publication Publication Date Title
CN110995513B (en) Data sending and receiving method in Internet of things system, internet of things equipment and platform
CN107483627A (en) A kind of file distributing, method for down loading, Distributor, client and system
CN102035859A (en) Method, system and device for displaying upload progress
CN103731499B (en) Terminal and document transmission method
CN103795762A (en) Reverse agent test system and method
CN105847386A (en) Live broadcasting stream processing method, device and system
CN113301568A (en) Network distribution method and device and intelligent household equipment
CN104468594B (en) The method, apparatus and system of a kind of request of data
CN105721526B (en) The synchronous method and device of a kind of terminal, server file
CN104125303B (en) Reading and writing data requesting method, client and system
CN103763380B (en) A kind of method and system of synchronous demonstrating data
CN104504006A (en) Method and system for acquiring and analyzing data on news client
CN111083204B (en) File transmission method, device and storage medium
CN107707590A (en) System, the method and device of data transfer
CN111447265A (en) File storage method, file downloading method, file processing method and related components
CN109150981B (en) Block chain network networking method, device, equipment and computer readable storage medium
CN106933569A (en) A kind of webpage method for refreshing and device
CN110445658B (en) Message processing method and system
EP2690560A2 (en) Method of benchmarking the behaviour of a replacement information system with the old system
CN106303577A (en) Download the method and device of Streaming Media
CN105281940A (en) Method, device and system of HELLO message interaction on the basis of NETCONF (The Network Configuration Protocol)
CN108243208A (en) A kind of method of data synchronization and device
CN105721231B (en) A kind of quality of service perception detection method and device
CN107423446A (en) New media based on cloud storage automates credible deployment system and method
CN109104472B (en) Block chain network networking method, device, equipment and computer readable storage medium

Legal Events

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

Application publication date: 20180216

RJ01 Rejection of invention patent application after publication