CN107707679A - File uploading method and device - Google Patents

File uploading method and device Download PDF

Info

Publication number
CN107707679A
CN107707679A CN201711208594.5A CN201711208594A CN107707679A CN 107707679 A CN107707679 A CN 107707679A CN 201711208594 A CN201711208594 A CN 201711208594A CN 107707679 A CN107707679 A CN 107707679A
Authority
CN
China
Prior art keywords
file
file destination
signing messages
destination
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN201711208594.5A
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.)
Green Bay Network Technology Co., Ltd.
Original Assignee
Grass Count Language (beijing) 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 Grass Count Language (beijing) Technology Co Ltd filed Critical Grass Count Language (beijing) Technology Co Ltd
Priority to CN201711208594.5A priority Critical patent/CN107707679A/en
Publication of CN107707679A publication Critical patent/CN107707679A/en
Withdrawn 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]

Abstract

The present invention proposes a kind of file uploading method and device, wherein, method includes:Attribute checking is carried out to the file destination that needs upload;After attribute is verified, the file destination is added in document queue;Obtain the first signing messages of the file destination;When during first signing messages is not present in the signing messages list that is got from server, judge whether the file destination has recorded breakpoint location;If record has the breakpoint location, the file destination is resumed to the server since the breakpoint location.By this method, requirement of the file upload to application environment can be reduced, file is improved and uploads success rate.

Description

