CN101286927A - Method for realizing P2P stream media system based on node interconnection optimization - Google Patents

Method for realizing P2P stream media system based on node interconnection optimization Download PDF

Info

Publication number
CN101286927A
CN101286927A CNA2008100113574A CN200810011357A CN101286927A CN 101286927 A CN101286927 A CN 101286927A CN A2008100113574 A CNA2008100113574 A CN A2008100113574A CN 200810011357 A CN200810011357 A CN 200810011357A CN 101286927 A CN101286927 A CN 101286927A
Authority
CN
China
Prior art keywords
data
node
small documents
stream media
data terminal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CNA2008100113574A
Other languages
Chinese (zh)
Inventor
曲言威
蒋一
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Individual
Original Assignee
Individual
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Individual filed Critical Individual
Priority to CNA2008100113574A priority Critical patent/CN101286927A/en
Publication of CN101286927A publication Critical patent/CN101286927A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a method for realizing a P2P streaming media system based on node interconnection and optimization, which comprises the steps that: (1) every node records node identification comprising an ip address, a listening udp port, a tcp port, network state and all streaming media documents owned; (2) the node identification is registered to a tracking server; (3) the tracking sever sends back other node identification to nodes at a data receiving terminal according to the differences of registration time and the streaming media documents; (4) nodes at the data receiving terminal establish data channels and selects channel transmission data according to information sent back and other nodes. The method of the invention carries out tracking and management aiming at every node, thereby effectively shortening the time of peer interconnection and improving the stability of data downloading.

Description

