CN102663104A - Document transmission method and document transmission system - Google Patents

Document transmission method and document transmission system Download PDF

Info

Publication number
CN102663104A
CN102663104A CN2012101097024A CN201210109702A CN102663104A CN 102663104 A CN102663104 A CN 102663104A CN 2012101097024 A CN2012101097024 A CN 2012101097024A CN 201210109702 A CN201210109702 A CN 201210109702A CN 102663104 A CN102663104 A CN 102663104A
Authority
CN
China
Prior art keywords
files
blocks
transmitting terminal
thread
receiving end
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
CN2012101097024A
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.)
Suzhou Codyy Network Technology Co Ltd
Original Assignee
Suzhou Codyy Network 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 Suzhou Codyy Network Technology Co Ltd filed Critical Suzhou Codyy Network Technology Co Ltd
Priority to CN2012101097024A priority Critical patent/CN102663104A/en
Publication of CN102663104A publication Critical patent/CN102663104A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention provides a document transmission method and a document transmission system. The method comprises the following steps: reading a document to be transmitted at the sending end, and splitting the document into a plurality of document blocks; calling a thread according to a preset strategy and transmitting the document blocks through a function NetGroup. addHaveObject at the sending end; and calling a function NetGroup. addWantObject and further receiving the document blocks from the sending end at the receiving end.

Description

