CN105472035A - File transmission method and device - Google Patents

File transmission method and device Download PDF

Info

Publication number
CN105472035A
CN105472035A CN201610006472.7A CN201610006472A CN105472035A CN 105472035 A CN105472035 A CN 105472035A CN 201610006472 A CN201610006472 A CN 201610006472A CN 105472035 A CN105472035 A CN 105472035A
Authority
CN
China
Prior art keywords
file
fragment
mark
server
file fragment
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
CN201610006472.7A
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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201610006472.7A priority Critical patent/CN105472035A/en
Publication of CN105472035A publication Critical patent/CN105472035A/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)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Embodiments of the invention provide a file transmission method and device. On one hand, according to the file transmission method and device provided by the embodiments of the invention, in an operation process of a browser, a file operation interface provided by the browser is dispatched to access a file to obtain a file fragment from the file, then a first file uploading request is sent to a server, wherein the first file uploading request carries the file fragment, a fragment serial number and an identifier of the filer, so that the server stores the file fragment according to the file fragment, the fragment serial number and the identifier of the filer. Therefore, by adopting the file transmission method and device in the technical scheme provided by the embodiments of the invention, the fragment processing cost of the file is reduced, and the fragment processing efficiency of the file is improved.

Description

A kind of document transmission method and device
[technical field]
The present invention relates to Internet technical field, particularly relate to a kind of document transmission method and device.
[background technology]
Along with the development of Internet technology, getting more and more alternately between website and browser, asynchronous script and extend markup language (AsynchronousJavaScriptAndExtensibleMarkupLanguage is developed into from initial submission of sheet, AJAX) mutual, the element document object model tree is simply controlled, to two dimension or the 3-D graphic that painting canvas can be used on the page to present various complexity from use script.But, based on HTML (HyperTextMarkupLanguage, HTML) files passe technology does not but have large development, files passe can meet uploading compared with small documents, but for uploading compared with large files, often cause files passe failure due to unstable networks.
In prior art, in order to solve the problem of big file uploading, by installing plug-in unit in a browser or enrolling the burst that code realizes large files in a browser, then file fragment is uploaded onto the server.But utilize the codes implement of plug-in unit or editor to carry out the processing mode of burst to file, cause the burst processing cost of file higher, the efficiency comparison of the burst process of file is low.
[summary of the invention]
In view of this, embodiments provide a kind of document transmission method and device, reduce the burst processing cost of file, improve the efficiency of the burst process of file.
The one side of the embodiment of the present invention, provides a kind of document transmission method, comprising:
In browser execution process, call the file operation interface that described browser provides, with access file;
File fragment is obtained from described file;
The first files passe request is sent to server, the mark of described file fragment, segment number and described file is carried in described first files passe request, so that described server is according to the mark of described file fragment, segment number and described file, described file fragment is stored.
Aspect as above and arbitrary possible implementation, provide a kind of implementation further, obtain file fragment, comprising from described file: utilize section Slice method to cut into slices to described file, and obtain the file fragment that Slice method returns.
Aspect as above and arbitrary possible implementation, a kind of implementation is provided further, described in browser execution process, call the file operation interface that described browser provides, before access file, described method also comprises: send the second files passe request to described server, the mark of described file is carried in described second files passe request, so that described server is according to the mark of described file, detect described file and whether there is the file fragment uploaded, if there is not the file fragment uploaded, return the conditional code being used to indicate described file and not uploading,
From described file, obtain file fragment, comprising: from the 0th byte of described file, according to designated length, described file is cut into slices, to obtain described file fragment.
Aspect as above and arbitrary possible implementation, a kind of implementation is provided further, described in browser execution process, call the file operation interface that described browser provides, before access file, described method also comprises: send the 3rd files passe request to described server, the mark of described file is carried in described 3rd files passe request, so that described server is according to the mark of described file, detect described file and whether there is the file fragment uploaded, if there is the file fragment uploaded, return the mark of the file fragment uploaded,
From described file, obtain file fragment, comprising: according to the mark returning the file fragment uploaded, described file is cut into slices, to obtain the file fragment do not uploaded.
Aspect as above and arbitrary possible implementation, provide a kind of implementation further, described method also comprises:
File download request is sent to described server, the mark of file is carried in described file download request, so that described server is according to the mark of described file, inquiry file stored record table, to obtain the stored position information of each file fragment, and according to the stored position information of each file fragment, obtain each file fragment from other servers, and return each file fragment;
Receive and merge each file fragment.
The one side of the embodiment of the present invention, provides a kind of file transfer means, comprising:
Processing module, in browser execution process, calls the file operation interface that described browser provides, with access file;
Burst module, for obtaining file fragment from described file;
Input/output module, for sending the first files passe request to server, the mark of described file fragment, segment number and described file is carried in described first files passe request, so that described server is according to the mark of described file fragment, segment number and described file, described file fragment is stored.
Aspect as above and arbitrary possible implementation, provide a kind of implementation further, described burst module, specifically for:
Utilize section Slice method to cut into slices to described file, and obtain the file fragment that Slice method returns.
Aspect as above and arbitrary possible implementation, a kind of implementation is provided further, described input/output module, also for: send the second files passe request to described server, the mark of described file is carried in described second files passe request, so that described server is according to the mark of described file, detects described file and whether there is the file fragment uploaded, if there is not the file fragment uploaded, return the conditional code being used to indicate described file and not uploading;
Described burst module, specifically for: from the 0th byte of described file, according to designated length, described file is cut into slices, to obtain described file fragment.
Aspect as above and arbitrary possible implementation, a kind of implementation is provided further, described input/output module, also for: send the 3rd files passe request to described server, the mark of described file is carried in described 3rd files passe request, so that described server is according to the mark of described file, detects described file and whether there is the file fragment uploaded, if there is the file fragment uploaded, return the mark of the file fragment uploaded;
Described burst module, specifically for: according to the mark returning the file fragment uploaded, described file is cut into slices, to obtain the file fragment do not uploaded.
Aspect as above and arbitrary possible implementation, a kind of implementation is provided further, described input/output module, also for sending file download request to described server, the mark of file is carried in described file download request, so that described server is according to the mark of described file, inquiry file stored record table, to obtain the stored position information of each file fragment, and according to the stored position information of each file fragment, obtain each file fragment from other servers, and return each file fragment;
Described input/output module, also for receiving each file fragment;
Described device also comprises: merge module, for merging each file fragment that described receiver module receives.
As can be seen from the above technical solutions, the embodiment of the present invention has following beneficial effect:
In the technical scheme that the embodiment of the present invention provides, browser provides the file operation interface of operation file, the web application run in browser can easily pass JavaScript engine and visit file, thus burst process can be carried out to file, and file fragment is transferred to server stores.With prior art, use plug-in unit or codes implement to compare the processing mode that file carries out burst, reduce the burst processing cost of file, improve the efficiency of the burst process of file.Also can avoid the instability problem owing to using plug-in unit to bring to browser in prior art, improve the reliability of file fragmentation process and transmission.
[accompanying drawing explanation]
In order to be illustrated more clearly in the technical scheme of the embodiment of the present invention, be briefly described to the accompanying drawing used required in embodiment below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the schematic flow sheet of the embodiment one of the document transmission method that the embodiment of the present invention provides;
Fig. 2 is the schematic flow sheet of the embodiment two of the document transmission method that the embodiment of the present invention provides;
Fig. 3 is the schematic flow sheet of the embodiment three of the document transmission method that the embodiment of the present invention provides;
Fig. 4 is the schematic flow sheet of the embodiment four of the document transmission method that the embodiment of the present invention provides;
Fig. 5 is the functional block diagram of the embodiment one of the file transfer means that the embodiment of the present invention provides;
Fig. 6 is the functional block diagram of the embodiment two of the file transfer means that the embodiment of the present invention provides.
[embodiment]
Technical scheme for a better understanding of the present invention, is described in detail the embodiment of the present invention below in conjunction with accompanying drawing.
Should be clear and definite, 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 other embodiments all obtained under creative work prerequisite, belong to the scope of protection of the invention.
The term used in embodiments of the present invention is only for the object describing specific embodiment, and not intended to be limiting the present invention." one ", " described " and " being somebody's turn to do " of the singulative used in the embodiment of the present invention and appended claims is also intended to comprise most form, unless context clearly represents other implications.
Should be appreciated that term "and/or" used herein is only a kind of incidence relation describing affiliated partner, can there are three kinds of relations in expression, and such as, A and/or B, can represent: individualism A, exists A and B simultaneously, these three kinds of situations of individualism B.In addition, character "/" herein, general expression forward-backward correlation is to the relation liking a kind of "or".
Although should be appreciated that may adopt in embodiments of the present invention term first, second etc. carry out description document upload request, these files passe requests should not be limited to these terms.These terms are only used for files passe request to be distinguished from each other out.Such as, when not departing from embodiment of the present invention scope, the first files passe request also can be called as the second files passe request, and similarly, the second files passe request also can be called as the first files passe request.
Depend on linguistic context, word as used in this " if " can be construed as into " ... time " or " when ... time " or " in response to determining " or " in response to detection ".Similarly, depend on linguistic context, phrase " if determination " or " if detecting (the conditioned disjunction event of statement) " can be construed as " when determining " or " in response to determining " or " when detecting (the conditioned disjunction event of statement) " or " in response to detection (the conditioned disjunction event of statement) ".
Embodiment one
The embodiment of the present invention provides a kind of document transmission method, please refer to Fig. 1, the schematic flow sheet of the embodiment one of its document transmission method provided for the embodiment of the present invention, and as shown in the figure, the method comprises the following steps:
S101, in browser execution process, calls the file operation interface that described browser provides, with access file.
Concrete, write the file operation interface that browser provides in the JavaScript engine in browser in advance, like this, in browser execution process, the file that JavaScript engine is selected on a web browser according to user, can call file operation interface, conduct interviews to this file.
In a concrete implementation procedure, described file operation interface can be the application programming interface (ApplicationProgrammingInterface, API) based on the file operation of HTML5, as HTMLFileAPI.
S102, obtains file fragment from described file.
Concrete, described JavaScript engine can utilize section (Slice) method to cut into slices to file, then can obtain the file fragment that Slice method returns.
Such as, Slice method can be Slice (start, end), wherein, parameter s tart represents the beginning byte number of the file fragment that needs obtain, and parameter end represents the end byte number of the file fragment that needs obtain, as start equals 0, end equals 1000, and represent and need from file, obtain the file fragment of the 0th byte to the 1000th byte, the length of this file fragment is 1000 bytes.
S103, the first files passe request is sent to server, the mark of described file fragment, segment number and described file is carried in described first files passe request, so that described server is according to the mark of described file fragment, segment number and described file, described file fragment is stored.
Concrete, above-mentioned JavaScript engine can send the first files passe request to server, and this first files passe request can carry the mark of the file fragment of acquisition, segment number and file.Wherein, segment number can as the mark of file fragment, also can represent the position of this file fragment in whole file and order.
In a concrete implementation procedure, the segment number of this file fragment can be determined according to the designated length of the beginning byte number of this file fragment and file fragment.Such as, the beginning byte number of file fragment is 3000, and the designated length of file fragment is 1000, then can determine that the segment number of this file fragment is 4, and namely this file fragment is the 4th file fragment in file.
It should be noted that, provide the API of operation file in HTML5 standard had the API of operation file, the Web run in browser application can carry out the operation such as reading, write, file, file of file very easily by JavaScript engine.Therefore the embodiment of the present invention still can realize burst process to file and transmission when not using plug-in unit, avoid the technical problem using plug-in unit or codes implement to cause the processing mode that file carries out burst, reduce the burst processing cost of file, improve the efficiency of the burst process of file.
Embodiment two
Based on the document transmission method that above-described embodiment one provides, present embodiments provide a kind of specific implementation of document transmission method.Please refer to Fig. 2, the schematic flow sheet of the embodiment two of its document transmission method provided for the embodiment of the present invention, as shown in the figure, this document transmission method can comprise the following steps:
S201, the second files passe request is sent to described server, the mark of described file is carried in described second files passe request, so that described server is according to the mark of described file, detect described file and whether there is the file fragment uploaded, if there is not the file fragment uploaded, return the conditional code being used to indicate described file and not uploading.
Concrete, above-mentioned JavaScript engine is before sending file fragment to server, and first send the second files passe request to server, the mark of described file is carried in this second files passe request.Like this, server can according to the mark of file, the file table safeguarded in Query Database, if do not comprise the mark of the file that the second files passe request is carried in this file table, then illustrate that the server institute of the second files passe request that receives is in the cluster for this file, the file fragment also do not uploaded, server in the cluster Servers-all does not all store one or more file fragments of this file.Then, server is to above-mentioned JavaScript engine return state code, and this conditional code is used to indicate described file and does not upload.
In a concrete implementation procedure, a file table can be safeguarded, the details of the file such as each record mark of include file, file owner, filename, file size and the last modification time of file, user name and user ID in this file table in described database.In cluster, have server to receive and store a file fragment, this server needs the details of file belonging to file fragment to send to database to store.
S202, in browser execution process, calls the file operation interface that described browser provides, with access file.
S203, from the 0th byte of described file, according to designated length, cuts into slices to described file, to obtain described file fragment.
Concrete, above-mentioned JavaScript engine owing to receiving conditional code from server, thus determines that file is not also uploaded onto the server, therefore, the file operation interface that JavaScript engine calling browser provides visits file, then utilizes Slice method to obtain file fragment from file.
In a concrete implementation procedure, file fragment is not also had to upload onto the server owing to needing the file uploaded, therefore can cut into slices from the 0th byte of file, as JavaScript engine can equal 0 according to parameter s tart, and designated length calculates the numerical value of parameter end, then call Slice method according to the numerical value 0 of parameter s tart and the numerical value of parameter end, to make Slice method cut into slices from the 0th byte of file, obtain file fragment.So, JavaScript engine can utilize Slice method to obtain some file fragments successively from file.In the embodiment of the present invention, the designated length of file fragment can be fixed, or also can not fix, and the embodiment of the present invention is not particularly limited this.
S204, the first files passe request is sent to server, the mark of described file fragment, segment number and described file is carried in described first files passe request, so that described server is according to the mark of described file fragment, segment number and described file, described file fragment is stored.
Concrete, the some file fragments obtained can be sent to server by the first files passe request by above-mentioned JavaScript engine.Wherein, JavaScript engine can generate a first files passe request for each file fragment, and a file fragment, the segment number of this file fragment and the mark of file are carried in each first files passe request.
Wherein, each first files passe request according to segment number, can be sent to server by JavaScript engine in order, or, also not in accordance with order, each first files passe request can be sent to server.Or each first files passe request also can be sent to server by JavaScript engine simultaneously, or, also asynchronously each first files passe request can be sent to server.
Embodiment three
Based on the document transmission method that above-described embodiment one provides, present embodiments provide the another kind of specific implementation of document transmission method.Please refer to Fig. 3, the schematic flow sheet of the embodiment three of its document transmission method provided for the embodiment of the present invention, as shown in the figure, this document transmission method can comprise the following steps:
S301, the 3rd files passe request is sent to described server, the mark of described file is carried in described 3rd files passe request, so that described server is according to the mark of described file, detect described file and whether there is the file fragment uploaded, if there is the file fragment uploaded, return the mark of the file fragment uploaded.
Concrete, above-mentioned JavaScript engine is before sending file fragment to server, and first send the 3rd files passe request to server, the mark of described file is carried in the 3rd files passe request.Like this, server can according to the mark of file, the file table safeguarded in Query Database, if comprise the mark of the file that the 3rd files passe request is carried in this file table, then illustrate that the server institute of the 3rd files passe request that receives is in the cluster for this file, there is the file fragment uploaded, then this server is according to the burst record sheet safeguarded in the further Query Database of the mark of file, to obtain the mark of the file fragment uploaded, server returns the mark of the file fragment uploaded to above-mentioned JavaScript engine.
In a concrete implementation procedure, a burst record sheet in described database, can also be safeguarded, the stored position information of each the record mark of include file, the mark of file fragment and file fragment in this burst record sheet.Wherein, the stored position information of file fragment can for preserving the IP address of the server of this file fragment, or, also can for preserving the domain name of the server of this file fragment, or, if the IP address of server is dynamic change, the stored position information of file fragment can also be a numerical value, and this numerical value can be mapped to the IP address of a server.Be understandable that in cluster, have server to receive a file fragment, this server needs the mark of the mark of file, the mark of file fragment and server belonging to file fragment to send to database to store.
S302, in browser execution process, calls the file operation interface that described browser provides, with access file.
S303, according to returning the file fragment uploaded, cuts into slices to described file, to obtain the file fragment do not uploaded.
Concrete, above-mentioned JavaScript engine is owing to receiving the mark of the file fragment uploaded from server, thus determine that file has had file fragment to upload to server, therefore, the file operation interface that JavaScript engine calling browser provides visits file, then utilizes Slice method from file, obtain the file fragment do not uploaded.
In a concrete implementation procedure, JavaScript engine can according to the mark of the file fragment uploaded, obtain beginning byte number and the end byte number of the file fragment do not uploaded, then according to beginning byte number and end byte number, call Slice method, with make Slice method from file this byte number and designated length, start to cut into slices, obtain the some file fragments started between byte number and end byte number.So, the JavaScript engine file fragment that Slice method can be utilized from file to obtain one or more do not upload.
S304, the first files passe request is sent to server, the mark of described file fragment, segment number and described file is carried in described first files passe request, so that described server is according to the mark of described file fragment, segment number and described file, described file fragment is stored.
Concrete, one or more file fragment do not uploaded obtained can be sent to server by the first files passe request by above-mentioned JavaScript engine.Wherein, JavaScript engine can generate a first files passe request for each file fragment do not uploaded, and a file fragment do not uploaded, the segment number of this file fragment and the mark of file are carried in each first files passe request.
Wherein, each first files passe request according to segment number, can be sent to server by JavaScript engine in order, or, also not in accordance with order, each first files passe request can be sent to server.Or each first files passe request also can be sent to server by JavaScript engine simultaneously, or, also asynchronously each first files passe request can be sent to server.
Be understandable that, in the present embodiment, server can detect JavaScript engine ask existing file fragment in the file uploaded to be uploaded, illustrate that this file may cause files passe to interrupt due to network problem in upper once upload procedure, make to only have partial document fragment to upload successfully, therefore the present embodiment can be applied to the breaking point uploading scene of file, for the file fragment uploaded existed in server, do not need again to upload, JavaScript engine only needs the file fragment do not uploaded to be transferred to server, avoid to the file uploaded repeat transmission, save flow and bandwidth.
Such as, server detects in the file that JavaScript engine requests is uploaded that the file fragment being designated 1 ~ 99 exists, therefore, the mark 1 ~ 99 of file fragment is returned to JavaScript engine by server, and like this, JavaScript engine is according to the mark 1 ~ 99 of the file fragment returned, from file from the 100th file fragment, obtain the 100th file fragment and later file fragment, and the file fragment of acquisition is continued to be transferred to server, realize document breakpoint transmission.
Embodiment four
Based on the document transmission method that above-described embodiment one to embodiment three provides, present embodiments provide a kind of document transmission method, this document transmission method is the concrete methods of realizing based on the file download on the basis of embodiment one to embodiment three.Please refer to Fig. 4, the schematic flow sheet of the embodiment four of its document transmission method provided for the embodiment of the present invention, as shown in the figure, this document transmission method can comprise the following steps:
S401, file download request is sent to server, the mark of file is carried in described file download request, so that described server is according to the mark of described file, inquiry file stored record table, to obtain the stored position information of each file fragment, and according to the stored position information of each file fragment, obtain each file fragment from other servers, and return each file fragment.
Concrete, JavaScript engine can send file download request to server, and this file download request carries the mark of file.
In a concrete implementation procedure, the server receiving file download request according to the mark of file, can inquire about the stored position information of each file fragment of this file in the burst record sheet of database maintenance.Then, this server is according to each stored position information, other servers corresponding with stored position information carry out alternately, according to file fragment sequencing hereof, file fragment is obtained from other servers corresponding, and after often getting a file fragment, just forward this file fragment to JavaScript engine.
S402, receives and merges each file fragment.
Concrete, the file fragment that JavaScript engine accepts server returns, because server is backspace file fragment in order, therefore JavaScript engine can carry out nature merging treatment to each file fragment in the process receiving each file fragment, thus can download to file.
In addition, it should be noted that, because server is external disclosure, in order to prevent other user's upload files beyond operation system to server, providing following two kinds of modes in the embodiment of the present invention, control of authority has been carried out to the user of upload file.
First kind of way comprises: for the request received, as the first files passe request, the second files passe request, the 3rd files passe request or file download request, server need the request first judging to receive for the URL(uniform resource locator) (UniformResourceLocator of webpage, URL) or domain name whether belong to default white list, if judge the request received for the URL of webpage or domain name belong to default white list, server just receives and processes this request.Otherwise, if judge the request received for the ULR of webpage or domain name do not belong to default white list, server rejects this request.
The second way comprises: above-mentioned JavaScript engine is when sending request, as the first files passe request, the second files passe request, the 3rd files passe request or file download request, need to utilize Message Digest 5 to carry out computing to user name and user ID, to obtain informative abstract, then in the request sent, carry this informative abstract and user name.Server after receiving the request, first identify according to user name inquiring user, then corresponding Message Digest 5 is utilized to carry out computing to user name and user ID, to obtain informative abstract, and the informative abstract of carrying in this informative abstract and request is compared, if two informative abstracts are consistent, then server determines that certification is passed through, and server can receive and process this request.If two informative abstracts are inconsistent, then server determination authentification failure, server rejects this request.Therefore, as long as at least one is not stolen in the user name of operation system user and user ID, other users beyond operation system are just difficult to send spurious requests and disturb file transfer to server.
The embodiment of the present invention provides the device embodiment realizing each step and method in said method embodiment further.
Please refer to Fig. 5, the functional block diagram of the embodiment one of its file transfer means provided for the embodiment of the present invention.As shown in the figure, this device comprises:
Processing module 50, in browser execution process, calls the file operation interface that described browser provides, with access file;
Burst module 51, for obtaining file fragment from described file;
Input/output module 52, for sending the first files passe request to server, the mark of described file fragment, segment number and described file is carried in described first files passe request, so that described server is according to the mark of described file fragment, segment number and described file, described file fragment is stored.
In a concrete implementation procedure, described burst module 51, specifically for:
Utilize section Slice method to cut into slices to described file, and obtain the file fragment that Slice method returns.
In a concrete implementation procedure, described input/output module 52, also for: send the second files passe request to described server, the mark of described file is carried in described second files passe request, so that described server is according to the mark of described file, detect described file and whether there is the file fragment uploaded, if there is not the file fragment uploaded, return the conditional code being used to indicate described file and not uploading;
Described burst module 51, specifically for: from the 0th byte of described file, according to designated length, described file is cut into slices, to obtain described file fragment.
Or, in a concrete implementation procedure, described input/output module 52, also for: send the 3rd files passe request to described server, the mark of described file is carried in described 3rd files passe request, so that described server is according to the mark of described file, detects described file and whether there is the file fragment uploaded, if there is the file fragment uploaded, return the mark of the file fragment uploaded;
Described burst module 51, specifically for: according to the mark returning the file fragment uploaded, described file is cut into slices, to obtain the file fragment do not uploaded.
Because each unit in the present embodiment can perform the method shown in Fig. 1 ~ Fig. 3, the part that the present embodiment is not described in detail, can with reference to the related description to Fig. 1 ~ Fig. 3.
Please refer to Fig. 6, the functional block diagram of the embodiment two of its file transfer means provided for the embodiment of the present invention.As shown in the figure, described input/output module 52, also for sending file download request to described server, the mark of file is carried in described file download request, so that described server is according to the mark of described file, and inquiry file stored record table, to obtain the stored position information of each file fragment, and according to the stored position information of each file fragment, obtain each file fragment from other servers, and return each file fragment;
Input/output module 52, also for receiving each file fragment;
Described device also comprises: merge module 53, for merging each file fragment that described receiver module receives.
Because each unit in the present embodiment can perform the method shown in Fig. 4, the part that the present embodiment is not described in detail, can with reference to the related description to Fig. 4.
The technical scheme of the embodiment of the present invention has following beneficial effect:
In the embodiment of the present invention, by browser execution process, call the file operation interface that described browser provides, with access file; Thus, from described file, obtain file fragment; And then, the first files passe request is sent to server, the mark of described file fragment, segment number and described file is carried in described first files passe request, so that described server is according to the mark of described file fragment, segment number and described file, described file fragment is stored.
In the technical scheme that the embodiment of the present invention provides, browser provides the file operation interface of operation file, the web application run in browser can easily pass JavaScript engine and visit file, thus burst process can be carried out to file, and file fragment is transferred to server stores.With prior art, use plug-in unit or codes implement to compare the processing mode that file carries out burst, reduce the burst processing cost of file, improve the efficiency of the burst process of file.Also can avoid the instability problem owing to using plug-in unit to bring to browser in prior art, improve the reliability of file fragmentation process and transmission.
Those skilled in the art can be well understood to, and for convenience and simplicity of description, the system of foregoing description, the specific works process of device and unit, with reference to the corresponding process in preceding method embodiment, can not repeat them here.
In several embodiment provided by the present invention, should be understood that, disclosed system, apparatus and method, can realize by another way.Such as, device embodiment described above is only schematic, such as, the division of described unit, is only a kind of logic function and divides, and actual can have other dividing mode when realizing, such as, multiple unit or assembly can in conjunction with or another system can be integrated into, or some features can be ignored, or do not perform.Another point, shown or discussed coupling each other or direct-coupling or communication connection can be by some interfaces, and the indirect coupling of device or unit or communication connection can be electrical, machinery or other form.
The described unit illustrated as separating component or can may not be and physically separates, and the parts as unit display can be or may not be physical location, namely can be positioned at a place, or also can be distributed in multiple network element.Some or all of unit wherein can be selected according to the actual needs to realize the object of the present embodiment scheme.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, also can be that the independent physics of unit exists, also can two or more unit in a unit integrated.Above-mentioned integrated unit both can adopt the form of hardware to realize, and the form that hardware also can be adopted to add SFU software functional unit realizes.
The above-mentioned integrated unit realized with the form of SFU software functional unit, can be stored in a computer read/write memory medium.Above-mentioned SFU software functional unit is stored in a storage medium, comprising some instructions in order to make a computer installation (can be personal computer, server, or network equipment etc.) or processor (Processor) perform the part steps of method described in each embodiment of the present invention.And aforesaid storage medium comprises: USB flash disk, portable hard drive, read-only memory (Read-OnlyMemory, ROM), random access memory (RandomAccessMemory, RAM), magnetic disc or CD etc. various can be program code stored medium.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, within the spirit and principles in the present invention all, any amendment made, equivalent replacement, improvement etc., all should be included within the scope of protection of the invention.