File uploading method and device
Technical field
The present invention relates to field of computer technology, more particularly to a kind of file uploading method and device.
Background technology
In web application, frequently encounter by client file upload onto the server use scene, such as uploading pictures or Video file, for other client downloads, realizes resource-sharing to server.
However, due to the complexity of web application scene and the reason such as unstability of webpage condition, cause on file More uncontrollable factor, such as increasing with software type, judgement of the client for file format during biography be present Accuracy declines;When network environment is poor, there is interim card situation in file transmission, causes file bust this etc..
The content of the invention
It is contemplated that at least solves one of technical problem in correlation technique to a certain extent.
Therefore, first purpose of the present invention is to propose a kind of file uploading method, uploaded with reducing file to application The requirement of environment, improve file and upload success rate.
Second object of the present invention is to propose that a kind of file uploads device.
Third object of the present invention is to propose a kind of computer equipment.
Fourth object of the present invention is to propose a kind of computer program product.
The 5th purpose of the present invention is to propose a kind of non-transitorycomputer readable storage medium.
For the above-mentioned purpose, first aspect present invention embodiment proposes a kind of file uploading method, including:
Attribute checking is carried out to the file destination that needs upload;
After attribute is verified, the file destination is added in document queue;
Obtain the first signing messages of the file destination;
When during first signing messages is not present in the signing messages list that is got from server, described in judgement Whether file destination has recorded breakpoint location;
If record has the breakpoint location, the target text is resumed to the server since the breakpoint location Part.
The file uploading method of the embodiment of the present invention, by carrying out attribute checking to the file destination that uploads of needs, when testing File destination is added in document queue by card after passing through, and the first signing messages of file destination is obtained, in the first signing messages When being not present in the signing messages list that is got from server, determine whether file destination has recorded breakpoint bit Put, and when record has breakpoint location, file destination is resumed to server since breakpoint location.By before file uploads Attribute checking is first carried out, client can be alleviated the problem of inaccurate is judged to file format;Judge to service by signing messages Whether file destination be present on device, avoided repeating to upload.And allow breakpoint transmission during upload, when target text When part is not present on server, it can attempt to obtain the breakpoint location of file destination, get breakpoint location then from breakpoint bit Put beginning and resume file destination to server, can realize that the burst of file destination uploads, reduce the requirement to network bandwidth, carry High file uploads success rate.
For the above-mentioned purpose, second aspect of the present invention embodiment proposes a kind of file and uploads device, including:
Authentication module, the file destination for being uploaded to needs carry out attribute checking;
Add module, for after attribute is verified, the file destination to be added in document queue;
Acquisition module, for obtaining the first signing messages of the file destination;
Judge module, for the signing messages list for being not present in getting from server in first signing messages When middle, judge whether the file destination has recorded breakpoint location;
Uploading module, for when record has breakpoint location, institute to be resumed to the server since the breakpoint location State file destination.
The file of the embodiment of the present invention uploads device, and attribute checking is carried out by the file destination uploaded to needs, when testing File destination is added in document queue by card after passing through, and the first signing messages of file destination is obtained, in the first signing messages When being not present in the signing messages list that is got from server, determine whether file destination has recorded breakpoint bit Put, and when record has breakpoint location, file destination is resumed to server since breakpoint location.By before file uploads Attribute checking is first carried out, client can be alleviated the problem of inaccurate is judged to file format;Judge to service by signing messages Whether file destination be present on device, avoided repeating to upload.And allow breakpoint transmission during upload, when target text When part is not present on server, it can attempt to obtain the breakpoint location of file destination, get breakpoint location then from breakpoint bit Put beginning and resume file destination to server, can realize that the burst of file destination uploads, reduce the requirement to network bandwidth, carry High file uploads success rate.
For the above-mentioned purpose, third aspect present invention embodiment proposes a kind of computer equipment, including:Memory, place The computer program managed device and storage on a memory and can run on a processor, wherein, meter described in the computing device During calculation machine program, the file uploading method as described in first aspect embodiment is realized.
To achieve these goals, fourth aspect present invention embodiment proposes a kind of computer program product, when described When instruction in computer program product is by computing device, the file uploading method as described in first aspect embodiment is performed.
To achieve these goals, fifth aspect present invention embodiment proposes a kind of computer-readable storage of non-transitory Medium, computer program is stored thereon with, the file as described in first aspect embodiment is realized when the program is executed by processor Method for uploading.
The additional aspect of the present invention and advantage will be set forth in part in the description, and will partly become from the following description Obtain substantially, or recognized by the practice of the present invention.
Brief description of the drawings
Of the invention above-mentioned and/or additional aspect and advantage will become from the following description of the accompanying drawings of embodiments Substantially and it is readily appreciated that, wherein:
Fig. 1 is the schematic flow sheet for the file uploading method that one embodiment of the invention proposes;
Fig. 2 is the schematic flow sheet for the file uploading method that another embodiment of the present invention proposes;
Fig. 3 is the schematic flow sheet for the file uploading method that further embodiment of this invention proposes;
Fig. 4 is the schematic flow sheet for the file uploading method that yet another embodiment of the invention proposes;
Fig. 5 is the structural representation that the file that one embodiment of the invention proposes uploads device;
Fig. 6 is the structural representation that the file that another embodiment of the present invention proposes uploads device;
Fig. 7 is the structural representation that the file that further embodiment of this invention proposes uploads device;And
Fig. 8 is the structural representation for the computer equipment that one embodiment of the invention proposes.
Embodiment
Embodiments of the invention are described below in detail, the example of the embodiment is shown in the drawings, wherein from beginning to end Same or similar label represents same or similar element or the element with same or like function.Below with reference to attached The embodiment of figure description is exemplary, it is intended to for explaining the present invention, and is not considered as limiting the invention.
Below with reference to the accompanying drawings the file uploading method and device of the embodiment of the present invention are described.
At present, the file for this kind of cross-terminal that client file interacts with server file uploads interactive application increasingly Popularization.However, because web application is sentenced using the complexity of scene, the unstability of network condition and client file form The reasons such as disconnected inaccuracy, cause and many uncontrollable factors in file upload procedure be present, such as:(1) with the market All kinds of softwares flourish, and judgement of the client for file format is more and more inaccurate and sharp in web application, for example, The storage file of the trendy software such as sketch can not carry out the judgement of file format by MIME;(2) client in web application The calculating to the cryptographic Hash (hash values) of file is held bottleneck to be present, it is difficult to conveniently and efficiently calculate correct hash values;(3) take The business already present file content in end is carried out invalid interactive modifying by software systems, causes the inconvenience operated with;(4) In the case where network environment conditions are poor, file transmission situations such as slow, interim card be present, cause transmit work can not normally, Favorably accomplish;(5) uploaded while big file and may result in software systems paralysis, caused the damage of file data or lose Lose;Etc..
In view of the above-mentioned problems, the present invention proposes a kind of file uploading method, file can be reduced and uploaded to application environment Requirement, improve file upload success rate.
Fig. 1 is the schematic flow sheet for the file uploading method that one embodiment of the invention proposes.
As shown in figure 1, this document method for uploading comprises the following steps:
Step 101, attribute checking is carried out to the file destination that needs upload.
, can be first to the target that upload of needs when needing the file by client to be uploaded to service end in the present embodiment File carries out attribute checking, and file destination just is uploaded into service end after being verified, if attribute checking is not by eventually The only upload operation of the file destination.
Further, when attribute checking not by when, can also to user show prompt message, with remind user upload quilt Terminate, and shown to user and terminate reason.For example it can show to user and be terminated because the size of file destination is undesirable The prompt message of upload.
Wherein, type, size of checking file destination etc. can be included by attribute checking being carried out to file destination.
Herein it should be noted that the detailed description that attribute checking is carried out to the file destination uploaded to needs will be follow-up Provide in content, to avoid repeating, do not illustrate excessively herein.
Step 102, after attribute is verified, file destination is added in document queue.
Attribute checking is carried out for file destination and by rear, file destination can be added in document queue, with etc. It is to be uploaded.
Alternatively, in a kind of possible implementation of the embodiment of the present invention, when file destination is verified by attribute, adding Add to before document queue, can also judge to whether there is identical file in document queue, and be not present in document queue During with file destination identical file, file destination is added in document queue;When existing in document queue and file destination During identical file, further determine whether to allow repeatedly to upload identical file, if not allowing, file destination is not added Into document queue;If allowing, file destination is added in document queue, to avoid not allowing to upload same file In the case of repeat upper transmitting file and cause the wasting of resources.
Step 103, the first signing messages of file destination is obtained.
Wherein, the first signing messages of file destination can be the cryptographic Hash of file destination, then obtains the of file destination One signing messages includes:The cryptographic Hash of file destination is calculated as the first signing messages.Specifically, related Hash can be used Algorithm calculates the cryptographic Hash of file destination.
Further,, can also first root when calculating cryptographic Hash in a kind of possible implementation of the embodiment of the present invention Whether allow parallel computation according to the condition judgment of client, and when judging to allow parallel computation, calculate the Kazakhstan of file destination While uncommon value, the file in document queue in addition to file destination, and the cryptographic Hash of calculation document are read also from cache pool As the first signing messages of respective file, and then using the cryptographic Hash of file destination and the cryptographic Hash of each file, formed and breathed out Uncommon queue.When judging not allow parallel computation, then the calculating of cryptographic Hash can be carried out to a file every time, after the completion of calculating Next file is read from cache pool again and calculates cryptographic Hash, and after the completion of the All Files in cache pool is calculated, profit Hash queue is formed with the cryptographic Hash of gained.
Herein it should be noted that when judging not allow parallel computation, multiple Kazakhstan can be calculated during in order to calculate every time Uncommon value,, can also be to the length of calculating queue in a kind of possible implementation of the embodiment of the present invention to improve computational efficiency Detected, judge to calculate whether queue overflows.When calculating queue is not overflowed, continue to read file from cache pool, to increase Add the length for calculating queue, ensure that the amount of calculation for calculating cryptographic Hash every time reaches maximum, making to calculate every time can obtain as far as possible The cryptographic Hash of more files, computational efficiency is improved, improve the disposal ability of method.
Whether parallel computation is allowed by the condition judgment according to client, and when allowing parallel computation, parallel computation The cryptographic Hash of multiple files, when not allowing parallel computation, to each file serial computing cryptographic Hash, to realize according to client The suitable computational methods of environmental selection, improve method applicability.
Step 104, when being not present in the first signing messages in the signing messages list that is got from server, judge Whether file destination has recorded breakpoint location.
Wherein, breakpoint location is used to indicate the position being interrupted during the transmission of file last time, when file is not transmitted once And during the end of transmission, file, which is divided into, have been transmitted data and has not transmitted data two parts, and can be in addition at data outage Disconnected mark, mark position is breakpoint location.
In the present embodiment, it can in the server establish in advance and store a signing messages list, for each upload To the file of server, signing messages corresponding to file can be recorded in signing messages list.For each to be uploaded File destination, after the first signing messages for obtaining file destination, signing messages list can be obtained from server, and will First signing messages of file destination is matched with the signing messages recorded in the signing messages list obtained, to judge first Signing messages whether there is in signing messages list.When the first signing messages is not present in signing messages list, then enter One step judges whether file destination has recorded breakpoint location.When the first signing messages is present in signing messages list, show The file destination has been stored with the server, then can terminate upload, while can show that file destination is existing to user Prompt message, avoid to same server upload duplicate file cause the wasting of resources.
Step 105, if record has breakpoint location, file destination is resumed to server since breakpoint location.
When judging to learn in file destination that record has breakpoint location, it is believed that the partial data of file destination on Pass, then can continue to upload file destination to server since breakpoint location.When breakpoint location is not recorded in file destination When, it is believed that file destination was not uploaded, then can directly upload whole file destination.
The file uploading method of the present embodiment, attribute checking is carried out by the file destination uploaded to needs, when checking is logical Later file destination is added in document queue, obtains the first signing messages of file destination, do not deposited in the first signing messages When in the signing messages list got from server, determine whether file destination has recorded breakpoint location, And when record has breakpoint location, file destination is resumed to server since breakpoint location.By first before file uploads Attribute checking is carried out, client can be alleviated the problem of inaccurate is judged to file format;Server is judged by signing messages On whether file destination be present, avoid repeat upload.And allow breakpoint transmission during upload, work as file destination When being not present on server, it can attempt to obtain the breakpoint location of file destination, get breakpoint location then from breakpoint location Start to resume file destination to server, can realize that the burst of file destination uploads, reduce the requirement to network bandwidth, improve File uploads success rate.
In order to more clearly describe in above-described embodiment to the tool of the file destination progress attribute checking uploaded to needs Body process, the embodiment of the present invention propose another file uploading method, and Fig. 2 is on the file that another embodiment of the present invention proposes The schematic flow sheet of transmission method.
As shown in Fig. 2 on the basis of embodiment as shown in Figure 1, step 101 comprises the following steps:
Step 201, the file format and file size of file destination are extracted, forms the attribute information of file destination.
Wherein, file format includes file extension, file MIME type and/or filename regular expression.
, can be first big according to the file format of file destination extraction file destination and file for file destination to be uploaded It is small, and the attribute information using the file format of extraction and file size as file destination.
Step 202, verify whether the file format in attribute information meets default file format requirements.
In the present embodiment, for the attribute information of file destination, it can first verify whether is file format in attribute information Meet default file format requirements.Wherein, default file format can be the file format that server allows to upload.
As a kind of example, when file format includes file extension, file MIME type and filename regular expression When, it is necessary to verify whether file extension meets the file extension that server allows to upload, whether file MIME type meet Expression requires, and whether checking filename regular expression correct, when checking by when, it is pre- just to think that file format meets If file format requirements;If any of which checking does not pass through, then it is assumed that the file format of file destination is unsatisfactory for default text Part call format, relevant information can be now shown to user to remind user which kind of checking is not by order to which user enters the hand-manipulating of needle To property modification.
Step 203, if file format meets default file format requirements, whether checking file size meets to preset File size requirement.
Wherein, default file size can be the maximum amount of data for certain type file that server allows.For difference The file of type, server can set different size of maximum amount of data, such as, for text, what server allowed Maximum amount of data is 100M;For audio file, the maximum amount of data that server allows is 30M;For video file, server The maximum amount of data of permission is 3G.
When the file format of file destination meets default file format requirements, file destination can be further verified Whether file size meets default file size requirement.Specifically, target text can be determined according to the extension name of file destination The type of part, and maximum amount of data corresponding with identified type is obtained from server, by the file size of file destination Compared with the maximum amount of data for the type file that server allows, when file size is not less than the maximum data allowed During amount, it is believed that file size meets default file size requirement.When file size exceedes allowed maximum amount of data, text Part upload procedure is terminated, and the excessive prompt message of file can be shown to user.
Step 204, if file size meets default file size requirement, by testing the attribute of file destination Card.
When the file size of file destination meets default file size requirement, then it is assumed that pass through the category to file destination Property checking.
The file uploading method of the present embodiment, by extraction document form and file size from file destination, and testing When card file format meets that default file format requirements and file size meet default file size requirement, it is believed that pass through The attribute of file destination is verified, can realize the automatic checking of file destination, transmitting file meets wanting for server in guarantees Ask, successfully to upload document laid basis.
In order to clearly describe the specific implementation whether file destination in above-described embodiment records breakpoint location Journey, the present invention propose another file uploading method, and Fig. 3 is the stream for the file uploading method that further embodiment of this invention proposes Journey schematic diagram.
As shown in figure 3, on the basis of embodiment as shown in Figure 1, step 104 may comprise steps of:
Step 301, the first request is sent to server, first asks to be used for the information list that asks for an autograph.
In the present embodiment, after the first signing messages for obtaining file destination, client can send the to server One request, to obtain signing messages list from server.Wherein, record has in server storage file in signing messages list Signing messages.
Step 302, by the first signing messages of file destination and signing messages list match.
, can be by the first signing messages and signing messages of file destination after server obtains signing messages list The each signing messages recorded in list is compared, to judge to whether there is and the first signing messages in signing messages list The signing messages of matching.
Step 303, if not matching the signing messages consistent with the first signing messages, root in signing messages list According to the mark of file destination, the breakpoint information of inquiry file destination from the first memory space.
Wherein, the upload information of each file to have uploaded onto the server can be stored in the first memory space, uploads letter Ceasing in the upload deadline for including but not limited to going up transmitting file, the size of file, the type of file, file upload procedure is It is no be interrupted, interrupting information etc..
, can be according to target when not matching the signing messages consistent with the first signing messages in signing messages list The mark of file, the breakpoint information of file destination is inquired about from the first memory space.Wherein, the mark of file destination can be mesh Mark in extension name of file, title, numbering etc. any one or at least two combination.
Step 304, if being stored with the breakpoint information of file destination, breakpoint location is obtained from breakpoint information.
When file destination was once uploaded, and upload procedure is interrupted, such as because of network interruption or network condition too Difference causes upload procedure to be interrupted, and this document label and breakpoint information can be recorded in the first memory space.When file destination again It is secondary when being uploaded, according to the mark of file destination, the breakpoint information of file destination can be inquired from the first memory space, and Breakpoint location is obtained from breakpoint information.Wherein, breakpoint information can include but is not limited to break period, interruption position, interruption When the data volume that has uploaded etc..
The text method for uploading of the present embodiment, by obtaining signing messages list from server, by the file destination of acquisition The first signing messages matched with signing messages list, and in signing messages list be not present and the first signing messages During the signing messages matched somebody with somebody, the breakpoint information of file destination is inquired about from the first memory space, and inquiring the disconnected of file destination During point information, breakpoint location is obtained from breakpoint information, during to upload file destination again, continue since breakpoint location on Pass, avoid repeating the partial data for uploading file destination, the memory space of bandwidth resources and server can be saved.
In order to clearly describe to resume the tool of file destination in above-described embodiment to server since breakpoint location Body implementation process, the present invention propose another file uploading method, and Fig. 4 is that the file that yet another embodiment of the invention proposes uploads The schematic flow sheet of method.
As shown in figure 4, on the basis of embodiment as shown in Figure 1, step 105 may comprise steps of:
Step 401, file destination is subjected to burst, obtains the file fragment of file destination.
When inquiring the breakpoint location of file destination, burst can be carried out to file destination, obtain the text of file destination Part fragment.For example burst can be carried out to file destination according to default size, make the size of each file fragment no more than pre- If size.
Alternatively, in a kind of possible implementation of the embodiment of the present invention, the size of burst can be pre-set, and Before burst is carried out to file destination, according to the size of default burst, judge whether to need to carry out burst to file destination, When the size of file destination is more than the size of default burst, file destination is subjected to burst, obtains the file of file destination Fragment;When the size of file destination is not more than the size of default burst, can directly be uploaded without burst.
Step 402, using the file fragment including breakpoint location as start file fragment.
Step 403, file destination is resumed to server since start file fragment.
In the present embodiment, to file destination carry out burst after, can using the file fragment including breakpoint location as Beginning file fragment, and since start file fragment, file destination is resumed to server.
Specifically, start file fragment and subsequent file fragment can be added to and uploaded in queue, by uploading team Row resume file destination to server parallel.Wherein, to when uploading queue add file fragment, upload queue can first be obtained Capacity, according to upload queue capacity and file fragment size, it is determined that upload file fragment number, and from starting text Part fragment starts, according to the number of determination to queue add file fragment is uploaded, to ensure that maximum number can be uploaded every time File fragment, improve efficiency of transmission.
The file uploading method of the present embodiment, file fragment is obtained by carrying out burst to file destination, breakpoint will be included The file fragment of position resumes file destination since start file fragment as start file fragment to server, can Realize and continue to upload file destination from breakpoint location, avoid uploading duplicate data, save to Internet resources and server storage money The occupancy in source.
In a kind of possible implementation of the embodiment of the present invention, before file destination upload, it can also determine to allow Identical file destination is uploaded to different server, and in the present embodiment, file destination only allows to upload to same server Once, to ensure that the file repeated is not present in same server, the storage resource of server is saved.By allowing to difference Server upload identical file destination, can ensure that, in a server failure, user can obtain from other servers File destination is taken, reaches the purpose of file backup, lifts Consumer's Experience.
Above-mentioned file uploading method, Properties Control can be carried out automatically according to the Special use environmental condition of user, such as Calculating, the repetition of service end file of completion hash values are compared, the breakpoint transmission of file and network concurrent control etc., realize pin To flexibly matching somebody with somebody under the complicated situations such as different file formats, different client conditions and different network environment conditions Put, the mode such as user is pulled by simple file, file selection, file stickup can be achieved file and upload, simple to operate, carry Consumer's Experience is risen.
In order to realize above-described embodiment, the present invention also proposes that a kind of file uploads device.
Fig. 5 is the structural representation that the file that one embodiment of the invention proposes uploads device.
Include as shown in figure 5, this document uploads device 50:Authentication module 510, add module 520, acquisition module 530, sentence Disconnected module 540, and uploading module 550.
Wherein, authentication module 510, the file destination for being uploaded to needs carry out attribute checking.
Specifically, authentication module 510 is used for the file format and file size for extracting file destination, forms file destination Attribute information;Wherein, file format includes file extension, file MIME type and/or filename regular expression;Checking category Property information in file format whether meet default file format requirements, and meet that default file format will in file format When asking, further verify whether file size meets default file size requirement;When file size meets that default file is big It is small when requiring, then pass through and the attribute of file destination is verified.
Meet default file by extraction document form and file size from file destination, and in checking file format When call format and file size meet default file size requirement, it is believed that by being verified to the attribute of file destination, energy Enough realize the automatic checking of file destination, transmitting file meets the requirement of server in guarantee, successfully to upload document laid base Plinth.
Add module 520, for after attribute is verified, file destination to be added in document queue.
Acquisition module 530, for obtaining the first signing messages of file destination.
Specifically, the cryptographic Hash that acquisition module 530 is used to calculate file destination is as the first signing messages.
Further, acquisition module 530 can also be read while the cryptographic Hash of file destination is calculated from cache pool File in document queue in addition to file destination, and first signing messages of the cryptographic Hash of calculation document as file, and then Using the cryptographic Hash of file destination and the cryptographic Hash of each file, Hash queue is formed.
Judge module 540, for the signing messages list for being not present in getting from server in the first signing messages When middle, judge whether file destination has recorded breakpoint location.
Uploading module 550, for when record has breakpoint location, target text to be resumed to server since breakpoint location Part.
Further, in a kind of possible implementation of the embodiment of the present invention, as shown in fig. 6, implementing as shown in Figure 5 On the basis of example, judge module 540 can include:
Transmitting element 541, for sending the first request to server, first asks to be used for the information list that asks for an autograph.
Matching unit 542, for by the first signing messages of file destination and signing messages list match.
Query unit 543, the A.L.S. consistent with the first signing messages is not matched in signing messages list for working as During breath, according to the mark of file destination, the breakpoint information of inquiry file destination from the first memory space.
Acquiring unit 544, for when being stored with the breakpoint information of file destination, breakpoint bit to be obtained from breakpoint information Put.
By obtaining signing messages list from server, by the first signing messages and signing messages of the file destination of acquisition List is matched, and in signing messages list be not present matched with the first signing messages signing messages when, deposited from first The breakpoint information that file destination is inquired about in space is stored up, and when inquiring the breakpoint information of file destination, is obtained from breakpoint information Breakpoint location is taken, during to upload file destination again, continues to upload since breakpoint location, avoids repeating to upload file destination Partial data, the memory space of bandwidth resources and server can be saved.
Further, in a kind of possible implementation of the embodiment of the present invention, as shown in fig. 7, implementing as shown in Figure 5 On the basis of example, uploading module 550 can include:
Sharding unit 551, for file destination to be carried out into burst, obtain the file fragment of file destination.
Determining unit 552, for using the file fragment including breakpoint location as start file fragment.
Uploading unit 553, for resuming file destination to server since start file fragment.
Specifically, can will be by start file fragment and subsequent file fragment when uploading unit 553 uploads file destination It is added to and uploads in queue, then file destination is resumed to server by uploading queue in parallel.Wherein, uploading unit 553 is upward When passing add file fragment in queue, the capacity for uploading queue can be first obtained, according still further to the capacity and file piece for uploading queue The size of section, it is determined that the number of the file fragment uploaded, and then since start file fragment, according to the number of determination to upload Queue add file fragment.
File fragment is obtained by carrying out burst to file destination, using the file fragment including breakpoint location as starting text Part fragment, and file destination is resumed to server since start file fragment, it can realize and continue to upload mesh from breakpoint location File is marked, avoids uploading duplicate data, saves the occupancy to Internet resources and server stores resources.
In a kind of possible implementation of the embodiment of the present invention, this document uploads device 50 to server up transfer file When, it can also first determine to allow to upload identical file destination to different servers, wherein, file destination only allows to same Individual server uploads once, to ensure that the file repeated is not present in same server, saves the storage resource of server.It is logical Crossing allows to upload identical file destination to different server, can ensure in a server failure, and user can be from Other servers obtain file destination, reach the purpose of file backup, lift Consumer's Experience.
It should be noted that the foregoing explanation to file uploading method embodiment is also applied for the file of the present embodiment Device is uploaded, its realization principle is similar, and here is omitted.
The file of the present embodiment uploads device, and attribute checking is carried out by the file destination uploaded to needs, when checking is logical Later file destination is added in document queue, obtains the first signing messages of file destination, do not deposited in the first signing messages When in the signing messages list got from server, determine whether file destination has recorded breakpoint location, And when record has breakpoint location, file destination is resumed to server since breakpoint location.By first before file uploads Attribute checking is carried out, client can be alleviated the problem of inaccurate is judged to file format;Server is judged by signing messages On whether file destination be present, avoid repeat upload.And allow breakpoint transmission during upload, work as file destination When being not present on server, it can attempt to obtain the breakpoint location of file destination, get breakpoint location then from breakpoint location Start to resume file destination to server, can realize that the burst of file destination uploads, reduce the requirement to network bandwidth, improve File uploads success rate.
In order to realize above-described embodiment, the present invention also proposes a kind of computer equipment.
Fig. 8 is the structural representation for the computer equipment that one embodiment of the invention proposes.As shown in figure 8, the computer is set Standby 80 include:Memory 801, processor 802 and it is stored in the computer that can be run on memory 801 and on processor 802 Program 803, wherein, when processor 802 performs computer program 803, realize file uploading method as in the foregoing embodiment.
In order to realize above-described embodiment, the present invention also proposes a kind of computer program product, when in computer program product Instruction by computing device when, perform file uploading method as in the foregoing embodiment.
In order to realize above-described embodiment, the present invention also proposes a kind of non-transitorycomputer readable storage medium, deposited thereon Computer program is contained, file uploading method as in the foregoing embodiment is realized when the program is executed by processor.
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show The description of example " or " some examples " etc. means specific features, structure, material or the spy for combining the embodiment or example description Point is contained at least one embodiment or example of the present invention.In this manual, to the schematic representation of above-mentioned term not Identical embodiment or example must be directed to.Moreover, specific features, structure, material or the feature of description can be with office Combined in an appropriate manner in one or more embodiments or example.In addition, in the case of not conflicting, the skill of this area Art personnel can be tied the different embodiments or example and the feature of different embodiments or example described in this specification Close and combine.
In addition, term " first ", " second " are only used for describing purpose, and it is not intended that instruction or hint relative importance Or the implicit quantity for indicating indicated technical characteristic.Thus, define " first ", the feature of " second " can be expressed or Implicitly include at least one this feature.In the description of the invention, " multiple " are meant that at least two, such as two, three It is individual etc., unless otherwise specifically defined.
Any process or method described otherwise above description in flow chart or herein is construed as, and represents to include Module, fragment or the portion of the code of the executable instruction of one or more the step of being used to realize custom logic function or process Point, and the scope of the preferred embodiment of the present invention includes other realization, wherein can not press shown or discuss suitable Sequence, including according to involved function by it is basic simultaneously in the way of or in the opposite order, carry out perform function, this should be of the invention Embodiment person of ordinary skill in the field understood.
Expression or logic and/or step described otherwise above herein in flow charts, for example, being considered use In the order list for the executable instruction for realizing logic function, may be embodied in any computer-readable medium, for Instruction execution system, device or equipment (such as computer based system including the system of processor or other can be held from instruction The system of row system, device or equipment instruction fetch and execute instruction) use, or combine these instruction execution systems, device or set It is standby and use.For the purpose of this specification, " computer-readable medium " can any can be included, store, communicate, propagate or pass Defeated program is for instruction execution system, device or equipment or the dress used with reference to these instruction execution systems, device or equipment Put.The more specifically example (non-exhaustive list) of computer-readable medium includes following:Electricity with one or more wiring Connecting portion (electronic installation), portable computer diskette box (magnetic device), random access memory (RAM), read-only storage (ROM), erasable edit read-only storage (EPROM or flash memory), fiber device, and portable optic disk is read-only deposits Reservoir (CDROM).In addition, computer-readable medium, which can even is that, to print the paper of described program thereon or other are suitable Medium, because can then enter edlin, interpretation or if necessary with it for example by carrying out optical scanner to paper or other media His suitable method is handled electronically to obtain described program, is then stored in computer storage.
It should be appreciated that each several part of the present invention can be realized with hardware, software, firmware or combinations thereof.Above-mentioned In embodiment, software that multiple steps or method can be performed in memory and by suitable instruction execution system with storage Or firmware is realized.Such as, if realized with hardware with another embodiment, following skill well known in the art can be used Any one of art or their combination are realized:With the logic gates for realizing logic function to data-signal from Logic circuit is dissipated, the application specific integrated circuit with suitable combinational logic gate circuit, programmable gate array (PGA), scene can compile Journey gate array (FPGA) etc..
Those skilled in the art are appreciated that to realize all or part of step that above-described embodiment method carries Suddenly it is that by program the hardware of correlation can be instructed to complete, described program can be stored in a kind of computer-readable storage medium In matter, the program upon execution, including one or a combination set of the step of embodiment of the method.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing module, can also That unit is individually physically present, can also two or more units be integrated in a module.Above-mentioned integrated mould Block can both be realized in the form of hardware, can also be realized in the form of software function module.The integrated module is such as Fruit is realized in the form of software function module and as independent production marketing or in use, can also be stored in a computer In read/write memory medium.
Storage medium mentioned above can be read-only storage, disk or CD etc..Although have been shown and retouch above Embodiments of the invention are stated, it is to be understood that above-described embodiment is exemplary, it is impossible to be interpreted as the limit to the present invention System, one of ordinary skill in the art can be changed to above-described embodiment, change, replace and become within the scope of the invention Type.