A kind of document transmission method and system
Technical field
The invention belongs to network communication field, relate in particular to a kind of document transmission method and system.
Background technology
Along with the develop rapidly of the network communications technology, to the network file transmission speed require increasingly high.At present, upload based on webpage or the speed of file in download slower.And, upload or during file in download,, then need start anew again to upload or file in download, thereby cause time waste based on webpage if run into the situation that network is relatively poor or network breaks off.
Summary of the invention
The present invention provides a kind of document transmission method and system, to address the above problem.
The present invention provides a kind of document transmission method.Said method may further comprise the steps: transmitting terminal reads file waiting for transmission, and said file is split as a plurality of blocks of files; Said transmitting terminal transmits said blocks of files according to the preset strategy invokes thread through function NetGroup.addHaveObject; Receiving end call function NetGroup.addWantObject receives said blocks of files from said transmitting terminal.
The present invention also provides a kind of document transmission system, comprises transmitting terminal and receiving end.Transmitting terminal connects receiving end.Wherein, transmitting terminal is used to read file waiting for transmission, and said file is split as a plurality of blocks of files.Transmitting terminal also is used for transmitting said blocks of files according to the preset strategy invokes thread through function NetGroup.addHaveObject.Receiving end is used for call function NetGroup.addWantObject and receives said blocks of files from said transmitting terminal.
Compared to prior art; According to document transmission method provided by the invention and system; Transmitting terminal transmits after file to be transmitted is split as a plurality of blocks of files; And transmitting terminal transmits said blocks of files through function NetGroup.addHaveObject, and receiving end call function NetGroup.addWantObject receives blocks of files.So, transmit after big file is split as a plurality of blocks of files, can save the transmission time, and improve transmission speed.In addition, file transfer is more stable, thereby can tackle complicated network environment.
Description of drawings
Accompanying drawing described herein is used to provide further understanding of the present invention, constitutes the application's a part, and illustrative examples of the present invention and explanation thereof are used to explain the present invention, do not constitute improper qualification of the present invention.In the accompanying drawings:
The process flow diagram of the document transmission method that provides for preferred embodiment according to the present invention shown in Figure 1;
The synoptic diagram of the document transmission system that provides for preferred embodiment according to the present invention shown in Figure 2.
Embodiment
Hereinafter will and combine embodiment to specify the present invention with reference to accompanying drawing.Need to prove that under the situation of not conflicting, embodiment and the characteristic among the embodiment among the application can make up each other.
The process flow diagram of the document transmission method that provides for preferred embodiment according to the present invention shown in Figure 1.As shown in Figure 1, the document transmission method that preferred embodiment of the present invention provides comprises step 101~103.
In step 101, transmitting terminal reads file waiting for transmission, and said file is split as a plurality of blocks of files.For example, transmitting terminal reads file A waiting for transmission, and file A waiting for transmission is split as five blocks of files (that is, blocks of files a1, a2, a3, a4, a5).Wherein, can file A be split as five blocks of files of the same size, perhaps as required file A be split as five blocks of files that cause not of uniform size.Yet the present invention does not limit this.
In step 102, said transmitting terminal transmits said blocks of files according to the preset strategy invokes thread through function NetGroup.addHaveObject.For example, the transmitting terminal invokes thread is through function NetGroup.addHaveObject (a1, a5) transfer files piece a1~a5.
In present embodiment; Preset strategy is: said transmitting terminal is set the priority of all threads in the thread pool; And the corresponding relation of definite blocks of files and thread priority; Said transmitting terminal calculates the idleness of all threads in each priority, and calls corresponding thread according to the idleness of thread in the size of blocks of files and the corresponding priority of said blocks of files and transmit said blocks of files.Particularly, when corresponding to not of uniform size the causing of the blocks of files of same thread priority, transmitting terminal calls the higher bigger blocks of files of thread transmission of idleness in the said priority, calls the less blocks of files of thread transmission that idleness is lower in the said priority.When corresponding to the size of the blocks of files of same thread priority when consistent, the thread in the said priority of transmitting terminal random call transmits said blocks of files.In this, the idleness of thread referred to sample in the period, and the free time of thread accounts for the number percent of sampling period.The idleness of thread calculates and can be real-time calculating or regularly calculating.Yet the present invention does not limit this.
For example, the corresponding relation of thread and its priority is as shown in the table in the thread pool of transmitting terminal setting.
The thread name Priority
Thread 1 The first estate
Thread 2 The first estate
Thread 3 The first estate
Thread 4 The first estate
Thread 5 Second grade
Thread 6 Second grade
Thread 7 Second grade
Thread 8 The tertiary gradient
Thread 9 The tertiary gradient
Thread 10 The tertiary gradient
As above shown in the table, each thread priority is followed successively by from high to low: the first estate, second grade, the tertiary gradient.Wherein, the present invention is not limited to thread and the priority corresponding relation in the table.In practical application, can reset thread and priority as required.
In addition, transmitting terminal is also confirmed the corresponding relation of blocks of files and thread priority.For example, during as if transmitting terminal transfer files A, B and C, transmitting terminal is split as blocks of files a1~a5 with file A, and file B is split as blocks of files b1~b4, and file C is split as blocks of files c1~c3.Wherein, The not of uniform size of blocks of files a1~a5 (for example causes; Blocks of files is followed successively by by big extremely little order: blocks of files a1, blocks of files a2, blocks of files a3, blocks of files a4, blocks of files a5), the size of blocks of files b1~b4 is consistent, and the size of blocks of files c1~c3 is consistent.Simultaneously, transmitting terminal for example can confirm that the corresponding relation of blocks of files a1~a5, b1~b4 and c1~c3 and thread priority is as shown in the table.
Blocks of files Thread priority
Blocks of files a1~a5 The first estate
Blocks of files b1~b4 Second grade
Blocks of files c1~c3 The tertiary gradient
In present embodiment; Because the not of uniform size of blocks of files a1~a5 causes; Therefore; Transmitting terminal calls the higher bigger blocks of files of thread transmission of idleness in the corresponding thread priority (that is, the first estate) of blocks of files a1~a5, calls the less blocks of files of thread transmission that idleness is lower in the said priority.For example; If the idleness of the thread in the first estate priority from height to low order is: thread 1, thread 2, thread 3, thread 4; The idleness of the thread of second level priority from height to low order is: thread 5, thread 6, thread 7, the idleness of the thread of tertiary gradient priority from height to low order is: thread 8, thread 9, thread 10.Correspondingly, transmitting terminal calls the thread 1 transfer files piece a1 in the first estate, invokes thread 2 transfer files piece a2, invokes thread a3 transfer files piece a3, invokes thread 4 transfer files piece a4.Simultaneously, transmitting terminal calls the thread 5 transfer files piece a5 that idleness is the highest in second level priority.In addition, transmitting terminal random call thread 6 transfer files piece b1 in the remaining thread from second grade, invokes thread 7 transfer files piece b2 call higher thread 8 of idleness in the tertiary gradient priority and thread 9 transfer files piece b3 and blocks of files b4 respectively simultaneously.In addition, transmitting terminal can call the thread 10 transfer files piece c1 in the tertiary gradient priority.Can wait for the thread processing again after the free time in the corresponding priority for blocks of files c2 and c3.
In another embodiment; Preset strategy is: said transmitting terminal is set the priority of file to be transmitted; And thread is included into different classes of according to the idleness of all threads in the thread pool; And confirm priority and other corresponding relation of thread class of file to be transmitted, and the size of the blocks of files that splits according to file to be transmitted is called in each classification the blocks of files that thread accordingly transmits the file of corresponding priority.Particularly; When corresponding to not of uniform size the causing of same other blocks of files of thread class; Transmitting terminal calls the higher bigger blocks of files of thread transmission of the not busy rate of said thread classification hollow, calls the lower less blocks of files of thread transmission of the not busy rate of said thread classification hollow.When corresponding to the size of same other blocks of files of thread class when consistent, the thread in the said thread classification of transmitting terminal random call transmits said blocks of files.In this, the idleness of thread referred to sample in the period, and the free time of thread accounts for the number percent of sampling period.The idleness of thread calculates and can be real-time calculating or regularly calculating.Yet the present invention does not limit this.
Particularly, the priority of the file to be transmitted of transmitting terminal setting for example is followed successively by from high to low: the first order, the second level, the third level.Yet the present invention does not limit this.In other embodiment, the priority of file to be transmitted can be set as required.In addition, the thread in the thread pool is that the criteria for classifying is divided with the idleness.For example; Thread can be divided into three classifications according to idleness, and particularly, idleness can be classified as first category more than or equal to 75% thread; Idleness is greater than 50% and can be classified as second classification less than 75% thread, and idleness is less than or equal to 50% thread can be classified as the 3rd classification.Wherein, the present invention does not limit the criteria for classifying of thread.In addition, transmitting terminal is also confirmed priority and other corresponding relation of thread class of file to be transmitted.For example, the file to be transmitted of the first order is corresponding to the thread of first category, and partial file to be transmitted is corresponding to the thread of second classification, and the file to be transmitted of the third level is corresponding to the thread of the 3rd classification.In this, the priority of file to be transmitted and thread classification are man-to-man relation, yet the present invention is not limited thereto.In other embodiment, file to be transmitted can be set as required and thread classification corresponding relation is the relation of one-to-many or multi-to-multi.Wherein, other corresponding relation of file to be transmitted and thread class is for example shown in the following table.
File to be transmitted File Privilege to be transmitted The thread classification
File D, E The first order First category
File M, N The second level Second classification
File P, Q The third level The 3rd classification
In present embodiment, the idleness that transmitting terminal calculates all threads can be included into corresponding classification with thread.In this, the corresponding relation of thread and its classification is for example shown in the following table.
With transmitting terminal transfer files D, M is example; Transmitting terminal for example is split as three blocks of files d1~d3 with file D; And the not of uniform size of blocks of files d1~d3 (for example causes; Blocks of files is followed successively by by big extremely little order: blocks of files d1, blocks of files d2, blocks of files d3), transmitting terminal is split as three blocks of files m1~m3 of the same size with file M.Therefore, transmitting terminal can call the highest thread a transfer files piece d1 of idleness in the corresponding thread classification (that is, first category) of file D, invokes thread b transfer files piece d2, invokes thread c transfer files piece d3.Simultaneously; Transmitting terminal can call the corresponding thread classification of file M (promptly; Second classification) the thread d transfer files piece m1 in, thread e transfer files piece m2 (perhaps, invokes thread d transfer files m2; Invokes thread e transfer files piece m1), call the higher thread f transfer files piece m3 of idleness in the 3rd classification simultaneously.
In step 103, receiving end call function NetGroup.addWantObject receives said blocks of files from said transmitting terminal.
In present embodiment; Transmitting terminal is before receiving end transfer files piece; Transmitting terminal sends first instruction and gives receiving end; Receiving end receives the first instruction back response NetGroup.Replication.Fetch.Result incident, and call function NetGroup.addWantObject receives blocks of files from transmitting terminal.And after receiving end received blocks of files from transmitting terminal, receiving end sent second instruction and gives transmitting terminal.Wherein, after first instruction that the receiving end receiving end/sending end sends, carry out blocks of files and receive preparation, transmitting terminal can confirm that receiving end has received blocks of files after receiving second instruction of receiving end transmission.In addition, transmitting terminal can at first send file header, and receiving end calls NetGroup.addWantObjects (0,0) and receives file header, and wherein, file header is preserved the essential information (for example, filename and file size etc.) of file.In this, the reception of blocks of files order is not limit, as long as guarantee at first to receive file header.In addition, receiving end receives and preserves the blocks of files that receives after the blocks of files, all finishes receiving until the All Files piece of file, preserves file at last.
In present embodiment, when being client as if transmitting terminal, receiving end can be client or server.When receiving end was client, transmitting terminal can be client or server.The present invention does not limit this.
The synoptic diagram of the document transmission system that preferred embodiment according to the present invention shown in Figure 2 provides.As shown in Figure 2, the document transmission system that preferred embodiment of the present invention provides comprises transmitting terminal 20 and receiving end 21.Transmitting terminal 20 connects receiving end 21.Wherein, transmitting terminal 20 is used to read file waiting for transmission, and said file is split as a plurality of blocks of files.Transmitting terminal 20 also is used for transmitting said blocks of files according to the preset strategy invokes thread through function NetGroup.addHaveObject.Receiving end 21 is used for call function NetGroup.addWantObject and receives said blocks of files from said transmitting terminal.Specific operation process about native system is said with above-mentioned method, so repeat no more in this.
In present embodiment, when being client as if transmitting terminal, receiving end can be client or server.When receiving end was client, transmitting terminal can be client or server.Yet the present invention does not limit this.
In sum; Document transmission method that preferred embodiment provides according to the present invention and system; Transmitting terminal transmits after file to be transmitted is split as a plurality of blocks of files; And transmitting terminal transmits said blocks of files through function NetGroup.addHaveObject, and receiving end call function NetGroup.addWantObject receives blocks of files.So, transmit after big file is split as a plurality of blocks of files, can save the transmission time, and improve transmission speed.In addition, file transfer is more stable, thereby can tackle complicated network environment.
The above is merely the preferred embodiments of the present invention, is not limited to the present invention, and for a person skilled in the art, the present invention can have various changes and variation.All within spirit of the present invention and principle, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (10)

