CN105338090A - WebSocket-based breakpoint continuous transmission method and device - Google Patents

WebSocket-based breakpoint continuous transmission method and device Download PDF

Info

Publication number
CN105338090A
CN105338090A CN201510772456.4A CN201510772456A CN105338090A CN 105338090 A CN105338090 A CN 105338090A CN 201510772456 A CN201510772456 A CN 201510772456A CN 105338090 A CN105338090 A CN 105338090A
Authority
CN
China
Prior art keywords
files
blocks
file destination
file
uploaded
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
CN201510772456.4A
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.)
Inspur Software Group Co Ltd
Original Assignee
Inspur Software Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inspur Software Group Co Ltd filed Critical Inspur Software Group Co Ltd
Priority to CN201510772456.4A priority Critical patent/CN105338090A/en
Publication of CN105338090A publication Critical patent/CN105338090A/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/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • 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 invention provides a WebSocket-based breakpoint continuous transmission method and device, wherein the method comprises the following steps: determining a target file, and adding the target file into a to-be-uploaded column for file uploading; calculating a hash value of a target file in a queue to be uploaded, sending file information of the target file to a server side so that the server side divides the target file into a plurality of pieces of file block information, and judging whether file blocks corresponding to each piece of file block information are successfully uploaded or not according to the divided pieces of file block information; receiving an uploading instruction sent by a server when determining that the file blocks which are not successfully uploaded exist, wherein the uploading instruction comprises file block information corresponding to the file blocks which are not successfully uploaded, and the file block information comprises a hash value and an initial position of the file blocks which are not successfully uploaded in a target file; and uploading the file blocks which are not successfully uploaded according to the uploading instruction. The invention can realize the breakpoint continuous transmission of the file and improve the transmission efficiency of the larger file.

Description

