Summary of the invention
In view of this, the objective of the invention is to overcome the weak point of prior art, propose a kind of stream media service system and its implementation based on controllable P 2 P technology.
The present invention combines the advantage of CDN and P2P technology, under the prerequisite that ensures QoS, can effectively reduce operating cost of operator, reduces the network traffics of backbone network, alleviates the outlet bandwidth pressure of central machine room; Simultaneously, system has the retractility and the autgmentability of height, can well satisfy the streaming media service request of the intensive burst of user, also can be along with user's increase expansion service ability.In addition, this system also provides DRM (Digital Rights Management, digital copyright management) function, effectively authenticates and charges, and avoids the propagation of illegal and pirate content, satisfies the requirement of operator's management and operation; For demand (telecommunication) service, time-out be provided, advance, F.F., retreat, rewind down and drag the VCR function.
For achieving the above object, the invention provides a kind of stream media service system based on controllable P 2 P technology, its technical scheme is:
A kind of stream media service system is four parts according to spatial division, comprises the network that is connected these three parts of overall center, branch center and client; Be divided into three levels according to logic function, comprise that business provides layer, business support layer and transport network layer.The present invention also comprises proxy caching technology, load-balancing technique, distributed storage and controllable P 2 P transmission technology.
The present invention is divided into four parts from the space:
1. overall center comprises Web server, database server, overall central dispatching server, overall central store server cluster and NM server;
2. the branch center comprises branch center dispatch server and branch center streaming media server cluster, and the branch center can be provided with one or more according to actual conditions, perhaps one or more levels;
3. client;
4. the network that connects these three parts.
According to actual conditions, overall center and branch center also can merge.
This system is divided into three levels from logic function:
1. business provides layer, comprises Web server, overall central store server cluster, branch center streaming media server cluster and client, be used for streaming medium content issue, store and provide streaming media service;
2. the business support layer comprises database server, overall central dispatching server, branch center dispatch server and NM server, is responsible for realizing management and dispatching and the safety certification and the billing function of program file and media flow transmission.
3. transport network layer based on the broadband network of ICP/IP protocol, is responsible for the transmission of Media Stream and control information;
Described business provides in the layer:
Web server is responsible for user's login and is withdrawed from, and to the introduction that the user provides streaming media resource link and flow-medium performance content, can also supply user inquiring personal account information.
Overall situation central store server cluster is responsible for preserving the primary flow media file.
Branch center streaming media server cluster, be arranged on network edge, responsible user to affiliated area provides quick streaming media service nearby, and, eliminate local out-of-date streaming media resource simultaneously according to the streaming media resource copy that the user click condition storage is brought from overall central store server push.
Client after the link of user's click steam media resource, begins to download and playing stream media, is carrying out providing streaming media service to other clients of being trusted on the basis of local storage to downloading content simultaneously.
In described business support layer:
Database server is responsible for storing individual subscriber account information and streaming media resource information.
Overall situation central dispatching server is responsible for according to user's IP address user's request being redirected to the streaming media server of corresponding branch center, and is responsible for pushing the streaming media resource copy according to scheduling strategy to the branch center streaming media server.
The branch center dispatch server, be responsible for receiving various control informations, manage and control between branch center streaming media server and the client and the media flow transmission between client and the client, the distributed storage of while control flows media content on client is to realize the overall situation and local utilization of resources and load balancing.
NM server is responsible for the management of user profile and various resources.
Described system business provides the quantity of all kinds of servers in layer and the service control layer to be configured according to service needed, with the expansion and the variation of adaptive system service ability.
Described Internet communication layer is meant the broadband network based on ICP/IP protocol, does not need to support IPv6 and multicast, but when the network support multicast, programme televised live can realize that native system is also supported IPv6 simultaneously by the multicast mode.For ensureing QoS, all transfer of data have all adopted ways of connecting in transport layer.
Wherein, described overall central store server cluster and branch center streaming media server cluster have all adopted distributed file system, its core is that data path is separated the structure storage system with the control access, each memory device has certain intelligence, and the data that can manage automatically on it distribute.Thereby solved the problem that in present streaming media server disk reading rate easily becomes performance bottleneck.Each streaming media server of branch center can be shared the file of distributed type assemblies file system simultaneously.
Described client is provided with two memory cache districts: receive buffer area and play buffer area.Receive buffer area and be used to receive the packet that sends over from streaming media server or other clients line ordering of going forward side by side; Play buffer area and be responsible for storing the content that to play.Client also is provided with a physical storage area simultaneously, is used for storing the contents fragment that receives, so that provide service to other clients when needed; For the integrality of protection memory contents, prevent piracy and reduce disk fragments that this memory block is designed to the encrypt file of a fixed size, comprising data block index and data block contents.
Described dispatch server is realized controllable P 2 P technology to client by implementing certain scheduling strategy.
Described controllable P 2 P technology is meant that by the control strategy of dispatch server according to controllable P 2 P transmission is controlled to the P2P between the client.
The control strategy of described controllable P 2 P comprises authentication, mandate, charging, audit, grouping, flow medium function restriction, the communication of client and/or encrypts, wherein:
Authentication, being used for the branch center dispatch server safeguards the information of all authorized client, after the branch center dispatch server is received a request, according to the certification policy that pre-defines client is authenticated, if by the other side's information would be noted, whether if place on record, so just checking needs to upgrade;
Authorize, be used for the client that the branch center dispatch server passes through authentication and authorize, make its can with other client communications;
Charge, be used for client authorization that the branch center dispatch server passes through authentication after, according to the charge information of the charging policy record client that pre-defines;
Audit is used between the client by authentication, and the relation that breaks the wall of mistrust between the client and server, thereby carries out the P2P transfer of data;
Grouping is used for the branch center dispatch server and according to the request of the Control Parameter of the strategy that pre-defines, setting and client subparticipation is returned to the requesting party to the information of the client of same content and select according to self-demand;
The media function restriction, be used for client after the response of receiving the branch center dispatch server and authentication are passed through, just can obtain the information of other clients of mandate, it just can be according to these information and authority so, connect with other clients, from they obtain the authorization resource and other authorities there;
Communication, be used at whole communication process, client must constantly be communicated by letter with the branch center dispatch server, reports the state of oneself, also obtain simultaneously the state of other authorized client that control information communicates by letter with current participation there, comprise IP address and port from the branch center dispatch server;
Encrypt, be used for adopting between client and the branch center dispatch server cryptographic protocol to communicate by letter, client passes to the branch center dispatch server to state information of oneself and authentication information, and the branch center dispatch server then passes to client to authorized client tabulation and state information.
In order to achieve the above object, it is a kind of in the stream media service system mid point broadcasting flow-medium service implementing method based on controllable P 2 P technology that the present invention also provides, and its technical scheme is:
1. user's Website login, introducing the page by entering program after authenticating, the user is at browsing pages and behind the program of need selecting, click corresponding link and will start client-side program automatically, Web server sends to overall central dispatching server to IP address and streaming media resource demand information simultaneously;
2. overall central dispatching server sends to corresponding branch center dispatch server according to user's IP address with user's address and streaming media resource demand information, and whether the streaming media server of checking this branch center store the program that the user needs, if just do not push the streaming media resource file to this branch center immediately;
3. the branch center dispatch server according to the streaming media server scheduling strategy, at first selects a branch center streaming media server and program request user client to connect after receiving client slide program fragment demand information, and sends stream medium data; Simultaneously according to the controllable P 2 P control strategy, this client is set up and being connected of other qualified clients, obtain data, thereby gradually reduce even break away from dependence the branch center streaming media server;
4. packet is stored in client and receives buffer area and sort and decipher, and the content replication that will play is to playing buffer area then, after playing buffer area and being full of for the first time, can begin broadcast program;
5. client is in operation regularly to the local fragments store information of branch center dispatch server report and the information of service is provided to other clients, after the instruction that receives other client-requested services, at first the client that requires to serve is carried out safety certification, by after can set up P2P and connect, service is provided;
6. advance when the user carries out, F.F. or when dragging the VCR operation forward, client sends the program fragment demand information to branch center dispatch server, repeating step 3;
7. retreat when the user carries out, rewind down or when dragging the VCR operation backward, client-side program checks at first whether local storage has this fragment, if have, directly deciphering, copy to and play the buffer area broadcast, if no, then send the program fragment demand information to the branch center dispatch server, repeating step 3.
8. after the peer client that service is provided interrupts service is provided for a certain reason, at first according to tabulating, if all backup request are all failed in the tabulation, then to branch center dispatch server request, repeating step 3 to the backup client request.
In the described step 2, if the streaming media resource that the branch center does not have the user to need can provide streaming media service to the user receiving and store when overall center pushing the streaming media resource of coming.
When the network equipment was supported multicast, programme televised live can be realized with the multicast mode.
The present invention is a kind of based on the stream media service system of controllable P 2 P technology and the implementation method of request program thereof, has the following advantages and innovates effect:
1. secure QoS, the present invention ensures final QoS by the Streaming Media compensation technique;
2. use flexibly, the present invention has adopted the controllable P 2 P control strategy, can be easy to realize multiple valued added applications on this basis;
3. have high performance price ratio, owing to realized the P2P between the client, thus effectively reduce the investment of whole system;
4. effectively reduce the network traffics of backbone network, the present invention is set to network edge nearby for the user provides service with the branch center, therefore can effectively reduce the network traffics of backbone network;
5. effectively alleviate central machine room network bandwidth pressure, when concurrent user number is high, utilize the P2P between the client, can effectively alleviate the load of central machine room;
6. have retractility and autgmentability highly, can effectively deal with the service request of intensive burst, hardware configuration also can increase and decrease according to actual conditions.
7. can seamlessly transit from existing CDN system,, only need a small amount of hardware change, rely on software upgrading to seamlessly transit existing CDN system, thus the existing investment of protection operator;
8. response speed is fast, and film can drag, and relies on the high-performance of server, and system can respond user's operation fast, and certain VCR function is provided.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, the present invention is described in further detail below in conjunction with accompanying drawing.
Networking structure of the present invention as shown in Figure 1, overall center comprises Web server, database server, overall central dispatching server, overall central store server cluster and NM server among the figure.Web server is responsible for user's login and is withdrawed from, and to the introduction that the user provides program chaining and flow-medium performance content, can also supply user inquiring personal account information; Database server is responsible for storing individual subscriber account information and streaming media resource information; Overall situation central dispatching server is responsible for according to user's IP address user's request being redirected to the streaming media server of corresponding branch center, and is responsible for pushing the streaming media resource copy according to scheduling strategy to the branch center streaming media server; Overall situation central store server cluster is responsible for preserving the primary flow media file; NM server is responsible for the management of user profile and various resources.Wherein overall central store server cluster has adopted distributed file system, has very high disk read-write speed and robustness.Overall situation central dispatching server is a client of overall central store server cluster.
Among Fig. 1, the branch center that is arranged on network edge comprises branch center dispatch server and streaming media server cluster.The branch center dispatch server, be responsible for receiving various control informations, manage and control between branch center streaming media server and the client and the media flow transmission between client and the client, the distributed storage of while control flows media content on client is to realize the overall situation and local utilization of resources and load balancing; Branch center streaming media server cluster, responsible user to affiliated area provides quick streaming media service nearby, and, eliminate local out-of-date streaming media resource simultaneously according to the streaming media resource copy that the user click condition storage is brought from overall central store server push.Branch center streaming media server cluster has adopted distributed file system too, each streaming media server also is a client of this distributed file system in operation streaming media service program, thereby not only can share the file on the distributed type assemblies file system, can also obtain very high disk read-write speed, avoid because the system bottleneck that disk read-write speed causes inadequately.Overall situation central dispatching server also is the distributed file system client that each branch center streaming media server cluster constitutes, because overall central dispatching server also is the client of overall central store server cluster simultaneously, therefore on overall central dispatching server, be easy to realize the propelling movement of streaming media resource.
Among Fig. 1, the user obtains service by the accessing terminal to network of band client-side program.
Media flow transmission process among the present invention as shown in Figure 2.Dotted line is represented control flows among Fig. 2; The solid lines represent data of band arrow flows to, and represents different programs with A and B.As shown in Figure 2, the transmission course of Media Stream is described below:
Client node 1 at first connecting system require to provide streaming media service A, after authentication, overall central dispatching server is redirected to certain branch center with demand according to the contiguous principle in region;
2. the branch center dispatch server is dispatched arbitrary streaming media server (in this example, using streaming media server 1) and is provided streaming media service for it according to user's request;
3. after a period of time, client node 2 also proposes with the identical service A of client node 1 to this branch center;
4. owing to have programme content A in streaming media server 1 internal memory, according to buffer memory cache principle of priority, branch center dispatch server Scheduling Flow media server 1 provides service for client node 2, begins to carry out resource searching simultaneously;
5. the branch center server search has the content that client node 2 needs to the client node 1, so the IP address of client node 1 is sent to client node 2;
6. client node 2 connects client node 1, through safety certification, client node 1 begins to send data to client node 2, because in this class network of similar ADSL, upstream and downstream bandwidth is also asymmetric, so client node 1 can not be independently for client node 2 provides service, and need and streaming media server provides service together, but alleviated the pressure of streaming media server at this moment;
7. client node 3 adds (content of existing A on it), because that client node 3 requires is different streaming media service B, principle according to load balancing, the branch center dispatch server is dispatched another streaming media server (in this example, using streaming media server 2) and is provided service as client node 3;
8. client node 4 adds, require streaming media service A, branch center dispatch server at first Scheduling Flow media server 1 passes through resource searching then for it provides service, the content that all has client node 4 to need on the discovery client node 1,2,3 is so issue the client node 4 of tabulating;
9. client node 4 connects client node 1,2,3 respectively, through safety certification after, begin to obtain data from client node 1,2,3, this moment, client node 4 can be completely free of the dependence of convection media server 1;
10. after the user drags film, directly send the segment demand information to the branch center dispatch server, the branch center dispatch server is according to handling with the similar mode of preceding step;
11. in playing process, after the client node that service is provided lost efficacy, client node at first connected backup node, if backup node all lost efficacy, then demand is submitted to branch center dispatch server requirement and reschedules.