CN107528926A - A kind of file uploading method and system - Google Patents

A kind of file uploading method and system Download PDF

Info

Publication number
CN107528926A
CN107528926A CN201710942869.1A CN201710942869A CN107528926A CN 107528926 A CN107528926 A CN 107528926A CN 201710942869 A CN201710942869 A CN 201710942869A CN 107528926 A CN107528926 A CN 107528926A
Authority
CN
China
Prior art keywords
file
section
uploaded
client
uploading method
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
CN201710942869.1A
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.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai 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 Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201710942869.1A priority Critical patent/CN107528926A/en
Publication of CN107528926A publication Critical patent/CN107528926A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • 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/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1074Peer-to-peer [P2P] networks for supporting data block transmission mechanisms
    • H04L67/1078Resource delivery mechanisms
    • H04L67/108Resource delivery mechanisms characterised by resources being split in blocks or fragments

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a kind of file uploading method and system.It is related to computer internet technology;Solve the problems, such as that file uploads easily to be led to the failure by web influence.This method includes:According to the slice size of setting, slicing treatment is carried out to file to be uploaded, obtains at least one section, it is determined that section sum;The section is sequentially uploaded one by one to service end, untill upload of all cutting into slices is completed.Technical scheme provided by the invention is applied to data transfer, realizes the file with breakpoint transmission effect and uploads.

Description