Claims (13)

  1. A kind of 1. file uploading method, it is characterised in that including:
    Attribute checking is carried out to the file destination that needs upload;
    After attribute is verified, the file destination is added in document queue;
    Obtain the first signing messages of the file destination;
    When during first signing messages is not present in the signing messages list that is got from server, the target is judged Whether file has recorded breakpoint location;
    If record has the breakpoint location, the file destination is resumed to the server since the breakpoint location.
  2. 2. according to the method for claim 1, it is characterised in that the described pair of file destination for needing to upload carries out attribute and tested Card, including:
    The file format of the file destination and the file size are extracted, forms the attribute information of the file destination;Wherein, The file format includes file extension, file MIME type and/or filename regular expression;
    Verify whether the file format in the attribute information meets default file format requirements;
    If the file format meets default file format requirements, verify whether the file size meets default text Part size requirements;
    If the file size meets default file size requirement, by being verified to the attribute of the file destination.
  3. 3. according to the method for claim 1, it is characterised in that first signing messages for obtaining the file destination, Including:
    The cryptographic Hash of the file destination is calculated as first signing messages.
  4. 4. according to the method for claim 3, it is characterised in that also include:
    While the cryptographic Hash of the file destination is calculated, read from cache pool in the document queue except target text File outside part, and calculate first signing messages of the cryptographic Hash as the file of the file;
    Using the cryptographic Hash of the file destination and the cryptographic Hash of each file, Hash queue is formed.
  5. 5. according to the method for claim 1, it is characterised in that described to be not present in first signing messages from service When in the signing messages list got in device, judge whether the file destination has recorded breakpoint location, including:
    The first request is sent to the server, described first asks to be used to ask the signing messages list;
    By the first signing messages of the file destination and the signing messages list match;
    If the signing messages consistent with first signing messages is not matched in the signing messages list, according to institute The mark of file destination is stated, the breakpoint information of the file destination is inquired about from the first memory space;
    If being stored with the breakpoint information of the file destination, the breakpoint location is obtained from the breakpoint information.
  6. 6. according to the method for claim 1, it is characterised in that described to continue since the breakpoint location to the server The file destination is passed, including:
    The file destination is subjected to burst, obtains the file fragment of the file destination;
    Using the file fragment including the breakpoint location as start file fragment;
    Since the start file fragment the file destination is resumed to the server.
  7. 7. according to the method for claim 6, it is characterised in that it is described since the start file fragment to the service Device resumes the file destination, including:
    The start file fragment and subsequent file fragment are added to and uploaded in queue;
    The file destination is resumed to the server by the upload queue in parallel.
  8. 8. according to the method for claim 7, it is characterised in that described by the start file fragment and subsequent file piece Section, which is added to, to be uploaded in queue, including:
    Obtain the capacity of the upload queue;
    According to the size of the capacity and file fragment, it is determined that the number of the file fragment uploaded;
    Since the start file fragment, queue add file fragment is uploaded to described according to the number.
  9. 9. according to the method for claim 1, it is characterised in that also include:
    It is determined that allow to upload file destination described in identical to different servers;Wherein, the file destination only allows to same One server uploads once.
  10. 10. a kind of file uploads device, it is characterised in that including:
    Authentication module, the file destination for being uploaded to needs carry out attribute checking;
    Add module, for after attribute is verified, the file destination to be added in document queue;
    Acquisition module, for obtaining the first signing messages of the file destination;
    Judge module, used in being not present in the signing messages list that is got from server in first signing messages When, judge whether the file destination has recorded breakpoint location;
    Uploading module, for when record has the breakpoint location, institute to be resumed to the server since the breakpoint location State file destination.
  11. A kind of 11. computer equipment, it is characterised in that including:Memory, processor and storage on a memory and can handled The computer program run on device, wherein, described in the computing device during computer program, realize as in claim 1-9 File uploading method described in any one.
  12. 12. a kind of computer program product, it is characterised in that when the instruction in the computer program product is by computing device When, perform file uploading method as claimed in any one of claims 1-9 wherein.
  13. 13. a kind of non-transitorycomputer readable storage medium, is stored thereon with computer program, it is characterised in that the program File uploading method as claimed in any one of claims 1-9 wherein is realized when being executed by processor.
