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 receiving in space of memory body or storage facilities, to collect out of order multicast package and to be 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 packet loss ratio, also avoids wasting the situation of the data that received meaninglessly.
In order to achieve the above object, the invention provides a kind of method of reseptance of multicast package, it is in order to receive multiple multicast packages from a transmitting terminal.The method of reseptance of multicast package comprises: one sets up the step of buffer memory (buffer) subregion, creates (create) multiple cache partitions in a memory body; Package is write the step of cache partitions by one, and at least one multicast package of a data block (data block) identical belonging to of receiving is sequentially write to identical cache partitions; The step of one writing data blocks, the multicast package of the data block under in arbitrary cache partitions has received when complete, the data block that the all-multicast package that receives complete cache partitions is decompressed under being combined into, the data block being combined into is write to 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 to cache partitions " also can comprise: in the time that the data block under the multicast package receiving does not correspond to arbitrary cache partitions, carry out following steps: find an empty cache partitions; And deposit the multicast package of reception in empty cache partitions.
The step that " package is write to cache partitions " also can comprise: the data block under the multicast package receiving does not correspond to arbitrary cache partitions, and while can not find empty cache partitions, carry out following steps: will in memory body, exist cache partitions at most to write subregion as one; The all-multicast package that writes subregion is write to storage facilities; Empty and write subregion; And the multicast package of reception is deposited in and writes subregion.
The step that wherein " the all-multicast package that writes subregion is write to storage facilities " can comprise: when having in storage facilities when writing arbitrary package corresponding to subregion, carry out following step: when storage facilities and the multicast package that writes the data block under subregion have received when complete, the all-multicast package of data block is decompressed and is combined into data block, and the data block being combined into is write to storage facilities; And the multicast package of working as storage facilities and writing the data block under subregion do not receive when complete, by the all-multicast package that the writes subregion storage facilities that writes direct.
The step that " the all-multicast package that writes subregion is write to storage facilities " also can comprise: when in storage facilities not when writing arbitrary package corresponding to subregion, by the all-multicast package that the writes subregion storage facilities that writes direct.
According to an enforcement example, the step of " request retransmission " can be to carry out in the time starting to collect first multicast package of different data blocks.Implement example according to another, the step of " request retransmission " can be to carry out in the time that a life period of arbitrary cache partitions is greater than a cache-time critical value.
In addition, the step of " request retransmission " also can comprise: when a packet loss ratio that is greater than the cache partitions of cache-time critical value when arbitrary life period is greater than a packet loss critical value, send the repeat requests that requires the all-multicast package that heavily send data block to transmitting terminal; And in the time that packet loss ratio is not more than 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 receiving in the space of memory body or storage facilities, to collect out of order multicast package and to be 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 packet loss ratio, also avoids wasting the situation of the data that received meaninglessly.
Describe the present invention below in conjunction with the drawings and specific embodiments, but not as a limitation of the invention.
Embodiment
In execution mode, describe below detailed features of the present invention and advantage in detail, its content is enough to make any those skilled in the art understand technology contents of the present invention and implement according to this, and according to the disclosed content of this specification, claim scope and graphic, any those skilled in the art can understand object and the advantage that the present invention is relevant 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 multiple multicast packages from a transmitting terminal.Wherein transmitting terminal can utilize user's data protocol (User datagram protocol, UDP) to transmit multiple multicast packages to a receiving terminal.
Please refer to Fig. 1 is the flow chart of the method for reseptance of the multicast package of an enforcement example.Can be seen and be known by Fig. 1, the method for reseptance of multicast package comprises: set up buffer memory (buffer) subregion (step S100), package is write to cache partitions (step S200), writing data blocks (data block) (step S300) and request retransmission (step S400).
Step S100 creates (create) multiple cache partitions in a memory body of the computer of receiving terminal.At least one multicast package of the data block identical belonging to of reception is sequentially write identical cache partitions by step S200.Step S300 has received when complete at the multicast package of the data block under in arbitrary cache partitions, the data block that the all-multicast package that receives complete cache partitions is decompressed under being combined into, the data block being combined into is write to a storage facilities, and empty the complete cache partitions of reception.Step S400 does not receive complete cache partitions for the multicast package of arbitrary non-NULL and affiliated data block, sends a repeat requests to transmitting terminal.
Please refer to Fig. 2 and Fig. 3, below by Fig. 2 and Fig. 3 in detail the flow process of step S200 is described in detail.Fig. 2 and Fig. 3 are respectively the flow chart of the step S200 of an enforcement example, and the flow chart of step S216 in Fig. 2.
First receiving terminal can first judge that whether data block under the multicast package of reception is corresponding to arbitrary cache partitions (step S210).Data block under the multicast package receiving is during corresponding to one of cache partitions, before representing there to be the multicast package that received corresponding same data block.Therefore the multicast package of the data block identical belonging to of reception is sequentially write to identical cache partitions (step S211).And after step S211, can judge whether the all-multicast package of corresponding data block to be collected, then perform step S300 according to this.
And in the time that the data block under the multicast package receiving does not correspond to arbitrary cache partitions, can first find an empty cache partitions (step S212); And judge whether to find empty cache partitions (step S213).If free cache partitions still in memory body, just deposit the multicast package of reception in empty cache partitions (step S214).
And in the time can not find empty cache partitions, can will in memory body, exist cache partitions at most as writing subregion (step S215), and the all-multicast package that writes subregion be write to storage facilities (step S216).Wherein storage facilities can be for example hard disk or the virtual memory body of the computer of receiving terminal.The data backup of multicast package that writes subregion, after storage facilities, is just emptied and writes subregion (step S217), then the multicast package newly receiving is deposited in and writes subregion (step S218).
That is to say, the method for reseptance of multicast package can be noted down a life period of each cache partitions.In the time that memory body is not enough, can the data of cache partitions be moved in storage facilities in the mode of first in first out (first in first out, FIFO), then the data that newly receive are stored in memory body.
In an enforcement example, above-mentioned steps S216 (the all-multicast package that writes subregion is write to storage facilities) also can comprise multiple steps of Fig. 3.
Before data are write to storage facilities, can first judge and in storage facilities, have or not the arbitrary package (step S220) corresponding with writing subregion.That is to say whether have and be written among storage facilities corresponding to the package of same data block before judgement.When in storage facilities not when writing arbitrary package corresponding to subregion, storage facilities (step S221) can write direct the all-multicast package that writes subregion.It should be noted that it is only now that the multicast package that these are not decompressed is temporary in storage facilities.For fear of other data that have influence in storage facilities, now these multicast packages can be write to the predetermined position that will deposit its corresponding data block in storage facilities.
And when having in storage facilities when writing arbitrary package corresponding to subregion, whether the multicast package that can judge storage facilities and write the data block under subregion has received complete (step S222).If complete, the all-multicast package of data block can be decompressed and is combined into data block, and the data block being combined into is write to storage facilities (step S223).Now receiving terminal is respectively the multicast package that is temporary in storage facilities and cache partitions to be read, and is combined into complete data block, then this data block is override to the multicast package that is originally temporary in storage facilities.In more detail, after the all-multicast package being read out is combined, more decompressed to obtain complete data block.Relatively, when storage facilities and the multicast package that writes the data block under subregion do not receive when complete, storage facilities (step S224) can write direct the all-multicast package that writes subregion.
According to above-mentioned flow process, the method for reseptance of multicast package can solve the out of order problem of existing middle package effectively by the mechanism of the dual buffer memory of memory body and storage facilities.
In addition, the method for reseptance of multicast package also can solve the problem that existing middle package is lost with step S400.According to an enforcement example, step S400 (step of " request retransmission ") carries out in the time starting to collect first multicast package of different data blocks.Implement example according to another, step S400 carries out in the time that the life period of arbitrary cache partitions is greater than a cache-time critical value.In other words, step S400 judges whether to propose repeat requests to transmitting terminal in the time the data of a cache partitions need to being write to storage facilities.
Please refer to Fig. 4, it is the flow chart for the step S400 of an enforcement example.
Receiving terminal can judge whether the packet loss ratio that arbitrary life period is greater than the cache partitions of cache-time critical value is greater than packet loss critical value (step S410).Wherein packet loss ratio can be 1 to deduct the quantity of the multicast package that this cache partitions in processing has, and the ratio of the quantity of all multicast package of data block corresponding to cache partitions.For example be cut into altogether the transmission of 100 multicast packages when a data block, and receiving terminal is while only receiving 90 at present, packet loss ratio is 1-90/100=10%.
In the time that packet loss ratio is greater than a packet loss critical value, receiving terminal can send the repeat requests (step S420) that requires the all-multicast package that heavily gives this data block to transmitting terminal.And in the time that packet loss ratio is not more than packet loss critical value, 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, in the time that packet loss ratio is little, can only require transmitting terminal heavily to send the multicast package of loss.If but packet loss ratio is large, can directly require heavily to send whole data block, to avoid the extra parts such as the file header (header) of multicast package to cause too large burden to network and transmitting terminal.
Below coordinate Fig. 5 A to Fig. 8 that actual example is described.
Fig. 5 A, Fig. 5 B and Fig. 5 C are the schematic diagrames of the multicast package for normally receiving, occur out of order and generation packet loss.Wherein suppose that the multicast packages 20 such as A0, A1 and An are corresponding to a data block (hereinafter referred to as data block A), the multicast packages 20 such as B0, B1 and Bn are corresponding to another data block (hereinafter referred to as data block B).There is out of order situation in the multicast package 20 of the An of Fig. 5 B and B1, the multicast package 20 of the A2 of Fig. 5 C and Bn-1 has been lost.
For out of order situation, receiving terminal can will deposit corresponding cache partitions 32 in corresponding to the multicast package 20 of data block A and data block B respectively equally, as shown in Figure 6.After cache partitions 32 collects corresponding multicast package 20, just can perform step S300 its decompress(ion) is contractd and is integrated into data block, then data block is write among storage facilities 40.Even comparatively complicated example, as Fig. 7, also can solve out of order problem by multiple cache partitions 32.
In Fig. 7, the multicast package 20 of A1 and B2 has been lost.Because packet loss ratio is not high, therefore can only ask transmitting terminal heavily to give the multicast package 20 of these two loss.The A1 heavily being sent and B2 are also written into corresponding cache partitions 32 according to the method for reseptance of multicast package.Therefore the cache partitions 32 that wherein A1 is corresponding collects the all-multicast package 20 of corresponding data block A, and deposits data block A in storage facilities 40.
And follow the enforcement example with reference to figure 8.In the time receiving the multicast package 20 of D0, due to the insufficient space of memory body 30, receiving terminal based on first in first out by the write direct temporarily providing room 42 of storage facilities of the data of cache partitions corresponding data block A 32.And as aforementioned, be only now the temporary multicast package 20 that these are not decompressed, and these multicast packages 20 can be write to predetermined position of wanting store data piece A in storage facilities 40.
The multicast package 20 of D0 and D1 just can write the spatial cache 32 being cleared.When receiving terminal is found to be stored in the A1 (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 these multicast packages 20 that are temporary in storage facilities 40 and cache partitions 32 can be read, compressor units generated data piece A, then data block A is override to the data in the temporarily providing room 42 that is originally temporary in storage facilities.
In sum, the method of reseptance of multicast package can utilize the incomplete data block of high speed processing ability buffer memory (namely not receiving complete multicast package) of memory body, and effectively solve the out of order false packet loss problem causing of packet receiving, and can not exert an influence to data transmission bauds.And utilize the large capacity of storage facilities to keep in the method for imperfect data, can process the very poor and situation of a large amount of packet losses of network condition, and then improve the transmission success rate of multicast package.In addition, require the retransmission mechanism of the multicast package that retransmits whole data block or loss by modes such as packet loss ratios, the method for reseptance of multicast package can effectively reduce network communication amount, improves efficiency of transmission, and reduces offered load.
Certainly; the present invention also can have other various embodiments; in the situation that not deviating from spirit of the present invention and essence thereof; those of ordinary skill in the art are when making according to the present invention various corresponding changes and distortion, but these corresponding changes and distortion all should belong to the protection range of the appended claim of the present invention.