A kind of file uploading method and system
Technical field
The present invention relates to computer internet technology, espespecially a kind of file uploading method and system.
Background technology
It is normal functional in software development process that file, which uploads, but either by windows client-side program, also It is by browser, no matter using any agreement, a little limitation is all present, common limitation such as network state, agreement are to asking Limitation of seeking time and file size etc..These limitations would generally cause file Transmission, or even request to be rejected, and cause text Part uploads failure.This problem is showed and must be especially apparent when uploading super large file.
The content of the invention
In order to solve the above-mentioned technical problem, the invention provides a kind of file uploading method and system, the side of section is passed through Formula is handled file to be uploaded, obtains the smaller data cell of multiple granularities, is uploaded section one by one and is finally realized to whole The upload of individual file, the probability of loading error occurring is reduced, solve file upload and easily asked by what web influence led to the failure Topic.
In order to reach the object of the invention, the invention provides a kind of file uploading method, including:
According to the slice size of setting, slicing treatment is carried out to file to be uploaded, obtains at least one section, it is determined that section Sum;
The section is sequentially uploaded one by one to service end, untill upload of all cutting into slices is completed.
Preferably, this method also includes:
Calculate the cryptographic Hash and total size of the file to be uploaded.
Preferably, when uploading each section, any or any multinomial combination in following parameter is carried:
The cryptographic Hash of the file to be uploaded, the total size of the file to be uploaded, section sum, the section of current transmission Sequence number.
Present invention also offers a kind of file uploading method, including:
Receive the section that client uploads;
After all section finishes receiving, into complete file and preserved according to the sequential combination of section.
Preferably, when receiving the section that client uploads, also have received any or any multinomial in following parameter Combination:
The cryptographic Hash of the file to be uploaded, the total size of the file to be uploaded, section sum, the section of current transmission Sequence number.
Preferably, after the step of receiving the section that client uploads, in addition to:
Transmission progress is calculated by following formula, to transmission progress described in the client feedback:
The total size of transmission progress=have been received by slice size sum/file to be uploaded.
Preferably, after the step of receiving the section that client uploads, in addition to:
The each section received is individually stored under independent file.
Preferably, after all section finishes receiving, according to the sequential combination of section into complete file and the step of preserve Including:
Travel through all files folder and obtain all sections;
The section is spliced into complete file in sequence, deletes the section individually deposited and file;
The cryptographic Hash of the complete file is calculated, when the cryptographic Hash being calculated is consistent with receiving cryptographic Hash, is completed Integrity checking, preserve the complete file.
Present invention also offers a kind of file uploading system, including service end and client;
The client, for the slice size according to setting, slicing treatment is carried out to file to be uploaded, obtains at least one Individual section, it is determined that section sum, sequentially uploads the section to the service end, be up to whole sections upload completion one by one Only;
The service end, the section uploaded for receiving the client, after all section finishes receiving, according to section Sequential combination into complete file and preserve.
Preferably, the service end, it is additionally operable to calculate transmission progress by following formula, to the client feedback institute State transmission progress:
The total size of transmission progress=have been received by slice size sum/file to be uploaded.
The invention provides a kind of file uploading method and system, in client, according to the slice size of setting, treats Transmitting file carries out slicing treatment, obtains at least one section, it is determined that section sum, sequentially uploads the section and extremely service one by one End, untill upload of all cutting into slices is completed;In service end, the section that client uploads is received, is finished receiving in all sections Afterwards, into complete file and preserved according to the sequential combination of section.Realize the file with breakpoint transmission effect to upload, solve File uploads the problem of easily being led to the failure by web influence.
Other features and advantages of the present invention will be illustrated in the following description, also, partly becomes from specification Obtain it is clear that or being understood by implementing the present invention.The purpose of the present invention and other advantages can be by specification, rights Specifically noted structure is realized and obtained in claim and accompanying drawing.
Brief description of the drawings
Accompanying drawing is used for providing further understanding technical solution of the present invention, and a part for constitution instruction, with this The embodiment of application is used to explain technical scheme together, does not form the limitation to technical solution of the present invention.
Fig. 1 is a kind of schematic flow sheet for file uploading method that embodiments of the invention one provide;
Fig. 2 is a kind of realization principle schematic diagram for file uploading method that embodiments of the invention one provide.
Embodiment
For the object, technical solutions and advantages of the present invention are more clearly understood, below in conjunction with accompanying drawing to the present invention Embodiment be described in detail.It should be noted that in the case where not conflicting, in the embodiment and embodiment in the application Feature can mutually be combined.
Can be in the computer system of such as one group computer executable instructions the flow of accompanying drawing illustrates the step of Perform.Also, although logical order is shown in flow charts, in some cases, can be with suitable different from herein Sequence performs shown or described step.
Network limitation would generally cause file Transmission, or even request to be rejected, and cause file to upload failure.It is this to ask Topic is showed and must be especially apparent when uploading super large file.
Most to solve the above problems, the embodiment provides a kind of file uploading method and system, pass through file The functions such as section, file transmission, Piece file mergence, progress calculating, integrity detection, Network Abnormal processing, realize high reliability File, the upload of especially big file, solve the problems, such as file upload easily led to the failure by web influence.
First with reference to accompanying drawing, embodiments of the invention one are illustrated.
The embodiments of the invention provide a kind of file uploading method, the flow such as Fig. 1 transmitted using this method completion file It is shown, including:
Step 101, the slice size according to setting, slicing treatment is carried out to file to be uploaded, obtains at least one section, It is determined that section sum;
In this step, client calculates Hash (hash) value and total size of file to be uploaded, according to total size and section The section sum of cutting required for size calculates.The setting of slice size can be adjusted according to network condition and file size.
Step 102, the section is sequentially uploaded one by one to service end, untill upload of all cutting into slices is completed;
In this step, in sequence file cut into slices and asynchronous transmission, subsidiary parameter during transmission:The text to be uploaded The cryptographic Hash of part, the total size of the file to be uploaded, section sum, the section sequence number of current transmission.
Step 103, service end receive the section that client uploads;
In this step, service end receives section, and each section is stored under an independent catalogue file folder.It is preferred that , catalogue is named with file hash values, and section file name is set to the form of " file hash values+sequence number ".
Step 104, transmission progress is calculated, to transmission progress described in the client feedback;
Transmission progress is calculated by following formula, to transmission progress described in the client feedback:
The total size of transmission progress=have been received by slice size sum/file to be uploaded.
When progress reaches 100%, client wouldn't be fed back, merging and integrity checking stage into file, is completed Feed back client again afterwards.
Step 105, all section finish receiving after, into complete file and preserved according to the sequential combination of section;
This step specifically includes:
1st, travel through all files folder and obtain all sections;
2nd, the section is spliced into complete file in sequence, deletes the section individually deposited and file;
3rd, the cryptographic Hash of the complete file is calculated, it is complete when the cryptographic Hash being calculated is consistent with receiving cryptographic Hash Into integrity checking, the complete file is preserved.Upload procedure is then completed in the matching of hash values, finally feeds back client.
The principle that section upload is carried out using file uploading method provided in an embodiment of the present invention is as shown in Figure 2.
In file upload procedure it is possible that exception and processing mode it is as follows:
(1) single slice transmission failure.Such case needs client to upload this section again.If frequency of failure mistake It is more, it can directly abandon uploading and prompting mistake.
(2) upload and upload identical file again after cancelling.In this case, because section file and section are with text Named based on part hash values, so the section uploaded before this file can be detected for second when uploading identical file, this A little sections can be utilized directly, and continue to upload on this basis, also directly counted when calculating progress, be achieved in resolving The effect that point resumes.
(3) abandon uploading and produce rubbish section.If eliminating upload in user's upload procedure, rubbish section can be produced, can Special timed task is established, clears up these files.
Pay attention to, when timed task cleaning rubbish is cut into slices, those the just section files of upload soon should be avoided, because these are literary Part may be used or can use in the near future.Therefore, when clearing up the establishment for being necessary inspection section catalogue during rubbish section Between apart from current time whether long enough.
Embodiments of the invention two are illustrated below.
The embodiments of the invention provide a kind of file uploading system, the system includes:
The client, for the slice size according to setting, slicing treatment is carried out to file to be uploaded, obtains at least one Individual section, it is determined that section sum, sequentially uploads the section to the service end, be up to whole sections upload completion one by one Only;
The service end, the section uploaded for receiving the client, after all section finishes receiving, according to section Sequential combination into complete file and preserve.
Preferably, the service end, it is additionally operable to calculate transmission progress by following formula, to the client feedback institute State transmission progress:
The total size of transmission progress=have been received by slice size sum/file to be uploaded.
It is big according to the section of setting in client the embodiment provides a kind of file uploading method and system It is small, slicing treatment is carried out to file to be uploaded, obtains at least one section, it is determined that section sum, sequentially cuts described in upload one by one Piece is to service end, untill upload of all cutting into slices is completed;In service end, the section that client uploads is received, in whole sections After finishing receiving, into complete file and preserved according to the sequential combination of section.Realize on the file with breakpoint transmission effect Pass, solve in file upload procedure because the reasons such as network interruption, agreement limitation cause not uploading or upload failure problem. Timed task is cleared up, and checks whether the creation time of file is early enough compared with current time in cleaning, in order to avoid delete by mistake just In the section file used, the reliability that file uploads is further increased.
Although disclosed herein embodiment as above, described content be only readily appreciate the present invention and use Embodiment, it is not limited to the present invention.Technical staff in any art of the present invention, taken off not departing from the present invention On the premise of the spirit and scope of dew, any modification and change, but the present invention can be carried out in the form and details of implementation Scope of patent protection, still should be subject to the scope of the claims as defined in the appended claims.