CN201711208594.5A 2017-11-27 2017-11-27 File uploading method and device Withdrawn CN107707679A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711208594.5A CN107707679A (en) 2017-11-27 2017-11-27 File uploading method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711208594.5A CN107707679A (en) 2017-11-27 2017-11-27 File uploading method and device

Publications (1)

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

Family

ID=61185994

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711208594.5A Withdrawn CN107707679A (en) 2017-11-27 2017-11-27 File uploading method and device

Country Status (1)

Country Link
CN (1) CN107707679A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109194739A (en) * 2018-09-03 2019-01-11 中国平安人寿保险股份有限公司 A kind of file uploading method, storage medium and server
CN109800392A (en) * 2019-01-11 2019-05-24 滨州建筑工程施工图审查中心 Digitize the Multifunctional graph paper method for uploading and device in check of drawings
CN110944034A (en) * 2019-10-21 2020-03-31 量子云未来(北京)信息科技有限公司 Webpage end breakpoint resume method and device, electronic equipment and storage medium
CN111225058A (en) * 2020-01-09 2020-06-02 深圳壹账通智能科技有限公司 File uploading method and related product
CN111314021A (en) * 2020-02-07 2020-06-19 北京字节跳动网络技术有限公司 Data transmission method and device, electronic equipment and computer readable storage medium
CN112866195A (en) * 2020-12-31 2021-05-28 平安医疗健康管理股份有限公司 Agile data transmission method and device, computer equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1893436A (en) * 2005-07-01 2007-01-10 萧学文 Method and system for up transmitting file on mobile terminal
EP2117223A1 (en) * 2008-04-18 2009-11-11 Nikon Corporation Image transmission apparatus and image reception apparatus
CN105227613A (en) * 2014-06-30 2016-01-06 北京金山安全软件有限公司 File uploading method and device
CN105338090A (en) * 2015-11-12 2016-02-17 浪潮软件集团有限公司 WebSocket-based breakpoint continuous transmission method and device
CN103002029B (en) * 2012-11-26 2016-12-21 北京百度网讯科技有限公司 The management method of upper transmitting file, system and client
CN107172131A (en) * 2017-04-26 2017-09-15 腾讯科技(深圳)有限公司 File uploading method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1893436A (en) * 2005-07-01 2007-01-10 萧学文 Method and system for up transmitting file on mobile terminal
EP2117223A1 (en) * 2008-04-18 2009-11-11 Nikon Corporation Image transmission apparatus and image reception apparatus
CN103002029B (en) * 2012-11-26 2016-12-21 北京百度网讯科技有限公司 The management method of upper transmitting file, system and client
CN105227613A (en) * 2014-06-30 2016-01-06 北京金山安全软件有限公司 File uploading method and device
CN105338090A (en) * 2015-11-12 2016-02-17 浪潮软件集团有限公司 WebSocket-based breakpoint continuous transmission method and device
CN107172131A (en) * 2017-04-26 2017-09-15 腾讯科技(深圳)有限公司 File uploading method and device

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109194739A (en) * 2018-09-03 2019-01-11 中国平安人寿保险股份有限公司 A kind of file uploading method, storage medium and server
CN109800392A (en) * 2019-01-11 2019-05-24 滨州建筑工程施工图审查中心 Digitize the Multifunctional graph paper method for uploading and device in check of drawings
CN110944034A (en) * 2019-10-21 2020-03-31 量子云未来(北京)信息科技有限公司 Webpage end breakpoint resume method and device, electronic equipment and storage medium
CN111225058A (en) * 2020-01-09 2020-06-02 深圳壹账通智能科技有限公司 File uploading method and related product
CN111225058B (en) * 2020-01-09 2023-11-03 深圳壹账通智能科技有限公司 File uploading method and related products
CN111314021A (en) * 2020-02-07 2020-06-19 北京字节跳动网络技术有限公司 Data transmission method and device, electronic equipment and computer readable storage medium
CN112866195A (en) * 2020-12-31 2021-05-28 平安医疗健康管理股份有限公司 Agile data transmission method and device, computer equipment and storage medium
CN112866195B (en) * 2020-12-31 2022-09-16 深圳平安医疗健康科技服务有限公司 Agile data transmission method and device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN107707679A (en) File uploading method and device
CN102819531B (en) A kind of cloud reading service system, cloud reading service method and apparatus
CN110287383B (en) Method and device for checking field information
CA2814950C (en) Realtime synchronized document editing by multiple users for blogging
CN111008075B (en) Load balancing system, method, device, equipment and medium
US20240020270A1 (en) Efficient similarity detection
CN108667861A (en) By browser to the method, system and server of device real-time monitoring
CN103546517B (en) Network information push system and method
CN108710681A (en) File acquisition method, device, equipment and storage medium
CN102752388A (en) Browser-based interactive system, browser-based interactive method, browser and cloud server
CN102124481A (en) Embedding macros in web pages with advertisements
US9519537B2 (en) Apparatus, system and method for application log data processing
CN103890734A (en) Telemetry file hash and conflict detection
CN107517239A (en) Data transmission method and device
CN102710799B (en) Client plug-in based on real-time Message Passing installs system for prompting and method
CN109783463A (en) File synchronisation method, device and computer readable storage medium
CN110619571A (en) Loan application processing method and device
CN110633120A (en) Configuration software control processing method, device, server, user terminal and system
WO2018006575A1 (en) Interconnected document updating method based on common interests
CN109635193B (en) Book reading sharing platform
CN106776504A (en) A kind of document format on-line conversion method and system
CN110245307A (en) Page cache management method and system, terminal device and storage medium
CN110991358A (en) Text comparison method and device based on block chain
CN106603603A (en) HTML 5 browser supported asynchronous uploading method and system for multiple files
CN102467355B (en) Messaging device and method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20190903

Address after: 100192 Dongsheng Science Park, Zhongguancun, 66 Xixiaokou Road, Haidian District, Beijing

Applicant after: Green Bay Network Technology Co., Ltd.

Address before: 100089 Beijing Haidian District Xixiaokou Road 66 Zhongguancun Dongsheng Science Park B-6 Building B 5 floors

Applicant before: Grass count language (Beijing) Technology Co., Ltd.

WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20180216