1. a document transmission method is characterized in that, may further comprise the steps:
Transmitting terminal reads file waiting for transmission, and said file is split as a plurality of blocks of files;
Said transmitting terminal transmits said blocks of files according to the preset strategy invokes thread through function NetGroup.addHaveObject;
Receiving end call function NetGroup.addWantObject receives said blocks of files from said transmitting terminal.
2. method according to claim 1; It is characterized in that; Said preset strategy is: said transmitting terminal is set the priority of all threads in the thread pool; Confirm the corresponding relation of blocks of files and thread priority, said transmitting terminal calculates the idleness of all threads in each priority, and calls corresponding thread according to the idleness of thread in the size of blocks of files and the corresponding priority of said blocks of files and transmit said blocks of files.
3. method according to claim 2; It is characterized in that; When corresponding to not of uniform size the causing of the blocks of files of same thread priority; Said transmitting terminal calls the higher bigger blocks of files of thread transmission of idleness in the said priority, calls the less blocks of files of thread transmission that idleness is lower in the said priority.
4. method according to claim 1; It is characterized in that; Said transmitting terminal is before said receiving end transmits said blocks of files; Said transmitting terminal sends first instruction and gives said receiving end, and said receiving end receives the said first instruction back response NetGroup.Replication.Fetch.Result incident, and call function NetGroup.addWantObject receives said blocks of files from said transmitting terminal.
5. method according to claim 4 is characterized in that, after said receiving end received said blocks of files from said transmitting terminal, said receiving end sent second instruction and gives said transmitting terminal.
6. method according to claim 1 is characterized in that, said transmitting terminal is a client.
7. method according to claim 1 is characterized in that, said receiving end is a client.
8. a document transmission system is characterized in that, comprises transmitting terminal and receiving end, and said transmitting terminal connects said receiving end,
Wherein, transmitting terminal is used to read file waiting for transmission, and said file is split as a plurality of blocks of files;
Said transmitting terminal also is used for transmitting said blocks of files according to the preset strategy invokes thread through function NetGroup.addHaveObject;
Said receiving end is used for call function NetGroup.addWantObject and receives said blocks of files from said transmitting terminal.
9. system according to claim 8 is characterized in that, said transmitting terminal is a client.
10. system according to claim 8 is characterized in that, said receiving end is a client.
CN2012101097024A 2012-04-16 2012-04-16 Document transmission method and document transmission system Pending CN102663104A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2012101097024A CN102663104A (en) 2012-04-16 2012-04-16 Document transmission method and document transmission system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2012101097024A CN102663104A (en) 2012-04-16 2012-04-16 Document transmission method and document transmission system

