Summary of the invention
In order to address the above problem; The object of the present invention is to provide the method for reseptance of a kind of multicast package (multi-cast package); Utilize the temporary multicast package that receives in space of memory body or storage facilities, to collect out of order multicast package and it is organized back useful data block.And for the multicast package of losing, the method for reseptance of multicast package also can require transmitting terminal to retransmit required multicast package according to the packet loss ratio, also avoids wasting the situation of the data that received meaninglessly.
In order to achieve the above object, the present invention provides a kind of method of reseptance of multicast package, and it is in order to receive a plurality of multicast packages from a transmitting terminal.The method of reseptance of multicast package comprises: one sets up the step of buffer memory (buffer) subregion, in a memory body, creates (create) a plurality of cache partitions; One writes the step of cache partitions with package, and at least one multicast package of the data block (data block) that belonging to of receiving is identical writes identical cache partitions in regular turn; The step of one writing data blocks; The multicast package of the data block under in arbitrary cache partitions has received when complete; The all-multicast package decompression that receives complete cache partitions is combined into affiliated data block; The data block that is combined into is write a storage facilities, and empty the complete cache partitions of reception; And the step of a request retransmission, do not receive complete cache partitions for the multicast package of arbitrary non-NULL and affiliated data block, send a repeat requests to transmitting terminal.
The step that wherein " package is write cache partitions " also can comprise: when the data block under the multicast package that receives does not correspond to arbitrary cache partitions, carry out following steps: the cache partitions of seeking a sky; And deposit the multicast package that receives in empty cache partitions.
The step that " package is write cache partitions " also can comprise: the data block under the multicast package that receives does not correspond to arbitrary cache partitions; And when can not find empty cache partitions, carry out following steps: with existing cache partitions at most to write subregion in the memory body as one; The all-multicast package that writes subregion is write storage facilities; Empty and write subregion; And the multicast package that receives deposited in write subregion.
Wherein the step of " the all-multicast package that will write subregion writes storage facilities " can comprise: when having in the storage facilities when writing the corresponding arbitrary package of subregion; Carry out following step: when storage facilities and the multicast package that writes the data block under the subregion have received when complete; The all-multicast package decompression of data block is combined into data block, and the data block that is combined into is write storage facilities; And the multicast package of working as storage facilities and writing the data block under the subregion do not receive when complete, with the all-multicast package that the writes subregion storage facilities that writes direct.
The step of " the all-multicast package that will write subregion writes storage facilities " also can comprise: when in the storage facilities not when writing the corresponding arbitrary package of subregion, with the all-multicast package that the writes subregion storage facilities that writes direct.
Implement example according to one, the step of " request retransmission " can be when beginning to collect first multicast package of different data blocks, to carry out.Implement example according to another, the step of " request retransmission " then can be that a life period in arbitrary cache partitions is carried out during greater than a cache-time critical value.
In addition, the step of " request retransmission " also can comprise: when arbitrary life period greater than a packet loss ratio of the cache partitions of cache-time critical value during greater than a packet loss critical value, send the repeat requests of the all-multicast package that requires heavily to send data block to transmitting terminal; And when the packet loss ratio is not more than the packet loss critical value, send the repeat requests that requires heavily to send at least one incomplete multicast package to transmitting terminal.
In sum, the method for reseptance of multicast package utilizes the temporary multicast package that receives in the space of memory body or storage facilities, to collect out of order multicast package and it is organized back useful data block.And for the multicast package of losing, the method for reseptance of multicast package also can require transmitting terminal to retransmit required multicast package according to the packet loss ratio, also avoids wasting the situation of the data that received meaninglessly.
Describe the present invention below in conjunction with accompanying drawing and specific embodiment, but not as to qualification of the present invention.
Embodiment
Below in execution mode, be described in detail detailed features of the present invention and advantage; Its content is enough to make any those skilled in the art to understand technology contents of the present invention and implements according to this; And according to content, the claim scope and graphic that this specification disclosed, any those skilled in the art can understand purpose and the advantage that the present invention is correlated with easily.
The present invention is about the method for reseptance of a kind of multicast package (multi-cast package), and it is in order to receive a plurality of multicast packages from a transmitting terminal.Wherein (User datagram protocol UDP) transmits a plurality of multicast packages and gives a receiving terminal transmitting terminal user's data protocol capable of using.
Be one to implement the flow chart of method of reseptance of the multicast package of example please with reference to Fig. 1.Can see by Fig. 1 and to know that the method for reseptance of multicast package comprises: set up buffer memory (buffer) subregion (step S100), package is write cache partitions (step S200), writing data blocks (data block) (step S300) and request retransmission (step S400).
Step S100 creates (create) a plurality of cache partitions in a memory body of the computer of receiving terminal.At least one multicast package that step S200 will receive belongs to identical data block writes identical cache partitions in regular turn.Step S300 has received when complete at the multicast package of the data block under in arbitrary cache partitions; The all-multicast package decompression that receives complete cache partitions is combined into affiliated data block; The data block that is combined into is write a storage facilities, and empty the complete cache partitions of reception.Step S400 does not then receive complete cache partitions for the multicast package of arbitrary non-NULL and affiliated data block, sends a repeat requests to transmitting terminal.
Please with reference to Fig. 2 and Fig. 3, below the flow process of step S200 is detailed through Fig. 2 and Fig. 3.Fig. 2 and Fig. 3 are respectively the flow chart of the step S200 of an enforcement example, and the flow chart of the step S216 among Fig. 2.
At first receiving terminal can judge earlier that whether data block under the multicast package of reception is corresponding to arbitrary cache partitions (step S210).When the data block under the multicast package that receives during corresponding to one of cache partitions, before the expression so that the multicast package that received corresponding same data block to be arranged.The multicast package that belongs to identical data block that therefore will receive writes identical cache partitions (step S211) in regular turn.And after step S211, can judge whether the all-multicast package of the data block of correspondence is collected, again execution in step S300 according to this.
And when the data block under the multicast package that receives does not correspond to arbitrary cache partitions, can seek the cache partitions (step S212) of a sky earlier; And judge whether to find empty cache partitions (step S213).If the cache partitions of still having time in the memory body just deposits the multicast package that receives in empty cache partitions (step S214).
And when can not find empty cache partitions, can be with existing at most cache partitions as writing subregion (step S215) in the memory body, and the all-multicast package that will write subregion writes storage facilities (step S216).Wherein storage facilities can for example be the hard disk or the virtual memory body of the computer of receiving terminal.The data backup of the multicast package that writes subregion behind storage facilities, is just emptied and writes subregion (step S217), and the multicast package that will newly receive again deposits in and writes subregion (step S218).
That is to say that the method for reseptance of multicast package can be noted down a life period of each cache partitions.When memory body is not enough, can with first in first out (first in first out, mode FIFO) is moved into the data of cache partitions in the storage facilities, the data that will newly receive again are stored in the memory body.
In an enforcement example, above-mentioned steps S216 (the all-multicast package that will write subregion writes storage facilities) also can comprise a plurality of steps of Fig. 3.
Before data are write storage facilities, can judge earlier to have or not the arbitrary package (step S220) corresponding in the storage facilities with writing subregion.That is to say whether existing package corresponding to same data block has been written among the storage facilities before judging.When in the storage facilities not when writing the corresponding arbitrary package of subregion, can be with the all-multicast package that the writes subregion storage facilities (step S221) that writes direct.It should be noted that only be that these multicast packages that do not decompress are temporary in storage facilities this moment.For fear of other data that have influence in the storage facilities, can write the predetermined position that will deposit its corresponding data block in the storage facilities this moment with these multicast packages.
And when having in the storage facilities when writing the corresponding arbitrary package of subregion, whether the multicast package that can judge storage facilities and write the data block under the subregion has received complete (step S222).If complete, can the all-multicast package of data block be decompressed and be combined into data block, and the data block that is combined into is write storage facilities (step S223).This moment, receiving terminal was that the multicast package that will be temporary in storage facilities and cache partitions is respectively read, and was combined into complete data block, again this data block was override the multicast package that originally is temporary in storage facilities.In more detail, after the all-multicast package of being read is combined, is extracted again and contracts to obtain complete data block.Relatively, when storage facilities and the multicast package that writes the data block under the subregion do not receive when complete, can be with the all-multicast package that the writes subregion storage facilities (step S224) that writes direct.
According to above-mentioned flow process, the mechanism of the dual buffer memory that the method for reseptance of multicast package can be through memory body and storage facilities solves the existing middle out of order problem of package effectively.
In addition, the method for reseptance of multicast package also can solve the problem that existing middle package is lost with step S400.Implement example according to one, step S400 (step of " request retransmission ") carries out when beginning to collect first multicast package of different data blocks.Implement example according to another, step S400 then can be that life period in arbitrary cache partitions is carried out during greater than a cache-time critical value.In other words, step S400 judges whether and need propose repeat requests to transmitting terminal in the time need the data of a cache partitions being write storage facilities.
Please with reference to Fig. 4, it is to be the flow chart of the step S400 of an enforcement example.
Receiving terminal can judge arbitrary life period greater than a packet loss ratio of the cache partitions of cache-time critical value whether greater than packet loss critical value (step S410).Wherein the packet loss ratio can be 1 to deduct the quantity of the multicast package that this cache partitions in the processing has, and the ratio of the quantity of all multicast package of the corresponding data block of cache partitions.For example be cut into the transmission of 100 multicast packages altogether when a data block, and receiving terminal is when only receiving 90 at present, the packet loss ratio is 1-90/100=10%.
When packet loss ratio during greater than a packet loss critical value, receiving terminal can send the repeat requests (step S420) of the all-multicast package that requires heavily to give this data block to transmitting terminal.And when the packet loss ratio is not more than the packet loss critical value, then can send the repeat requests (step S430) that requires heavily to send at least one incomplete multicast package to transmitting terminal.That is to say, when the packet loss ratio is little, can only require transmitting terminal heavily to send the multicast of losing package.But if the packet loss ratio is big, then can directly require heavily to send whole data block, network and transmitting terminal caused too big burden with the file header extra parts such as (header) of avoiding the multicast package.
Below cooperate Fig. 5 A to Fig. 8 that real example is described.
Fig. 5 A, Fig. 5 B and Fig. 5 C are the sketch mapes that receives, takes place the multicast package of out of order and generation packet loss for normal.Wherein suppose multicast packages 20 such as A0, A1 and An corresponding to a data block (below be called data block A), multicast packages 20 such as B0, B1 and Bn are corresponding to another data block (below be called data block B).Out of order situation has taken place in the multicast package 20 of the An of Fig. 5 B and B1, and the multicast package 20 of the A2 of Fig. 5 C and Bn-1 has then been lost.
For out of order situation, receiving terminal can deposit same multicast package 20 corresponding to data block A and data block B in corresponding cache subregion 32 respectively, and is as shown in Figure 6.After cache partitions 32 collects corresponding multicast package 20, but just execution in step S300 contracts its decompress(ion) and is integrated into data block, writes data block among the storage facilities 40 again.Even comparatively complicated example such as Fig. 7 also can solve out of order problem through a plurality of cache partitions 32.
The multicast package 20 of A1 and B2 has been lost among Fig. 7.Because the packet loss ratio is not high, therefore can only ask transmitting terminal heavily to give these two the multicast packages of losing 20.A1 that is heavily sent and B2 also are written into corresponding cache subregion 32 according to the method for reseptance of multicast package.Wherein therefore A1 corresponding cache subregion 32 collects the all-multicast package 20 of corresponding data block A, and deposits data block A in storage facilities 40.
And follow enforcement example with reference to figure 8.When receiving the multicast package 20 of D0 because the insufficient space of memory body 30, receiving terminal based on first in first out with the write direct temporarily providing room 42 of storage facilities of the data of data block A corresponding cache subregion 32.And as aforementioned, only be temporary with these multicast packages 20 that does not decompress this moment, and can these multicast packages 20 be write predetermined position of wanting store data piece A in the storage facilities 40.
The multicast package 20 of D0 and D1 just can write the spatial cache 32 that is cleared.When receiving terminal is found to be stored in the A1 (the transmitting terminal by-carriage) of spatial cache 32 and is stored in other multicast package 20 of temporarily providing room 42 of storage facilities when complete; Just can these multicast packages 20 that be temporary in storage facilities 40 and cache partitions 32 be read; Compressor units generated data piece A overrides the data in the temporarily providing room 42 that originally is temporary in storage facilities with data block A again.
In sum; The method of reseptance of multicast package can utilize the incomplete data block of high speed processing ability buffer memory (just not receiving complete multicast package) of memory body; And effectively solve the out of order false packet loss problem that causes of packet receiving, and can not exert an influence to data transmission bauds.And the big capacity that utilizes storage facilities is kept in the method for imperfect data, can handle the very poor and situation of a large amount of packet losses of network condition, and then improves the transmission success rate of multicast package.In addition, require to retransmit whole data block or the retransmission mechanism of the multicast package of losing through modes such as packet loss ratios, the method for reseptance of multicast package can effectively reduce the network communication amount, improves efficiency of transmission, and reduces offered load.
Certainly; The present invention also can have other various embodiments; Under the situation that does not deviate from spirit of the present invention and essence thereof; Those of ordinary skill in the art work as can make various corresponding changes and distortion according to the present invention, but these corresponding changes and distortion all should belong to the protection range of the appended claim of the present invention.