Background technology
Along with multimedia communication and amusement become the part that people live, Internet video is becoming the hot topic on the Internet.With respect to traditional internet, applications, video stream traffic need be supported a large amount of concurrent users usually, needs to consume the more network bandwidth simultaneously, and the appearance of peer-to-peer network technology, has solved the problems referred to above of Internet video.
Gossip is a kind of main communication mechanism of node in the peer-to-peer network, in peer-to-peer network, when each node and other node communications, all the information of other nodes that this nodal information and this node are obtained all sends to the other side, mechanism by constantly mutual transmission information between this node, all nodes in the peer-to-peer network finally can obtain the information of other all nodes, realize resource-sharing.In addition, also can transmit information by the mode of searching that floods between each node of peer-to-peer network, in this mode, each node all sends to all nodes that can communicate by letter with it with self information, like this, also can realize resource-sharing between each node.
(Video-On-Demand VOD) is exactly a kind of implementation that multimedia resource is shared in the peer-to-peer network in video request program.In the VOD business, when certain user A lands the VOD server and selects to watch certain program A of, user A client is equivalent to generate a node A in peer-to-peer network, this VOD server can be added into node A in the peer-group, and all nodes in this peer-group are all being watched program A, node A can establish a connection with the node in this group then, realizes resource-sharing.In playing process, the program fragment of the required broadcast of local node can arrive the download of central server end or download in the buffer memory of all the other nodes according to the message that all the other nodes in this group send over, and each preferential fragment of downloading the urgent need download of the fragment of closelying follow current broadcast.
Present VOD can realize the user after one section download postpones to wait for, realizes the VOD service of " watching while downloading ".But, if support in the VOD business that the user carries out video tape recorder (Video CassetteRecording, VCR) operation, broadcast when being displaying video, time-out, precedingly drag, after drag, operation such as F.F., rewind down, then in the process of displaying video, the frequent VCR operation of user can bring very big download to postpone, thereby influences watching of user.In order to address this problem, just need in the VOD technology, adopt prefetching technique.
Prefetching technique is a local node under the prerequisite that guarantees the current normal play of user, utilizes to download some users in the buffer memory of all the other nodes of unnecessary bandwidth in same peer-group or the central server in advance and may need the fragment play future.The fragment of wherein, looking ahead is all the other fragments the fragment of downloading except that the fragment and the urgent need of current broadcast.As shown in Figure 1, suppose with a minister to be that 100 minutes program is divided into 100 fragments store, each fragment playing duration is 1 minute, if the current broadcast of local node is the 5th minute fragment, the fragment number of stipulating to look ahead is 1, the fragment of then being badly in need of downloading is the 6th a minute fragment immediately following the fragment of current broadcast, prefetching technique is under the prerequisite that guarantees preferential the 6th minute fragment of downloading the 5th minute fragment and being badly in need of downloading, utilize the unnecessary bandwidth of local network to look ahead a certain fragment except that the 5th minute fragment and the 6th minute fragment in advance in the buffer memory of all the other nodes or in the central server (because 1-4 minute fragment had just been play according to certain specific strategy, therefore also exist in the buffer memory of this node, do not need to look ahead).Existing forecasting method mainly contains: order forecasting method, forecasting method and the most rare forecasting method of the overall situation at random.
The order forecasting method refers to according to look ahead in proper order fragment after the fragment of be badly in need of downloading of the normal play of program, program as shown in Figure 1, if current plays clip is the 5th minute a fragment, the fragment number of stipulating to look ahead is 1, because the 6th minute fragment needs preferential the download for the fragment of being badly in need of downloading, what obtain after therefore adopting sequential grammar to look ahead is the 7th minute fragment.As seen, the order forecasting method is not looked ahead according to VOD user's VCR behavior, and therefore, prefetch hit rate is lower, does not fundamentally solve because the download delay issue that the frequent VCR operation of user brings.
Forecasting method refers to utilize the fragment that the unnecessary bandwidth of local node is looked ahead in advance at random also not to be had in the buffer memory of local node in the buffer memory of adjacent node at random.As seen, looking ahead at random has blindness, and the result that looks ahead and programme content and user watch custom not have inner link, and therefore, prefetch hit rate is low.
The most rare forecasting method of the overall situation refers to that local node obtains the global information of network earlier by central server, local node utilizes unnecessary bandwidth then, the fragment that other nodes all do not look ahead of in central server, looking ahead, the fragment of the prefetched least number of times of perhaps in the buffer memory of all the other nodes, looking ahead.The shortcoming of this scheme is to obtain global information by central server, is not suitable for distributed peer-to-peer network.Simultaneously, that the most rare fragment of the overall situation that is prefetched to might not be the popular fragment that needs in the network or the fragment of this user VCR action need, so prefetch hit rate is low.
As seen, because existing prefetching technique is not all considered user's the VCR operating habit and the content of program, so prefetch hit rate is low, can not effectively reduce the download delay issue that user VCR operation brings.
Embodiment
The embodiment of the invention provides a kind of program fragment prefetching method, comprising:
The network node of request program is that index search first is play the record sheet and/or the second broadcast record sheet with the corresponding identification string of the program fragment of the current broadcast of this node, matches at least one entry; Wherein, described first plays record sheet is used to write down the broadcast state information of playing other network node of same program with this section point, and the corresponding program fragment that described broadcast state information comprises the program fragment that corresponding joint nexus play at least identifies; Described second plays record sheet is used for before this request program of minute book node the program fragment sign of request program; Described first plays record sheet and second plays each program fragment that record sheet adopts identical program fragment identification method sign to play;
Obtain local cache and program fragments that occurrence number is maximum in the described entry sign that is not included in this node from described at least one entry, the program fragment that described program fragment sign is corresponding is as looking ahead fragment and looking ahead.
Below with specific embodiment said method is elaborated:
Embodiment 1
In the Internet video to each fragment of a program watch rate inhomogeneous, and, always have the portion of hot point fragment that can attract spectators, so user's broadcast situation has all certain rules to seek for a specific program.Present embodiment provides a kind of forecasting method of program fragment from programme content.
In the method that present embodiment provides: each node of watching same program uses the mode of searching that floods that the broadcast state information of local node is sent other nodes that are connected with this node according to the setting-up time cycle, and perhaps each node uses Gossip mode periodically the first broadcast record sheet of this locality preservation to be sent to other nodes that are connected with this node; Each node receives broadcast state information or first that other nodes send over play record sheet after: be generated as first according to the broadcast state information of other each nodes that receive and play record sheet, and preserve from this locality first play the corresponding record item that matches the corresponding identification string that comprises self current plays clip the record sheet; From the corresponding record item that matches, select and be not included in the corresponding program fragment of the maximum corresponding program fragment sign of entry in the local cache and affiliated as looking ahead fragment and looking ahead.
Each node broadcast state information comprises node identification at least, broadcast program fragment sequence string identifies and timestamp.
Wherein, node identification is the constant mark or the temporary mark of each node in the peer-to-peer network, and for example the network ID of available this node is represented.
Broadcast program fragment identification string is that present node is from beginning to watch the broadcast record that generates this node of this broadcast state information moment.For example, establish a program 1 minute to be that unit carries out segmentation and each fragment that will be divided into is numbered in proper order by the program normal play, each numbering is the sign of the program fragment of each minute, if the program fragment identification string that certain node is carved at a time is: 1,2,3,4,5,6,7,8,11,12,13,14,15,7,8, then this broadcast program fragment identification string represents that the user of this node watches (not carrying out the VCR operation) from the program beginning always, be dragged to the 11st minute before when seeing the 8th minute and begun to watch, towed back to the 7th minute when seeing the 15th minute again and watch, the current fragment of watching the 8th minute of this node users.In addition, each sheet segment identification of broadcast program fragment identification string is except can representing each segment number after this program is by the time segmentation, can also represent that each program fragment accounts for the percentage of whole program duration, for example, the content that last number 8 these node users of expression are being watched 8% place of this program total length in the broadcast of the front record.
Timestamp is the duration equal time information that the constantly corresponding or present node of current state information generation has been survived in network when the generation state information.
When certain node during as receiving terminal, this node is generated as first according to the broadcast state information of other each nodes that receive and plays record sheet and storage, and first plays in the record sheet and comprise some entries, every corresponding described broadcast state information of entry.Following table 1 is depicted as first schematic diagram of playing record sheet that certain node generates according to the state information of each node that receives, and this first is play in record sheet, sequential storage the broadcast state information of each node of receiving of this node:
Table 1
The sign of node 1 |
The broadcast record of node 1 |
Timestamp |
The sign of node 2 |
The broadcast record of node 2 |
Timestamp |
. . . . . . |
. . . . . . |
. . . .. . |
The sign of node N |
The broadcast record of node N |
Timestamp |
If it is L that first of node is play the quantity that comprises entry in the record sheet, as seen, the entry that first shown in the table 1 play in the record sheet is L=N.Consider the memory capacity of node, need preestablish the max-thresholds L of the entry quantity of the first broadcast record sheet
Max, for example establish L
MaxBe 10000, then a certain node receives after broadcast state information or first that other nodes send plays record sheet, upgrades first of local storage according to the broadcast state information of other each nodes or the entry in the playing list and plays record sheet.
Below be that example describes with a node according to first process of playing record sheet of broadcast state information updating this locality of other each nodes.Figure 2 shows that a node receives upgrades local first flow chart of playing record sheet after the broadcast state information of other each nodes, may further comprise the steps:
S201: the broadcast state information that receives other each nodes.
S202: judge whether the node identification in this broadcast state information that receives can match in the first broadcast record sheet that local node is preserved, if can match entry in the first broadcast record sheet that local node is preserved with same node point sign, then continue to carry out S203, otherwise carry out S210.
S203: whether the timestamp information that carries in the timestamp information in the corresponding record item that comparison match goes out and the broadcast state information of reception is identical, if both differences then continue to carry out S204, both identical S205 that then carry out.
S204: the corresponding record item that matches with the broadcast state information updating that receives.
S205: abandon the broadcast state information of current reception, the first broadcast record sheet that this locality is preserved does not upgrade processing.
S210: judge current first plays the max-thresholds whether the entry number of storing in the record sheet has reached setting, if then carry out S211, otherwise carry out S212.
S211: first play in the record sheet timestamp information from current time respective record item farthest with what the broadcast state information that receives replaced that local node preserves.
S212: add an entry, the broadcast state information of current reception is added in the local first broadcast record sheet of preserving.
Because corresponding one of every entry that first of each node is play in the record sheet is play state information, therefore, certain node is play record sheet according to first of other certain nodes that receive and is upgraded local first to play the process of record sheet identical with process shown in Figure 2, and it is first to play the entry in the record sheet that unique difference is broadcast state information change shown in Figure 2.When this node receives the first broadcast record sheet of a plurality of nodes, only need to play record sheet and successively the local first broadcast record sheet is upgraded according to first of each node, finish until renewal.
Behind the first broadcast record sheet that has upgraded this node, can play record sheet according to first after upgrading and carry out program fragment prefetching.Figure 3 shows that the program fragment prefetching method flow chart that present embodiment provides, prefetching process may further comprise the steps:
S301: the corresponding identification string of determining present node current playing program fragment.
For example, the homologous segment of current playing program fragment identification string is 3 fragments.
S302: all entries that from the first broadcast record sheet that preserve this locality, find out the corresponding identification string that comprises the current playing program fragment;
S303: from all entries that find out, select and be not included in the corresponding program fragment of program fragment signs in the local cache and that occurrence number is maximum in these entries as looking ahead fragment;
The program fragment quantity that need look ahead is at least one, and the program fragment quantity of looking ahead can be set according to user's needs of each node, for example, and 3 program fragments of can looking ahead.When the number of fragments of the fragment of looking ahead is an above fragment, the plays clip of a substring correspondence in the program fragment identification string of having play in the fragment of looking ahead each entry for the local first broadcast record sheet of preserving.
Preferably, because immediately following the program fragment of the fragment after the current playing program fragment for being badly in need of downloading, can predesignate the fragment of being badly in need of downloading in the general VOD system is preferentially to download, therefore, look ahead fragment can be not included in the local cache and be badly in need of to download the maximum corresponding program fragment of affiliated entry outside the fragment.
In addition, select to look ahead from the nearest fragment of current plays clip, and when entry quantity equates under determining a plurality of plays clip sequence strings, chosen distance is current broadcasts nearest homologous segment conduct of the fragment time fragment of looking ahead as far as possible.
S304: obtain the fragment of determining and being saved in the buffer memory of local node of looking ahead.
Present node can be downloaded the fragment that need look ahead in regular turn according to first program identification of playing in the entry that comprises the fragment of looking ahead in the record sheet in the buffer memory of corresponding node.
Like this, can directly from some adjacent nodes of present node, download the fragment that to look ahead, and no longer need to expend time of carrying out the whole network search and communication request to the download of looking ahead from this node node far away or server end, reduced the download delay of this node.And, because the fragment of looking ahead is the statistics of watching behavior to make of watching all user nodes of this program with certificate, therefore, the fragment that is prefetched to is some popular fragments of this program often, just should node users required see, therefore, for certain node users, the prefetch hit rate of the program forecasting method that the embodiment of the invention provides is higher.In addition, even not being this node users, the fragment that is prefetched to just in time do not need the fragment of watching, but from whole network, because the fragment of looking ahead is popular fragment, even present node does not need, other needed the node of this fragment to download rapidly near this node also can offer the fragment of fetching in advance this node, had further reduced the delay of whole network.
Be better explanation program fragment prefetching process shown in Figure 3, below be elaborated with object lesson.For example: following table 2 be depicted as carries out that certain node A generates before the fragment prefetching first play record sheet, this first plays the broadcast state information that has write down Node B, C, D, E, F, G, H, I in record sheet altogether.
Table 2
Node identification |
Play record | Timestamp |
B |
|
|
|
|
|
|
1,2,3,4,5,6,7,8 |
T1 |
C |
|
|
|
|
|
1,2,3,4,5,8,9,10,11 |
T2 |
D |
|
|
|
|
1,2,3,4,8,9,10,11,12,13,14 |
T3 |
E |
|
|
|
|
|
1,2,3,4,5,8,9,10 |
T4 |
F |
|
|
|
|
1,3,4,7,8,9,10,11,12 |
T5 |
G |
|
|
|
|
|
|
|
|
1,2,3,2,3,4,5,6,7,8 |
T6 |
H |
3,4,7,8,9,10,13,14,15 |
T7 |
I |
1,2,3,4,9,10,11 |
T8 |
Suppose that node A current playing program fragment corresponding identification string is (1,2,3), wherein, this program was that unit is divided into a plurality of fragments with 1 minute.Open up the spatial cache that can preserve 3 minutes lengths of a film in the buffer memory of node A the program fragment that will look ahead, the program fragment quantity that promptly can look ahead is 3.
When beginning to look ahead, node A matches the entry that comprises (1,2,3) in table 2, and matching result is the current playing program fragment corresponding identification string that all comprises node A in the entry of Node B, C, D, E, G, I.Suppose to set in advance to need not to look ahead and be badly in need of 2 fragments of download, promptly need not to look ahead fragment 4 and fragment 5, the sheet segment identification that then can look ahead from each entry is respectively:
Node B: (6,7,8);
Node C:(8,9,10);
Node D:(8,9,10);
Node E:(8,9,10);
Node G:(6,7,8);
Node I:(9,10,11).
As seen, the program fragment sign substring that extracts that satisfies condition has (6,7,8), (8,9,10) and (9,10,11), wherein because (8,9,10) number of times of Chu Xianing maximum (3 times), therefore, node A determines that the current fragment that should look ahead is (8,9,10), be node A when the 3rd minute fragment of current broadcast, except fragment 4 and fragment 5 that download to be badly in need of, the unnecessary bandwidth of can utilizing local node is gone the quick-downloading fragment 8 in arbitrary node place, fragment 9 and the fragment 10 among node C, D, the E.
Embodiment 2
Present embodiment provides a kind of program fragment prefetching method, and this method is more similar to the method that embodiment 1 provides, and different is that present embodiment is with certificate the statistics of user's VCR operating habit itself to be carried out fragment prefetching.
In the present embodiment, the plays clip information of the each request program of certain nodes records user generates second of a node and plays record sheet.
Second play every entry in the record sheet comprise this node before the program fragment sign of request program, in addition, every entry also can comprise the program identification of every entry correspondence.
Similar with embodiment 1, certain node is opened up certain memory space in advance and is used for the second broadcast record sheet, and the max-thresholds of entry number in the second broadcast record sheet is set.After the user finishes watching a new program, if the entry number in the second broadcast record sheet does not also reach the max-thresholds (second plays record sheet is not filled with) of setting, then deposit the program identification of this program and the program fragment identification string of actual play in second broadcast record sheet as an entry; Be filled with if second plays record sheet, then can play record sheet to second and upgrade according to the more new model of setting.Preferably, can use first-in first-out principle or minimum using priciple to play record sheet to second upgrades.
Play record sheet if use the first-in first-out principle to upgrade second of local node, then every drilling film releasing segment information also can comprise timestamp except comprising program identification and plays clip sequence string sign.Similar with embodiment 1: timestamp is made a living into the moment (finishing watching the moment of corresponding program) of corresponding entry, when then upgrading the second broadcast record sheet, can upgrade according to the time of timestamp record: play this reproduction time of record sheet middle distance entry the earliest with second and delete, and newly-generated entry is added in this second broadcast record sheet.
Play record sheet if use minimum using priciple to upgrade second, then every drilling film releasing segment information also can comprise the access times entry except comprising program identification and plays clip sequence string sign.When local node carries out fragment prefetching at every turn, second currency of playing the access times entry of the entry that comprises the fragment of determining of looking ahead in the record sheet is increased by 1, then when generating new entry and second and play record sheet and be filled with, the entry of access times entry numerical value minimum in the entry of the second broadcast record sheet at first can be deleted, and the entry of this generation is added in this second broadcast record sheet.
When node is watched program, play record sheet at every turn, determine the fragment that to look ahead according to the forecasting method that embodiment 1 provides according to second of storage.That is:
At first determine the corresponding identification string of the program fragment of the current broadcast of this node;
Play in the record sheet second then and match all entries that comprise current playing program fragment identification string;
From the corresponding record item that matches, select again and be not included in the corresponding program fragment of program fragment signs in the local cache and that occurrence number is maximum as looking ahead fragment;
The method that provides by embodiment 1 is obtained the fragment of looking ahead in adjacent node or in the server at last.
Program forecasting method by present embodiment provides can carry out fragment prefetching more targetedly according to the VCR custom of each node users, and prefetch hit rate also is improved.
Embodiment 3
Present embodiment provides a kind of program fragment prefetching method, and this method in conjunction with the embodiments 1 and method that provides of embodiment 2 is carried out program fragment prefetching from the VCR operating habit of programme content and each node users to the program of current broadcast.
During concrete enforcement, the method that node provides according to embodiment 1 is determined the program fragment that current needs are looked ahead, and is called the first fragment string of looking ahead at this; In addition, the method that node also provides according to embodiment 2 is determined the fragment that current needs are looked ahead, and is called the second fragment string of looking ahead; Then, node can be looked ahead according to self needs.For example: node can be looked ahead first fragment string and the second whole fragments of determining that comprise in the fragment string of looking ahead of looking ahead, first look ahead the several fragments in the fragment string of several fragments and second in the fragment string of looking ahead of also can looking ahead as required.
Present embodiment is owing to taken all factors into consideration programme content and user's VCR operating habit, and therefore, the hit rate as a result of looking ahead is also higher relatively.In addition, each node can also be with the fragment that is prefetched to for downloads of looking ahead of other adjacent node, minimizing network delay.
Corresponding to the program forecasting method that the embodiment of the invention provides, the embodiment of the invention also provides a kind of peer network node, and as shown in Figure 4, this node comprises: transmitting element 42, memory cell 43 and acquiring unit 45, wherein:
Transmitting element 42 is used to generate this playing programs state information, sends described broadcast state information or the local first broadcast record sheet of preserving to other network node that connects;
Memory cell 43 is used for the second broadcast record sheet that first of this playing programs state information of other network node of stored record is play the plays clip information of record sheet and/or the request program before of minute book node;
Acquiring unit, be used for playing record sheet according to the first broadcast record sheet and/or second that described memory cell is preserved, with the corresponding identification string of the program fragment of the current broadcast of this node is that index search first is play record sheet and/or second and play record sheet, matches at least one entry; Obtain from the entry that matches and be not included in program fragments in the local cache and that occurrence number is maximum in described entry sign, the program fragment that described program fragment sign is corresponding is as looking ahead fragment and looking ahead.
Above-mentioned peer network node also comprises broadcast unit 41 and updating block 44:
Broadcast unit 41 is used for look ahead segment and program fragment and broadcast that the described acquiring unit of buffer memory obtains;
Updating block 44 is used to receive the broadcast state information or the first broadcast record sheet that other network node sends, and upgrades the first broadcast record sheet of preserving in the described memory cell; Or after a request program of this node finishes, add the corresponding program identification and the actual play fragment sequence string of this request program, upgrade described second and play record sheet.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within the scope of claim of the present invention and equivalent technologies thereof, then the present invention also is intended to comprise these changes and modification interior.