Publications (1)

Publication Number Publication Date
CN102663104A true CN102663104A (en) 2012-09-12

Family

ID=46772595

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2012101097024A Pending CN102663104A (en) 2012-04-16 2012-04-16 Document transmission method and document transmission system

Country Status (1)

Country Link
CN (1) CN102663104A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102611760A (en) * 2012-04-16 2012-07-25 苏州阔地网络科技有限公司 File transmission method and system
CN105357305A (en) * 2015-11-13 2016-02-24 北京金山安全软件有限公司 File sending method and device, file receiving method and device and terminal equipment
CN108429799A (en) * 2018-03-01 2018-08-21 北京天融信网络安全技术有限公司 Parallel transmission method, device and the storage medium of batch documents
CN108965112A (en) * 2018-08-09 2018-12-07 江苏神州信源系统工程有限公司 The method and device of file transmission is carried out using instant message applications

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101547161A (en) * 2008-03-28 2009-09-30 阿里巴巴集团控股有限公司 Folder transmission system, folder transmission device and folder transmission method
CN101980168A (en) * 2010-11-05 2011-02-23 北京云快线软件服务有限公司 Dynamic partitioning transmission method and device
CN102207890A (en) * 2011-05-27 2011-10-05 苏州阔地网络科技有限公司 Task information processing method and scheduling control processing device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101547161A (en) * 2008-03-28 2009-09-30 阿里巴巴集团控股有限公司 Folder transmission system, folder transmission device and folder transmission method
CN101980168A (en) * 2010-11-05 2011-02-23 北京云快线软件服务有限公司 Dynamic partitioning transmission method and device
CN102207890A (en) * 2011-05-27 2011-10-05 苏州阔地网络科技有限公司 Task information processing method and scheduling control processing device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
TOM: "File Sharing Over P2P In Flash Player 10.1 With Object Replication", 《HTTP://TOMKRCHA.COM/?=1646》, 14 July 2010 (2010-07-14) *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102611760A (en) * 2012-04-16 2012-07-25 苏州阔地网络科技有限公司 File transmission method and system
CN105357305A (en) * 2015-11-13 2016-02-24 北京金山安全软件有限公司 File sending method and device, file receiving method and device and terminal equipment
CN105357305B (en) * 2015-11-13 2018-11-20 北京金山安全软件有限公司 File sending method and device, file receiving method and device and terminal equipment
CN108429799A (en) * 2018-03-01 2018-08-21 北京天融信网络安全技术有限公司 Parallel transmission method, device and the storage medium of batch documents
CN108965112A (en) * 2018-08-09 2018-12-07 江苏神州信源系统工程有限公司 The method and device of file transmission is carried out using instant message applications