Claims (10)

1. a document transmission method, is characterized in that, described method comprises:
In browser execution process, call the file operation interface that described browser provides, with access file;
File fragment is obtained from described file;
The first files passe request is sent to server, the mark of described file fragment, segment number and described file is carried in described first files passe request, so that described server is according to the mark of described file fragment, segment number and described file, described file fragment is stored.
2. method according to claim 1, is characterized in that, obtains file fragment, comprising from described file: utilize section Slice method to cut into slices to described file, and obtains the file fragment that Slice method returns.
3. method according to claim 1, it is characterized in that, described in browser execution process, call the file operation interface that described browser provides, before access file, described method also comprises: send the second files passe request to described server, the mark of described file is carried in described second files passe request, so that described server is according to the mark of described file, detect described file and whether there is the file fragment uploaded, if there is not the file fragment uploaded, return the conditional code being used to indicate described file and not uploading;
From described file, obtain file fragment, comprising: from the 0th byte of described file, according to designated length, described file is cut into slices, to obtain described file fragment.
4. method according to claim 1, it is characterized in that, described in browser execution process, call the file operation interface that described browser provides, before access file, described method also comprises: send the 3rd files passe request to described server, the mark of described file is carried in described 3rd files passe request, so that described server is according to the mark of described file, detect described file and whether there is the file fragment uploaded, if there is the file fragment uploaded, return the mark of the file fragment uploaded;
From described file, obtain file fragment, comprising: according to the mark returning the file fragment uploaded, described file is cut into slices, to obtain the file fragment do not uploaded.
5. the method according to claim 1 or 3 or 4, it is characterized in that, described method also comprises:
File download request is sent to described server, the mark of file is carried in described file download request, so that described server is according to the mark of described file, inquiry file stored record table, to obtain the stored position information of each file fragment, and according to the stored position information of each file fragment, obtain each file fragment from other servers, and return each file fragment;
Receive and merge each file fragment.
6. a file transfer means, is characterized in that, described device comprises:
Processing module, in browser execution process, calls the file operation interface that described browser provides, with access file;
Burst module, for obtaining file fragment from described file;
Input/output module, for sending the first files passe request to server, the mark of described file fragment, segment number and described file is carried in described first files passe request, so that described server is according to the mark of described file fragment, segment number and described file, described file fragment is stored.
7. device according to claim 6, is characterized in that, described burst module, specifically for:
Utilize section Slice method to cut into slices to described file, and obtain the file fragment that Slice method returns.
8. device according to claim 6, is characterized in that,
Described input/output module, also for: send the second files passe request to described server, the mark of described file is carried in described second files passe request, so that described server is according to the mark of described file, detect described file and whether there is the file fragment uploaded, if there is not the file fragment uploaded, return the conditional code being used to indicate described file and not uploading;
Described burst module, specifically for: from the 0th byte of described file, according to designated length, described file is cut into slices, to obtain described file fragment.
9. device according to claim 6, it is characterized in that, described input/output module, also for: send the 3rd files passe request to described server, the mark of described file is carried in described 3rd files passe request, so that described server is according to the mark of described file, detects described file and whether there is the file fragment uploaded, if there is the file fragment uploaded, return the mark of the file fragment uploaded;
Described burst module, specifically for: according to the mark returning the file fragment uploaded, described file is cut into slices, to obtain the file fragment do not uploaded.
10. the device according to claim 6 or 8 or 9, is characterized in that,
Described input/output module, also for sending file download request to described server, the mark of file is carried in described file download request, so that described server is according to the mark of described file, inquiry file stored record table, to obtain the stored position information of each file fragment, and according to the stored position information of each file fragment, obtain each file fragment from other servers, and return each file fragment;
Described input/output module, also for receiving each file fragment;
Described device also comprises: merge module, for merging each file fragment that described receiver module receives.
CN201610006472.7A 2016-01-04 2016-01-04 File transmission method and device Pending CN105472035A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610006472.7A CN105472035A (en) 2016-01-04 2016-01-04 File transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610006472.7A CN105472035A (en) 2016-01-04 2016-01-04 File transmission method and device