The breaker point continuous transmission method of a kind of sing on web Socket and device
Technical field
The present invention relates to computer networking technology, particularly relate to breaker point continuous transmission method and the device of a kind of sing on web Socket.
Background technology
Along with the fast development of Internet technology, between each enterprise, file transfers efficiency is also more and more higher.Between enterprise or when enterprises carries out file transfers, transmit leg directly can utilize Internet technology, and the file of required transmission is sent to recipient.But may gap be there is in the network speed of transmit leg and recipient, or, there is the network stabilization of one or both very poor, the interruption in file transfer processes may be caused, make file cannot continue to upload transmitting a half.
At present, in the process transmitting file, interrupt if something unexpected happened, can only again transmit this file, when file is larger, greatly have impact on the efficiency of file transfers.
Summary of the invention
In view of this, the invention provides breaker point continuous transmission method and the device of a kind of sing on web Socket, after file transfers accidental interruption, breakpoint transmission can be realized.
First aspect, embodiments provides the breaker point continuous transmission method of a kind of sing on web Socket, is applied to client, comprises:
Send to the file destination of server end needed for determining, and described file destination is added to be uploaded wait to arrange in carry out files passe;
Calculate the hashed value of the described file destination in described queue to be uploaded, and the fileinfo of described file destination is sent to server end, described fileinfo comprises the hashed value of described file destination, to make described server end that described file destination is divided into multiple blocks of files information, and judge whether blocks of files corresponding to each blocks of files information is uploaded successfully according to the multiple blocks of files information divided;
The uploading instructions that reception server end sends when determining to include and not uploading successful blocks of files, do not upload the corresponding blocks of files information of successful blocks of files described in described uploading instructions comprises, described blocks of files information comprises hashed value and does not describedly upload the original position of successful blocks of files in described file destination;
According to described uploading instructions, do not upload successful blocks of files upload described.
Preferably,
Comprise further: set up many interface channels between server end, and be the corresponding queue to be uploaded of each interface channel configuration;
Described described file destination is added to be uploaded wait to arrange in carry out files passe and comprise: described file destination is added described many to be uploaded wait to arrange at least one queue to be uploaded in carry out files passe.
Second aspect, embodiments provides the breaker point continuous transmission method of a kind of sing on web Socket, is applied to server end, comprises:
Receive the fileinfo that the file destination of the required transmission that client sends is corresponding, described fileinfo comprises the hashed value of described file destination;
Described file destination is divided into multiple blocks of files information by the fileinfo according to described file destination, and each fileinfo comprises hashed value and describedly do not upload the original position of successful blocks of files in described file destination;
Judge whether each blocks of files is uploaded successfully according to each blocks of files information, determine to include do not upload successful blocks of files time, uploading instructions is sent to client, the corresponding blocks of files information of successful blocks of files is not uploaded described in described uploading instructions comprises, described blocks of files information comprises hashed value and does not describedly upload the original position of successful blocks of files in described file destination, does not upload described successful blocks of files and uploads to make client according to described uploading instructions.
Preferably,
Described judge whether each file is uploaded successfully according to each blocks of files information before, comprise further: according to hashed value and first character string of described file destination, first file is named, and the multiple blocks of files information after dividing are stored in described first file; Wherein, described multiple blocks of files information comprises: original position in described file destination of the upload progress of blocks of files quantity, each blocks of files, each blocks of files and each blocks of files whether upload in successful mark one or more;
Described judge whether each file is uploaded successfully according to each blocks of files information before, comprise further: according to hashed value and second character string of described file destination, second file is named, and successful each blocks of files will be uploaded is stored in described second file.
Preferably, after determining that the All Files block included by described file destination is all uploaded successfully, comprise further: perform the deletion action to multiple blocks of files information corresponding to the described file destination stored in described first file, and/or, perform the deletion action to described file destination in described second file.
The third aspect, embodiments provides a kind of client, comprising:
Determining unit, for sending to the file destination of server end needed for determining;
Uploading unit, for described file destination is added to be uploaded wait to arrange in carry out files passe;
Processing unit, for calculating the hashed value of the described file destination in described queue to be uploaded, and the fileinfo of described file destination is sent to server end, described fileinfo comprises the hashed value of described file destination, to make described server end that described file destination is divided into multiple blocks of files information, and judge whether blocks of files corresponding to each blocks of files information is uploaded successfully according to the multiple blocks of files information divided;
Receiving element, for the uploading instructions that reception server end sends when determining to include and not uploading successful blocks of files, do not upload the corresponding blocks of files information of successful blocks of files described in described uploading instructions comprises, described blocks of files information comprises hashed value and does not describedly upload the original position of successful blocks of files in described file destination;
Described uploading unit, for according to described uploading instructions, does not upload successful blocks of files upload described.Preferably, comprise further:
Set up unit, for setting up many interface channels between server end;
Dispensing unit, for being the corresponding queue to be uploaded of each interface channel configuration;
Described uploading unit, specifically for described file destination is added described many to be uploaded wait to arrange at least one queue to be uploaded in carry out files passe.
Fourth aspect, embodiments provides a kind of server end, comprising:
Receiving element, the fileinfo that the file destination for receiving transmission needed for client transmission is corresponding, described fileinfo comprises the hashed value of described file destination;
Division unit, is divided into multiple blocks of files information for the fileinfo according to described file destination by described file destination, and each fileinfo comprises hashed value and describedly do not upload the original position of successful blocks of files in described file destination;
Judging unit, for judging whether each blocks of files is uploaded successfully according to each blocks of files information, triggering transmitting element when determining to include and not uploading successful blocks of files and performing corresponding operating;
Described transmitting element, for sending uploading instructions to client, the corresponding blocks of files information of successful blocks of files is not uploaded described in described uploading instructions comprises, described blocks of files information comprises hashed value and does not describedly upload the original position of successful blocks of files in described file destination, does not upload described successful blocks of files and uploads to make client according to described uploading instructions.
Preferably, comprise further:
First processing unit, for according to the hashed value of described file destination and the first character string, names the first file, and is stored in described first file by the multiple blocks of files information after dividing; Wherein, described multiple blocks of files information comprises: original position in described file destination of the upload progress of blocks of files quantity, each blocks of files, each blocks of files and each blocks of files whether upload in successful mark one or more;
Second processing unit, for according to the hashed value of described file destination and the second character string, names the second file, and will upload successful each blocks of files and be stored in described second file.
Preferably, comprise further:
Delete cells, for performing the deletion action to multiple blocks of files information corresponding to the described file destination stored in described first file, and/or, perform the deletion action to described file destination in described second file.
The breaker point continuous transmission method of the sing on web Socket that the embodiment of the present invention proposes and device, according to the fileinfo of file destination, file destination can be divided into multiple blocks of files information, server end judges whether blocks of files is uploaded, determine to include do not upload successful blocks of files time, uploading instructions is sent to client, the corresponding blocks of files information of successful blocks of files is not uploaded described in described uploading instructions comprises, described blocks of files information comprises hashed value and does not describedly upload the original position of successful blocks of files in described file destination, like this, client just can not uploaded successful blocks of files upload described according to described uploading instructions, thus realize the breakpoint transmission of file, thus the transmission efficiency improved compared with large files.
Accompanying drawing explanation
Fig. 1 is the method flow diagram that the embodiment of the present invention provides;
Fig. 2 is the method flow diagram that another embodiment of the present invention provides;
Fig. 3 is the method flow diagram that further embodiment of this invention provides;
Fig. 4 is the client terminal structure schematic diagram that the embodiment of the present invention provides;
Fig. 5 is the client terminal structure schematic diagram that another embodiment of the present invention provides;
Fig. 6 is the server end structural representation that the embodiment of the present invention provides;
Fig. 7 is the server end structural representation that another embodiment of the present invention provides;
Fig. 8 is the server end structural representation that further embodiment of this invention provides.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described.Obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
Embodiments provide the breaker point continuous transmission method of a kind of sing on web Socket, be applied to client, see Fig. 1, the method can comprise the following steps:
Step 101: the file destination sending to server end needed for determining, and described file destination is added in queue to be uploaded carry out files passe;
Step 102: the hashed value calculating the described file destination in described queue to be uploaded, and the fileinfo of described file destination is sent to server end, described fileinfo comprises the hashed value of described file destination, to make described server end that described file destination is divided into multiple blocks of files information, and judge whether blocks of files corresponding to each blocks of files information is uploaded successfully according to the multiple blocks of files information divided;
Step 103: the uploading instructions that reception server end sends when determining to include and not uploading successful blocks of files, do not upload the corresponding blocks of files information of successful blocks of files described in described uploading instructions comprises, described blocks of files information comprises hashed value and does not describedly upload the original position of successful blocks of files in described file destination;
Step 104: according to described uploading instructions, does not upload successful blocks of files upload described.
Visible, due to the breaker point continuous transmission method of sing on web Socket proposed in the embodiment of the present invention, client can calculate the hashed value of file destination and send the fileinfo of described file destination to server end, like this, file destination just can be divided into multiple blocks of files information according to described fileinfo by server end, and judge whether blocks of files is uploaded successfully according to blocks of files information, when having non-upload file block, uploading instructions is sent to client, client is not uploaded successful blocks of files upload described after reception uploading instructions, thus realize the breakpoint transmission of file, thus the transmission efficiency improved compared with large files.
In a preferred embodiment of the invention, because single interface channel is slower in upload file hourly velocity, so before step 101, can also comprise: set up many interface channels between server end, and be the corresponding queue to be uploaded of each interface channel configuration; Described described file destination is added to be uploaded wait to arrange in carry out files passe and comprise: described file destination is added described many to be uploaded wait to arrange at least one queue to be uploaded in carry out files passe.Visible, owing to setting up many interface channels between server end, and be the corresponding queue to be uploaded of each interface channel configuration, described file destination is added described many to be uploaded wait to arrange at least one queue to be uploaded in carry out files passe, thus realize multiple file cocurrent and upload, thus in the fireballing situation of network speed, accelerate the uploading speed of file.
Embodiments provide the breaker point continuous transmission method of a kind of sing on web Socket, be applied to server end, see Fig. 2, the method can comprise the following steps:
Step 201: receive the fileinfo that the file destination of the required transmission that client sends is corresponding, described fileinfo comprises the hashed value of described file destination;
Step 202: described file destination is divided into multiple blocks of files information by the fileinfo according to described file destination, each fileinfo comprises hashed value and does not describedly upload the original position of successful blocks of files in described file destination;
Step 203: judge whether each blocks of files is uploaded successfully according to each blocks of files information, determine to include do not upload successful blocks of files time, uploading instructions is sent to client, the corresponding blocks of files information of successful blocks of files is not uploaded described in described uploading instructions comprises, described blocks of files information comprises hashed value and does not describedly upload the original position of successful blocks of files in described file destination, does not upload described successful blocks of files and uploads to make client according to described uploading instructions.
Visible, due to the breaker point continuous transmission method of sing on web Socket proposed in the embodiment of the present invention, described file destination is divided into multiple blocks of files information by the fileinfo that the file destination that server end can send according to client is corresponding, judge whether each blocks of files is uploaded successfully according to each blocks of files information, determine to include do not upload successful blocks of files time, uploading instructions is sent to client, client receives after uploading instructions and does not upload successful blocks of files upload described, thus realize the breakpoint transmission of file, thus the transmission efficiency improved compared with large files.
In a preferred embodiment of the invention, in order to distinguish described blocks of files information and the blocks of files uploaded, before step 203, comprise further: according to hashed value and first character string of described file destination, first file is named, and the multiple blocks of files information after dividing are stored in described first file; Wherein, described multiple blocks of files information comprises: original position in described file destination of the upload progress of blocks of files quantity, each blocks of files, each blocks of files and each blocks of files whether upload in successful mark one or more; Described judge whether each file is uploaded successfully according to each blocks of files information before, comprise further: according to hashed value and second character string of described file destination, second file is named, and successful each blocks of files will be uploaded be stored in described second file, thus complete the name of described blocks of files information with the blocks of files uploaded, thus achieve the differentiation of described blocks of files information with the blocks of files uploaded.
In a preferred embodiment of the invention, in order to reduce the hard drive space shared by server end, after determining that the All Files block included by described file destination is all uploaded successfully, comprise further: perform the deletion action to multiple blocks of files information corresponding to the described file destination stored in described first file, and/or, perform the deletion action to described file destination in described second file, thus complete and delete uploading the discarded record successfully, thus decrease the hard drive space that server end takies.
For making the object, technical solutions and advantages of the present invention clearly, below in conjunction with specific embodiment, the present invention is described in further detail.
Embodiments provide the breaker point continuous transmission method of a kind of sing on web Socket, please refer to Fig. 3, the method comprises following implementation procedure:
Step 301: client sets up at least one interface channel between server end, and configures a queue to be uploaded for each interface channel.
In the present embodiment, client according to the network speed between server end, can determine the number of the interface channel set up.
Wherein, network speed is faster, and the number of the passage that can connect is more.Such as, current network speed is 2M/s, can determine to set up 5 interface channels, be respectively interface channel 1, interface channel 2, interface channel 3, interface channel 4 and interface channel 5.
In the present embodiment, in order to ensure uploading in order of file, a queue to be uploaded can be configured for each interface channel, uploading in order so that file to be uploaded is sent in queue to be uploaded.
Step 302: the file destination sending to server end needed for determining, and file destination is added at least one to be uploaded wait to arrange in carry out files passe.
In the present embodiment, this file destination can be added in a queue to be uploaded and carry out files passe, also this file destination can be divided into multiple part, and each part be joined the parallel of realize target file in a queue to be uploaded and upload, to improve the efficiency of files passe.
Step 303: client judges whether there is the file uploaded in queue to be uploaded, if had, performs step 304.
In the present embodiment, the file uploaded in this queue to be uploaded may be whole file destination, also may be remaining a part of file destination.
That whole file destinations is described the present embodiment for the file uploaded in this queue to be uploaded below.
Step 304: client calculates the hashed value of the file destination in queue to be uploaded, and the fileinfo sending file destination to server end, wherein, this fileinfo comprises the hashed value of file destination.
In the present embodiment, hashed value is the numerical value utilizing logical operation to obtain according to file content, and this hashed value is used for identification document uniqueness.Wherein, this logical operation can comprise: any one in MD2, MD4, MD5 and SHA-1.
In the present embodiment, the fileinfo of file destination can comprise the file size of file destination, the hashed value of file destination, the file name of file destination and the instruction type of file destination.Wherein hashed value is used for differentiating file; The instruction type of file destination to be uploaded is file header.Such as, this file size is 40MB, and hashed value is 123, and name is called company information, and instruction type is file header.
Step 305: the fileinfo of the file destination that received server-side client sends, and the hashed value of this file destination comprised by fileinfo is delivered to operation system, according to hashed value, operation system judges whether file is successfully uploaded, if not, perform step 306, otherwise, perform step 312.
In the present embodiment, operation system can be searched for uploading in successful file according to this hashed value, if search identical hashed value, then uploads successfully for characterizing this file, otherwise, do not upload successfully for characterizing this file.
Step 306: file destination is divided at least one blocks of files information according to the fileinfo of file destination by server end, each fileinfo comprises hashed value and does not upload the original position of successful blocks of files in file destination.
In the present embodiment, server end can determine Divide File to be the number of blocks of files according to file size, current network speed, server handling ability.
Wherein, file is larger, and current network speed is faster, and server handling ability is stronger, and the blocks of files number divided is more.Such as, file size is 50MB, and network speed is 2M/s, and server handling ability is very strong, can determine Divide File to be become 10 blocks of files.
In the present embodiment, in order to the blocks of files information divided with upload successful blocks of files and distinguish, and successful blocks of files can be uploaded be stored into blocks of files information respectively in different files.
In a preferred embodiment of the invention, can be named by the hashed value of file for storage file block message and the file uploading successful blocks of files, and in order to distinguish the title of two files, can name each file respectively in the following way:
1, obtain character string 1, according to hashed value and the character string 1 of file destination, file 1 is named, and the multiple blocks of files information after dividing are stored in file 1; Wherein, multiple blocks of files information can comprise: original position in file destination of the upload progress of blocks of files quantity, each blocks of files, each blocks of files and each blocks of files whether upload in successful mark one or more.Wherein, this character string 1 can comprise the character such as letter, numeral, and such as, this character string 1 is ABC, and hashed value is 123.
Wherein, can comprise according to the mode that hashed value and the character string 1 of file destination carry out naming: " hashed value " " character string 1 ", such as " 123ABC ", or, " character string 1 " " hashed value ", such as " ABC123 ".
2, obtain character string 2, according to hashed value and the character string 2 of file destination, file 2 is named, and successful each blocks of files will be uploaded be stored in file 2.Such as, this character string 2 is fdat, and hashed value is 123.
In like manner, can comprise according to the mode that hashed value and character string 2 pairs of files 2 of file destination carry out order: the mode of hashed value connection string 2, such as, " 123fdat ", or character string 2 connects the mode of hashed value, such as, " fdat123 ", then or, the combination in any of character string more than 2 hashed value.
By the way to described blocks of files information and the name of blocks of files of uploading, thus achieve described blocks of files information and the differentiation of blocks of files of uploading and preservation.
Step 307: server end is according to the hashed value of this file destination and each blocks of files information, determine whether not upload successful file, when being defined as not uploading successful blocks of files, not uploading successful blocks of files and sent uploading instructions according to this to client.
In the present embodiment, uploading instructions comprises the corresponding blocks of files information not uploading successful blocks of files, and blocks of files information comprises hashed value and do not upload the original position of successful blocks of files in file destination.Wherein, hashed value is used for identifying file, and original position is used for determining non-upload file block position hereof, thus accomplishes to upload from breakpoint.
In order to client can show the upload progress of the blocks of files uploaded, this uploading instructions can also comprise the blocks of files number of needs transmission, current transmission progress and transport-type, and wherein, this transport-type can in transmission.
Step 308: the uploading instructions that client reception server end sends.
Step 309: client, according to uploading instructions, will not uploaded successful blocks of files and rejoined to upload to server end in queue to be uploaded, and show the upload progress of the blocks of files that this is uploaded again.
In the present embodiment, client identifies the file do not uploaded by the file hash in uploading instructions, and determines non-upload file block position hereof by the original position in uploading instructions, thus determines the blocks of files do not uploaded.
In the present embodiment, client, by display-object files passe progress, can allow user understand the real-time progress uploaded of file, be convenient to the estimation of user to uplink time.Wherein, this upload contents can comprise blocks of files content, blocks of files number, blocks of files start-stop position, the hashed value of file and instruction type.Wherein instruction type is blocks of files.
Step 310: received server-side also preserves blocks of files content, blocks of files number, blocks of files start-stop position, the hashed value of file and instruction type, and calculation document upload progress, upgrades the file uploading successful blocks of files.
In the present embodiment, calculation document upload progress transaction file block message file, can the file progress that sends to client of Deterministic service device end be last look, ensure that the real-time update of client file progress.
Step 311: server end is used for storing the file uploading successful blocks of files judges file destination whether end of transmission according to this, if not, perform step 307.
In the present embodiment, upload if Single document does not complete, perform step 307, namely files passe process is proceeded to file destination.
Step 312: server end is by the hashed value of file after file destination files passe completes, and file name, file size and file storage location pass to operation system.
Step 313: operation system process fileinfo, after being disposed, send delete instruction to server end, server end is deleted file according to delete instruction.
In the present embodiment, file destination is uploaded successfully, uploads successful fileinfo and is processed by operation system, achieves being separated of uploading system and operation system.
In the present embodiment, delete instruction can comprise the content of the hashed value of file destination and the deletion required for service needed.
In the present embodiment, in order to reduce the hard drive space shared by server end, after determining that the All Files block included by file destination is all uploaded successfully, can perform the deletion action of multiple blocks of files information corresponding to the file destination stored in the first file and the deletion action to the second file internal object file according to delete instruction; Or the deletion action performed multiple blocks of files information corresponding to the file destination stored in the first file; Or the deletion action performed the second file internal object file; Or deletion action is not performed to the file in two files.Thus complete and delete uploading the discarded record successfully, thus decrease the hard drive space that server end takies.
Step 314: server end sends the complete instruction of files passe to client, and files passe instruction comprises file hash and instruction type, and instruction type is end of transmission, for notifying that user's files passe terminates.
Step 315: after client receives and uploads complete instruction, showing current upload file progress is 100%.
In the present embodiment, after files passe, client display upload file progress is 100%, and user can know that file has been uploaded complete in time.
The embodiment of the present invention also proposed a kind of client, and as shown in Figure 4, this client comprises:
Determining unit 401, for sending to the file destination of server end needed for determining;
Uploading unit 402, for described file destination is added to be uploaded wait to arrange in carry out files passe;
Processing unit 403, for calculating the hashed value of the described file destination in described queue to be uploaded, and the fileinfo of described file destination is sent to server end, described fileinfo comprises the hashed value of described file destination, to make described server end that described file destination is divided into multiple blocks of files information, and judge whether blocks of files corresponding to each blocks of files information is uploaded successfully according to the multiple blocks of files information divided;
Receiving element 404, for the uploading instructions that reception server end sends when determining to include and not uploading successful blocks of files, do not upload the corresponding blocks of files information of successful blocks of files described in described uploading instructions comprises, described blocks of files information comprises hashed value and does not describedly upload the original position of successful blocks of files in described file destination;
Described uploading unit 402, for according to described uploading instructions, does not upload successful blocks of files upload described.
In the embodiment of the present invention, in order to set up many interface channels between server end, and be the corresponding queue to be uploaded of each interface channel configuration, as shown in Figure 5, client also comprises:
Set up unit 501, for setting up many interface channels between server end;
Dispensing unit 502, for being the corresponding queue to be uploaded of each interface channel configuration.
Described uploading unit 402, specifically for described file destination is added described many to be uploaded wait to arrange at least one queue to be uploaded in carry out files passe.
The embodiment of the present invention also proposed a kind of server end, and as shown in Figure 6, this server end comprises:
Receiving element 601, the fileinfo that the file destination for receiving transmission needed for client transmission is corresponding, described fileinfo comprises the hashed value of described file destination;
Division unit 602, is divided into multiple blocks of files information for the fileinfo according to described file destination by described file destination, and each fileinfo comprises hashed value and describedly do not upload the original position of successful blocks of files in described file destination;
Judging unit 603, for judging whether each blocks of files is uploaded successfully according to each blocks of files information, triggering transmitting element when determining to include and not uploading successful blocks of files and performing corresponding operating;
Transmitting element 604, for sending uploading instructions to client, the corresponding blocks of files information of successful blocks of files is not uploaded described in described uploading instructions comprises, described blocks of files information comprises hashed value and does not describedly upload the original position of successful blocks of files in described file destination, does not upload described successful blocks of files and uploads to make client according to described uploading instructions.
In the embodiment of the present invention, in order to distinguish described blocks of files information and the blocks of files uploaded and preserve, as shown in Figure 7, server end also comprises:
First processing unit 701, for according to the hashed value of described file destination and the first character string, names the first file, and is stored in described first file by the multiple blocks of files information after dividing; Wherein, described multiple blocks of files information comprises: original position in described file destination of the upload progress of blocks of files quantity, each blocks of files, each blocks of files and each blocks of files whether upload in successful mark one or more;
Second processing unit 702, for according to the hashed value of described file destination and the second character string, names the second file, and will upload successful each blocks of files and be stored in described second file.
In the embodiment of the present invention, in order to reduce the hard drive space shared by server end, server end also comprises:
Delete cells 801, for performing the deletion action to multiple blocks of files information corresponding to the described file destination stored in described first file, and/or, perform the deletion action to described file destination in described second file.
In sum, the embodiment of the present invention at least can realize following effect:
In embodiments of the present invention, client sets up at least one interface channel between server end, and configure a queue to be uploaded for each interface channel, therefore this file destination can be divided into multiple part, and each part is joined the parallel of realize target file in a queue to be uploaded and upload, thus improve the efficiency of files passe.Therefore, the present invention can improve the upper transfer efficiency of files passe.
In embodiments of the present invention, in order to ensure uploading in order of file, for each interface channel configures a queue to be uploaded, upload in order so that file to be uploaded is sent in queue to be uploaded.Therefore, the present invention can ensure uploading in order of file.
In embodiments of the present invention, because operation system can be searched for uploading in successful file according to hashed value, thus judge whether file is uploaded, thus avoid content same file to repeat to upload, save network bandwidth resources, improve uploading speed.Therefore, the present invention can save network bandwidth resources, improves uploading speed.
In embodiments of the present invention, server end can determine Divide File to be the number of blocks of files according to file size, current network speed, server handling ability, thus large files is divided into multiple blocks of files and uploads, thus when network speed is fast, accelerate the uploading speed of large files.Therefore, the present invention can improve the uploading speed of large files.
In embodiments of the present invention, in order to distinguish the blocks of files information divided and the blocks of files uploaded, according to hashed value and first character string of described file destination, the first file is named, and the multiple blocks of files information after dividing are stored in described first file; According to hashed value and second character string of described file destination, second file is named, and successful each blocks of files will be uploaded be stored in described second file, thus complete described blocks of files information and the name of blocks of files of uploading, thus achieve described blocks of files information and the differentiation of blocks of files of uploading and preservation.Therefore, the present invention can distinguish the blocks of files information divided and the blocks of files uploaded.
In embodiments of the present invention, uploading instructions comprises the corresponding blocks of files information not uploading successful blocks of files, and blocks of files information comprises hashed value and do not upload the original position of successful blocks of files in file destination.Wherein, hashed value is used for identifying file, and original position is used for determining non-upload file block position hereof, thus accomplishes to upload from breakpoint.When network environment instability, can by breakpoint transmission by stable for large files end of uploading onto the server.Therefore, the present invention can realize breakpoint transmission, and is uploaded stable for large files by breakpoint transmission.
In embodiments of the present invention, client can show current files passe progress.Therefore, the present invention can allow user understand the upload progress of file at any time.
In embodiments of the present invention, in order to reduce the hard drive space shared by server end, after determining that the All Files block included by described file destination is all uploaded successfully, perform the deletion action to multiple blocks of files information corresponding to the described file destination stored in described first file, and/or, perform deletion action to described file destination in described second file, thus complete and delete uploading the discarded record successfully, thus decrease the hard drive space that server end takies.Therefore, the present invention effectively can reduce the hard drive space that server end takies.
9, in embodiments of the present invention, Single document is uploaded successfully, uploads successful fileinfo and is processed by operation system, achieves being separated of uploading system and operation system.Therefore the present invention can realize being separated of uploading system and operation system.
10, in embodiments of the present invention, after files passe, it is 100% that client can show upload file progress.Therefore user can know that file has been uploaded complete in time.
Finally it should be noted that: the foregoing is only preferred embodiment of the present invention, only for illustration of technical scheme of the present invention, be not intended to limit protection scope of the present invention.All any amendments done within the spirit and principles in the present invention, equivalent replacement, improvement etc., be all included in protection scope of the present invention.