Claims (10)

  1. A kind of 1. file uploading method, it is characterised in that including:
    According to the slice size of setting, slicing treatment is carried out to file to be uploaded, obtains at least one section, it is determined that section is total Number;
    The section is sequentially uploaded one by one to service end, untill upload of all cutting into slices is completed.
  2. 2. file uploading method according to claim 1, it is characterised in that this method also includes:
    Calculate the cryptographic Hash and total size of the file to be uploaded.
  3. 3. file uploading method according to claim 2, it is characterised in that when uploading each section, carry following Any or any multinomial combination in parameter:
    The cryptographic Hash of the file to be uploaded, the total size of the file to be uploaded, section sum, the section sequence of current transmission Number.
  4. A kind of 4. file uploading method, it is characterised in that including:
    Receive the section that client uploads;
    After all section finishes receiving, into complete file and preserved according to the sequential combination of section.
  5. 5. file uploading method according to claim 4, it is characterised in that when receiving the section that client uploads, also It has received any or any multinomial combination in following parameter:
    The cryptographic Hash of the file to be uploaded, the total size of the file to be uploaded, section sum, the section sequence of current transmission Number.
  6. 6. file uploading method according to claim 5, it is characterised in that receive client upload section the step of it Afterwards, in addition to:
    Transmission progress is calculated by following formula, to transmission progress described in the client feedback:
    The total size of transmission progress=have been received by slice size sum/file to be uploaded.
  7. 7. file uploading method according to claim 5, it is characterised in that receive client upload section the step of it Afterwards, in addition to:
    The each section received is individually stored under independent file.
  8. 8. file uploading method according to claim 7, it is characterised in that after all section finishes receiving, according to cutting The sequential combination of piece includes into complete file and the step of preservation:
    Travel through all files folder and obtain all sections;
    The section is spliced into complete file in sequence, deletes the section individually deposited and file;
    The cryptographic Hash of the complete file is calculated, when the cryptographic Hash being calculated is consistent with receiving cryptographic Hash, is completed complete Property inspection, preserves the complete file.
  9. 9. a kind of file uploading system, it is characterised in that including service end and client;
    The client, for the slice size according to setting, slicing treatment is carried out to file to be uploaded, obtains at least one cut Piece, it is determined that section is total, the section is sequentially uploaded one by one to the service end, untill all section uploads completion;
    The service end, the section uploaded for receiving the client, after all section finishes receiving, according to the suitable of section Sequence is combined into complete file and preserved.
  10. 10. file uploading method according to claim 9, it is characterised in that
    The service end, it is additionally operable to calculate transmission progress by following formula, to transmission progress described in the client feedback:
    The total size of transmission progress=have been received by slice size sum/file to be uploaded.