Publications (1)

Publication Number Publication Date
CN105472035A true CN105472035A (en) 2016-04-06

Family

ID=55609297

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610006472.7A Pending CN105472035A (en) 2016-01-04 2016-01-04 File transmission method and device

Country Status (1)

Country Link
CN (1) CN105472035A (en)

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106375483A (en) * 2016-11-09 2017-02-01 腾讯科技(深圳)有限公司 File transmission method and device
CN106559427A (en) * 2016-11-22 2017-04-05 台州库得软件有限公司 A kind of data storage and data transmission system
CN107172131A (en) * 2017-04-26 2017-09-15 腾讯科技(深圳)有限公司 File uploading method and device
CN107483627A (en) * 2017-09-12 2017-12-15 网宿科技股份有限公司 A kind of file distributing, method for down loading, Distributor, client and system
CN108234539A (en) * 2016-12-14 2018-06-29 北京金山云网络技术有限公司 A kind of file upload, download, transmission method and device
CN108810055A (en) * 2017-05-04 2018-11-13 贵州白山云科技有限公司 A kind of big document transmission method and device
CN108933805A (en) * 2017-05-26 2018-12-04 武汉斗鱼网络科技有限公司 A kind of document transmission method and system
CN108965463A (en) * 2018-08-08 2018-12-07 北京筑龙信息技术有限责任公司 A kind of document transmission method, device and system
CN109361754A (en) * 2018-11-05 2019-02-19 中国广核电力股份有限公司 A kind of document transmission method and device based on browser
CN109617957A (en) * 2018-12-05 2019-04-12 量子云未来(北京)信息科技有限公司 A kind of file uploading method based on CDN network, device, server
CN109819339A (en) * 2017-11-20 2019-05-28 创盛视联数码科技(北京)有限公司 The method of HTML5 breakpoint transmission
CN109918908A (en) * 2019-02-13 2019-06-21 广东华讯网络投资有限公司 A kind of data safety detection system and business handling method
CN111586103A (en) * 2020-04-08 2020-08-25 北京明略软件系统有限公司 File fragment downloading method and device
CN112039932A (en) * 2019-06-03 2020-12-04 北京国电通网络技术有限公司 File transmission method and device
CN112468511A (en) * 2020-12-11 2021-03-09 建信金融科技有限责任公司 File transmission method and device
US11172023B2 (en) 2017-09-29 2021-11-09 Wangsu Science & Technology Co., Ltd. Data synchronization method and system
US11190576B2 (en) 2017-09-12 2021-11-30 Wangsu Science & Technology Co., Ltd. File distribution and download method, distribution server, client terminal and system
WO2024051672A1 (en) * 2022-09-08 2024-03-14 天翼数字生活科技有限公司 Method and system for unitized scheduling and access of device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140278530A1 (en) * 2013-03-15 2014-09-18 WISC Image (MD) LLC Associating received medical imaging data to stored medical imaging data
CN105049514A (en) * 2015-07-30 2015-11-11 北京奇虎科技有限公司 File downloading method and file downloading device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140278530A1 (en) * 2013-03-15 2014-09-18 WISC Image (MD) LLC Associating received medical imaging data to stored medical imaging data
CN105049514A (en) * 2015-07-30 2015-11-11 北京奇虎科技有限公司 File downloading method and file downloading device

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
BOYTNT: ""利用HTML5分片上传超大文件"", 《51博客》 *
W3C: ""File API"", 《W3C》 *
XICHENG: ""Research on File Upload Based on HTML5"", 《COLLEGE OF INFORMATION ENGINEERING》 *