Claims (10)

1. a breaker point continuous transmission method of sing on web Socket, is characterized in that, is applied to client, comprising:
Send to the file destination of server end needed for determining, and described file destination is added to be uploaded wait to arrange in carry out files passe;
Calculate the hashed value of the described file destination in described queue to be uploaded, and the fileinfo of described file destination is sent to server end, described fileinfo comprises the hashed value of described file destination, to make described server end that described file destination is divided into multiple blocks of files information, and judge whether blocks of files corresponding to each blocks of files information is uploaded successfully according to the multiple blocks of files information divided;
The uploading instructions that reception server end sends when determining to include and not uploading successful blocks of files, do not upload the corresponding blocks of files information of successful blocks of files described in described uploading instructions comprises, described blocks of files information comprises hashed value and does not describedly upload the original position of successful blocks of files in described file destination;
According to described uploading instructions, do not upload successful blocks of files upload described.
2. method according to claim 1, is characterized in that,
Comprise further: set up many interface channels between server end, and be the corresponding queue to be uploaded of each interface channel configuration;
Described described file destination is added to be uploaded wait to arrange in carry out files passe and comprise: described file destination is added described many to be uploaded wait to arrange at least one queue to be uploaded in carry out files passe.
3. a breaker point continuous transmission method of sing on web Socket, is characterized in that, is applied to server end, comprising:
Receive the fileinfo that the file destination of the required transmission that client sends is corresponding, described fileinfo comprises the hashed value of described file destination;
Described file destination is divided into multiple blocks of files information by the fileinfo according to described file destination, and each fileinfo comprises hashed value and describedly do not upload the original position of successful blocks of files in described file destination;
Judge whether each blocks of files is uploaded successfully according to each blocks of files information, determine to include do not upload successful blocks of files time, uploading instructions is sent to client, the corresponding blocks of files information of successful blocks of files is not uploaded described in described uploading instructions comprises, described blocks of files information comprises hashed value and does not describedly upload the original position of successful blocks of files in described file destination, does not upload described successful blocks of files and uploads to make client according to described uploading instructions.
4. method according to claim 3, is characterized in that,
Described judge whether each file is uploaded successfully according to each blocks of files information before, comprise further: according to hashed value and first character string of described file destination, first file is named, and the multiple blocks of files information after dividing are stored in described first file; Wherein, described multiple blocks of files information comprises: original position in described file destination of the upload progress of blocks of files quantity, each blocks of files, each blocks of files and each blocks of files whether upload in successful mark one or more;
Described judge whether each file is uploaded successfully according to each blocks of files information before, comprise further: according to hashed value and second character string of described file destination, second file is named, and successful each blocks of files will be uploaded is stored in described second file.
5. method according to claim 4, it is characterized in that, after determining that the All Files block included by described file destination is all uploaded successfully, comprise further: perform the deletion action to multiple blocks of files information corresponding to the described file destination stored in described first file, and/or, perform the deletion action to described file destination in described second file.
6. a client, is characterized in that, comprising:
Determining unit, for sending to the file destination of server end needed for determining;
Uploading unit, for described file destination is added to be uploaded wait to arrange in carry out files passe;
Processing unit, for calculating the hashed value of the described file destination in described queue to be uploaded, and the fileinfo of described file destination is sent to server end, described fileinfo comprises the hashed value of described file destination, to make described server end that described file destination is divided into multiple blocks of files information, and judge whether blocks of files corresponding to each blocks of files information is uploaded successfully according to the multiple blocks of files information divided;
Receiving element, for the uploading instructions that reception server end sends when determining to include and not uploading successful blocks of files, do not upload the corresponding blocks of files information of successful blocks of files described in described uploading instructions comprises, described blocks of files information comprises hashed value and does not describedly upload the original position of successful blocks of files in described file destination;
Described uploading unit, for according to described uploading instructions, does not upload successful blocks of files upload described.
7. client according to claim 6, comprises further:
Set up unit, for setting up many interface channels between server end;
Dispensing unit, for being the corresponding queue to be uploaded of each interface channel configuration;
Described uploading unit, specifically for described file destination is added described many to be uploaded wait to arrange at least one queue to be uploaded in carry out files passe.
8. a server end, is characterized in that, comprising:
Receiving element, the fileinfo that the file destination for receiving transmission needed for client transmission is corresponding, described fileinfo comprises the hashed value of described file destination;
Division unit, is divided into multiple blocks of files information for the fileinfo according to described file destination by described file destination, and each fileinfo comprises hashed value and describedly do not upload the original position of successful blocks of files in described file destination;
Judging unit, for judging whether each blocks of files is uploaded successfully according to each blocks of files information, triggering transmitting element when determining to include and not uploading successful blocks of files and performing corresponding operating;
Described transmitting element, for sending uploading instructions to client, the corresponding blocks of files information of successful blocks of files is not uploaded described in described uploading instructions comprises, described blocks of files information comprises hashed value and does not describedly upload the original position of successful blocks of files in described file destination, does not upload described successful blocks of files and uploads to make client according to described uploading instructions.
9. server end according to claim 8, comprises further:
First processing unit, for according to the hashed value of described file destination and the first character string, names the first file, and is stored in described first file by the multiple blocks of files information after dividing; Wherein, described multiple blocks of files information comprises: original position in described file destination of the upload progress of blocks of files quantity, each blocks of files, each blocks of files and each blocks of files whether upload in successful mark one or more;
Second processing unit, for according to the hashed value of described file destination and the second character string, names the second file, and will upload successful each blocks of files and be stored in described second file.
10. server end according to claim 9, is characterized in that, comprises further:
Delete cells, for performing the deletion action to multiple blocks of files information corresponding to the described file destination stored in described first file, and/or, perform the deletion action to described file destination in described second file.
CN201510772456.4A 2015-11-12 2015-11-12 WebSocket-based breakpoint continuous transmission method and device Pending CN105338090A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510772456.4A CN105338090A (en) 2015-11-12 2015-11-12 WebSocket-based breakpoint continuous transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510772456.4A CN105338090A (en) 2015-11-12 2015-11-12 WebSocket-based breakpoint continuous transmission method and device

