CN105187564B - A kind of method of mobile phone terminal document breakpoint transmission - Google Patents
A kind of method of mobile phone terminal document breakpoint transmission Download PDFInfo
- Publication number
- CN105187564B CN105187564B CN201510660934.2A CN201510660934A CN105187564B CN 105187564 B CN105187564 B CN 105187564B CN 201510660934 A CN201510660934 A CN 201510660934A CN 105187564 B CN105187564 B CN 105187564B
- Authority
- CN
- China
- Prior art keywords
- basic unit
- file
- thread
- transmitted
- transmission
- 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.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/06—Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention discloses a kind of methods of mobile phone terminal document breakpoint transmission, are related to mobile phone terminal file transfer technology field.This method is by being divided into multiple basic units for file to be transmitted, when being interrupted in transmission file processes, it can be starting point according to the basic unit of the lowest number in unfinished state, basic unit in unfinished state is transmitted, until completing, by using basic unit and number, title, place server address, local cache address, download state and the file block size of basic unit are set, the safety and efficiency of transmission can be improved.
Description
Technical field
The present invention relates to mobile phone terminal file transfer technology field more particularly to a kind of sides of mobile phone terminal document breakpoint transmission
Method.
Background technique
In mobile phone terminal downloading or during upper transmitting file, when network failure occurs in mobile phone terminal, is interrupted by incoming call, mobile phone electricity
When amount is insufficient, in order to the rate for improving downloading next time or uploading, generally can use the function of breakpoint transmission from
Continue downloading or upper transmitting file at breakpoint.
Wherein, the principle of mobile phone terminal breakpoint transmission is: in downloading or upload, will download or upload a task (file
Or a compressed package) man-made division is several parts, each part is uploaded or is downloaded using a thread, if encountered
Network failure etc. make download or upload disconnect when, next time can since uploaded or download disconnection part continue on descend
Unfinished part is carried, and need not upload or download from the beginning.So as to save the time of user, improve efficiency.
Currently, when carrying out man-made division to a file, usually file is drawn in mobile phone terminal breakpoint transmission technology
It is divided into 8-10 blocks of files, further according to the size of entire file, determines the size of each blocks of files, when entire Documents Comparison is small
When, each Documents Comparison obtained after division is small, then when multiple lesser files being uploaded or downloaded, rate can compare
Fastly, system performance is relatively high;And when entire Documents Comparison is big, each Documents Comparison obtained after division is big, then to it is multiple compared with
When big file is uploaded or downloaded, rate can be slow, and system performance also can be relatively low, and file biography often occurs in mobile phone terminal
The phenomenon that defeated Caton.
Summary of the invention
The purpose of the present invention is to provide a kind of methods of mobile phone terminal document breakpoint transmission, to solve to deposit in the prior art
Foregoing problems.
To achieve the goals above, The technical solution adopted by the invention is as follows:
A kind of method of mobile phone terminal document breakpoint transmission, includes the following steps:
S1 judges whether there is the basic unit in unfinished state, if so, then jumping to S2, otherwise, jumps to
S3;
S2 obtains the smallest basic unit of number for being in unfinished state, and using the basic unit as starting point, to place
It is transmitted in the basic unit of unfinished state, is to complete its status modifier, and jump after each basic unit is transmitted
Go to S4;
File is divided into multiple basic units and transmitted by S3 using file header as starting point, each basic unit transmission
It after the completion, is to complete its status modifier, and jump to S4;
The basic unit being transmitted is combined into complete file according to number order by S4, judge this document with it is to be passed
Whether defeated file size is consistent, if unanimously, be transmitted, otherwise, jumps to S1.
Further, the basic unit further includes title, place server address, local cache address, download state
And file block size.
Preferably, the size of the blocks of files is 2M.
Preferably, S1 specifically:
S101, mobile phone terminal connect server, obtain the size of file to be transmitted;
S102, inquired from local data base whether documentary basic unit, if so, then jumping to S2;Otherwise, it jumps
Go to S3.
Preferably, in S2 and S3, multi-thread transmission is used to basic unit, each basic unit uses a thread
Transmission.
Preferably, described to use multi-thread transmission, specifically, starting 3 thread transmission simultaneously.
Preferably, per thread setting is idle with busy two states, and the thread progress for starting idle state is described basic
The transmission of unit, and the idle state of thread is revised as busy condition, after being transmitted, the busy condition of thread is revised as
Idle state.
Preferably, after the completion of the responsible transformation task of a thread, judge whether entire file is transmitted, if so,
Then terminate, otherwise, the thread of idle state is called to carry out the transmission of next basic unit.
The beneficial effects of the present invention are: the method for mobile phone terminal document breakpoint transmission provided in an embodiment of the present invention, pass through by
File to be transmitted is divided into multiple basic units, can be according in unfinished when interrupting in transmission file processes
The smallest basic unit of the number of state is starting point, is transmitted to the basic unit in unfinished state, until complete,
By using basic unit and the number of basic unit is set, title, place server address, local cache address, downloads shape
The safety and efficiency of transmission can be improved in state and file block size:
1, can judge whether blocks of files lacks using number, at the same can blocks of files to caching carried out according to reference number of a document it is fast
Speed sorts and stores;
2, each file block size is fixed, and can judge whether there is loss of data in transmission process according to the size of blocks of files,
And modify the attribute of download state;
3, position that file takes and deposits is judged according to file name, place server address, local cache address, it can be very
Fast completion file taking and depositing, and guarantees accuracy.
Detailed description of the invention
Fig. 1 is the method flow schematic diagram of mobile phone terminal document breakpoint transmission provided in an embodiment of the present invention;
Fig. 2 is the mobile phone terminal file download breakpoint transmission flow diagram that the embodiment of the present invention one provides;
Fig. 3 is the mobile phone terminal file download thread process flow diagram that the embodiment of the present invention one provides;
Fig. 4 is that mobile phone terminal file provided by Embodiment 2 of the present invention uploads breakpoint transmission flow diagram;
Fig. 5 is that mobile phone terminal file provided by Embodiment 2 of the present invention uploads thread process flow diagram.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with attached drawing, to the present invention into
Row is further described.It should be appreciated that the specific embodiments described herein are only used to explain the present invention, it is not used to
Limit the present invention.
As shown in Figure 1, the embodiment of the invention provides a kind of methods of mobile phone terminal document breakpoint transmission, including walk as follows
It is rapid:
S1 judges whether there is the basic unit in unfinished state, if so, then jumping to S2, otherwise, jumps to
S3;
S2 obtains the smallest basic unit of number for being in unfinished state, and using the basic unit as starting point, to place
It is transmitted in the basic unit of unfinished state, is to complete its status modifier, and jump after each basic unit is transmitted
Go to S4;
File is divided into multiple basic units and transmitted by S3 using file header as starting point, each basic unit transmission
It after the completion, is to complete its status modifier, and jump to S4;
The basic unit being transmitted is combined into complete file according to number order by S4, judge this document with it is to be passed
Whether defeated file size is consistent, if unanimously, be transmitted, otherwise, jumps to S1.
Wherein, the basic unit further includes title, place server address, local cache address, download state and text
Part block size.
In the embodiment of the present invention, by using basic unit and the number, title, place server of basic unit are set
The safety and efficiency of transmission can be improved in location, local cache address, download state and file block size:
1, can judge whether blocks of files lacks using number, at the same can blocks of files to caching carried out according to reference number of a document it is fast
Speed sorts and stores;
2, each file block size is fixed, and can judge whether there is loss of data in transmission process according to the size of blocks of files,
And modify the attribute of download state;
3, position that file takes and deposits is judged according to file name, place server address, local cache address, it can be very
Fast completion file taking and depositing, and guarantees accuracy.
In the embodiment of the present invention, the size of the blocks of files is 2M.
Through test, it is found that blocks of files is dimensioned to 2M, the transmission speed of entire file and accurate can be improved
Rate.
In the embodiment of the present invention, S1 specifically:
S101, mobile phone terminal connect server, obtain the size of file to be transmitted;
S102, inquired from local data base whether documentary basic unit, if so, then jumping to S2;Otherwise, it jumps
Go to S3.
In the embodiment of the present invention, in S2 and S3, multi-thread transmission is used to basic unit, each basic unit uses
One thread transmission.
It is described to use multi-thread transmission in the embodiment of the present invention, specifically, starting 3 thread transmission simultaneously.
By providing while starting the quantity of thread, can control the size of the blocks of files of simultaneous transmission, without due to
Start excessive thread simultaneously, so that the file of simultaneous transmission is excessive, influences the transmission speed of file.
, it is specified that starting 3 threads simultaneously in the embodiment of the present invention, per thread is responsible for one basic unit of transmission every time
Information can make the transmission speed of entire file reach most fast.
In the embodiment of the present invention, per thread setting is idle with busy two states, and the thread for starting idle state carries out
The transmission of the basic unit, and the idle state of thread is revised as busy condition, after being transmitted, by the busy shape of thread
State is revised as idle state.
It is multiple to arrange by that can learn the transmission situation of file to the two different states of per thread setting
The transmission of basic unit, meanwhile, be conducive to system to the calling of line layer, improve per thread to the transmission rate of file.
Meanwhile different thread according to the rules, the completion status of the clear file transmission of system can also be made.
In the embodiment of the present invention, after the completion of the responsible transformation task of a thread, judge whether entire file is transmitted,
If it is, terminating, otherwise, the thread of idle state is called to carry out the transmission of next basic unit.
Embodiment one
As shown in Figures 2 and 3, the embodiment of the invention provides the methods of the breakpoint transmission of mobile phone terminal downloading file.This method
Realization process are as follows:
Mobile phone terminal connects the size that server obtains downloading file, by inquiring file basic unit in local server
Number, judges whether this document is in unfinished state.If unfinished state is in, with the place recorded in local data base
It is that starting point divides file, and carries out to the basic unit of division in the smallest basic unit of the number of unfinished state
Multithreading downloading;If there is no the file of unfinished state, then first entire file is divided, is then started under multithreading
It carries.
Wherein, file division can be in the following way: by entire file using 2M size as one " basic unit " into
Row divides, and " basic unit " includes " blocks of files ", further comprises server where basic unit number, file name, file
Address, local cache address, six parts of basic information of download state.
Multithreading downloading: while starting 3 threads, per thread sets " free time " and " busy " two states, each line
Journey is responsible for the downloading of a file " basic unit ", and the information of file " basic unit " is stored in database, will after the completion of downloading
This segment file itself is cached to local, and the download state of " basic unit " information in database is changed to " complete ", isochrone
Journey state is changed to " free time ".
Idle thread processing: after the completion of the responsible task of a thread, judge whether entire file downloads completion, if not complete
At the downloading for then calling idle progress next " basic unit ".
Breakpoint processing: when there is downloading interruption, download thread stops, and the basic unit information downloaded will be stored in this
In ground database, next time can read when downloading from database, and finding download state is " unfinished " and the smallest " base of number
This unit " re-starts multithreading downloading by starting point of the number of this basic unit.
Processing after completing file download: the file of local cache will be read after the completion of entire file download according to number
" basic unit " and it is combined into a complete file, removes local caching and data-base content after the completion.
Embodiment two
As shown in Figures 4 and 5, the embodiment of the invention provides the methods of the breakpoint transmission of transmitting file on mobile phone terminal.This method
Realization process are as follows:
Mobile phone terminal sends to server-side and requests from the file to be uploaded locally is chosen, and inquires local data base, judges whether
There is the upload file record in unfinished state, if so, the smallest basic unit of the number for then obtaining unfinished state, and from
The basic unit of the lowest number starts, and carries out the upload of the file of unfinished state, if no record, first draws to entire file
It is divided into multiple basic units, then starts multithreading and start to upload.
Wherein, file division can be in the following way: " basic by file using 2M size as one " basic unit "
Unit " includes
" blocks of files ", client where server address, file where further comprising the full name of file block number, file, file
It holds address, upload six parts of basic information of state, in the database that first file size is uploaded onto the server before uploading.
Multithreading uploads: while starting 3 threads, per thread sets " free time " and " busy " two states, each line
Journey is responsible for the upload of a file " basic unit ", the information of file " basic unit " is uploaded to database, server will be literary
Part content caching, a client thread complete the upload state that " basic unit " information in server database is modified after uploading
It is changed to " complete ", while client thread state changes " free time ".
Idle thread processing: after the completion of the responsible task of a thread, judge whether entire file uploads completion, if not complete
At the upload for then calling idle progress next " basic unit ".
Breakpoint processing: it when occurring uploading interruption, uploads thread and stops, the basic unit information uploaded will be stored in clothes
It is engaged in device database, next time can read when uploading from database, and finding upload state is " unfinished " and file block number
The smallest " basic unit " carries out multithreading upload by starting point of the number of this basic unit.
Complete the processing after file uploads: the file size that server-side judgement uploads and the file stored in database before
Then entire file download in the same size is completed, and the file that server end caches is combined into a complete text fastly according to number
Part clears up content in server database.
By using above-mentioned technical proposal disclosed by the invention, obtained following beneficial effect: the embodiment of the present invention is mentioned
The method of the mobile phone terminal document breakpoint transmission of confession, by the way that file to be transmitted is divided into multiple basic units, when transmission file
It can be starting point according to minimum compile of the basic unit in unfinished state, in not complete when interrupting in the process
Transmitted at the basic unit of state, until complete, by be arranged the number of basic unit, title, place server address,
Local cache address, download state and file block size can be improved the safety and efficiency of transmission, be mainly manifested in:
1, can judge whether blocks of files lacks using number, at the same can blocks of files to caching carried out according to reference number of a document it is fast
Speed sorts and stores;
2, each file block size is fixed, and can judge whether there is loss of data in transmission process according to the size of blocks of files,
And modify the attribute of download state;
3, position that file takes and deposits is judged according to file name, place server address, local cache address, it can be very
Fast completion file taking and depositing, and guarantees accuracy.
All the embodiments in this specification are described in a progressive manner, the highlights of each of the examples are with
The difference of other embodiments, the same or similar parts between the embodiments can be referred to each other.
Those skilled in the art should be understood that method and step provided by the above embodiment timing can according to the actual situation into
Row is adaptively adjusted, and can also concurrently carry out according to the actual situation.
The all or part of the steps in method that above-described embodiment is related to can be instructed by program relevant hardware come
It completes, the program can store in the storage medium that computer equipment can be read, for executing the various embodiments described above side
All or part of the steps described in method.The computer equipment, such as: personal computer, server, the network equipment, intelligent sliding
Dynamic terminal, smart home device, wearable intelligent equipment, vehicle intelligent equipment etc.;The storage medium, such as: RAM,
ROM, magnetic disk, tape, CD, flash memory, USB flash disk, mobile hard disk, storage card, memory stick, webserver storage, network cloud storage
Deng.
Finally, it is to be noted that, herein, relational terms such as first and second and the like be used merely to by
One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation
Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaning
Covering non-exclusive inclusion, so that the process, method, commodity or the equipment that include a series of elements not only include that
A little elements, but also including other elements that are not explicitly listed, or further include for this process, method, commodity or
The intrinsic element of equipment.In the absence of more restrictions, the element limited by sentence "including a ...", is not arranged
Except there is also other identical elements in process, method, commodity or the equipment for including the element.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art
For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered
Depending on protection scope of the present invention.
Claims (1)
1. a kind of method of mobile phone terminal document breakpoint transmission, which comprises the steps of:
S1 judges whether there is the basic unit in unfinished state, if so, then jumping to S2, otherwise, jumps to S3;
S2 obtains the smallest basic unit of number for being in unfinished state, and using the basic unit as starting point, in not
The basic unit of completion status is transmitted, and is to complete its status modifier, and jump to after each basic unit is transmitted
S4;
File is divided into multiple basic units and transmitted, each basic unit is transmitted by S3 using file header as starting point
It afterwards, is to complete its status modifier, and jump to S4;
The basic unit being transmitted is combined into complete file according to number order by S4, judge this document with it is to be transmitted
Whether file size is consistent, if unanimously, be transmitted, otherwise, jumps to S1;
The basic unit further includes title, place server address, local cache address, download state and file block size;
The size of the blocks of files is 2M;
In S2 and S3, multi-thread transmission is used to basic unit, each basic unit is using a thread transmission;
Per thread setting is idle with busy two states, and the thread for starting idle state carries out the transmission of the basic unit,
And the idle state of thread is revised as busy condition, after being transmitted, the busy condition of thread is revised as idle state;
After the completion of the responsible transformation task of one thread, judge whether entire file is transmitted, if it is, terminate, otherwise,
The thread of idle state is called to carry out the transmission of next basic unit;
S1 specifically:
S101, mobile phone terminal connect server, obtain the size of file to be transmitted;
S102, inquired from local data base whether documentary basic unit, if so, then jumping to S2;Otherwise, it jumps to
S3;
It is described to use multi-thread transmission, specifically, starting 3 thread transmission simultaneously.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510660934.2A CN105187564B (en) | 2015-10-14 | 2015-10-14 | A kind of method of mobile phone terminal document breakpoint transmission |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510660934.2A CN105187564B (en) | 2015-10-14 | 2015-10-14 | A kind of method of mobile phone terminal document breakpoint transmission |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105187564A CN105187564A (en) | 2015-12-23 |
CN105187564B true CN105187564B (en) | 2019-02-19 |
Family
ID=54909403
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510660934.2A Active CN105187564B (en) | 2015-10-14 | 2015-10-14 | A kind of method of mobile phone terminal document breakpoint transmission |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105187564B (en) |
Families Citing this family (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106445665B (en) * | 2016-09-19 | 2019-11-15 | 武汉斗鱼网络科技有限公司 | A kind of system file method for down loading and download tool applied to Android system |
CN108566417A (en) * | 2018-03-22 | 2018-09-21 | 四川长虹电器股份有限公司 | A kind of multithread breakpoint continued transmission download system based on android system and method |
CN110928863A (en) * | 2019-11-20 | 2020-03-27 | 无锡识凌科技有限公司 | Method for task breakpoint resume applied to data cleaning tool |
CN110933159A (en) * | 2019-11-27 | 2020-03-27 | 中电装备山东电子有限公司 | File transmission method and system supporting breakpoint continuous transmission |
CN111193777B (en) * | 2019-12-13 | 2021-02-05 | 佛山欧神诺云商科技有限公司 | File downloading method and device based on breakpoint continuous transmission and storage medium |
CN111432008A (en) * | 2020-03-30 | 2020-07-17 | 中科九度(北京)空间信息技术有限责任公司 | Breakpoint multi-source continuous transmission data transmission method |
CN111930696B (en) * | 2020-07-22 | 2023-08-01 | 建信金融科技有限责任公司 | File transmission processing method and system based on small program |
CN112073385A (en) * | 2020-08-17 | 2020-12-11 | 浙江鸿城科技有限责任公司 | Protocol format quick coding method based on reference cache multi-state construction |
CN113064857A (en) * | 2021-03-17 | 2021-07-02 | 歌尔科技有限公司 | File transmission control method, equipment and medium |
CN114884937B (en) * | 2022-05-27 | 2024-01-09 | 宁夏中宁县京能新能源有限公司 | New energy centralized control system data breakpoint continuous transmission method |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102340545A (en) * | 2011-10-31 | 2012-02-01 | 深圳市五巨科技有限公司 | Server and data processing method thereof |
CN102790771A (en) * | 2012-07-25 | 2012-11-21 | 山东中创软件商用中间件股份有限公司 | File transmission method and system |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103188305B (en) * | 2011-12-30 | 2016-08-03 | 北大方正集团有限公司 | A kind of multithread breakpoint continued transmission method and system |
CN103227812B (en) * | 2013-03-19 | 2016-08-03 | 青岛海信宽带多媒体技术有限公司 | Smart machine is supported method for down loading and the device of breakpoint transmission |
-
2015
- 2015-10-14 CN CN201510660934.2A patent/CN105187564B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102340545A (en) * | 2011-10-31 | 2012-02-01 | 深圳市五巨科技有限公司 | Server and data processing method thereof |
CN102790771A (en) * | 2012-07-25 | 2012-11-21 | 山东中创软件商用中间件股份有限公司 | File transmission method and system |
Also Published As
Publication number | Publication date |
---|---|
CN105187564A (en) | 2015-12-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105187564B (en) | A kind of method of mobile phone terminal document breakpoint transmission | |
CN102223416B (en) | Method and system for transmitting media file | |
CN103096385B (en) | A kind of method of flow control, device and terminal | |
CN103177042B (en) | A kind of method and device of web page browsing | |
US10862992B2 (en) | Resource cache management method and system and apparatus | |
CN103916702B (en) | Method and terminal for intercepting advertisements | |
CN104778222B (en) | Media library based on USB storage device is established and update method | |
CN103970788A (en) | Webpage-crawling-based crawler technology | |
CN102307234A (en) | Resource retrieval method based on mobile terminal | |
CN111246302B (en) | Method, device and terminal for downloading data by browser | |
CN106095923A (en) | A kind of method and system adding data of being on the list in orderly list | |
CN102122303A (en) | Method for data migration, service system and sever equipment | |
CN103500213A (en) | Page hot-spot resource updating method and device based on pre-reading | |
WO2010081281A1 (en) | Method for switching an intelligent network interpretation engine | |
CN104581354A (en) | Video buffering method and video buffering device | |
CN103780676A (en) | File transmission method, device and system | |
CN104331601A (en) | Method and device for optimizing game scenes | |
CN104778172B (en) | Webpage information prefetches processing method, device and corresponding web page browsing device | |
CN105608158A (en) | Method and apparatus for displaying picture in waterfall flow manner | |
CN103716573B (en) | A kind of method and apparatus of video playback | |
CN104537005A (en) | Data processing method and device for webpage crawling | |
CN103365977A (en) | Storage processing method and device for data on nonvolatile storage medium | |
CN105573782A (en) | Software pre-loading method for transparent wearable intelligent device | |
CN104536780A (en) | Electronic game resource high-efficiency loading method and system | |
CN116828237B (en) | Video playing method, video playing system, electronic device and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP03 | Change of name, title or address |
Address after: 100101 Beijing Chaoyang District Anxiang Beilijia 11 B Block 2 Floor Patentee after: CHINA SCIENCE MAPUNIVERSE TCHNDOGY CO., LTD. Address before: 100101 Beijing Chaoyang District, Anxiang Beilijia 11 Pioneer Building, Block B, 2 Floors Patentee before: MAPUNI Co., Ltd. |
|
CP03 | Change of name, title or address |