Cited By (26)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106375483A (en) * 2016-11-09 2017-02-01 腾讯科技(深圳)有限公司 File transmission method and device
CN106559427B (en) * 2016-11-22 2020-04-28 台州库得软件有限公司 Data storage and data transmission system
CN106559427A (en) * 2016-11-22 2017-04-05 台州库得软件有限公司 A kind of data storage and data transmission system
CN108234539B (en) * 2016-12-14 2022-06-03 北京金山云网络技术有限公司 File uploading, downloading and transmitting method and device
CN108234539A (en) * 2016-12-14 2018-06-29 北京金山云网络技术有限公司 A kind of file upload, download, transmission method and device
CN107172131A (en) * 2017-04-26 2017-09-15 腾讯科技(深圳)有限公司 File uploading method and device
CN107172131B (en) * 2017-04-26 2020-12-04 腾讯科技(深圳)有限公司 File uploading method and device
CN108810055A (en) * 2017-05-04 2018-11-13 贵州白山云科技有限公司 A kind of big document transmission method and device
CN108810055B (en) * 2017-05-04 2022-03-29 贵州白山云科技股份有限公司 Large file transmission method and device
CN108933805A (en) * 2017-05-26 2018-12-04 武汉斗鱼网络科技有限公司 A kind of document transmission method and system
CN107483627B (en) * 2017-09-12 2021-06-22 网宿科技股份有限公司 File distribution method, file download method, distribution server, client and system
CN107483627A (en) * 2017-09-12 2017-12-15 网宿科技股份有限公司 A kind of file distributing, method for down loading, Distributor, client and system
US11190576B2 (en) 2017-09-12 2021-11-30 Wangsu Science & Technology Co., Ltd. File distribution and download method, distribution server, client terminal and system
US11172023B2 (en) 2017-09-29 2021-11-09 Wangsu Science & Technology Co., Ltd. Data synchronization method and system
CN109819339A (en) * 2017-11-20 2019-05-28 创盛视联数码科技(北京)有限公司 The method of HTML5 breakpoint transmission
CN108965463B (en) * 2018-08-08 2021-08-17 北京筑龙信息技术有限责任公司 File transmission method, device and system
CN108965463A (en) * 2018-08-08 2018-12-07 北京筑龙信息技术有限责任公司 A kind of document transmission method, device and system
CN109361754A (en) * 2018-11-05 2019-02-19 中国广核电力股份有限公司 A kind of document transmission method and device based on browser
CN109617957A (en) * 2018-12-05 2019-04-12 量子云未来(北京)信息科技有限公司 A kind of file uploading method based on CDN network, device, server
CN109918908A (en) * 2019-02-13 2019-06-21 广东华讯网络投资有限公司 A kind of data safety detection system and business handling method
CN112039932A (en) * 2019-06-03 2020-12-04 北京国电通网络技术有限公司 File transmission method and device
CN112039932B (en) * 2019-06-03 2023-10-20 北京国电通网络技术有限公司 File transmission method and device
CN111586103A (en) * 2020-04-08 2020-08-25 北京明略软件系统有限公司 File fragment downloading method and device
CN112468511A (en) * 2020-12-11 2021-03-09 建信金融科技有限责任公司 File transmission method and device
CN112468511B (en) * 2020-12-11 2023-02-03 建信金融科技有限责任公司 File transmission method and device
WO2024051672A1 (en) * 2022-09-08 2024-03-14 天翼数字生活科技有限公司 Method and system for unitized scheduling and access of device

