A kind of VOD method and system for realizing that P2P sharesTechnical field
The present invention relates to field of communication technology more particularly to a kind of VOD methods and system for realizing that P2P shares.
Background technology
Conventional video playing on the market in order to realize that P2P shares effect, saves bandwidth expense, generally uses and playingP2P modules are integrated in device, in playing process, by this player P2P modules, correlation P2P servers and other play simultaneouslyThe P2P systems of the user node composition of this document, share to carry out P2P.But share for carrying out P2P using aforesaid wayUser, it is necessary to while using same manufacturer player and play same video or be mounted with the player of same manufacturerAnd same video file is store, it could be by the content share of the video file to other users.
Therefore video file share there are these points deficiency:
1.P2P technologies quotient is in order to dock the player that flash, android, ios, html5 etc. are respectively held, it is necessary to develop a set ofThere is very great development cost in the P2P systems of each platform.
2. player manufacturer integrates each end P2P modules of P2P technologies quotient offer, interface is relatively more, there are butt-joint intoThis, takes time and effort.
3. the player while program request or caching same video ability of same manufacturer only either be installeds using same manufacturerIt can carry out P2P to share so that the height that P2P shares rate is limited by player installation and service condition, is not achieved good pointEffect is enjoyed, there are bottlenecks for bandwidth conservation.
Invention content
The present invention for problems of the prior art, provide it is a kind of realize VOD method that P2P shares andSystem shares effect, and being capable of maximum dynamics saving bandwidth with good.
The technical solution that the present invention is proposed with regard to above-mentioned technical problem is as follows:
On the one hand, the present invention provides a kind of VOD method realized P2P and shared, including:
Player sends order request by order video file to Scout service device;
The Scout service device carries out the player with region according to the order request with the router of operatorDetection;
The Scout service device will store the video text when detecting the router for having stored the video fileThe IP of the router of part feeds back to the player;
The player is downloaded the video file from corresponding router by the IP and is played out.
Further, the VOD method that the realization P2P shares further includes:
The Scout service device, will be the same as the same operator in region when the router for being stored with the video file is not detectedIn the IP of an idle router feed back to the player;
The player triggers corresponding router by the IP and downloads the video file;
The video data of download is fed back to the player in real time and played out by the corresponding router.
Further, the VOD method that the realization P2P shares further includes:
The fileinfo of the video file is sent to statistics by the player in real time in video file described in program requestServer;
The statistical server counts the fileinfo, generates statistical log;
Log server obtains and stores the statistical log.
Further, the VOD method that the realization P2P shares further includes:
Hot list server obtains the statistical log, and calculate heat according to the statistical log at interval of preset durationDoor list of videos;
Popular video file in the popular list of videos is pushed to idle router by the hot list serverCarry out pre-download storage.
Further, the VOD method that the realization P2P shares further includes:
Each router is shared as P2P nodes in downloading video files, by this router, while obtains and download phase identical textOther P2P nodes of part, and to the P2P node requests datas of acquisition.
On the other hand, the present invention provides a kind of video on-demand system realized P2P and shared, including player, Scout serviceDevice and at least one router;The player includes request module and download module;The Scout service device includes detection mouldBlock and the first feedback module;
The request module is used to send order request to Scout service device by order video file;
The detection module be used for according to the order request to the player with region with operator router intoRow detection;
First feedback module is used for when detecting the router for having stored the video file, will have been stored describedThe IP of the router of video file feeds back to the player;
The download module plays out for downloading the video file from corresponding router by the IP.
Further, the Scout service device further includes the second feedback module, and the player further includes trigger module;
Second feedback module is used for when the router for being stored with the video file is not detected, will be same with regionThe IP of an idle router in operator feeds back to the player;
The trigger module is used to trigger the corresponding router download video file by the IP;
The corresponding router plays out for the video data of download to be fed back to the player in real time.
Further, the video on-demand system that the realization P2P shares further includes statistical server and log server;InstituteIt states player and further includes sending module;
The sending module is used in video file described in program request, is in real time sent the fileinfo of the video fileTo statistical server;
The statistical server generates statistical log for being counted to the fileinfo;
Log server is used to obtain and store the statistical log.
Further, the video on-demand system that the realization P2P shares further includes hot list server;
The hot list server is used to obtain the statistical log at interval of preset duration, according to the statistical logCalculate popular list of videos, and by the popular video file in the popular list of videos be pushed to idle router carry out it is pre- underCarry storage.
Further, the request module specifically includes:
Each router is additionally operable in downloading video files, this router is shared as P2P nodes, is obtained simultaneouslyOther P2P nodes of same file are downloaded, and to the P2P node requests datas of acquisition.
The advantageous effect that technical solution provided in an embodiment of the present invention is brought is:
P2P programs are installed on the router, router is made to realize P2P functions, player obtains video from neighbouring routerData play out so that P2P shares the installation and use for being not limited to player, as long as having, router user is online, utilizesIdle broadband resource can be achieved with sharing;Download is shared in router offer, is made user's order video, can be accomplished no out domainNet does not go out the cell routing of inhabitation, does not go out regional network, Bu Chu operators, you can the video file of needs is downloaded to, so as to subtractThe Internet resources burden of few operator, while also do one's bit for low-carbon China Reconstructs.
Description of the drawings
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodimentAttached drawing is briefly described, it should be apparent that, the accompanying drawings in the following description is only some embodiments of the present invention, forFor those of ordinary skill in the art, without creative efforts, other are can also be obtained according to these attached drawingsAttached drawing.
Fig. 1 is the flow diagram of VOD method that the realization P2P that the embodiment of the present invention one provides shares;
Fig. 2 is the schematic diagram of VOD method that the realization P2P that the embodiment of the present invention one provides shares;
Fig. 3 is the structure diagram of video on-demand system that realization P2P provided by Embodiment 2 of the present invention shares.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to embodiment party of the present inventionFormula is described in further detail.
Embodiment one
An embodiment of the present invention provides a kind of VOD methods realized P2P and shared, and referring to Fig. 1, this method includes:
S1, player send order request by order video file to Scout service device;
S2, the Scout service device according to the order request to the player with region with operator router intoRow detection;
S3, the Scout service device will store described regard when detecting the router for having stored the video fileThe IP of the router of frequency file feeds back to the player;
S4, the player are downloaded the video file from corresponding router by the IP and are played out.
It should be noted that being equipped with P2P programs on router, by selling for router, router is distributed in the whole nationVarious regions.P2P technologies quotient provides the P2P-SDK plug-in units that function is unified and logic is single and is called to player.
In program request video file, P2P-SDK plug-in requests tracking (tracker) server obtains nearby playerThe IP of several routers of the video file is stored, P2P-SDK plug-in units are downloaded from these routers by http agreements and regardedFrequency file plays out.Player is played out using simple http agreements from neighbouring router pulling data, makes P2PFunction is realized completely by router program, using the user of the router, not program request immediately or a certain player of installation,Its router can also provide idle bandwidth, data be uploaded to just in the user of program request this document, so as to make the resource of whole networkIt saves and maximizes.
Further, the VOD method that the realization P2P shares further includes:
The Scout service device, will be the same as the same operator in region when the router for being stored with the video file is not detectedIn the IP of an idle router feed back to the player;
The player triggers corresponding router by the IP and downloads the video file;
The video data of download is fed back to the player in real time and played out by the corresponding router.
If it should be noted that this carrier routers of this area, i.e., nearby router does not store the video file,Scout service device returns to the IP of the router of one or several free time nearby to player, is touched by the P2P-SDK plug-in units of playerIt sends out this one or several idle router and carries out P2P downloads, router feeds back to the video data of download while downloadingPlayer plays out.
Further, the VOD method that the realization P2P shares further includes:
The fileinfo of the video file is sent to statistics by the player in real time in video file described in program requestServer;
The statistical server counts the fileinfo, generates statistical log;
Log server obtains and stores the statistical log.
It should be noted that player, in order video file, the data such as meeting real-time report fileinfo take to statisticsBusiness device, statistical server generation statistical log, log server obtain statistical log at statistical server and are stored.
Further, the VOD method that the realization P2P shares further includes:
Hot list server obtains the statistical log, and calculate heat according to the statistical log at interval of preset durationDoor list of videos;
Popular video file in the popular list of videos is pushed to idle router by the hot list serverCarry out pre-download storage.
It should be noted that log list of the hot list server in log server calculates popular video rowTable.Specifically, hot list server calculates popular video row at interval of preset duration (generally 5 minutes) crawl statistical logTable, and carry out pre-download storage by the regular P2P programs for being pushed to associated router.Specific rules are will be in popular list of videosThe popular video file of video-on-demand times TOP100, be pushed to according to a certain percentage certain remaining space router carry out it is pre- underStorage is carried, i.e., more popular video file is pushed to more routers.Each video file had expired time, more than 48 hoursThen expired deletion.
Further, the VOD method that the realization P2P shares further includes:
Each router is shared as P2P nodes in downloading video files, by this router, while obtains and download phase identical textOther P2P nodes of part, and to the P2P node requests datas of acquisition.
It should be noted that the destination server resource that the P2P programs in router are asked by downloading user, leads to simultaneouslyIt crosses P2P programs and obtains the P2P node identical with the resource, request of data is initiated, and oneself is shared as to the P2P nodes of acquisitionP2P nodes.
It is the schematic diagram of VOD method that realization P2P provided in an embodiment of the present invention shares referring to Fig. 2, principleIncluding:Player carries out certain video file program request by clicking broadcast button, and player starts P2P-SDK modules, playerTracker servers is asked to return to accessor, player is played out by http agreements from router downloading data.It playsDevice is reported to statistical server, statistical server generation statistical log, and store statistical log and arrive in program request, by fileinfoLog server, hot list server obtain statistical log to calculate popular list of videos at interval of preset duration, and according toPopular video file in popular list of videos is pushed to router download.
The embodiment of the present invention installs P2P programs on the router, and router is made to realize P2P functions, and player is from neighbouring roadVideo data is obtained by device to play out so that P2P shares the installation and use for being not limited to player, as long as there is router useFamily is online, can be achieved with sharing using idle broadband resource;Download is shared in router offer, is made user's order video, can be doneTo no out domain net, do not go out the cell routing of inhabitation, do not go out regional network, Bu Chu operators, you can download to the video of needsFile so as to reduce the Internet resources of operator burden, while is also done one's bit for low-carbon China Reconstructs.
Embodiment two
An embodiment of the present invention provides a kind of video on-demand systems realized P2P and shared, and can realize above-mentioned realization P2P pointsAll flows for the VOD method enjoyed, referring to Fig. 3, the system comprises player 1, Scout service devices 2 and at least oneRouter 3;The player 1 includes request module and download module;The Scout service device 2 includes detection module and first insteadPresent module;
The request module is used to send order request to Scout service device by order video file;
The detection module be used for according to the order request to the player with region with operator router intoRow detection;
First feedback module is used for when detecting the router for having stored the video file, will have been stored describedThe IP of the router of video file feeds back to the player;
The download module plays out for downloading the video file from corresponding router by the IP.
Further, the Scout service device further includes the second feedback module, and the player further includes trigger module;
Second feedback module is used for when the router for being stored with the video file is not detected, will be same with regionThe IP of an idle router in operator feeds back to the player;
The trigger module is used to trigger the corresponding router download video file by the IP;
The corresponding router plays out for the video data of download to be fed back to the player in real time.
Further, the video on-demand system that the realization P2P shares further includes statistical server 4 and log server 5;The player further includes sending module;
The sending module is used in video file described in program request, is in real time sent the fileinfo of the video fileTo statistical server 4;
The statistical server 4 generates statistical log for being counted to the fileinfo;
Log server 5 is used to obtain and store the statistical log.
Further, the video on-demand system that the realization P2P shares further includes hot list server 6;
The hot list server 6 is used to obtain the statistical log at interval of preset duration, according to the statistics dayWill calculates popular list of videos, and the popular video file in the popular list of videos is pushed to idle router 3 and is carried outPre-download stores.
Further, the request module specifically includes:
Each router is additionally operable in downloading video files, this router is shared as P2P nodes, is obtained simultaneouslyOther P2P nodes of same file are downloaded, and to the P2P node requests datas of acquisition.
The embodiment of the present invention installs P2P programs on the router, and router is made to realize P2P functions, and player is from neighbouring roadVideo data is obtained by device to play out so that P2P shares the installation and use for being not limited to player, as long as there is router useFamily is online, can be achieved with sharing using idle broadband resource;Download is shared in router offer, is made user's order video, can be doneTo no out domain net, do not go out the cell routing of inhabitation, do not go out regional network, Bu Chu operators, you can download to the video of needsFile so as to reduce the Internet resources of operator burden, while is also done one's bit for low-carbon China Reconstructs.
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all the present invention spirit andWithin principle, any modification, equivalent replacement, improvement and so on should all be included in the protection scope of the present invention.