CN107623710A - A kind of file uploading method and terminal - Google Patents

A kind of file uploading method and terminal Download PDF

Info

Publication number
CN107623710A
CN107623710A CN201610564295.4A CN201610564295A CN107623710A CN 107623710 A CN107623710 A CN 107623710A CN 201610564295 A CN201610564295 A CN 201610564295A CN 107623710 A CN107623710 A CN 107623710A
Authority
CN
China
Prior art keywords
uploaded
file
blocks
server
files
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
CN201610564295.4A
Other languages
Chinese (zh)
Inventor
王涛伟
刘朝晖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Spotmau Information Technology Co Ltd
Original Assignee
Shenzhen Spotmau Information 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 Shenzhen Spotmau Information Technology Co Ltd filed Critical Shenzhen Spotmau Information Technology Co Ltd
Priority to CN201610564295.4A priority Critical patent/CN107623710A/en
Publication of CN107623710A publication Critical patent/CN107623710A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention discloses a kind of file uploading method and terminal, this method includes:If receiving the instruction for uploading file to be uploaded, file to be uploaded is subjected to piecemeal to obtain at least one blocks of files to be uploaded according to the first preset rules;Obtain file block message to be uploaded;The file block message to be uploaded is sent to server;If receiving the comparison result of server return, judge to whether there is and blocks of files content identical file destination block to be uploaded in server;If comparison result is in the absence of uploading blocks of files to be uploaded.The embodiment of the invention also discloses a kind of terminal.The blocks of files to be uploaded being not present in the embodiment of the present invention upload server, so as to reduce terminal amount of calculation, reduce the used time, to improve Consumer's Experience, and be suitable for uploading the application scenarios of big file on the weaker mobile terminal of computing capability.

Description