A kind of method that realizes the P2P stream media system based on node interconnection optimization
Technical field
The present invention relates to a kind of implementation method of Streaming Media, more particularly, relate to a kind of dependence and optimize the method that internodal interconnection mode improves P2P technology realization stream media system.
Background technology
1.P2P the stream media technology introduction
The stream media technology of current P2P is paid attention to by people, and its main implementation procedure comprises software loading, the registration of server end information, obtains media resource information, and realizes interconnection, transfer of data and further buffered play.This technology has two aspect advantages:
A, do not need the support of internet router and network infrastructure, so cost performance is high and be easy to dispose.
B, Streaming Media user be downloads of media stream just, but also be other user's file upload, therefore, and the scale that this method can extend one's service and organize, and bring more resources by more demand.
The network configuration of P2P stream media system, most of system can classify as method or the notion of setting in the computer theory.In this method, node is organized into certain topology of transmitting data, and (normally set, as shown in Figure 1), each packet all is transmitted on same topology.Node on the topological structure has the clearly relation of definition, for example, and " father node-child node " relation in the tree structure.This method is typical method for pushing, receives packet when node that is:, and it just is forwarded to the copy of this packet its each child node.
Among Fig. 1, father node in the top network structure, the top of whole tree just, we are referred to as the father node server, remaining child node, Shu branches and leaves part just, we are referred to as peer or peer server, each peer is that the mode by " c/s pattern " client-server coexistence exists, and has not only downloaded but also provide download.
2.P2P the key technology in the Streaming Media
Because there is unsteadiness in node in the P2P stream media system, so the P2P stream media system need be selected to have breakthrough aspect technology, the fault-tolerant and security mechanism at Media Stream location technology, node.
A, Media Stream location: based on the P2P demand stream media system of catalogue, the mode of searching of its media file is to safeguard all media server information and customer information (comprising IP address, buffer size etc.) by LIST SERVER.When new client's request arrives, the media file of search request in catalogue, fast return both candidate nodes, both candidate nodes can be media servers, can be the clients that this filmstrip can be provided also, thereby have the characteristic of P2P.
The selection of B, node: in a typical P2P overlay network, the node in the network is from each different autonomous territories, and node can freely add or leave overlay network the time in office, causes overlay network to have very big dynamic and uncontrollability.Therefore, how when service conversation is initial, determine that a metastable service node or a node set that provides certain service quality (QoS) to guarantee is the problem that the P2P stream media system presses for solution.
C, fault tolerant mechanism: because the dynamic of node in the P2P stream media system is providing the node of service may leave system, transmission link also may lose efficacy because of congested.For the continuity that guarantees to accept to serve, must take some fault tolerant mechanisms to make the unaffected or recovery as early as possible of service ability of system
D, security mechanism: network security is the basic demand of P2P stream media system, must carry out security control to P2P information by the technology such as identity identifying and authenticating, mandate, data integrity, confidentiality and non-repudiation of security fields.To the control of property right, present stage can be adopted the control of DRM technology; For can being installed based on the P2P Streaming Media broadcast system of enterprise-level, fire compartment wall stops disabled user's visit; P2P stream media system on the internet can guarantee safety by the packet cipher mode.In the P2P stream media system, can adopt the grading authorized way of user, stop unauthorized access.
3.P2P the problem one of Streaming Media transmission
Transfer of data is that network data is shared requisite part, the key point of p2p software success or not especially.The most typical product of p2p software is that bt downloads, and it is exactly the maximized network data of having shared that bt downloads.The characteristics that are loaded in hop under the bt are to only require data integrity, and concept of time is not very strong.It then is to have proposed requirements at the higher level on the basis that bt downloads that Online Video is watched, and not only requires data integrity, and to the requirement of time also unusual strictness, it is extra important that the height of efficiency of transmission also just becomes.The height of network transmission efficiency can directly have influence on the viewing effect of video.
Initial transfer of data is directly to begin transmission from file header, pass to till the tail of file always, obviously, a little less than this transmission means is highly brittle, network occurs a bit, and unsettled situation will cause bust this, can cause lot of data to need to retransmit, lose time and bandwidth does not say that single transmission means speed can not guarantee.Bt download has afterwards occurred again, bt adopts the mode that file division is become a plurality of fritters, each fritter all has the numbering of oneself, just can begin from the optional position to download as long as hold a file of having described file division information during download, supports many parts to download simultaneously simultaneously.When some abnormal conditions takes place when, transmit as Halfway Stopping, only needing this moment does not have the little block file of having descended heavily down, downloaded finish just do not need to have descended again, all fritters of describing on description document are downloaded and are finished, and all files are linked together just passable according to fixing order again.The more initial downloading mode of the transmission means of bt has clearly advantage, has increased breakpoint transmission, has saved bandwidth waste, and multiple spot is downloaded simultaneously, makes that the speed of downloading is faster, also more stable.Because bt downloads, and only requires the file complete transmission is got final product, and does not require the time, so the piece number that bt splits when splitting file is more limited, with the fritter transmission, the thought of multicast communication is not carried out through to the end, and efficient is just restriction to some extent also.
4.P2P the problem two of Streaming Media transmission
Everybody may see Online Video, and the maximum characteristics of Online Video need real-time transmission data exactly, watches Shi Douhui that one period buffer time is arranged at every turn, and this is that Online Video is inevitable, also is the right problem of demand side.The work that needs during this period of time to finish mainly contains two parts, at first needs positioning media stream, Media Stream position just, and Media Stream may exist a place or many places, obtains the address of the Media Stream that needs fast, is the main task of the first step; Next is exactly to connect fast, downloads the data of enough playing.Video software is given the quality of people's first sensation, embodies finishing on these two tasks, and wait will inevitably cause the user irritated mood to occur for a long time, is that all Online Video softwares all need the problem that solves during this period of time so shorten.
Originally way is to do investment on service equipment, increases server, increases bandwidth, allows the data of beginning download from server location, and with the shortest maximum data of time buffering, the enough data that begin to play of buffering just begin to play.Best example is exactly the 5a5e Online Video program request that company of Netcom does, and he just has enough big bandwidth, a plurality of servers, but he the long and slack problem of picture of stand-by period equally can occur.This mainly because server holds the problem of carrying the upper limit to be caused, no matter you have equipment how well, this insurmountable bottleneck problem all will inevitably occur.This way is in the development that has limited software virtually, and this risk that can increase software development with high investment, and this way is not that we pursue.
Way afterwards is the thought according to the p2p technology, and most data are by transmitting between peer and the peer, and having only a spot of data is to download from server.Do the pressure that significantly alleviates server like this, utilized the peer resource to greatest extent.Problem also occurs thereupon, as above said, when beginning to watch video, need carry out Media Stream location, two steps of transfer of data." it is uncertain to hold Media Stream " of peer, " length of holding Media Stream is uncertain ", " provide service ability uncertain ", " network state is uncertain " or the like uncertain factor is for the part that begins most buffered data has been made more difficulty.
The general way of p2p video software is to come clear and definite uncertain factor above-mentioned by the agreement inquiry, can increase the preceding mutual time of transfer of data so undoubtedly, and the inquiry number of times is many more, and the time will become long more.
Because the uncertainty of peer behavior, a lot of software is appropriate inadequately in the processing means.Done a lot of idle works in interconnected carrying out peer, joint efficiency is low, main cause be the preparation when preparing to connect do not enough, know nothing for the peer that will initiate to connect, joint efficiency can't improve at all under this condition.Because Media Stream disperses to be stored in above the different peer, the Media Stream localization part is exactly the peer location in fact so, finds to meet the peer that oneself requires most in numerous peer, and this process of " looking for " is exactly the Media Stream position fixing process.So how find " peer that can offer own media data " fast and accurately, just become the key of document alignment part.Finish the location accurately, the work of back is exactly the utilized bandwidth of trying one's best, and with prestissimo " broadcast " needed data is downloaded and is come.
5. technological concept gathers
Server as shown in Figure 1, comprises child node peer server and father node server.
Streaming Media is meant the media formats of the mode of employing stream transmission in the Internet/Intranet broadcast, as audio frequency, video or multimedia file.
Receive data terminal, a certain node (peer) receives the data that other servers provide, and this node (peer) is called the reception data terminal.
Send data terminal, a certain server provides data for other peer nodes, and this server is called the transmission data terminal.Send data terminal herein and both comprised the node that is sending data, comprise that also relative reception data terminal can send the node of data.
Summary of the invention
A very important job of node interconnection optimization part of the present invention is exactly the preparation in early stage, before also not connecting with the other side, at first the other side's constant is grasped, and connects again, and joint efficiency will be significantly improved.Therefore the present invention is primarily aimed at above-mentioned " problem two of P2P Streaming Media transmission " and is solved, and specific purposes are as follows:
1, finish the Media Stream location fast and accurately before connecting, the clear and definite Media Stream of distinguishing own needs may need one or more Media Streams, the asking to which concrete peer of each Media Stream correspondence.
2, connect, set up the stream relation of the supply with the fastest speed and purpose peer.
3, carry out strick precaution, the situation that the stream supply that prevention may occur is interrupted under the disabled situation of peer, is accomplished timely replacing.
Generally all comprise a plurality of transmission data terminals and receive data terminal at the P2P of prior art stream media system.Implementation procedure is roughly: software loading, information registration, interconnected and transport stream media file, and receive data terminal buffered play files in stream media.The present invention is in order to address the above problem, design a kind of method that realizes the P2P stream media system based on node interconnection optimization of knowing clearly, comprise the steps: also that in the process of conventional P 2P stream media system (S1) each node is recorded as unique node identification with node state, the udp port that described node identification comprises the ip address, monitoring, tcp port, network state, the files in stream media that is had; (S2) each node is registered to tracking server with its node identification; (S3) described tracking server does not receive the node identification information that the data terminal node returns other nodes that have the required file of this reception data terminal node in the same way according to hour of log-on and playing stream media file; (S4) receive the data terminal node according to the network state in other node identifications that return self with other nodes of part between set up data channel and data are transmitted in the selector channel.
The present invention is based on node interconnection optimization and realize the method for P2P stream media system, its improvement is that in step (S2), tracking server is stored each node identification according to hour of log-on and in the mode of various flows media file branch different directories; In step (S3), the file size that other nodes had in the return information need be enough to satisfy the use of this reception data terminal.
The present invention is based on node interconnection optimization and realize the method for P2P stream media system, in the implementation process of conventional P 2P stream media system, also comprise the steps:
(1) split file: will send data terminal files in stream media to be sent is that benchmark splits into n part small documents with the frame number n that has each second, and number consecutively is m, and promptly m gets 1 to n; Wherein, m part small documents corresponding m frame data in the per second in the stored stream media file in chronological order.
(2) transfer of data: between reception data terminal and transmission data terminal, set up data transmission channel, transmission n part small documents.
(3) buffered play: the reception data terminal will cushion each frame partial data of downloading and press playing sequence rearrangement back broadcast.
The method of above-mentioned realization P2P stream media system, its further improvement also is, in data transmission procedure, reception data terminal and 1-4n transmission data terminal are set up data transmission channel in the same time, and (p≤n) bar is used for transmitting respectively said n part small documents to select p.
In addition, step (S4) in the information that the reception data terminal returns, has the transmission data terminal minimum number with a small documents, receive then that data terminal is preferential sets up data channel with these nodes that send in data terminals, and select wherein one to be used to transmit this part small documents.And in all data transmission channels set up and the small documents that transmitting, the umber of a certain channel transfer small documents is minimum, then preferentially selects this data channel to be used to transmit the small documents that other parts are not transmitted.
Under the optimal way, receiving data terminal is that each part small documents and 2-4 transmission data terminal are set up data transmission channel, selects one to be used to transmit this part small documents, and this moment, other passages were used for fast quick-recovery breakpoint transmission as " fully hot ".Promptly when this passage that is transmitting data was cut off, passage of other in the 2-4 bar continued this part of transmission small documents.
The method of above-mentioned realization P2P stream media system, its further improvement also are, require every part of small documents to send/receive data in order in the data transmission procedure.And under the optimal way, send data terminal and the data of each frame are split into the 2-3 piece be used for transmitting; Accordingly, set up buffering area at the reception data terminal for each frame and be used to integrate above-mentioned 2-3 blocks of data, the laggard row buffering of data that is integrated into a complete frame is play.
In addition, method of the present invention, its improvement also is, receiving data terminal, a small documents of certain of reception is as m part small documents, when its data volume is more normally play required many 60-180 of data volume frame (going out 1-3 minute played data soon), at this moment, need to end the transmission of m part small documents; Treat that then a certain moment continues to download this part small documents (this 3-10 constantly will need in m part small documents not after second data downloaded is used for buffered play) again.
The present invention is based on the method for the interconnected optimization realization of node P2P stream media system, carry out tracing management, the most information stores of peer on manager, can be obtained the basic condition information of these peer when obtaining peer at each peer; Save the step of agreement inquiry, avoid waste, allow all one's effort during this period of time of buffering remove to cushion media data.Therefore the present invention has following beneficial effect:
1, preparation is abundant, and document alignment has fast and accurately effectively been shortened the interconnected consumption time of peer, the consumption time when having shortened initial play;
When 2, connecting, initiate to connect to a plurality of peer simultaneously, increased the successful property that connects, improved joint efficiency, ensured the quick foundation of stream relation of the supply; Initiate to connect to a plurality of peer simultaneously, shorter than the time that " peer, the connection of a peer " consumes.
3, the peer reasonable resources is used, and is more stable for download this locality on a plurality of peer of being dispersed in of data source equilibrium, and the flow data compensation after disconnecting for stream also can be rapider, improved the stability that data are downloaded.
4, the preventive means of peer broken string is taken precautions against effectively and is disconnected the influence that this locality is caused in the stream transmission procedure suddenly, for the stable download of the flow data of this locality provides a strong guarantee.
The fractionation mode that the present invention is based on files in stream media in addition realizes transfer of data, therefore also further has following beneficial effect:
5, adopt the parcel transmission, little and many data can have been utilized the network bandwidth to greatest extent, and transmission speed is more stable, for the broadcast of video continous-stable provides safeguard.
6, adopt the parcel transmission, when the follow-up biography of data interruption, more accurately the efficient of breakpoint transmission has been improved in the position of subsequent data, has shortened data greatly and has continued the required time.
When 7, network is unusual, be certain to occur junk data, adopt the parcel transmission can effectively control the generation of junk data, and effectively reduce the junk data amount, improved the efficient of Network Transmission.
Description of drawings
Fig. 1 is the schematic network structure of prior art P2P system;
Fig. 2 is the explanation schematic diagram of fractionation and transport stream media file;
Fig. 3 is that the present invention selects a kind of embodiment situation schematic diagram of " stream " in data transmission channel.
Embodiment
One, necessary notion introduction
The unique identification of Peerid:Peer, unique expression a peer, be called peerid, represent: Peerid=ip address+udp protocol port+tcp protocol port+network state+stored stream media file bitmap (information of required files in stream media) by a character string.
Media stream file--with former media file, the fractionation rule according to specific splits into a plurality of files, and each file is referred to as a media stream file.Split the quantity of back media stream file, then determine,, will form 24 files after the fractionation, be numbered, distinguished with 0-23 as 24 frames/per second according to the frame number of playing the each second of original.
Stream--in the process of the data of network (tcp) transmission, data will flow to the other side to water is equally continual, for image a media file are referred to as a stream herein.The transmission of every stream is identical, and the transmission course of a stream only is described in the presents.
Bitmap: simple understanding is exactly an int value (integer value), and each int value has 4 bytes, and just 32, by different implications is represented in 32 positions 0 or 1.Use herein this int value represent peer will hard-disc storage when watching a film those stay media file, as a buffer memory 0-4 files in stream media, will be 32 preceding 5 positions 1, the media file of 0-4 has been stored in expression.
Tracker server: claim perhaps " tracking server " that function mainly is to follow the tracks of the state of each peer.Peer is after being activated, at first can register to tracker, tracker can be stored in its peerid in the corresponding media file classification, peer can be in watching the process of film activating of property at interval, and progress is watched in report, after peer finishes watching whole film, can report that tracker watches to finish.Another function is with the peer data message of registration, externally provides.
Two, the data disassemble technique is realized the P2P Streaming Media
Please refer to the Chinese invention patent " based on the method for data disassemble technique realization P2P stream media system " that the applicant and the present invention apply on the same day.This application quotes in full in this as the part of the application's preferred embodiment, and describes as the application's a part.The part content quotation is as follows in the literary composition:
The P2P stream media system splits file according to the reproduction time of file, and the data that are about to each second split into " n " frame.The size of n depends on the playback rate (as 12 frames/per second, 24 frames/per second, 30 frames/per second) of former media file.Hereinafter n all represents the frame number that files in stream media has each second, is that benchmark splits into n part small documents with Streaming Media with n, and number consecutively is m (1≤m≤n), and m part small documents is stored the data of m frame in the per second in chronological order.Here every part of small documents is called one " media stream file ".
Specifically, be numbered 0......n-1 by in the past backward order during fractionation, write the 0th part of each second as a file according to time sequencing, by that analogy, write as n file.Suppose that the playback rate of the file of fractionation is 30 frames/per second herein, so just original need be split into 30 small documents, split file as shown in Figure 2, every part of small documents transmits respectively, and the transmission of every part of file among Fig. 2 is defined as one " stream ".Certainly, numbering also can adopt 1......n or other letter representations, is the mode that is equal to.Among Fig. 2, comprise the data of corresponding second respective frame in the small documents of every stream correspondence.
After splitting file, between reception data terminal and transmission data terminal, set up data transmission channel, transmission n part small documents; And the reception data terminal will cushion each frame partial data of downloading and press playing sequence rearrangement back broadcast.In addition, in data transmission procedure, reception data terminal and 1-4n transmission data terminal are set up data transmission channel in the same time, and (p≤n) bar is used for transmitting respectively said n part small documents to select p.Optimum way is that selecting wherein, n bar passage transmits said n part small documents simultaneously respectively.As p during less than n, mean that a passage can transmit many parts of small documents, promptly a passage has comprised many files transmission " stream ", guarantees that equally preferably n bar " stream " transmits n part small documents simultaneously respectively at this moment.
Under the optimal way, every part of small documents (corresponding time sequencing) transmission/reception data in order in data transmission procedure; And the transmission data terminal splits into the transmission of 2-3 piece with the data of each frame, sets up buffering area at the reception data terminal for each frame and is used to integrate above-mentioned 2-3 blocks of data, and the laggard row buffering of data that is integrated into a complete frame is play.
In addition, under the optimal way, above-mentioned reception data terminal sends data terminal and sets up data transmission channel with 2-4 for each part small documents, and synchronization only selects wherein one to be used to transmit this part small documents and to form one " stream ", and this moment, other passages conducts " fully hot " were used for fast quick-recovery breakpoint transmission.That is, when the passage that transmits data was cut off, one of other in the 2-4 bar continued this part of transmission small documents, thereby realize the breakpoint transmission function, finish until download.
In addition, the efficiencies of transmission a or many parts in n part small documents are too fast, when promptly receiving certain its data volume of a small documents that data terminal receives and more normally playing required data volume and have more the 60-180 frame (going out 1-3 minute played data soon).At this moment, need to end the transmission of these parts small documents, treat that then a certain moment continues to download these parts small documents again, and this to be its 3-10 constantly will need after second in these parts small documents not data downloaded be used for buffered play.For example, generally speaking, the transfer rate 1 of a small documents can guarantee the normal play of files in stream media frame/second, but when a certain moment, it is the 60-180 frame that the more in progress moment of the quantity of certain part of small documents of buffering area goes out the 1-3 minute data soon, ends the transmission of this part small documents this moment.If go out 1 minute soon, then continue to utilize former passage or other passages to download this part file after second at 50-57; If go out 2 minutes soon, then continue to utilize former passage or other " heat is equipped with " passages to download this part file after second at 110-117; If go out 3 minutes soon, then continuing to download this part file after second at 170-177. optimum way is to select to interrupt for benchmark in 2 minutes the transmission of this very fast " stream ".
With reference to figure 2,, describe from sending data terminal and receiving two aspects of data terminal respectively for transmission course is described.
Send data terminal: at every turn from file during reading of data, the frame sign of record reads when splitting, and reads in the buffering area with the identical size of frame.Herein, in order to realize the little blocks of data purpose of transmission fast, the data of a frame also can continue to decompose, and split into the several little blocks of data of appointment, add the frame end mark at latter end.Each is that unit sends with the piece when sending data, and the fractionation order when splitting piece sends one at every turn, and sends in order.In order to guarantee to transmit safety of data, bottom when implementing transmission, the udp protocol transmission can be packaged into the safe transmission that is similar to the tcp agreement (as: when transmitting terminal sends data according to 1,2,3,4,5 frame number sends data, is 1,2 certainly just when the other side receives, 3,4,5 order can go out active, as only having received 1,2,3, can not occur 1 certainly, 2,4,3,5 or 2, the situation of 1,4,3,5 grades).The transmission control section only needs in order each blocks of data all to be sent, and the bottom transmission will guarantee that the other side can receive in order.Needn't consider the situation that intermediate data is lost, if the middle situation that failure occurs sending, can determine that so this situation is that problem has appearred in the other side's network, and be to belong to insurmountable network abnormal problems such as network disconnection, stop immediately sending data, and deletion the other side peer is present in all local information to the other side.
Receive data terminal: when receiving data, the frame sign of noting down when splitting file is set up buffering area, the corresponding buffering area independently of every frame data.The effect of buffering area herein is that " a plurality of little blocks of data that is under the jurisdiction of a frame " is reduced into original frame data.During the blocks of data of frame end mark that received mark, current frame data is integrated and is finished, and beginning next frame data are integrated, by that analogy.Because transport layer has guaranteed that the reception order of data is identical with the sending order of the other side's peer, does not exist two frame data of reception out of position, or the intermediate data situation of losing, just very simple when integrating frame data.Suppose to receive from the position that begins most, create a buffering area identical with frame sign, prepare to receive data, what receive at first is the data of the 0th frame, and the data that at first require to receive are under the jurisdiction of the 0th frame, and are undesirable, explanation ensures under the prerequisite of transmission sequence in transport layer, the other side has occurred unusually, disconnects connecting, and seeks other data source and downloads.Meet the requirements and continue again to judge whether this blocks of data has ending piece mark, does not have, and blocks of data is write buffering area, waits for receiving next blocks of data; Have, illustrate that current frame data receives, blocks of data is write buffering area, and buffering area is submitted to the data integrated part; Create a new buffering area, wait for receiving the next frame data, process is the same, till whole file in download receives.
The data integrated part: the above transmission course of describing a stream, the transmission rule of n bar stream is identical, after every stream receives complete frame data, all can be delivered to unified position and integrate.Why needing to integrate is because when file splits, and the data arrangement of original has been done very big change in proper order, can't be directly passed to player, need reduce.Step of reducing is the inverse operation that splits, all data are rearranged combination, as shown in Figure 2, the 1st frame data since the 0th stream, then be the 1st frame data of the 1st stream, article 2, the 1st frame data of stream, the 1st frame data of the 3rd stream ... .., article 29, the 1st frame data of stream, article 0, the 2nd frame data of stream, the 2nd frame data of the 1st stream, the 2nd frame data of the 2nd stream, ... the 2nd frame data of the 29th stream of .., article 0, the 3rd frame data of stream, by that analogy, until the end of file.
When splitting file preferred " is benchmark with the frame number n that has each second ", certainly be the same idea scheme with " is benchmark with the frame number n that has in 0.5 second " or " the frame number n that has in second with 2-3 is a benchmark " as required, be equivalent way, can select to be suitable for according to the size of bandwidth.The present invention is not limited to file and splits.
More than quoted the Chinese invention patent " based on the method for data disassemble technique realization P2P stream media system " that the applicant and the present invention apply on the same day.This application quotes in full in this as the part of the optimum embodiment of the application, specifies embodiments of the present invention below.
Three, the embodiment of the invention specifies
Each peer (node) at first formed a peerid (node identification) with the state that oneself can determine, as the unique identification of oneself before oneself is externally provided.In case the information that comprises among the peerid all is the information of determining with regard to not changing substantially, comprising own outer net ip address, the udp port of monitoring, tcp port, network state, the files in stream media that is had.Above-mentioned network state can be utilized the nat state representation in the ISTUN standard.There is (the notion ginseng of concrete bitmap is according to first " necessary notion introduction ") in mode with stored stream media file bitmap under the above-mentioned files in stream media optimal way that has; In addition, under the optimal way, peerid comprises that 3-6 the file that this node is stored in all files in stream media gets final product, but and picked at random.Mode with above-mentioned second portion " the data disassemble technique is realized the P2P Streaming Media " is an example, suppose that a files in stream media is divided into 30 parts of small documents, then above-mentioned node " files in stream media that is had " is meant that a certain node has those small documents of 30 parts of small documents, gets final product with one 32 4 byte binary system integer value representations.Concrete mode is: represent that in corresponding " position " set this part small documents is had by this node, reset then represents do not have, and has those small documents thereby can derive this node.
Peerid generates the back and registers to the tracker server, according to hour of log-on, be registered in the catalogue of oneself watching same film under, this step is the precondition that realizes document alignment, the preparation of just doing.
The peer of each registration can obtain oneself to watch the needed peer information of film when returning, the specifying information that returns is distributed by tracker.Tracker divides timing meeting basis, the film of watching, and hour of log-on distributes, these peer in the return information have the media stream file of this node needs itself, and enough its of the file size of storage watched use.
Can confirm whether a plurality of transmission data terminals have its required file thereby each receives data terminal, and send download request to transmission data terminal with its required file.No matter some statement herein still receives data terminal as sending data terminal, all with " peer " expression, and reaching the purpose of simplification, and semanteme based on context, can clearly distinguish peer is as sending data terminal or reception data terminal; And when as the transmission data terminal, hereinafter " peer " also can refer to the father node server.
The reasonable operation instruction of Peer resource: the media stream file of each peer storage is all selected at random, and can download many " stream " to a peer simultaneously, promptly downloads a plurality of media stream file at same transmission data terminal.Will produce under the few situation of peer quantity, the peer that has has applied for many streams, and the peer that has is idle or only applied for a stream.Supply in order to download is stable, prevents that the unexpected off-line of certain peer from causing local data download to disconnect many connections simultaneously, causes bigger influence, when using the peer resource downloading, needs to consider that the data downloaded source is balanced uses.For example:
1, supposes a peer four files in stream media of 0-3 of having represented buffer memory, and the 0th stream has only this peer to have in the one's own resource, 1st, 2,3 three streams all have a lot of peer storages, so when using the peer resource, will at first download the 0th stream from this peer, other three streams are more according to circumstances downloaded to different peer.
2, suppose that the current media file has been split into 10 stream files altogether, when obtaining the peer information resources, only obtained 5 peer, when selecting data download, these 5 peer of the average use that will try one's best accomplish that as far as possible each peer downloads two stream files so.
After obtaining peer (peerid) information, in order rationally to use resource when in use, need add up the current peer resource of holding, during statistics mainly " the stored stream media file bitmap " according to peer add up, suppose that the current film of watching has been split into 10 files in stream media altogether, the statistics back just can obtain the result so: peer quantity is assumed value.
According to top assumed value, the process of peer is selected in explanation herein, embodiment as shown in Figure 3, among the figure, above a row expression be composed of the media stream file 0......9 of label, below the corresponding stream file of a row expression had by several peer, have several transmission data terminals (peer) to have this stream file in other words.The quantity of the peer that can have separately according to 10 streams according to statistics sorts, and from less to more, order is 8,9, and 5,7,6,3,4,2,1,0.When using the peer resource to download, at first be that the 8th stream file selected.In order to prevent the abnormal off-line behavior of peer, the initial connection when downloading, all can connect 2-4 peer simultaneously.Present the 8th stream has only two resources, all connects, and uses that the fastest peer of connection to begin to download, if all connection failures, in order to guarantee availability of data, can directly initiate download request to seed server (seed server has 10 whole stream files, and supply is downloaded).Next be the 2nd the 9th stream, select peer to connect, at this moment, need to consider that 3 peer that the 9th stream has are when the 8th stream connects, whether be used, if the peer that preferential connection was not used needs to select 2-4 peer to connect equally, be followed successively by 5 in order, 7,6,3,4,2,1,0, select peer to connect, the processing means are identical with the 9th stream, in this manner be connected peer and connect, just can reach the Peer resource substantially and rationally use, the purpose of optimization download link.Simultaneously, because early stage, the preparation before connection was abundant, finished in the also superincumbent selection of the work of document alignment.
By above-mentioned example as seen, select data channel to realize that the principle of transmission " stream " is:
(1) in receiving the information that data terminal returns, have with the number of servers of a small documents minimumly, receive then that data terminal is preferential sets up data channel with these servers, and select wherein one to be used to transmit this part small documents.Fig. 3 for example, the 8th small documents has only two peer to have, and receives therefore that data terminal is preferential sets up data channel with these two peer, and selects one and realize that " stream " transmits.
(2) in all data transmission channels set up and the small documents that transmitting, the umber of a certain channel transfer small documents is minimum, then preferentially selects this data channel to be used to transmit other parts small documents.For example, suppose that a files in stream media is divided into 8 parts of small documents, and two data passages have been set up, at this moment, 4 parts of small documents of a data channel transfer, and another data channel is transmitted 3 parts of small documents in addition, also have a small documents not to be transmitted, then the small documents that is not transmitted of this part preferentially selects for use the passage of second (transmitting three parts of small documents) to realize that " stream " transmits, because 3 less than 4, thereby reaches the purpose of as far as possible on average utilizing server.
Data are downloaded:
When connecting, can directly compare, judge connection and whether can set up according to the nat state among the peerid (network state is referring to Open Standard STUN/RFC3489 and UPNP) with local nat state.(for example: local nat state is udp-symmetric, and the other side nat state also is udp-symmetric, and so this situation does not need to send link information, can directly obtain the result that can't connect.) connect in the time of can setting up, the beginning data download, the data download request ensures efficient by the server end of the other side peer, during the transmission data, transport layer guarantee is arranged, and does not need to worry herein.
Breakpoint transmission:
Because the unpredictability of peer behavior when using the peer resource, needs the behavior of rolling off the production line suddenly of strick precaution peer constantly, when preventing that the stream file supply from disconnecting suddenly, the influence that long-time interruption caused of local data flow.Above we when selecting peer to connect, once mentioned, be that a stream is when selecting to connect peer, can select 2-4 peer to connect, but really be used for the peer that has only of data download, after other peer connects, can not disconnect, but exist as the form of the alternative connection of this stream.The characteristics of alternative peer keep connecting, but data download not; Every stream all can have 1 peer that is downloading and a plurality of alternative peer, when just when the peer of data download disconnects suddenly, goes to select among the alternative peer one and continues to download, and can replenish alternative peer at any time at once.When the peer in data download just disconnects suddenly, and when finding oneself not have alternative peer, can enable the seed address at once, go the seed server data download.
The above; only be the preferable embodiment of the present invention; but protection scope of the present invention is not limited thereto; anyly be familiar with those skilled in the art in the technical scope that the present invention discloses; be equal to replacement or change according to technical scheme of the present invention and inventive concept thereof, all should be encompassed within protection scope of the present invention.

Claims (9)

1, a kind of method based on node interconnection optimization realization P2P stream media system,
The P2P stream media system comprises a plurality of transmission data terminal nodes and receives the data terminal node that its implementation procedure is: software loading, information registration, interconnected and transport stream media file, and receive data terminal buffered play files in stream media;
It is characterized in that said process also comprises the steps:
(S1) each node is recorded as unique node identification with node state, the udp port that described node identification comprises the ip address, monitoring, tcp port, network state, the files in stream media that is had;
(S2) each node is registered to tracking server with its node identification;
(S3) described tracking server does not receive the nodal information that the data terminal node returns other nodes that have the required file of this reception data terminal node in the same way according to hour of log-on and playing stream media file;
(S4) receive the data terminal node according to the network state in other node identifications that return self with other nodes of part between set up data channel and data are transmitted in the selector channel.
2, according to the described method of claim 1, it is characterized in that in step (S2), described tracking server is stored each node identification according to hour of log-on and files in stream media branch different directories based on node interconnection optimization realization P2P stream media system.
According to the described method of claim 1, it is characterized in that 3, in step (S3), other nodes in the return information, the file size that it had are enough to satisfy the reception data terminal to be used based on node interconnection optimization realization P2P stream media system.
4, according to the arbitrary described method of claim 1-3, it is characterized in that, also comprise the steps: based on node interconnection optimization realization P2P stream media system
(Sa1) split file:
Is that benchmark splits into n part small documents with sending data terminal files in stream media to be sent with the frame number n that has each second, and number consecutively is m, and promptly m gets 1 to n; Wherein, m part small documents is stored the interior corresponding m frame data of per second in the described files in stream media in chronological order;
(Sa2) transfer of data:
Between reception data terminal and transmission data terminal, set up data transmission channel, transmission n part small documents;
(Sa3) buffered play:
The reception data terminal will cushion each frame partial data of downloading and press playing sequence rearrangement back broadcast.
5, according to the described method that realizes the P2P stream media system based on node interconnection optimization of claim 4, it is characterized in that, in described (Sa2) step, in the same time, reception data terminal and 1-4n transmission data terminal are set up data transmission channel, and select the p bar to be used for transmitting respectively described n part small documents, wherein p≤n.
6, according to the described method that realizes the P2P stream media system based on node interconnection optimization of claim 5, it is characterized in that, described step (S4), in the information that the reception data terminal returns, have transmission data terminal minimum number with a small documents, receive then that data terminal is preferential sets up data channel with these nodes that send in data terminals, and select wherein one to be used to transmit this part small documents.
7, according to the described method that realizes the P2P stream media system based on node interconnection optimization of claim 6, it is characterized in that, in data transmission channel of having set up and the small documents that transmitting, the umber of a certain channel transfer small documents is minimum, then preferentially selects this data channel to be used to transmit other parts small documents.
According to the described method of claim 7, it is characterized in that 8, receiving data terminal is that each part small documents and 2-4 transmission data terminal are set up data transmission channel, selects one to be used to transmit this part small documents based on node interconnection optimization realization P2P stream media system; When cutting off of this transmission channel transmitted, select in other passages, continue this part of transmission small documents.
9, according to the described method that realizes the P2P stream media system based on node interconnection optimization of claim 7, it is characterized in that, receiving data terminal, when the data volume of the m part small documents that receives is more normally play required many 60-180 of data volume frame, when promptly having more 1-3 minute played data, end the transmission of m part small documents; When the 3-10 in a certain moment needs promptly after second that data downloaded is not used to play in m part small documents, continue to download m part small documents again.
CNA2008100113574A 2008-05-08 2008-05-08 Method for realizing P2P stream media system based on node interconnection optimization Pending CN101286927A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNA2008100113574A CN101286927A (en) 2008-05-08 2008-05-08 Method for realizing P2P stream media system based on node interconnection optimization

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNA2008100113574A CN101286927A (en) 2008-05-08 2008-05-08 Method for realizing P2P stream media system based on node interconnection optimization

Publications (1)

Publication Number Publication Date
CN101286927A true CN101286927A (en) 2008-10-15

Family

ID=40058906

Family Applications (1)

Application Number Title Priority Date Filing Date
CNA2008100113574A Pending CN101286927A (en) 2008-05-08 2008-05-08 Method for realizing P2P stream media system based on node interconnection optimization

Country Status (1)

Country Link
CN (1) CN101286927A (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101873344A (en) * 2010-05-27 2010-10-27 中国科学院计算技术研究所 Integrated block switching P2P shared-file system and method for promoting seed-providing of node thereof
WO2010145199A1 (en) * 2009-06-17 2010-12-23 ***通信集团公司 Method, system and device for searching active nodes in p2p streaming media system
CN101969448A (en) * 2009-06-17 2011-02-09 ***通信集团公司 Method, system and equipment for searching active node in P2P streaming media system
CN102469153A (en) * 2010-11-04 2012-05-23 财团法人工业技术研究院 Point-to-point real-time streaming system and method
CN104166567A (en) * 2014-08-12 2014-11-26 广州金山网络科技有限公司 Method and device for downloading network stream data
CN105516109A (en) * 2015-11-30 2016-04-20 长安大学 Transmission scheduling method for ensuring video transmission service quality of wireless multi-hop network
CN105611425A (en) * 2015-09-25 2016-05-25 浪潮(北京)电子信息产业有限公司 Node optimization method and apparatus thereof
CN105871990A (en) * 2015-12-14 2016-08-17 乐视云计算有限公司 Download data scheduling method and device
CN106021565A (en) * 2016-05-31 2016-10-12 成都索贝数码科技股份有限公司 Method for continuing writing MXF files in Op1a format and Op1b format
CN107948670A (en) * 2016-10-12 2018-04-20 北京优朋普乐科技有限公司 A kind of small documents playback method and device
CN111314458A (en) * 2020-02-13 2020-06-19 深圳市网心科技有限公司 Method and device for punching P2P network and computer readable storage medium
CN115002182A (en) * 2022-05-31 2022-09-02 上海新致软件股份有限公司 Network node connection method, device, electronic equipment and storage medium

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8762461B2 (en) 2009-06-17 2014-06-24 China Mobile Communications Corporation Method, system and device for searching active peer in P2P streaming media system
WO2010145199A1 (en) * 2009-06-17 2010-12-23 ***通信集团公司 Method, system and device for searching active nodes in p2p streaming media system
CN101969448A (en) * 2009-06-17 2011-02-09 ***通信集团公司 Method, system and equipment for searching active node in P2P streaming media system
CN101969448B (en) * 2009-06-17 2013-03-13 ***通信集团公司 Method, system and equipment for searching active node in P2P streaming media system
CN101873344A (en) * 2010-05-27 2010-10-27 中国科学院计算技术研究所 Integrated block switching P2P shared-file system and method for promoting seed-providing of node thereof
CN101873344B (en) * 2010-05-27 2013-04-03 中国科学院计算技术研究所 Integrated block switching P2P shared-file system and method for promoting seed-providing of node thereof
CN102469153B (en) * 2010-11-04 2015-01-28 财团法人工业技术研究院 point-to-point real-time streaming system
CN102469153A (en) * 2010-11-04 2012-05-23 财团法人工业技术研究院 Point-to-point real-time streaming system and method
CN104166567A (en) * 2014-08-12 2014-11-26 广州金山网络科技有限公司 Method and device for downloading network stream data
CN105611425A (en) * 2015-09-25 2016-05-25 浪潮(北京)电子信息产业有限公司 Node optimization method and apparatus thereof
CN105516109A (en) * 2015-11-30 2016-04-20 长安大学 Transmission scheduling method for ensuring video transmission service quality of wireless multi-hop network
CN105516109B (en) * 2015-11-30 2018-08-07 长安大学 A kind of transmission dispatching method ensureing wireless multi-hop network transmission of video service quality
CN105871990A (en) * 2015-12-14 2016-08-17 乐视云计算有限公司 Download data scheduling method and device
CN106021565A (en) * 2016-05-31 2016-10-12 成都索贝数码科技股份有限公司 Method for continuing writing MXF files in Op1a format and Op1b format
CN106021565B (en) * 2016-05-31 2019-12-13 成都索贝数码科技股份有限公司 continuous writing method of MXF files in Op1a and Op1b formats
CN107948670A (en) * 2016-10-12 2018-04-20 北京优朋普乐科技有限公司 A kind of small documents playback method and device
CN111314458A (en) * 2020-02-13 2020-06-19 深圳市网心科技有限公司 Method and device for punching P2P network and computer readable storage medium
CN115002182A (en) * 2022-05-31 2022-09-02 上海新致软件股份有限公司 Network node connection method, device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN101286927A (en) Method for realizing P2P stream media system based on node interconnection optimization
US11233839B2 (en) System and method of minimizing network bandwidth retrieved from an external network
CN101286976A (en) Method for realizing P2P stream media system based on data disassemble technique
CN100461740C (en) Customer end node network topological structure method and stream media distributing system
US9325786B2 (en) Peer-to-peer interactive media-on-demand
Kreitz et al. Spotify--large scale, low latency, P2P music-on-demand streaming
CN100571377C (en) A kind of system and method that utilizes the peer-to-peer network technology to realize video request program
CN100405795C (en) Service system for distributed reciprocal flow media and realizing method for requesting programm
CN101534204A (en) Streaming media information distribution system and method thereof and user end
US20110055881A1 (en) Media file on-demand method, system and appartus
CN101714987B (en) P2P playing method and system
US20040210948A1 (en) Video splitting and distributed placement scheme for clustered video servers
US20080133767A1 (en) Real-time multicast peer-to-peer video streaming platform
JP2006526215A (en) Content distribution network system based on streaming and file division, merge and playback method
CN101552800A (en) Method, device and system for providing media content
CN106656593A (en) Streaming media live broadcast recording redundant hot-standby method and system
CN101119310B (en) Method and routing device for implementing stream media data transmission
JP2012150809A (en) System and method for buffering in p2p based streaming service, and system for distributing application for clients to process buffering
US20240179200A1 (en) System and method of minimizing network bandwidth retrieved from an external network
US9332421B2 (en) Method and apparatus for random access to multimedia content in wireless communication system
CN100446567C (en) Apparatus and method for realizing P2P stream broadcasting in information family appliances
CN102291458B (en) Method for peer-to-peer (p2p) server framework
Thampi A review on P2P video streaming
Lan et al. A peer-to-peer architecture for live streaming with DRM
Vassilakis et al. The impact of playout policy on the performance of P2P live streaming: or how not to kill your P2P advantage

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20081015