CN201710942869.1A 2017-10-11 2017-10-11 A kind of file uploading method and system Pending CN107528926A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710942869.1A CN107528926A (en) 2017-10-11 2017-10-11 A kind of file uploading method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710942869.1A CN107528926A (en) 2017-10-11 2017-10-11 A kind of file uploading method and system

Publications (1)

Publication Number Publication Date
CN107528926A true CN107528926A (en) 2017-12-29

Family

ID=60684942

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710942869.1A Pending CN107528926A (en) 2017-10-11 2017-10-11 A kind of file uploading method and system

Country Status (1)

Country Link
CN (1) CN107528926A (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108449607A (en) * 2018-01-18 2018-08-24 上海宝信软件股份有限公司 File compliance inspection method and system
CN108512933A (en) * 2018-04-13 2018-09-07 航天科技控股集团股份有限公司 A kind of big file uploading method and system based on SmartPM intelligent management platforms
CN109496419A (en) * 2018-05-23 2019-03-19 优视科技新加坡有限公司 Document handling method, device and system
CN109712692A (en) * 2018-12-02 2019-05-03 河南美伦医疗电子股份有限公司 Cloud brain electric management system based on cloud microtomy
CN109951514A (en) * 2019-01-16 2019-06-28 平安科技(深圳)有限公司 Document handling method, system and computer equipment based on cloud storage
CN110489379A (en) * 2019-08-07 2019-11-22 北京航空航天大学 Aircraft take a flight test synthesis display and data analysis Evaluation Platform
CN111835465A (en) * 2019-04-19 2020-10-27 武汉所为科技有限公司 Lora network communication method, Lora node and Lora network communication system
CN111935227A (en) * 2020-07-10 2020-11-13 上海淇毓信息科技有限公司 Method for uploading file through browser, browser and electronic equipment
CN112199342A (en) * 2020-11-04 2021-01-08 江苏特思达电子科技股份有限公司 File uploading method and device and computer equipment
CN113079219A (en) * 2021-04-12 2021-07-06 北京明略昭辉科技有限公司 Large file fragment uploading method and system
CN114390039A (en) * 2021-11-30 2022-04-22 航天信息股份有限公司 File uploading and downloading method and system

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101534322A (en) * 2009-04-13 2009-09-16 腾讯科技(深圳)有限公司 File upload system and file upload method
CN102752326A (en) * 2011-04-19 2012-10-24 腾讯科技(深圳)有限公司 Method, client, server and system for processing data in file downloading
CN102833294A (en) * 2011-06-17 2012-12-19 阿里巴巴集团控股有限公司 File processing method and system based on cloud storage, and server cluster system
CN104519090A (en) * 2013-09-27 2015-04-15 深圳市腾讯计算机系统有限公司 Method and device for file transfer
CN104796460A (en) * 2015-03-26 2015-07-22 小米科技有限责任公司 File transmission method and device
CN105227610A (en) * 2014-06-30 2016-01-06 北京金山安全软件有限公司 File uploading and storing method and device
CN107172131A (en) * 2017-04-26 2017-09-15 腾讯科技(深圳)有限公司 File uploading method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101534322A (en) * 2009-04-13 2009-09-16 腾讯科技(深圳)有限公司 File upload system and file upload method
CN102752326A (en) * 2011-04-19 2012-10-24 腾讯科技(深圳)有限公司 Method, client, server and system for processing data in file downloading
CN102833294A (en) * 2011-06-17 2012-12-19 阿里巴巴集团控股有限公司 File processing method and system based on cloud storage, and server cluster system
CN104519090A (en) * 2013-09-27 2015-04-15 深圳市腾讯计算机系统有限公司 Method and device for file transfer
CN105227610A (en) * 2014-06-30 2016-01-06 北京金山安全软件有限公司 File uploading and storing method and device
CN104796460A (en) * 2015-03-26 2015-07-22 小米科技有限责任公司 File transmission method and device
CN107172131A (en) * 2017-04-26 2017-09-15 腾讯科技(深圳)有限公司 File uploading method and device

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108449607B (en) * 2018-01-18 2020-06-12 上海宝信软件股份有限公司 File compliance checking method and system
CN108449607A (en) * 2018-01-18 2018-08-24 上海宝信软件股份有限公司 File compliance inspection method and system
CN108512933A (en) * 2018-04-13 2018-09-07 航天科技控股集团股份有限公司 A kind of big file uploading method and system based on SmartPM intelligent management platforms
CN109496419A (en) * 2018-05-23 2019-03-19 优视科技新加坡有限公司 Document handling method, device and system
CN109496419B (en) * 2018-05-23 2022-01-28 阿里巴巴(中国)有限公司 File processing method, device and system
WO2019222934A1 (en) * 2018-05-23 2019-11-28 优视科技新加坡有限公司 File processing method, apparatus and system
CN109712692A (en) * 2018-12-02 2019-05-03 河南美伦医疗电子股份有限公司 Cloud brain electric management system based on cloud microtomy
CN109951514A (en) * 2019-01-16 2019-06-28 平安科技(深圳)有限公司 Document handling method, system and computer equipment based on cloud storage
CN109951514B (en) * 2019-01-16 2022-03-25 平安科技(深圳)有限公司 File processing method and system based on cloud storage and computer equipment
CN111835465A (en) * 2019-04-19 2020-10-27 武汉所为科技有限公司 Lora network communication method, Lora node and Lora network communication system
CN111835465B (en) * 2019-04-19 2023-03-24 武汉所为科技有限公司 Lora network communication method, lora node and Lora network communication system
CN110489379A (en) * 2019-08-07 2019-11-22 北京航空航天大学 Aircraft take a flight test synthesis display and data analysis Evaluation Platform
CN110489379B (en) * 2019-08-07 2022-04-12 北京航空航天大学 Comprehensive display and data analysis and evaluation platform for aircraft test flight
CN111935227A (en) * 2020-07-10 2020-11-13 上海淇毓信息科技有限公司 Method for uploading file through browser, browser and electronic equipment
CN112199342A (en) * 2020-11-04 2021-01-08 江苏特思达电子科技股份有限公司 File uploading method and device and computer equipment
CN113079219A (en) * 2021-04-12 2021-07-06 北京明略昭辉科技有限公司 Large file fragment uploading method and system
CN114390039A (en) * 2021-11-30 2022-04-22 航天信息股份有限公司 File uploading and downloading method and system

Similar Documents

Publication Publication Date Title
CN107528926A (en) A kind of file uploading method and system
EP3847602B1 (en) Secure and transparent pruning for blockchains
US9329950B2 (en) Efficient fail-over in replicated systems
US8301706B2 (en) Routing of pooled messages via an intermediary
CN105743978A (en) Data transmitting method
CN104268291B (en) A kind of data consistency processing method and system
CN110287205A (en) A kind of across the fragment transaction data processing method of block chain and device
CN108710681A (en) File acquisition method, device, equipment and storage medium
CN105471635B (en) A kind of processing method of system log, device and system
CN103634361A (en) Method and apparatus for downloading file
CN104079623B (en) Multistage cloud storage synchronisation control means and system
WO2020226821A1 (en) Messaging to enforce operation serialization for consistency of a distributed data structure
CN107172112B (en) Computer file transmission method and device
CN109684130B (en) Method and device for backing up data of computer room
CN110633120A (en) Configuration software control processing method, device, server, user terminal and system
CN106878171B (en) Streaming data processing method and device for multiple data sources
CN109245930A (en) A kind of cloud security network element, cloud computing management platform and system
CN115689391B (en) Data disaster recovery method and system based on electronic commerce and cloud platform
CN103580951B (en) Output comparative approach, test migration householder method and the system of multiple information systems
CN116361271A (en) Block chain data modification and migration method, electronic equipment and storage medium
WO2014108800A2 (en) Method for comparing and reconsolidating geo-redundant database
CN106998481A (en) A kind of method and system that direct broadcasting room position is fixed in direct broadcasting room original list
CN116107290A (en) Industrial equipment fault monitoring method, device, system and storage medium
CN104468671B (en) A kind of configuring information processing method, device and relevant device
US20100268784A1 (en) Data synchronization system 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
RJ01 Rejection of invention patent application after publication

Application publication date: 20171229

RJ01 Rejection of invention patent application after publication