Similar Documents

Publication Publication Date Title
CN102611760A (en) File transmission method and system
CN102469064B (en) Realization Method of Communication and communication equipment
US10043220B2 (en) Method, device and storage medium for data processing
CN102868635B (en) The message order-preserving method of Multi-core and system
CN102663104A (en) Document transmission method and document transmission system
CN105978968A (en) Real-time transmission processing method, server and system of mass data
CN103401934A (en) Method and system for acquiring log data
DE102012207695A1 (en) Transfer application status across different devices
CN102035893A (en) Method and system for pushing data actively by server
CN104539510B (en) A kind of information transmission system and method based on multi-protocols
CN107589990B (en) Data communication method and system based on thread pool
CN102364457A (en) Document transformation method and system
JP4774131B2 (en) Method, apparatus, and software for translating a natural language request to change a subscription set for a publish / subscribe topic string
CN102970244A (en) Network message processing method of multi-CPU (Central Processing Unit) inter-core load balance
CN103312751A (en) Instant messaging method based on browser
CN102123084A (en) Resource scheduling method and system in cloud computing operating system
CN102638457B (en) Method and system for automatically allocating server resource
CN103491162A (en) Method and system for sharing information based on mobile Internet
CN106101022A (en) A kind of data request processing method and system
CN104933202A (en) Method and device for data extraction, transformation and ETL loading
CN103037000B (en) Publish-subscribe system and notification message processing method thereof
CN105208004A (en) Data input method based on OBD equipment
CN104980254A (en) Internet information processing system
CN101751397A (en) Method and device for importing files into database
CN104199738A (en) Multi-data processing equipment cooperative work method and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20120912