Similar Documents

Publication Publication Date Title
CN105472035A (en) File transmission method and device
US20180332453A1 (en) Contextual deep linking of applications
US8825637B1 (en) Recording user actions
CN101287013B (en) Method for updating Webpage and Web proxy device
CN104754073A (en) Resource access method and device
CN103746782A (en) Method and apparatus for obtaining feedback information of application
JP2010128877A (en) Web system and method of collecting processing record
US10158691B2 (en) Method and apparatus for providing network resources at intermediary server
CN104572843A (en) Page loading method and device
CN103530329A (en) Method and device for performing webpage loading and browsers
CN105100263A (en) Reverse proxy method and apparatus
CN108471359A (en) A kind of website visiting abnormality monitoring method, device and medium
CN113411404A (en) File downloading method, device, server and storage medium
CN110347955B (en) Resource detection method and device
CN104123143A (en) User control loading system and method
CN102970380B (en) Obtain method and the cloud storage server of the media data of cloud storage file
CN103491189A (en) Method for detecting installation state of client-side software in linkage mode based on cloud and wireless terminal and wireless terminal
CN111538922A (en) Link skip method, application client, device and storage medium
US10095791B2 (en) Information search method and apparatus
CN104346460A (en) Method and device for downloading file and browser client
EP2760183A1 (en) System for detecting hyperlink faults
CN103139298A (en) Method for transmitting network data and device
CN111338928A (en) Chrome-based browser testing method and device
CN112948733B (en) Interface maintenance method, device, computing equipment and medium
CN112416875B (en) Log management method, device, computer equipment and storage medium

Legal Events

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

Application publication date: 20160406

RJ01 Rejection of invention patent application after publication