Publications (1)

Publication Number Publication Date
CN105338090A true CN105338090A (en) 2016-02-17

Family

ID=55288365

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510772456.4A Pending CN105338090A (en) 2015-11-12 2015-11-12 WebSocket-based breakpoint continuous transmission method and device

Country Status (1)

Country Link
CN (1) CN105338090A (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105812456A (en) * 2016-03-08 2016-07-27 北京恒华伟业科技股份有限公司 File transmission method and device
CN107682399A (en) * 2017-08-29 2018-02-09 中国信息安全测评中心 A kind of file breaker point continuous transmission method based on big data
CN107707679A (en) * 2017-11-27 2018-02-16 小草数语(北京)科技有限公司 File uploading method and device
CN108093063A (en) * 2017-12-26 2018-05-29 中国电信股份有限公司新疆分公司 Big file multithreading FTP method for uploading
CN108234539A (en) * 2016-12-14 2018-06-29 北京金山云网络技术有限公司 A kind of file upload, download, transmission method and device
CN109819339A (en) * 2017-11-20 2019-05-28 创盛视联数码科技(北京)有限公司 The method of HTML5 breakpoint transmission
CN111314449A (en) * 2020-02-06 2020-06-19 北京东方金信科技有限公司 File breakpoint continuous transmission method and system
CN112637343A (en) * 2020-12-23 2021-04-09 中国建设银行股份有限公司 File transmission method, device and system
CN112769906A (en) * 2020-12-25 2021-05-07 三盟科技股份有限公司 File breakpoint uploading method and system, computer equipment and storage medium
CN113111043A (en) * 2021-04-21 2021-07-13 北京大学 Method, device and system for processing source data file of middle station and storage medium
CN114095493A (en) * 2021-11-17 2022-02-25 兰州乐智教育科技有限责任公司 File uploading method and system based on breakpoint retransmission
CN115378933A (en) * 2022-10-25 2022-11-22 四川蜀天信息技术有限公司 Breakpoint resume method and device for file transmission

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6098180A (en) * 1997-02-18 2000-08-01 E-Parcel, Llc Robust delivery system
CN101179393A (en) * 2006-12-14 2008-05-14 腾讯科技(深圳)有限公司 Method and system for implementing document breakpoint transmission
CN101674263A (en) * 2008-09-11 2010-03-17 华为技术有限公司 Transmission method, transmission system, transmission device and receiving device of large data object
CN102761614A (en) * 2012-06-29 2012-10-31 浪潮(北京)电子信息产业有限公司 Method and system for realizing breakpoint resume of network data transmission
CN103401914A (en) * 2013-07-26 2013-11-20 浪潮电子信息产业股份有限公司 File uploading broken-point continuously transferring method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6098180A (en) * 1997-02-18 2000-08-01 E-Parcel, Llc Robust delivery system
CN101179393A (en) * 2006-12-14 2008-05-14 腾讯科技(深圳)有限公司 Method and system for implementing document breakpoint transmission
CN101674263A (en) * 2008-09-11 2010-03-17 华为技术有限公司 Transmission method, transmission system, transmission device and receiving device of large data object
CN102761614A (en) * 2012-06-29 2012-10-31 浪潮(北京)电子信息产业有限公司 Method and system for realizing breakpoint resume of network data transmission
CN103401914A (en) * 2013-07-26 2013-11-20 浪潮电子信息产业股份有限公司 File uploading broken-point continuously transferring method

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105812456A (en) * 2016-03-08 2016-07-27 北京恒华伟业科技股份有限公司 File transmission method and device
CN108234539A (en) * 2016-12-14 2018-06-29 北京金山云网络技术有限公司 A kind of file upload, download, transmission method and device
CN107682399B (en) * 2017-08-29 2020-07-14 中国信息安全测评中心 File folder breakpoint continuous transmission method based on big data
CN107682399A (en) * 2017-08-29 2018-02-09 中国信息安全测评中心 A kind of file breaker point continuous transmission method based on big data
CN109819339A (en) * 2017-11-20 2019-05-28 创盛视联数码科技(北京)有限公司 The method of HTML5 breakpoint transmission
CN107707679A (en) * 2017-11-27 2018-02-16 小草数语(北京)科技有限公司 File uploading method and device
CN108093063A (en) * 2017-12-26 2018-05-29 中国电信股份有限公司新疆分公司 Big file multithreading FTP method for uploading
CN111314449A (en) * 2020-02-06 2020-06-19 北京东方金信科技有限公司 File breakpoint continuous transmission method and system
CN112637343A (en) * 2020-12-23 2021-04-09 中国建设银行股份有限公司 File transmission method, device and system
CN112769906A (en) * 2020-12-25 2021-05-07 三盟科技股份有限公司 File breakpoint uploading method and system, computer equipment and storage medium
CN113111043A (en) * 2021-04-21 2021-07-13 北京大学 Method, device and system for processing source data file of middle station and storage medium
CN114095493A (en) * 2021-11-17 2022-02-25 兰州乐智教育科技有限责任公司 File uploading method and system based on breakpoint retransmission
CN115378933A (en) * 2022-10-25 2022-11-22 四川蜀天信息技术有限公司 Breakpoint resume method and device for file transmission

Similar Documents

Publication Publication Date Title
CN105338090A (en) WebSocket-based breakpoint continuous transmission method and device
US10681127B2 (en) File upload method and system
JP5792850B2 (en) File folder transmission over the network
CN104170353B (en) TCP link configurations method, apparatus and equipment
CN107979592B (en) Method and device for sending service request message
US8898311B2 (en) Data communication method and information processing device
WO2017215646A1 (en) Data transmission method and apparatus
EP2667553A1 (en) Packet processing method, device and system
KR20130088774A (en) System and method for delivering segmented content
CN109361625B (en) Method, device and controller for checking forwarding table item
WO2019205897A1 (en) Data transmission method and related device
WO2019051628A1 (en) File distribution method, file download method, distribution server, client, and system
CN108347463A (en) A kind of terminal document method for uploading
WO2018153309A1 (en) File transmission method and apparatus capable of implementing demanded acceleration, medium, and device
WO2019057023A1 (en) Data recovery method, sending/receiving apparatus, and computer-readable storage medium
CN105721526A (en) Terminal and server file synchronization methods and device
CN103559198A (en) Data synchronizing method and equipment
US9935889B2 (en) Communication apparatus and method
CN101146130B (en) A method and system for transmitting data between clients
EP3171565B1 (en) Methods, devices and system for netconf hello packets interaction
CN107819697B (en) Data transmission method, switch and data center
US7779299B2 (en) Efficiently re-starting and recovering synchronization operations between a client and server
CN104243473A (en) Data transmission method and device
CN107707590A (en) System, the method and device of data transfer
CN104573518A (en) Method, device, server and system for scanning files

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20160217