A kind of file uploading method and terminal
Technical field
The present invention relates to network technique field, more particularly to a kind of file uploading method and terminal.
Background technology
The many cloud storage terminals in internet all support user by various files such as picture, video, music, various important at present The storage such as document to high in the clouds, and user can be uploaded such as PC, mobile phone and flat board by different terminals.In user File second biography and breakpoint transmission function have been derived during file is uploaded into high in the clouds.Wherein, the file second pass refer to if High in the clouds judge user transmission file before on be transmitted through, i.e., high in the clouds has been stored with this document, then directly return upload into Work(, user need not upload this file again.Breakpoint transmission refers to whole for the terminal such as movement in network environment under poor End is in the event of network interruption during upper transmitting file, then document transmission process is forced to stop.After network recovery is normal, Whole file need not be uploaded from the beginning again, i.e., it is still effective to have uploaded the part in high in the clouds before, but from last time network The place of interruption starts upper transmitting file.
Although the file second passes and breakpoint transmission can solve the problem that the problem of some files upload, entirely treated by calculating The MD5 values that the either calculating of the MD5 values of upper transmitting file has uploaded file part are compared with the file in high in the clouds so as to determine How above transmitting file.Current this processing mode, which does not account for high in the clouds, to be present and the less feelings of file content difference to be uploaded Shape, and it is longer the used time to be present, the shortcomings that poor user experience.
The content of the invention
The embodiment of the present invention provides a kind of file uploading method and terminal, and it can reduce the used time, improves Consumer's Experience.
In a first aspect, the embodiments of the invention provide a kind of file uploading method, this method includes:If receive upload to treat The instruction of upper transmitting file, the file to be uploaded is subjected to piecemeal to obtain at least one text to be uploaded according to the first preset rules Part block;File block message to be uploaded is obtained, each corresponding file block message to be uploaded of blocks of files to be uploaded is described to be uploaded Blocks of files information includes the size of the blocks of files to be uploaded and the MD5 values of the blocks of files to be uploaded;If receive server The comparison result of return, judge to whether there is and the blocks of files content identical file destination to be uploaded in the server Block;Wherein, the file destination block is carried out obtained by piecemeal, often by the file destination in server according to first preset rules The corresponding file destination block message of one file destination block, the file destination block message include the big of the file destination block The MD5 values of small and described file destination block, the file destination search gained by the server according to the second preset rules, and The server is compared to obtain the comparison result according to the file block message to be uploaded with file destination block message; If the comparison result is in the absence of the upload blocks of files to be uploaded.
On the other hand, the embodiments of the invention provide a kind of terminal, the terminal to include:Blocking unit, if for receiving The instruction of file to be uploaded is uploaded, the file to be uploaded is subjected to piecemeal to obtain at least one treat according to the first preset rules Upload blocks of files;Acquiring unit, for obtaining file block message to be uploaded, each corresponding text to be uploaded of blocks of files to be uploaded Part block message, size and the to be uploaded blocks of files of the blocks of files information to be uploaded including the blocks of files to be uploaded MD5 values;Transmitting element, for sending the file block message to be uploaded to server;Judging unit, if for receiving service The comparison result that device returns, judge to whether there is and the blocks of files content identical file destination to be uploaded in the server Block;Wherein, the file destination block is carried out obtained by piecemeal, often by the file destination in server according to first preset rules The corresponding file destination block message of one file destination block, the file destination block message include the big of the file destination block The MD5 values of small and described file destination block, the file destination search gained by the server according to the second preset rules, and The server is compared to obtain the comparison result according to the file block message to be uploaded with file destination block message; Uploading unit, if being in the absence of the upload blocks of files to be uploaded for the comparison result.
File to be uploaded is carried out piecemeal so as to obtain at least one treat by the embodiment of the present invention according to the first preset rules Transmitting file block, and file block message to be uploaded corresponding to blocks of files to be uploaded is obtained, then send file to be uploaded to server Block message, if receiving the comparison result of server return, judge to whether there is and blocks of files content phase to be uploaded in server With file destination block, if comparison result is in the absence of uploading the blocks of files to be uploaded.The embodiment of the present invention by that will treat on Transmitting file is divided into several blocks of files to be uploaded, and by judge with blocks of files content identical file destination block to be uploaded whether It is present in server, if being not present, directly uploads the blocks of files to be uploaded, according to this carries out whole file to be uploaded to realize Upload, the blocks of files to be uploaded being not present in the embodiment of the present invention upload server, so as to reduce terminal amount of calculation, reduction Used time, to improve Consumer's Experience.
Brief description of the drawings
Technical scheme in order to illustrate the embodiments of the present invention more clearly, it is required in being described below to embodiment to use Accompanying drawing is briefly described, it should be apparent that, drawings in the following description are some embodiments of the present invention, general for this area For logical technical staff, on the premise of not paying creative work, other accompanying drawings can also be obtained according to these accompanying drawings.
Fig. 1 is a kind of schematic flow diagram of file uploading method provided in an embodiment of the present invention;
Fig. 2 is a kind of schematic flow diagram for file uploading method that another embodiment of the present invention provides;
Fig. 3 is the sub-process schematic diagram of S207 in Fig. 2;
Fig. 4 is a kind of schematic block diagram of terminal provided in an embodiment of the present invention;
Fig. 5 is a kind of schematic block diagram for terminal that another embodiment of the present invention provides;
Fig. 6 is the schematic block diagram of execution unit in Fig. 5.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation describes, it is clear that described embodiment is part of the embodiment of the present invention, rather than whole embodiments.Based on this hair Embodiment in bright, the every other implementation that those of ordinary skill in the art are obtained under the premise of creative work is not made Example, belongs to the scope of protection of the invention.
It should be appreciated that ought be in this specification and in the appended claims in use, term " comprising " and "comprising" instruction Described feature, entirety, step, operation, the presence of element and/or component, but it is not precluded from one or more of the other feature, whole Body, step, operation, element, component and/or its presence or addition for gathering.
It is a kind of schematic flow diagram of file uploading method provided in an embodiment of the present invention referring to Fig. 1.This method can be somebody's turn to do Method may operate in the terminals such as smart mobile phone (such as Android phone, IOS mobile phones), tablet personal computer or electronic reader. As illustrated, this document method for uploading comprises the following steps S101~S105.
S101, if receiving the instruction for uploading file to be uploaded, file to be uploaded is divided according to the first preset rules Block is to obtain at least one blocks of files to be uploaded.
Specifically, in embodiments of the present invention, the uploading instructions of file to be uploaded can be that user loads file to be uploaded Operation such as in the touch operation of mobile terminal or the mouse action on computer terminal.If receive the upload of file to be uploaded Instruction, blocks of files to be uploaded is obtained according to the first preset rules from file to be uploaded.Wherein, if the first preset rules include treating Upper transmitting file is identical with the size of file destination, then respectively carries out file to be uploaded and file destination according to identical block size Decile;If file to be uploaded and file destination is of different sizes, according to identical number of blocks respectively by file to be uploaded and target File is divided.Wherein, file destination searches gained by server according to the second preset rules.
Specifically, second preset rules include at least one in active user ID, file name to be uploaded or temperature Or it is multiple, such as when the second preset rules include one in active user ID, file name to be uploaded or temperature, server File destination is searched in the file stored according to active user ID from the current ID, active user ID is to be uploaded to upload The user of file corresponding identity in the server, or server are searched and file to be uploaded according to file name to be uploaded Title identical file destination, or server are searched to obtain target according to the order of temperature from high to low from the file of storage File.And for example when the second preset rules include active user ID, file name to be uploaded or temperature in it is multiple when, Ke Yitong Cross and set different weights to search file destination.It is to be appreciated that the second preset rules are not limited only to this, user can basis Specific situation is configured, and is not construed as limiting herein.
S102, file block message to be uploaded is obtained, each corresponding file block message to be uploaded of blocks of files to be uploaded, treated Uploading blocks of files information includes the size of blocks of files to be uploaded and the MD5 values of blocks of files to be uploaded.
Specifically, file to be uploaded is being subjected to piecemeal to obtain at least one file to be uploaded according to the first preset rules , it is necessary to obtain file block message to be uploaded after block, the blocks of files information to be uploaded includes the size of blocks of files to be uploaded and treated The MD5 values of transmitting file block.MD5 (Message Digest Algorithm Message Digest Algorithm 5) leads for computer security The widely used a kind of hash function in domain, to provide the integrity protection of message.MD5 is any file (regardless of its size, lattice Formula, quantity) one same unique " digital finger-print " is produced, if anyone has done any change to file, its MD5 value Namely corresponding " digital finger-print " can all change.In embodiments of the present invention, obtained using MD5 algorithms corresponding to be uploaded The MD5 values of blocks of files.In addition, the size of blocks of files to be uploaded can be obtained by calling specified function, the technology has been Prior art, do not repeat herein.
S103, file block message to be uploaded is sent to server.
Specifically, in embodiments of the present invention, after file block message to be uploaded is obtained, by file block message to be uploaded Server is sent to so that server carries out corresponding retrieval on the server according to the file block message to be uploaded.Need to illustrate , due to S101, piecemeal has obtained multiple blocks of files to be uploaded from file to be uploaded, and each blocks of files to be uploaded is corresponding One file block message to be uploaded, in embodiments of the present invention, can successively will be to be uploaded according to the upload of file to be uploaded order File block message to be uploaded is sent to server so that server is retrieved corresponding to blocks of files.Wherein, upload order refers to Upload is proceeded by from the stem of file to be uploaded, is finished until file to be uploaded uploads.
S104, if receiving the comparison result of server return, judge to whether there is and blocks of files to be uploaded in server Content identical file destination block;Wherein, file destination block is carried out by the file destination in server according to the first preset rules Obtained by piecemeal, the corresponding file destination block message of each file destination block, file destination block message includes file destination block Size and file destination block MD5 values, file destination searches gained, and server root by server according to the second preset rules It is compared according to file block message to be uploaded with file destination block message to obtain comparison result.
Specifically, in embodiments of the present invention, the comparison result is used to represent in server with the presence or absence of to be uploaded with this The content identical file destination block of blocks of files, and server is carried out according to file block message to be uploaded and file destination block message Compare to obtain comparison result.Wherein, file destination block is divided by the file destination in server according to the first preset rules Obtained by block, the corresponding file destination block message of each file destination block, file destination block message includes file destination block The MD5 values of size and file destination block.
It is to be appreciated that server is searched to obtain file destination according to the second preset rules, and the file destination is according to One preset rules carry out piecemeal obtain file destination block, and if file to be uploaded it is identical with the size of file destination when, according to phase File to be uploaded and file destination are carried out decile to obtain the file destination block and blocks of files to be uploaded by same block size respectively, File i.e. to be uploaded is divided into identical size, quantity identical file destination block and blocks of files to be uploaded with file destination.If treat Upper transmitting file and file destination it is of different sizes, file to be uploaded and file destination are drawn respectively according to identical number of blocks Point, i.e., file to be uploaded is divided into quantity identical file destination block and blocks of files to be uploaded with file destination.Due to this point Block mode is not decile, therefore the situation that file destination block is consistent with also likely to be present block size in blocks of files to be uploaded.Service Device is compared to obtain comparison result according to file block message to be uploaded with file destination block message, i.e., by blocks of files to be uploaded Size and the MD5 values of blocks of files to be uploaded be compared with the MD5 values of the size of file destination block and file destination block, if two Person is identical, then illustrate in server exist with blocks of files content identical file destination block to be uploaded, otherwise, then explanation clothes It is engaged in being not present and file content identical file destination block to be uploaded in device.
S105, if comparison result is in the absence of uploading file to be uploaded.
Specifically, in embodiments of the present invention, if comparison result be in the absence of, illustrate in server in the absence of with it is to be uploaded Blocks of files content identical file destination block, therefore directly upload the blocks of files to be uploaded.
File to be uploaded is carried out piecemeal so as to obtain at least one treat by the embodiment of the present invention according to the first preset rules Transmitting file block, and file block message to be uploaded corresponding to blocks of files to be uploaded is obtained, then send file to be uploaded to server Block message, if receiving the comparison result of server return, judge to whether there is and blocks of files content phase to be uploaded in server With file destination block, if comparison result is in the absence of uploading the blocks of files to be uploaded.The embodiment of the present invention by that will treat on Transmitting file is divided into several blocks of files to be uploaded, and by judge with blocks of files content identical file destination block to be uploaded whether It is present in server, if being not present, directly uploads the blocks of files to be uploaded, according to this carries out whole file to be uploaded to realize Upload, the blocks of files to be uploaded being not present in the embodiment of the present invention upload server, so as to reduce terminal amount of calculation, reduction Used time, to improve Consumer's Experience, quickly upper transmitting file is realized on the weaker mobile terminal of computing capability.
It is a kind of schematic flow diagram for file uploading method that another embodiment of the present invention provides referring to Fig. 2.As schemed Show, this document method for uploading comprises the following steps S201~S207.
S201, if receiving the instruction for uploading file to be uploaded, file to be uploaded is divided according to the first preset rules Block is to obtain at least one blocks of files to be uploaded.
S202, file block message to be uploaded is obtained, each corresponding file block message to be uploaded of blocks of files to be uploaded, treated Uploading blocks of files information includes the size of blocks of files to be uploaded and the MD5 values of blocks of files to be uploaded.
S203, file block message to be uploaded is sent to server.
S204, if receiving the comparison result of server return, judge to whether there is and blocks of files to be uploaded in server Content identical file destination block;Wherein, file destination block is carried out by the file destination in server according to the first preset rules Obtained by piecemeal, the corresponding file destination block message of each file destination block, file destination block message includes file destination block Size and file destination block MD5 values, file destination searches gained, and server root by server according to the second preset rules It is compared according to file block message to be uploaded with file destination block message to obtain comparison result.
S205, if comparison result is in the absence of uploading blocks of files to be uploaded.
Step S201~205 are as described above, here is omitted.
S206, if whether comparison result judges to also have in file to be uploaded to the to be uploaded of server transmission to exist Blocks of files is to obtain judged result.
Specifically, if in server exist with blocks of files content identical file destination block to be uploaded, do not have to repeat on The blocks of files to be uploaded is passed, in order to further grasp whether the blocks of files to be uploaded obtained by file block to be uploaded has uploaded Finish, it is necessary to judge in file to be uploaded whether to also have the blocks of files to be uploaded not sent to server to obtain judged result, from And it is easy to blocks of files to be uploaded to be uploaded successively according to upload order.
S207, next file block message to be uploaded is sent to server according to judged result selectivity.
Reference picture 3, step S207 sub-process schematic diagram.As illustrated, step S207 includes step S301~S302.
S301, if judged result is to have, according to upload sequential selection in the blocks of files to be uploaded never sent to server Next blocks of files to be uploaded.
Specifically, if judged result illustrates also to exist in file to be uploaded not to the to be uploaded of server transmission to have File block message, in order to realize the complete upload of file to be uploaded and prevent something lost from falling any one blocks of files to be uploaded, never to According to the next blocks of files to be uploaded of sequential selection is uploaded in the blocks of files to be uploaded that server is sent, so that server is according to this The blocks of files information searching to be uploaded whether there is with the blocks of files content identical file destination block to be uploaded, until all File block message to be uploaded has all had transmitted to server.
S302, if judged result is does not have, display, which uploads, completes prompting
Specifically, if judged result illustrates not having in file to be uploaded not to the to be uploaded of server transmission not have File block message to be uploaded corresponding to all blocks of files to be uploaded of fileinfo, the i.e. file to be uploaded is all sent to Server, upload that the file to be uploaded has been completed according to comparison result, now grasp and work as the ease of user Preceding state, show that upload completes prompting so that user is checked in the terminal.
File to be uploaded is carried out piecemeal so as to obtain at least one treat by the embodiment of the present invention according to the first preset rules Transmitting file block, and file block message to be uploaded corresponding to blocks of files to be uploaded is obtained, then send file to be uploaded to server Block message, if receiving the comparison result of server return, judge to whether there is and blocks of files content phase to be uploaded in server With file destination block, if comparison result be in the absence of, upload the blocks of files to be uploaded, and if comparison result for exist, Determine whether to also have the blocks of files to be uploaded not sent to server in file to be uploaded to obtain judged result, if sentencing Disconnected result is straight according to the next file to be uploaded of sequential selection is uploaded in the blocks of files to be uploaded never sent to server to have Terminate to whole, if judged result is does not have, display, which uploads, to be completed to prompt.The embodiment of the present invention is by the way that file to be uploaded is divided into Several blocks of files to be uploaded, and by judging to whether there is in service with blocks of files content identical file destination block to be uploaded In device, if being not present, the blocks of files to be uploaded is directly uploaded, if in the presence of whether determining whether all blocks of files to be uploaded Server has been completely sent to it and carries out retrieval to finish until uploading, and shown to upload and successfully prompt, according to this come realize will be whole Individual file to be uploaded, which is uploaded and facilitates user to understand, uploads completion status.Do not deposited in the embodiment of the present invention upload server Blocks of files to be uploaded, so as to reduce terminal amount of calculation, reduce the used time, to improve Consumer's Experience, and be suitable for calculating The application scenarios of big file are uploaded on the weaker mobile terminal of ability.
Reference picture 4, it is a kind of schematic block diagram of terminal provided in an embodiment of the present invention.In the present embodiment as depicted Terminal 40 includes blocking unit 41, acquiring unit 42, transmitting element 43, judging unit 44 and uploading unit 45.
Blocking unit 41, will be to be uploaded according to the first preset rules if uploading the instruction of file to be uploaded for receiving File carries out piecemeal to obtain at least one blocks of files to be uploaded.
Acquiring unit 42, for for obtaining file block message to be uploaded, each corresponding one of blocks of files to be uploaded to be treated Transmitting file block message, blocks of files information to be uploaded include the size of blocks of files to be uploaded and the MD5 values of blocks of files to be uploaded.
Transmitting element 43, for sending file block message to be uploaded to server.
Judging unit 44, if the comparison result for receiving server return, judge to whether there is with treating in server Upload blocks of files content identical file destination block;Wherein, file destination block is pre- according to first by the file destination in server If rule is carried out obtained by piecemeal, the corresponding file destination block message of each file destination block, file destination block message includes The size of file destination block and the MD5 values of file destination block, file destination search gained by server according to the second preset rules, And server is compared to obtain comparison result according to file block message to be uploaded with file destination block message.
Uploading unit 45, if being in the absence of uploading blocks of files to be uploaded for comparison result.
Further, if the first preset rules are identical with the size of file destination including file to be uploaded, according to identical File to be uploaded and file destination are carried out decile by block size respectively;If file to be uploaded and file destination is of different sizes, press File to be uploaded and file destination are divided respectively according to identical number of blocks.
Further, the second preset rules include active user ID, file name to be uploaded or temperature, file destination by Server searches gained according to the second preset rules to be included:Server is stored according to active user ID from the current ID File destination is searched in file, active user ID is the user's corresponding identity in the server for uploading file to be uploaded; Or server is searched and file name identical file destination to be uploaded according to file name to be uploaded;Or server is according to temperature Order from high to low is searched to obtain file destination from the file of storage.
File to be uploaded is carried out piecemeal so as to obtain by the embodiment of the present invention by blocking unit 41 according to the first preset rules To at least one blocks of files to be uploaded, and the file block message to be uploaded as corresponding to acquiring unit 42 obtains blocks of files to be uploaded, Then file block message to be uploaded is sent to server by transmitting element 43, if receiving the comparison result of server return, By judging unit 44 judge in server whether there is with blocks of files content identical file destination block to be uploaded, if compare knot Fruit is in the absence of then uploading the blocks of files to be uploaded by uploading unit 45.The embodiment of the present invention is by the way that file to be uploaded is divided into Several blocks of files to be uploaded, and by judging to whether there is in service with blocks of files content identical file destination block to be uploaded In device, if being not present, the blocks of files to be uploaded is directly uploaded, is according to this uploaded whole file to be uploaded to realize, this hair The blocks of files to be uploaded being not present in bright embodiment upload server, so as to reduce terminal amount of calculation, reduce the used time, to carry High Consumer's Experience, and it is suitable for uploading the application scenarios of big file on the weaker mobile terminal of computing capability.
Reference picture 5, it is a kind of schematic block diagram for terminal that another embodiment of the present invention provides.The present embodiment as depicted In terminal 50 include blocking unit 51, acquiring unit 52, transmitting element 53, judging unit 55, uploading unit 55 and perform Unit 56.
Blocking unit 51, will be to be uploaded according to the first preset rules if uploading the instruction of file to be uploaded for receiving File carries out piecemeal to obtain at least one blocks of files to be uploaded.
Acquiring unit 52, for for obtaining file block message to be uploaded, each corresponding one of blocks of files to be uploaded to be treated Transmitting file block message, blocks of files information to be uploaded include the size of blocks of files to be uploaded and the MD5 values of blocks of files to be uploaded.
Transmitting element 53, for sending file block message to be uploaded to server.
Judging unit 54, if the comparison result for receiving server return, judge to whether there is with treating in server Upload blocks of files content identical file destination block;Wherein, file destination block is pre- according to first by the file destination in server If rule is carried out obtained by piecemeal, the corresponding file destination block message of each file destination block, file destination block message includes The size of file destination block and the MD5 values of file destination block, file destination search gained by server according to the second preset rules, And server is compared to obtain comparison result according to file block message to be uploaded with file destination block message.
Uploading unit 55, if being in the absence of uploading blocks of files to be uploaded for comparison result.
Further, if judging unit 54 is additionally operable to comparison result to exist, judge whether also have not in file to be uploaded The blocks of files to be uploaded sent to server is to obtain judged result;
Execution unit 56, for sending next file block message to be uploaded to server according to judged result selectivity.
Further, reference picture 6, the schematic block diagram of execution unit.As illustrated, execution unit 56 includes selecting unit 561 and display unit 562.
Selecting unit 561, if for judged result to have, according to upper in the blocks of files to be uploaded never sent to server Pass the next blocks of files to be uploaded of sequential selection.
Display unit 562, if for judged result not have, display, which uploads, completes prompting.
File to be uploaded is carried out piecemeal so as to obtain by the embodiment of the present invention by blocking unit 51 according to the first preset rules To at least one blocks of files to be uploaded, and the file block message to be uploaded as corresponding to acquiring unit 52 obtains blocks of files to be uploaded, Then file block message to be uploaded is sent to server by transmitting element 53, if receiving the comparison result of server return, By judging unit 54 judge in server whether there is with blocks of files content identical file destination block to be uploaded, if compare knot Fruit be in the absence of, then the blocks of files to be uploaded is uploaded by upper transmitting file 55, and if comparison result for exist, further by sentencing Disconnected unit 54 judges whether to also have the blocks of files to be uploaded not sent to server in file to be uploaded to obtain judged result, if Judged result is has, according to upload order by selecting in the blocks of files to be uploaded never sent by execution unit 56 to server Unit 561 selects next file to be uploaded until all terminating, if judged result is not have, and it is aobvious by display unit 562 Show that prompting is completed in upload.The embodiment of the present invention passes through judgement by the way that file to be uploaded is divided into several blocks of files to be uploaded It whether there is with blocks of files content identical file destination block to be uploaded in server, if being not present, directly upload this and treat Transmitting file block, if in the presence of determining whether all blocks of files to be uploaded have been completely sent to server and have been examined Suo Zhizhi is uploaded and finished, and is shown to upload and successfully prompted, and according to this uploads whole file to be uploaded to realize and conveniently uses Family, which understands, uploads completion status.The blocks of files to be uploaded being not present in the embodiment of the present invention upload server, so as to reduce Terminal amount of calculation, reduce the used time, to improve Consumer's Experience, and be suitable for uploading big text on the weaker mobile terminal of computing capability The application scenarios of part.
It is above the preferred embodiment of invention, rather than any formal limitation is done to invention.Those skilled in the art Various equivalent changes and improvement, all equivalent changes done within the scope of the claims can be imposed on the basis of above-described embodiment Change or modify, all should fall within the scope of invention.

Claims (10)

  1. A kind of 1. file uploading method, it is characterised in that including:
    If receiving the instruction for uploading file to be uploaded, the file to be uploaded is subjected to piecemeal to obtain according to the first preset rules To at least one blocks of files to be uploaded;
    File block message to be uploaded is obtained, each corresponding file block message to be uploaded of blocks of files to be uploaded is described to be uploaded Blocks of files information includes the size of the blocks of files to be uploaded and the MD5 values of the blocks of files to be uploaded;
    The file block message to be uploaded is sent to server;
    If receive server return comparison result, judge in the server whether there is with the blocks of files to be uploaded Hold identical file destination block;Wherein, the file destination block presets rule by the file destination in server according to described first Then carry out obtained by piecemeal, the corresponding file destination block message of each file destination block, the file destination block message includes The MD5 values of the size of the file destination block and the file destination block, the file destination is by the server according to second Preset rules search gained, and the server is compared according to the file block message to be uploaded with file destination block message To obtain the comparison result;
    If the comparison result is in the absence of the upload blocks of files to be uploaded.
  2. 2. the method as described in claim 1, it is characterised in that if the comparison result is in the absence of being treated described in upload After uploading blocks of files, methods described also includes:
    If the comparison result judges whether also have the text to be uploaded not sent to server in the file to be uploaded to exist Part block is to obtain judged result;
    Next file block message to be uploaded is sent to server according to judged result selectivity.
  3. 3. method as claimed in claim 2, it is characterised in that described to be sent according to judged result selectivity to server Next file block message to be uploaded, including:
    If the judged result is has, next according to sequential selection is uploaded in the blocks of files to be uploaded never sent to server Blocks of files to be uploaded;
    If the judged result is does not have, display, which uploads, completes prompting.
  4. 4. the method as described in claim 1, it is characterised in that first preset rules include:
    , respectively will be described to be uploaded according to identical block size if the file to be uploaded is identical with the size of the file destination File and the file destination carry out decile;
    If the file to be uploaded and file destination is of different sizes, according to identical number of blocks respectively by the file to be uploaded Divided with the file destination.
  5. 5. the method as described in claim 1, it is characterised in that second preset rules include active user ID, to be uploaded File name or temperature, the server are searched according to the second preset rules to obtain file destination, including:
    File destination, the active user are searched in the file that server is stored according to active user ID from the current ID ID is the user's corresponding identity in the server for uploading the file to be uploaded;
    Or server is searched and the file name identical file destination to be uploaded according to file name to be uploaded;
    Or server is searched to obtain file destination according to the order of temperature from high to low from the file of storage.
  6. 6. a kind of terminal, it is characterised in that the terminal includes:
    Blocking unit, if uploading the instruction of file to be uploaded for receiving, according to the first preset rules by the text to be uploaded Part carries out piecemeal to obtain at least one blocks of files to be uploaded;
    Acquiring unit, for obtaining file block message to be uploaded, each corresponding one of blocks of files to be uploaded blocks of files letter to be uploaded Breath, the blocks of files information to be uploaded include the size of the blocks of files to be uploaded and the MD5 values of the blocks of files to be uploaded;
    Transmitting element, for sending the file block message to be uploaded to server;
    Judging unit, if for receive server return comparison result, judge in the server whether there is with it is described Blocks of files content identical file destination block to be uploaded;Wherein, the file destination block by the file destination in server according to First preset rules are carried out obtained by piecemeal, the corresponding file destination block message of each file destination block, the target Blocks of files information includes the size of the file destination block and the MD5 values of the file destination block, and the file destination is by described Server searches gained according to the second preset rules, and the server is according to the file block message to be uploaded and file destination Block message is compared to obtain the comparison result;
    Uploading unit, if being in the absence of the upload blocks of files to be uploaded for the comparison result.
  7. 7. terminal as claimed in claim 6, it is characterised in that
    If the judging unit is additionally operable to the comparison result to exist, judge whether also have in the file to be uploaded not to clothes The blocks of files to be uploaded that business device is sent is to obtain judged result;
    The terminal also includes:
    Execution unit, for sending next file block message to be uploaded to server according to judged result selectivity.
  8. 8. terminal as claimed in claim 7, it is characterised in that the execution unit also includes:
    Selecting unit, if for the judged result to have, according to upload in the blocks of files to be uploaded never sent to server The next blocks of files to be uploaded of sequential selection;
    Display unit, if for the judged result not have, display, which uploads, completes prompting.
  9. 9. terminal as claimed in claim 6, it is characterised in that first preset rules include:
    , respectively will be described to be uploaded according to identical block size if the file to be uploaded is identical with the size of the file destination File and the file destination carry out decile;
    If the file to be uploaded and file destination is of different sizes, according to identical number of blocks respectively by the file to be uploaded Divided with the file destination.
  10. 10. terminal as claimed in claim 6, it is characterised in that second preset rules include active user ID, to be uploaded File name or temperature, the file destination search gained by the server according to second preset rules, including:
    File destination, the active user are searched in the file that server is stored according to active user ID from the current ID ID is the user's corresponding identity in the server for uploading the file to be uploaded;
    Or server is searched and the file name identical file destination to be uploaded according to file name to be uploaded;
    Or server is searched to obtain file destination according to the order of temperature from high to low from the file of storage.
CN201610564295.4A 2016-07-15 2016-07-15 A kind of file uploading method and terminal Pending CN107623710A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610564295.4A CN107623710A (en) 2016-07-15 2016-07-15 A kind of file uploading method and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610564295.4A CN107623710A (en) 2016-07-15 2016-07-15 A kind of file uploading method and terminal

Publications (1)

Publication Number Publication Date
CN107623710A true CN107623710A (en) 2018-01-23

Family

ID=61087733

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610564295.4A Pending CN107623710A (en) 2016-07-15 2016-07-15 A kind of file uploading method and terminal

Country Status (1)

Country Link
CN (1) CN107623710A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110175155A (en) * 2019-06-03 2019-08-27 武汉纺织大学 A kind of method and system of file duplicate removal processing
CN113810433A (en) * 2020-06-11 2021-12-17 腾讯科技(深圳)有限公司 File uploading method and device and computer equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102739791A (en) * 2012-06-28 2012-10-17 奇智软件(北京)有限公司 File downloading and uploading method and device
CN104468843A (en) * 2014-12-31 2015-03-25 浪潮软件股份有限公司 File uploading method and device
US20150163301A1 (en) * 2013-12-06 2015-06-11 Cellco Partnership D/B/A Verizon Wireless System for and method for media upload multithreading for large file uploads
CN105208108A (en) * 2015-08-31 2015-12-30 北京奇虎科技有限公司 File uploading/downloading method and system in Web environment, server and client end

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102739791A (en) * 2012-06-28 2012-10-17 奇智软件(北京)有限公司 File downloading and uploading method and device
US20150163301A1 (en) * 2013-12-06 2015-06-11 Cellco Partnership D/B/A Verizon Wireless System for and method for media upload multithreading for large file uploads
CN104468843A (en) * 2014-12-31 2015-03-25 浪潮软件股份有限公司 File uploading method and device
CN105208108A (en) * 2015-08-31 2015-12-30 北京奇虎科技有限公司 File uploading/downloading method and system in Web environment, server and client end

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110175155A (en) * 2019-06-03 2019-08-27 武汉纺织大学 A kind of method and system of file duplicate removal processing
CN110175155B (en) * 2019-06-03 2023-06-13 武汉纺织大学 File deduplication processing method and system
CN113810433A (en) * 2020-06-11 2021-12-17 腾讯科技(深圳)有限公司 File uploading method and device and computer equipment

Similar Documents

Publication Publication Date Title
CN109831487A (en) Fragmented file verification method and terminal equipment
CN109325349A (en) A kind of method for managing security, terminal device and computer readable storage medium
CN107872489A (en) A kind of file section method for uploading, device and cloud storage system
CN104219316A (en) Method and device for processing call request in distributed system
US9178860B2 (en) Out-of-path, content-addressed writes with untrusted clients
CN110247986A (en) A kind of document transmission method, device and electronic equipment
CN103108033B (en) File uploading method and system
CN106599262A (en) Medical informatization medical file redundancy removal system and method
CN103095824A (en) File uploading control method and system
CN109376981B (en) Data processing mode determining method and device, server and data processing method
US10122803B2 (en) Network data transmission method, device and system
CN105591999A (en) Verification method and device
CN107623710A (en) A kind of file uploading method and terminal
CN109218345A (en) Obtain method, storage medium, electronic equipment and the system of target resource
CN104049998B (en) The processing method of upgrade package, device and equipment in a kind of android system
CN111294377A (en) Network request sending method of dependency relationship, terminal device and storage medium
CN111159131A (en) Performance optimization method, device, equipment and computer readable storage medium
CN106332054B (en) The method and device of Data Migration authentication
CN105141673A (en) Intelligent terminal and user information processing method thereof
CN113961334B (en) Task processing method, device, equipment and storage medium
CN111371536A (en) Control instruction sending method and device
CN110769016A (en) File uploading method and computer storage medium
CN115190083A (en) Data transmission method and device applied to intelligent equipment
WO2017028572A1 (en) Method and apparatus for pushing program information
CN108111561B (en) Data downloading method and equipment thereof

Legal Events

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

Application publication date: 20180123

RJ01 Rejection of invention patent application after publication