Detailed description of the invention
For making the purpose of the embodiment of the present invention, technical scheme and advantage clearer, below in conjunction with this
Accompanying drawing in bright embodiment, is clearly and completely described the technical scheme in the embodiment of the present invention,
Obviously, described embodiment is a part of embodiment of the present invention rather than whole embodiments.Based on
Embodiment in the present invention, those of ordinary skill in the art are obtained under not making creative work premise
The every other embodiment obtained, broadly falls into the scope of protection of the invention.
Embodiments provide a kind of data transmission method and device, in order to by the data of multilink
Transmission means, increases the safety and reliability of data transmission.
See Fig. 1, a kind of data transmission method that the embodiment of the present invention provides, the method includes:
S101, the file transmitted for each needs, divide this document, obtain multiple data
Bag, each packet carries file identification and the Position Number in this document of this document;
It should be noted that need the file of transmission can include one or more.When needs transmit
File when only including, the file that these needs transmit is divided, obtains multiple packet,
And each packet will carry this packet Position Number at the file needing transmission.Such as,
Need to transmit a video, then this video is divided into many parts, every a data one packet of composition,
Such as, a vision signal is divided into 10 parts, then the packet of first part of video will be labeled as 1,
The packet of second part of video is labeled as 2, the like, the packet of the tenth part of video marks
It is 10, wherein it should be noted that 1,2,10 is each packet Position Number in this video.
It should be noted that the Position Number that includes of each packet and file identification may be located at this
End in packet, or beginning, the embodiment of the present invention is not specifically limited.
When the file needing transmission includes multiple, such as, the file of transmission is needed to include video 1, regard
Frequently 2, image 1 and image 2.When needs transmit multiple file, need each file is carried out literary composition
Part identifies.For example, it is possible to be a by the file identification of video 1, it is b by the file identification of video 2,
It is c by the file identification of image 1, is d by the file identification of image 2.Then each file is entered
Row divides, for example, it is possible to each file is divided into 10 groups, or more groups.Such as by a literary composition
Part is divided into 10 parts, is then marked by every a video data, can be by the number of first group
According to being labeled as a1 or 1a, it is then a2 or 2a by the data markers of second group.The like,
Mark each number evidence.In like manner, b file is divided into 10 parts, or less part, or more
Part, and mark every a data, can by first group data markers be b1 or 1b, so
After be b2 or 2b by the data markers of second group.The like, mark each number evidence.In like manner
Mark each file.Certainly, it is not limited only to carry out each file by way of example file identification
And Position Number, can be set voluntarily according to actual conditions.
It should be noted that each file needing transmission is carried out file identification by the embodiment of the present invention
Identification means, and each packet is carried out the numbering of Position Number, the present invention does not do to be had
Body limits.
S102, determine the number of the packet that each link can transmit, and permissible according to each link
All allocation of packets are transmitted to different links by the number of the packet of transmission.
Wherein it is desired to explanation, the file needing transmission is divided into multiple packet, so by the present invention
It is transmitted by different links afterwards.The number of the packet of each link transmission can be identical, it is possible to
With difference.
The data transmission method provided by the embodiment of the present invention, is first entered each file needing transmission
Row divides, and obtain multiple packet, and each packet carry the file identification of this document and
Position Number in this document, it is then determined that the number of packet that each link can transmit, and according to
All described allocation of packets enter to different links by the number of the packet that each link can transmit
Row transmission.Therefore the present invention utilizes and be divided into multiple link to be transmitted the file needing transmission, thus
Add the safety and reliability of data transmission.
Wherein, after determining the number of packet that each link can transmit, and by all data
Bag is distributed to before different links is transmitted, and the method also includes:
According to the AES preset corresponding to each link, encrypt each number of transmission on this link
According to bag.
In order to ensure the confidentiality of data transmission procedure, need each packet is provided with password, thus
Make when this packet is illegally stolen, it is not easy to be cracked.Wherein, pre-corresponding to each link
If AES can be identical, it is also possible to differ.
If the AES corresponding to each link is identical, then after each file being divided into multiple packet,
And carrying out data transmission between each packet, encrypt each packet according to this AES, or
The multiple packets belonging to same link transmission are encrypted.
If the AES corresponding to each link differs, then each file is divided into multiple data
Bao Hou, and before carrying out data transmission each packet, according to the chain distributing to the transmission of each packet
The AES on road, encrypts this packet.Such as, if by the allocation of packets of video a5 to link 2,
Then needing, according to the AES corresponding to link 2, to encrypt the packet of this a5, its link 2 represents
A link in multilink.
Wherein, the size dividing, for each file needing transmission, the multiple packets obtained is identical.
When each file needing transmission is divided, each file needing transmission can be divided into
The packet that size is identical, thus beneficially data determine, when transmitting, the packet that each link can transmit
Number.Of course, it is possible to each file needing transmission is divided into the packet varied in size, the present invention is not
It is specifically limited.
Wherein it is determined that the number of packet that each link can transmit, including:
Load pressure according to each link and network delay, determine the data that this link can transmit
The number of bag.
In data transmission procedure, it is thus necessary to determine that the number of the packet that each link can transmit.Such as,
Can be according to the load pressure of each link and network delay situation, and the size of each packet,
Distribute the packet number that this link can transmit.Such as load pressure is little, and the chain that network delay is less
Road, the packet number that can distribute is more.So can be according to load pressure, and the feelings of network delay
Condition, and the size of packet proportionally distributes the packet number that can transmit.When each packet
Size identical time, can by less for load pressure and that network delay is less link distribute multiple packets;
When varying in size of each packet, little for load pressure and that network delay is less link can be distributed
Bigger packet.The concrete distribution principle embodiment of the present invention is not specifically limited.
It should be noted that the load pressure that can be able to bear according to all links of each link and net
Network time delay situation, presetting each link needs the fixing packet number of transmission.Such as, institute is worked as
Having in link, the packet number having a link to transmit is 2, and other links can transmit
Packet number is all higher than 2, then needing to preset the packet that each link can transmit is 2.
It is thus desirable to the transmission situation of the link according to the packet number minimum can transmitted in all links, really
Fixed each link packet number set in advance in data transmission procedure.
Wherein, after determining the number of packet that each link can transmit, the method also includes:
Send the number of the packet that each link can transmit to receiving terminal.
It should be noted that when the packet number that each link can transmit is identical, and in receiving terminal
Storage has the packet number of transmission, then need not send the number of the packet that each link can transmit
To receiving terminal.When receiving terminal does not store the packet number of link transmission, then need determining often
After the packet number of one link transmission, this packet number is sent to receiving terminal by each link, in order to
Make receiving terminal it is determined that receive how many packets and just can confirm that and received all packets.
Wherein, after being transmitted all allocation of packets to different links, the method also includes:
In Preset Time, wait the feedback information that arbitrary described link to be received sends, wherein, feedback
Information is that receiving terminal is sent by this link, is used for being confirmed whether to be successfully received on this link transmission
The information of all packets.
It should be noted that Preset Time can according to circumstances depending on, generally 100ms~500ms.
After packets all in this link are sent to receiving terminal by each link, need in Preset Time,
Receive the feedback information that receiving terminal sends, in order to indicate whether receiving terminal has been properly received all packets.
When receiving the feedback information that arbitrary link sends, and the information carried in this feedback information is into
Merit receives all packets, then the file bust this belonging to this packet.It addition, when in Preset Time
When being not received by feedback information, illustrate that receiving terminal is not received by packet.Therefore, Preset Time is worked as
When being inside not received by feedback information, also illustrate that file bust this.
Wherein, when, in Preset Time, not receiving the feedback information that arbitrary link sends, or receive
During the feedback information of the packet being not successfully received on this link to receiving terminal, it is determined that retransmit link,
And again transmit, by this re-transmission link, the packet being not successfully received.
It should be noted that when receiving terminal does not receives packet, or the packet that receiving terminal receives
Number, when the number of this packet that should receive with receiving terminal transmission differs, determines that receiving terminal receives
Packet failure.When receiving terminal does not receives packet, feedback information will not be sent, thus without connecing
Receive the feedback information that arbitrary link sends;The packet number received when receiving terminal is 2, but transmission should
On the link of packet, the packet number of transmission altogether is 3, then can receive the feedback that receiving terminal sends
Information, instruction is not successfully received the packet on this link.Wherein it is desired to explanation, feedback information
In can include the packet number that has been received, it is also possible to do not include the packet number being received.
Feedback information can only include the instruction information being not successfully received packet, it is of course also possible to feedback information
In both include the packet number that has been received, and the packet information received.In concrete feedback information
Including the information content be not specifically limited, as long as being used to indicate whether to be properly received all packets,
Belong to protection scope of the present invention.
When receiving that arbitrary link is unsuccessful transfers all packets, need according to each link is negative
Carry pressure and network delay situation, determine the link that can retransmit.Which can certainly preset
Or which link is as retransmitting link.Such as, when determining the packet of transmission not success in link 2
When transferring, need the load pressure according to each link and network delay situation, by this link 2
The packet of transmission re-starts transmission, and the link that wherein can retransmit can be link 3 or 4, or
Other arbitrary links of person, or appoint several links.It is of course also possible to preset link 2 or chain
Road 3 or link 4 as retransmitting link, the packet bust this of transmission on whichever link,
On link 2 or link 3 or link 4, all re-start the transmission of packet.
Wherein, when again transmitting the packet being not successfully received, and feedback information include unsuccessful
The packet information of transmission, then can only transmit the packet of unsuccessful transmission on re-transmission link again,
Packets all on the link of unsuccessful transmission all can also be transmitted on re-transmission link again.Work as feedback
When information does not include the information of packet of unsuccessful transmission, need institute on the link of unsuccessful transmission
Packet is had all again to transmit on re-transmission link.
In sum, the method for a kind of data transmission that the present invention provides, first by each needs transmission
File divides, and obtains multiple packet, and wherein, each packet carries the files-designated of this document
Knowing and Position Number in this document, then load pressure and network delay according to each link are true
Determine the packet number that each link can transmit, and the packet number can transmitted by each link is sent out
Give receiving terminal, then give different links by each allocation of packets, when determining that each packet institute is right
During the transmission link answered, according to the AES of this link, encrypt each packet, after then encrypting
Packet be transmitted on the link, when in Preset Time, receive the feedback letter that receiving terminal sends
After in breath, all packets on this link of instruction have been properly received, the packet on this link transfers
Become;When, in Preset Time, not receiving and feedback information, or the feedback information received indicate this chain
When packet on road is not successfully received, it is thus necessary to determine that the link again transmitted, and by unsuccessful transmission
Packet re-starts transmission on this link again transmitted, thus completes whole data transmission procedure.
Because being divided into multiple link to be transmitted each file, thus add data transmission security and can
By property, by transmitting after being encrypted by each packet, add the confidentiality of data.
Correspondingly, see Fig. 2, the another kind of data transmission method that the embodiment of the present invention provides, the method
Including:
S201, receiving multiple packets of each link transmission, wherein, each packet carries this
The file identification of file belonging to packet and Position Number in this document;
The files-designated of file belonging to this packet is identified it should be noted that each packet carries
Know, and the Position Number that this packet is in this document.Such as, each link transmission is received many
During individual packet, that carry in some packets is a2, and that carry in some packets is b3, has
Packet in that carry is a5, etc..Wherein a, b represent different files, 2,3,5 generations
Table packet is at the Position Number of file.
S202, Position Number according to the identical packet of file identification, by number identical for file identification
A file is become according to inclusion.
When the file identification carried in the multiple packets received has difference, file identification is identical
Packet as a class, then packet identical for file identification is arranged according to Position Number
Sequence, thus synthesize a file.If the file identification carried in the multiple packets received is the most identical,
Or multiple packets do not carry file identification, then by packet according to the position carried in this packet
Put numbering to be ranked up, thus synthesize a file.
Wherein, at the Position Number of the packet identical according to file identification, file identification is identical
Before packet one file of synthesis, the method also includes:
According to the decipherment algorithm preset corresponding to each link, decipher each number of transmission on this link
According to bag.
It should be noted that when the multiple packets received are encryption data bag, need this number
It is decrypted according to the decipherment algorithm transmitting this link according to bag.Wherein when the deciphering corresponding to each link
When algorithm is identical, the most each packet is decrypted according to this decipherment algorithm;When each link institute
When corresponding decipherment algorithm differs, the most each packets need is according to the link institute transmitting this packet
Corresponding decipherment algorithm is decrypted.
Wherein, before receiving multiple packets of each link transmission, the method also includes:
Receive the number of packet that this link that each link sends can transmit;
The multiple packets receiving each link transmission specifically include:
The number of the packet that this link sent according to each link can transmit, receives this link and passes
Defeated multiple packets.
It should be noted that when receiving terminal does not stores the packet number that each link can transmit
Time, after transmitting terminal has confirmed the packet number that each link can transmit, need each link
The packet number of transmission is sent to receiving terminal, with so that receiving terminal is confirmed whether to have received all of
Packet, so receiving terminal is before receiving all packets, or after having received all packets,
Need to receive the packet number that each link can transmit, be confirmed whether to have received in order to receiving terminal
All of packet.Then receiving terminal is when receiving the packet number of each link transmission, needs root
It is received according to the packet number of this link transmission.Such as when the packet number of the first link transmission
When being 3, receiving terminal needs to receive could be bright when the number of the packet that the first link sends is 3
Really having received, when the packet number of the second link transmission is 5, receiving terminal needs to receive second
The packet number that link sends could receive when being 5 completely.The number of certain each link transmission
Can identical can also differ according to bag number.
When receiving terminal has stored the packet number that each link can transmit, then need not send out
Send the packet number that each link can transmit, such as, each link constant transmissions same number
Packet, and receiving terminal and transmitting terminal agreement is good, then send the packet of each link transmission
Number is not necessary to the step performed.Such as, when fixing each link transmission can transmit 3 packets,
Then receiving terminal is when receiving packet, and needing the packet number receiving on each link is 3.
Wherein, the method also includes:
Transmission feeds back to transmitting terminal, and wherein, feedback information is used for being confirmed whether to be successfully received this
The information of all packets of transmission on link.
It should be noted that when receiving terminal has received all packets, according to the number of each link transmission
According to bag number, can send and feed back to transmitting terminal, be properly received this link transmission in order to indicating whether
All packets.When receiving terminal does not receives packet, or the packet number that receiving terminal receives,
When the number of this packet transmission that should receive with receiving terminal differs, determine that receiving terminal receives packet
Failure.When receiving terminal does not receives packet, feedback information will not be sent;When the number that receiving terminal receives
It is 2 according to bag number, but the packet number transmitting transmission altogether on the link of this packet is 3, then connect
The feedback information that receiving end sends, instruction is not successfully received the packet on this link.Wherein it is desired to explanation
, feedback information can include the packet number being received, it is also possible to do not include being received
Packet number.Feedback information can only include the instruction information being not successfully received packet, certainly,
Feedback information can also both include the packet number being received, and the packet information received.Tool
The information content that the feedback information of body includes is not specifically limited, as long as being used to indicate whether to be properly received
Complete all packets, belong to protection scope of the present invention.
In sum, the data transmission method that the embodiment of the present invention provides, receiving each link transmission
Packet before, receive the packet number that this link can transmit, then according to this link transmission
Packet number, receive the packet number of this link transmission, when having received all packets,
And transmission feedback information has been properly received all packets in order to indicate;Then by each packet according to
Transmit the decipherment algorithm corresponding to the link of this packet and decipher each packet, by all packets
The packet that file identification is identical is integrated according to Position Number, the data that final act mark is identical
Inclusion becomes a file, thus completes the transmission of packet.Because a file is divided into multiple packet,
And be received by multilink, thus add the safety and reliability of data transmission, and need
Each packet is decrypted by decipherment algorithm to be passed through so that data have confidentiality, and then increase
The security of data and confidentiality in data transmission procedure.Even if on link or many
Individual data are coated and crack, because unclear whole file has several packet, and each packet institute
At the Position Number of file, so whole file is unlikely to lose completely.
Below by specific embodiment, whole data transmission procedure is described.
See Fig. 3, the data transmission method that the embodiment of the present invention provides, the method includes:
This document, for each file needing transmission, is divided, obtains many by S301, transmitting terminal
Individual packet, each packet carries the file identification of this document and position in this document is compiled
Number;
The size wherein dividing, for each file needing transmission, the multiple packets obtained is identical.
According to load pressure and the network delay of each link, S302, transmitting terminal determine that each link can
With the packet number of transmission, it is sent to the packet number that each link can transmit receive simultaneously
End;
S303, transmitting terminal, according to the AES preset corresponding to each link, are encrypted on this link
Each packet of transmission;
The packet number that all packets can transmit according to each link is carried out by S304, transmitting terminal
Distribute to each link, then transmit all packets to receiving terminal;
S305, receiving terminal receive the packet number that each link can transmit;
Wherein the execution process of step S305 is not necessary to after step S304, transmits according to information
Speed, can be after step S303, or before step S303, or in step S303
During execution.
The number of the packet that this link that S306, receiving terminal send according to each link can transmit,
Receiving multiple packets of this link transmission, wherein, each packet carries literary composition belonging to this packet
The file identification of part and Position Number in this document;
S307, when receiving terminal receives packet, can pass according to this link that each link sends
The number of defeated packet, and the packet number of this link transmission that receiving terminal receives, send
Feed back to transmitting terminal;
After wherein transmission feedback information may be located at step S308, the present invention is not specifically limited.
S308, transmitting terminal receive the feedback information that receiving terminal sends, and send when not receiving arbitrary link
Feedback information, or receive receiving terminal and be not successfully received the feedback information of the packet on this link
Time, it is determined that retransmit link, and again transmit, by this re-transmission link, the packet being not successfully received;
S309, receiving terminal receive the packet being not successfully received again;
S3010, receiving terminal, according to the decipherment algorithm preset corresponding to each link, decipher this link
Each packet of upper transmission;
S3011, receiving terminal are according to the Position Number of the identical packet of file identification, by file identification
Identical packet one file of synthesis.
To sum up, it is divided into multiple packet according to by each file needing transmission, and each packet is taken
With file identification and the Position Number in this document of file belonging to this packet, and according to multiple
Link is transmitted, simultaneously according to the password encryption corresponding to each link, so that packet exists
Even if one or more is cracked or reveals in transmitting procedure, also it is unlikely to lose whole file
Lose.Even if because deciphering one or more packet, not knowing that whole file includes several data yet
Bag, or do not know not have the position of file that packet is positioned at this packet place.Therefore the present invention
The data transmission method that embodiment provides, increases security and the confidentiality of data transmission.
See Fig. 4, a kind of data transmission device that the embodiment of the present invention provides, this device includes:
First module 41, for for each file needing transmission, this document being divided,
To multiple packets, each packet carries file identification and the position in this document of this document
Numbering;
Second unit 42, for determining the number of packet that each link can transmit, and according to often
All described allocation of packets enter to different links by the number of the packet that one link can transmit
Row transmission.
It is preferred that second unit 42 is additionally operable to:
According to the AES preset corresponding to each link, encrypt each number of transmission on this link
According to bag.
It is preferred that divide the size phase of the multiple packets obtained for each file needing transmission
With.
It is preferred that second unit 42 determines the number of the packet that each link can transmit, specifically
For:
Load pressure according to each link and network delay, determine the data that this link can transmit
The number of bag.
It is preferred that second unit 42 is after determining the number of packet that each link can transmit,
It is additionally operable to:
Send the number of the packet that described each link can transmit to receiving terminal.
It is preferred that second unit 42 is additionally operable to:
In Preset Time, wait the feedback information that arbitrary described link to be received sends, wherein, described
Feedback information is that receiving terminal is sent by this link, is used for being confirmed whether to be successfully received this link
The information of all packets of transmission.
It is preferred that second unit 42 is additionally operable to:
When, in described Preset Time, not receiving the feedback information that arbitrary link sends, or receive
When receiving terminal is not successfully received the feedback information of the packet on this link, it is determined that retransmit link, and
Again the packet being not successfully received is transmitted by this re-transmission link.
See Fig. 5, the another kind of data transmission device that the embodiment of the present invention provides, this device includes:
3rd unit 51, for receiving multiple packets of each link transmission, wherein, each data
Bag carries file identification and the Position Number in this document of file belonging to this packet;
4th unit 52, for the Position Number of the packet identical according to file identification, by files-designated
Sensible same packet one file of synthesis.
It is preferred that the 4th unit 52 is according to the Position Number of the identical packet of file identification, by literary composition
Before packet one file of synthesis that part mark is identical, it is additionally operable to:
According to the decipherment algorithm preset corresponding to each link, decipher each number of transmission on this link
According to bag.
It is preferred that before the 3rd unit 51 receives multiple packets of each link transmission, be additionally operable to:
Receive the number of packet that this link that each link sends can transmit;
Multiple packets of each link transmission of described reception specifically include:
The number of the packet that this link sent according to each link can transmit, receives this link and passes
Defeated multiple packets.
It is preferred that the 4th unit 52 is additionally operable to:
Transmission feeds back to transmitting terminal, and wherein, described feedback information is used for being confirmed whether to be properly received
The information of all packets of transmission on this link.
In sum, the data transmission method that the embodiment of the present invention provides, first need transmission by each
File be divided into multiple packet, and each packet carries the files-designated of file belonging to this packet
Know and Position Number in this document, then according to multiple link is transmitted, simultaneously according to each
AES corresponding to link is encrypted, the packet that finally can transmit according to each link
Number transmit all packets, even if so that packet in transmitting procedure, one or more is broken
Solve or reveal, be also unlikely to lose whole file.Even if because deciphering one or more data
Bag, does not knows that whole file includes several packet yet, or does not knows do not have packet to be positioned at this number
Position according to the file at bag place.Therefore the data transmission method that the embodiment of the present invention provides, increases number
According to security and the confidentiality of transmission, and reliability.
Device embodiment described above is only schematically, wherein said illustrates as separating component
Unit can be or may not be physically separate, the parts shown as unit can be or
Person may not be physical location, i.e. may be located at a place, or can also be distributed to multiple network
On unit.Some or all of module therein can be selected according to the actual needs to realize the present embodiment
The purpose of scheme.Those of ordinary skill in the art are not in the case of paying performing creative labour, the most permissible
Understand and implement.
Through the above description of the embodiments, those skilled in the art is it can be understood that arrive each reality
The mode of executing can add the mode of required general hardware platform by software and realize, naturally it is also possible to by firmly
Part.Based on such understanding, the portion that prior art is contributed by technique scheme the most in other words
Dividing and can embody with the form of software product, this computer software product can be stored in computer can
Read in storage medium, such as ROM/RAM, magnetic disc, CD etc., including some instructions with so that one
Computer equipment (can be personal computer, server, or the network equipment etc.) performs each to be implemented
The method described in some part of example or embodiment.
Last it is noted that above example is only in order to illustrate technical scheme, rather than to it
Limit;Although the present invention being described in detail with reference to previous embodiment, the ordinary skill of this area
Personnel it is understood that the technical scheme described in foregoing embodiments still can be modified by it, or
Person carries out equivalent to wherein portion of techniques feature;And these amendments or replacement, do not make corresponding skill
The essence of art scheme departs from the spirit and scope of various embodiments of the present invention technical scheme.