Summary of the invention
The deficiency that the objective of the invention is to solve in the background technology relevant stream media server system and stream media ordering method patent; Providing a kind of leaves files in stream media on the Hadoop storage cluster in; The clustered deploy(ment) of virtual stream media server is on blade server; Reception is obtained the files in stream media data from Hadoop storage cluster, and adopts virtual stream media server colony dispatching and metadata cache strategy, realizes the method for streaming media on demand function.
For reaching above purpose, the present invention takes following technical scheme to be achieved:
A kind of stream media ordering method based on Hadoop and virtual stream media server cluster; It is characterized in that; Comprise the steps: that (1) files in stream media leaves on the Hadoop storage cluster; (2) streaming media server is structured on the Virtual Server Cluster, and (3) virtual stream media server cluster directly obtains the files in stream media data from Hadoop storage cluster, and adopts virtual stream media server colony dispatching and data cache method; Realize the streaming media on demand function; Wherein, the described virtual stream media server of step (3) colony dispatching method is that the virtual machine server management node is used for controlling the unlatching of virtual stream media server and closing; The virtual machine server management node with virtual stream media server cluster network bandwidth usage surpass 80% or memory usage to surpass 90% be foundation, trigger virtual stream media server set-up mechanism; With virtual stream media server cluster overall bandwidth occupancy less than 20% and memory usage less than 30% and to have user's request amount be that 0 virtual stream media server is a foundation, trigger virtual stream media server reclaim mechanism;
The described virtual stream media server of step (3) cluster data cache method is, adopted the balanced deployment strategy of metadata cache of virtual stream media server cluster, carries out the prefix of file for the focus files in stream media and disposes; According to the real-time focus degree of files in stream media, real-time focus Documents Department is deployed on the virtual stream media server of new unlatching; And when carrying out the streaming media on demand service, consider the time order and function order and the relevance of request same stream media file, to the The data corresponding intervals buffer memory that obtains from Hadoop storage cluster; Read bandwidth according to virtual stream media server cluster to the file of Hadoop storage cluster, dynamically control the cache size on each virtual stream media server, trigger virtual machine scheduling policy.
In the such scheme, the concrete steps of described triggering virtual stream media server set-up mechanism are:
Step1: virtual machine server management node initialization;
Step2: the virtual machine server management node obtains the reservation internal memory θ that each virtual stream media server is provided with
iAnd the network bandwidth μ that reserves
iObtain current unlatching virtual stream media server number N;
Step3: virtual machine server management node real-time update detects the network bandwidth α that each virtual stream media server takies
iAnd the β of committed memory
iIf virtual stream media server cluster network bandwidth usage
Surpass 80% or memory usage
Surpass 90%, then jump to
Step4, otherwise continue to detect;
Step4: the virtual stream media server is reserved internal memory θ for the virtual stream media server of opening is provided with from assignable resource
N+1, network bandwidth μ
N+1, open the virtual stream media server and serve for user's program request.
The concrete steps of described triggering virtual stream media server reclaim mechanism are:
Step1: virtual machine server management node initialization;
Step2: the virtual machine server management node obtains the reservation internal memory θ that each virtual stream media server is provided with
iAnd the network bandwidth μ that reserves
iObtain current unlatching virtual stream media server number N;
Step3: the virtual machine server management node detects current each virtual stream media server and takies network bandwidth α
iAnd the β of committed memory
iIf the bandwidth usage of current virtual stream media server cluster
Less than 20% and memory usage
Less than 30% and exist the virtual stream media server to satisfy network bandwidth occupation rate β simultaneously
i/ μ
iBe 0%, then jump to Step4, otherwise continue to detect;
Step4: the virtual server management node, manage the internal memory α of this virtual stream media server to be recycled
L, network bandwidth β
LResource adds resource in the middle of the allowable resource, closes this virtual stream media server, reclaims virtual machine.
The balanced deployment strategy of the metadata cache of described virtual stream media server cluster is deployed in each file prefix on the virtual stream media server cluster for the mode of disposing with prefix, and concrete steps are following:
Step1:, obtain the focus files in stream media θ of server in time T according to the record of Hadoop storage cluster convection current media file access
i, focus files in stream media θ
iDefinition be in time T, its access times N
iGreater than 5% of the total access times N of Hadoop storage cluster file;
Step2: according to focus files in stream media θ
iThe times N of visit
i, can obtain θ
iRelative temperature
Wherein, n is the number of whole focus files, N
jBe focus files in stream media θ wherein
jAccess times;
Step3: the virtual stream media server number of establishing current startup is M, according to focus files in stream media θ
iRelative temperature
Obtain θ
iNeed carry out the number ρ of the virtual server of prefix deployment
iFor
Step4: according to each focus files in stream media θ
iPrefix is disposed number ρ
i, from M virtual stream media server, choose ρ
iIndividual is file θ
iCarrying out the prefix of load balancing disposes.
Described concrete steps at the new real-time focus file of opening of virtual stream media server deploy are:
Step1: obtain the visit situation of current Hadoop storage cluster convection current media file, establish file θ this moment
iThere is N
iIndividual request visit, the total request of Hadoop storage cluster response number is N;
Step2: for R
iSatisfy R
iThe file θ of>5%M
i, it is added real-time focus file set, the focus file set is { θ during document
i, θ
j..., θ
x, θ
y, and the focus file is k altogether;
Step3: establishing the virtual stream media server number that virtual stream media services this moment cluster opened is M, from focus file set { θ
i, θ
j..., θ
x, θ
yIn select at random
Individual, these focus files are carried out prefix dispose on the virtual stream media server of newly opening;
Described interval caching method does,
Step1: when the t moment, the user asks q to arrive the virtual machine server management node, checks whether the files in stream media θ of current request is present in the middle of the prefix deployment of virtual stream media server cluster.If exist, jump to Step2; Otherwise jump to Step3;
Step2: for the virtual stream media server set { S that exists files in stream media θ prefix to dispose
1, S
2..., S
n, select the minimum response request q of memory usage in the virtual stream media server, the user is served; When this moment this virtual stream media server had request q ' to Hadoop storage cluster files in stream media θ; The data that q ' beginning buffer memory reads; And the data after the Hadoop storage cluster demand file θ prefix, the data of getting off up to q ' buffer memory can be request q service; If there is not the request to Hadoop storage cluster convection current media file θ in current virtual stream media server, then uses the prefix buffer memory to serve, and from Hadoop storage cluster, obtain the further part of θ prefix file;
Step3: check (whether t-Δ t t) exists identical file request to the virtual stream media server in time in the time to file θ.If have identical file request, jump to Step4; Otherwise jump to Step5;
Step4: will ask q to distribute to exist the minimum virtual stream media server m of internal memory occupation rate in the virtual stream media server of file θ request, m begins the data of cache file θ.This virtual stream media server m begins the file θ of request q request is served; The virtual stream media server uses the prefix buffer memory to serve; And beginning is to the further part of Hadoop storage cluster demand file θ prefix file; Up to asking to begin data in buffer, utilize the interval data in buffer to serve at time t;
Step5: if there is not identical file request, then distribute the minimum virtual stream media server of a memory usage, begin to respond the service of this time asking q;
Step6: in the time of new request, be repeated to Step1, carry out Cyclic Service.
Cache size concrete steps on each virtual stream media server of described dynamic control are following:
Step1: the virtual machine server management node is obtained current Hadoop storage cluster service bandwidth occupation rate φ.If φ greater than 90%, jumps to Step2; If φ less than 10%, jumps to Step3;
Step2: the virtual machine server management node sends to each virtual stream media server increases the message of cache size at interval; Each virtual stream media server is received increases buffered message at interval, increases the interval buffer memory of each virtual stream media server, and size is the half the of each virtual stream media server free memory;
Step3: the virtual machine server management node sends the message of initialization interval cache size to each virtual stream media server; Each virtual stream media server is received the initialization interval buffered message, and interval cache size separately is set to initial value.
Compared with prior art, advantage of the present invention is:
1, virtual stream media services clustered deploy(ment) can be passed through the virtual machine server management node on blade server, according to virtual machine scheduling policy virtual machine is dynamically opened and is closed.
2, consider the focus degree of Hadoop storage cluster files in stream media, according to the focus degree file has been carried out corresponding prefix and dispose, can realize the load balancing of virtual bulk flow media server cluster.
3, consider the bandwidth that reads of virtual stream media server cluster and Hadoop storage cluster, can dynamically control virtual machine cache size at interval.Like this, the virtual machine server management node can trigger virtual machine creating and reclaim mechanism according to the network and the internal memory operating position of virtual stream media server cluster.
Embodiment
System architecture
With reference to shown in Figure 1, described stream media ordering method framework based on Hadoop and virtual stream media server cluster is become by virtual machine server management node, virtual stream media server and Hadoop saveset group, and is specific as follows:
Virtual machine server management node: be used to monitor the state of virtual stream media server, the unlatching and the shutoff operation of control virtual stream media server;
Virtual stream media server cluster: the server that specifically carries out order program service to the user; Formed virtual stream media services cluster by a plurality of virtual stream media servers;
Hadoop stores cluster: be in charge of files in stream media, the files in stream media request of response virtual stream media server;
Be the concrete embodiment of example shows with virtual resource monitor component IBM Tivoli Monitoring and Virtual Machine Manager serviced component Virtual Computing Lab below: the virtual machine server management node is the server end of virtual resource monitoring software IBM Tivoli Monitoring; Below be called ITM; Be used for monitoring the resource such as internal memory, the network bandwidth of virtual stream media server; And adopt Virtual Machine Manager serviced component virtual Computing Lab; Below be called VCL, accomplish the management of virtual machine; The virtual stream media server is the monitoring client of ITM, when VCL carries out virtual machine distribution startup, this virtual machine ITM Agent is registered among the ITM Sever; Hadoop stores cluster, is in charge of files in stream media, the files in stream media request of response virtual stream media server.
The set-up mechanism of virtual stream media server
According to current virtual stream media server network bandwidth occupancy and memory usage is index, triggers the creation operation of virtual stream media server.
1) virtual machine server management node initialization
The virtual machine server management node is collected the state information of virtual machine streaming media server, thereby realizes the monitoring to virtual machine streaming media server real-time status.The initialization of virtual machine server management node is responsible for safeguarding the streaming media server network bandwidth that all and virtual stream media apparatus interaction are collected and the tables of data of internal storage state information, handles the state parameter of its internal memory and network interface respectively.
2) the virtual machine server management node obtains the reservation internal memory θ that the virtual stream media server is provided with
iAnd the network bandwidth μ that reserves
i
Virtual machine server management node and virtual stream media server carry out alternately through the running state parameter information of XML form, collect the reservation internal memory θ that each virtual stream media server is provided with
iAnd the network bandwidth μ that reserves
i, opened virtual stream media server number N.
3) virtual machine server management node real-time update detects the network bandwidth α that the virtual stream media server takies
iAnd the β of committed memory
i
Virtual machine server management node real-time servicing upgrades the internal memory of each virtual stream media server and the state parameter of network interface, detects to obtain its network bandwidth α that takies
iAnd the β of committed memory
iWhen satisfying following condition, opening new virtual stream media server serves for user's program request:
(1) virtual stream media server cluster network bandwidth usage
(2) virtual stream media server cluster memory usage
Otherwise continue to detect each state parameter, repeat this step until satisfying above-mentioned condition.
4) open new virtual stream media server
The virtual server management node is safeguarded the mirror image of virtual stream media server through the virtual machine image manager, when needs are opened new virtual machine, from the mirror image manager, selects corresponding virtual machine mirror image to operate.
The virtual stream media server is reserved internal memory θ for the virtual stream media server that is about to open is provided with from assignable resource
N+1, reservation of network bandwidth μ
N+1Through the control of the virtual machine image manager in virtual server management node virtual machine image storehouse, be that identical streaming media server copy is copied on the physical server through internal network afterwards with the virtual server mirror image.After accomplishing the virtual server mirror-image copies, system carries out the startup of N+1 platform virtual server and the setting of streaming media server software environment, for user's program request is served.
With reference to shown in Figure 2, described virtual machine creating mechanism.The virtual machine server management node is realized the system running state data acquisition through middleware ITM, and the calling interface of Web mode is provided to the upper strata application service.The virtual machine server management node is set up the real-time running state parameter information that data are connected and obtain virtual machine through soap protocol with ITM condition monitoring server.
The virtual machine server management node encapsulates all state informations and collection method thereof; Every kind of state parameter all has corresponding type to manage; Comprise: MemoryParameters class, NetworkParameters class, be responsible for safeguarding the state parameter of internal memory and network interface respectively.
State information between virtual machine server management node and the ITM middleware is to transmit according to the XML form, so management node need call the parsing that the XML data content is carried out in the Dom4j storehouse.ITM Parse class is resolved the XML file that system obtains according to the setting form of ITM, extract various system running state parameters.The main flow process of system running state parameter collection is:
To intended target virtual machine and required running state parameter, generate the system running state parameter collection request of XML form.
1. the object of initialization HttpURLConnection class is set up HTTP with the virtual machine server management node and is linked and use setRequestProperty () method to carry out corresponding configuration to linking.
2. call getOutputStream () method and form output stream, and the object of initialization OutputStream class, the request of Write () method transmit status parameter collection called.
3. call the return results that getInputStream () obtains server, with its with and the object of XML form initialization Document class.
4. obtain the root element of this XML content through calling getRootElement () method.Parse required running state parameter through CalculatePara () method.
Collect the reservation internal memory θ that each virtual stream media server is provided with
iAnd the network bandwidth μ that reserves
i, current unlatching virtual stream media server number is N; Then detect and obtain its network bandwidth θ that takies
iAnd the μ of committed memory
iWhen satisfying following condition, opening new virtual stream media server serves for user's program request:
(1) virtual stream media server cluster network bandwidth usage
(2) virtual stream media server cluster memory usage
Otherwise continue to detect each state parameter, after satisfying above-mentioned condition, the virtual stream media server is from assignable resource, and the virtual stream media server that for this reason is about to open is provided with reserves internal memory θ
N+1, network bandwidth μ
N+1
The virtual machine server management node uses Virtual Machine Manager assembly VCL to manage a plurality of virtual machine operations tasks; VCL is through vcld assembly poll inquiry virtual machine server leader information, if find the virtual machine creating request then call its esx module and carry out corresponding operating.Add the support of the action need mirror site of virtual machine.As shown in Figure 4, this operation implementation procedure is following:
Step1:VCL assembly poll inquiry virtual machine server leader information, its esx module is then called in the request of discovery virtual machine creating;
Step2: judge whether the physical server disk space is enough,, otherwise go to Step8 if enough then continue Step3;
Step3: virtual machine title legitimacy is added in inspection, then continues Step4 as if legal, otherwise goes to Step8;
Step4: duplicate virtual machine image;
Step5: start virtual machine;
Step6: registration virtual machine IP;
Step7: add virtual machine Control Node management information;
Step8: finish the virtual machine creating operation.
The final startup of accomplishing N+1 platform virtual server is for user's program request is served.
The reclaim mechanism of virtual stream media server
Judged whether that according to current virtual stream media server network bandwidth occupancy and virutal machine memory occupancy the virtual stream media server is in unloaded idle state, when current virtual stream media server does not have user capture, triggered the reclaimer operation of virtual stream media server.
1) virtual machine server management node initialization
The virtual machine server management node is collected the state information of virtual machine streaming media server, thereby realizes the real-time status of virtual machine streaming media server is monitored.The initialization of virtual machine server management node is responsible for safeguarding the streaming media server network bandwidth that all and virtual stream media apparatus interaction are collected and the tables of data of internal storage state information.
2) the virtual machine server management node obtains the reservation internal memory θ that the virtual stream media server is provided with
iAnd the network bandwidth μ that reserves
i
Virtual server management node and virtual stream media server carry out alternately through the running state parameter information of XML form, collect the reservation internal memory θ that each virtual stream media server is provided with
iAnd the network bandwidth μ that reserves
i, having opened virtual stream media server number is N.
3) judge whether current virtual stream media server is in unloaded idle state and need be recovered
Unloaded idle state promptly exists the virtual stream media server to satisfy unloaded idle condition β
i/ μ
i=0% is that network bandwidth occupation rate is 0%.When carrying out virtual machine recovery decision-making, need to consider the special circumstances under the front end request distribution mechanisms.Supposing the system finds have a virtual stream media server M not have user capture in the Virtual Server Cluster according to state information this moment, and promptly M is in unloaded idle state, then has two kinds of possible situation to distinguish.
First kind of situation is that M is the virtual machine that leaves unused, and in following a period of time, also will leave unused always.Virtual machine under this state should be recovered, the system resource of release busy; Second kind of situation is that M is the new virtual stream media server that is created recently, just do not have user's program request this moment, satisfies unloaded idle condition β
i/ μ
i=0%, but follow-up request will be positioned on this virtual server very soon.The virtual machine of this moment should continue to keep, and handles the follow-up user who is about to arrive and asks.
Judge the virtual stream media server M that is in unloaded idle state is in above-mentioned which kind of situation:
The bandwidth usage of current virtual stream media server cluster
The memory usage of current virtual stream media server cluster
Satisfy above-mentioned two conditions, then M satisfies second kind of situation, need be recovered.Otherwise satisfy first kind of situation, be the new virtual machine server of creating, continue to detect each state parameter, repeat this step until satisfying above-mentioned condition.
4) close the virtual stream media server, reclaim virtual machine
The virtual server management node is managed the internal memory α of this virtual stream media server to be recycled
L, network bandwidth β
LThe physical resource that distributes before the resource etc., current unlatching virtual stream media server number is N; To reclaim resource and add in the middle of the allowable resource, close this virtual stream media server, and accomplish and reclaim this virtual stream media server.
With reference to shown in Figure 3, described virtual machine reclaim mechanism.To intended target virtual machine and required running state parameter, generate the system running state parameter collection request of XML form.
1. the object of initialization HttpURLConnection class is set up HTTP with the virtual machine server management node and is linked and use setRequestProperty () method to carry out corresponding configuration to linking.
2. call getOutputStream () method and form output stream, and the object of initialization OutputStream class, the request of Write () method transmit status parameter collection called.
3. call the return results that getInputStream () obtains server, with its with and the object of XML form initialization Document class.
4. obtain the root element of this XML content through calling getRootElement () method.Parse required running state parameter through CalculatePara () method.
Collect the reservation internal memory θ that each virtual stream media server is provided with
iAnd the network bandwidth μ that reserves
i, current unlatching virtual stream media server number is N; Then detect and obtain its network bandwidth α that takies
iAnd the β of committed memory
iWhen satisfying following condition, reclaim the virtual stream media server:
1) network bandwidth occupancy of current virtual stream media server cluster
2) memory usage of current virtual stream media server cluster
3) exist virtual stream media server M to satisfy unloaded idle condition β
i/ μ
i=0%,
Otherwise continue to detect each state parameter the internal memory θ of this virtual stream media server to be recycled of virtual server management node management after satisfying above-mentioned condition
i, network bandwidth μ
iThe physical resource that distributes before the resource etc., current unlatching virtual stream media server number is N;
The virtual machine server management node uses Virtual Machine Manager assembly VCL to manage a plurality of virtual machine operations tasks; VCL is through vcld assembly poll inquiry virtual machine server leader information, if find the virtual machine creating request then call its esx module and carry out corresponding operating.As shown in Figure 5, this operation implementation procedure is following:
Step1:VCL assembly poll inquiry virtual machine server leader information, its esx module is then called in discovery virtual machine deletion request;
Step2: nullify virtual machine IP;
Step3: stop virtual machine service;
Step4: nullify the virtual machine server leader information;
Step5: finish the virtual machine deletion action.
Reclaim resource the most at last and add in the middle of the allowable resource, close the virtual stream media server and accomplish the recovery of this virtual stream media server M.
The balanced prefix deployment strategy of files in stream media
This strategy is used for balanced deployment of prefix of carrying out the focus file on the virtual stream media server, mainly comprises and obtaining focus file, generation deployment umber, three steps of balanced deployment strategy, and is specific as follows:
With reference to shown in Figure 6, the described step of obtaining Streaming Media focus file is:
In the Step1:Hadoop storage cluster acquisition time T,, obtain files in stream media access times N according to Hadoop cluster Visitor Logs;
If Hadoop storage cluster file access record format is:<file mark θ
i, the file access time T
i>File access times N like this is: satisfy T
iIn time interval T, the bar number of file access record;
Step2:, obtain files in stream media θ according to Hadoop cluster Visitor Logs
iAccess times N
iFor files in stream media θ
iAccess times N
iFor: satisfy T
iIn time interval T, file mark is θ
iThe bar number of file access record;
Step3: for each files in stream media θ
i, calculate visit ratio N
iIf/N is N
i/ N jumps to Step4 greater than 5%; Otherwise whether inspection also has files in stream media not calculate, if having, repeats step3, otherwise jumps to Step5;
Step4: with this files in stream media θ
iAdd focus files in stream media data sequence;
Step5: the focus files in stream media sequence of generation is exactly the focus file sequence in time T.
With reference to shown in Figure 7, the deployment umber of each focus file of described generation, concrete steps are following:
Step1: virtual stream media server number M from the Virtual Service of service to the virtual machine server management node that inquire, obtain; The current virtual machine of virtual machine server management node inquiry VCL is opened tabulation, the virtual stream media server number that statistics is opened;
Step2: the relative temperature of calculating each focus files in stream media
Be designated as ρ
i
Step3: the deployment umber M * ρ that calculates each focus files in stream media
i, and condition below satisfying:
If M * ρ
iLess than 1, n then
iBe designated as 1;
If M * ρ
iGreater than 1, n then
iBe designated as M * ρ
iTake off integer.
Step4: generated the focus files in stream media and disposed number sequence n
1, n
2..., n
n
With reference to shown in Figure 8, described is the balanced step of disposing of file, specific as follows:
Step1: if files in stream media θ
iCorresponding deployment umber is n
i, then in deployment file, increase file n
i-1 part; Each files in stream media that need dispose is carried out such operation, and final deployment file set becomes number and does
The file deployment set
Step2: calculate virtual stream media server M
iNeed the file number h of deployment, obtaining current unlatching virtual stream media server number from the virtual machine server management node is M, and then h does
And the h minimum value is 1;
Step3: to virtual stream media server M
iCarry out following operation: from the file deployment set
A middle picked at random h files in stream media is disposed, and from set, leaves out this h files in stream media;
Step4: each virtual stream media server is repeated the operation of Step3;
Step5:, select a virtual stream media server to dispose at random to remaining files in stream media in the last file deployment set.
Newly open virtual stream media server prefix deployment strategy
The high capacity of virtual stream media services cluster triggers virtual stream media server set-up mechanism; According to the real time access record of files in stream media, real-time focus files in stream media is deployed on the virtual stream media server of new establishment.
With reference to shown in Figure 9, described is the step of newly opening virtual stream media server prefix deployment strategy, specific as follows:
Step1:Hadoop storage cluster acquisition time T obtains files in stream media access times N constantly; If Hadoop storage cluster file access record format is:<file mark θ
i, the file access time T
i>In time T constantly, file access total degree N is: satisfy T like this
iEqual T, the total number of file access record;
Step2: in time T constantly, obtain files in stream media θ from Hadoop storage cluster
iAccess times N
iIn time T constantly, for files in stream media θ
iAccess times N
iFor: satisfy T
iEqual T, file mark is θ
iThe bar number of file access record;
Step3: for each files in stream media θ
i, calculating real-time visit ratio N
iIf/N is N
i/ N jumps to Step4 greater than 5%; Otherwise whether inspection also has files in stream media not calculate, if having, repeats step3, otherwise jumps to Step5;
Step4: with this files in stream media θ
jAdd real-time focus files in stream media data acquisition system { θ
j, summation is designated as k;
Step5: obtain current unlatching virtual machine number M from the virtual machine server management node, from real-time focus files in stream media data acquisition system, select
individual being deployed to newly to open the virtual stream media server at random.
The interval cache policy
Utilize the correlation and the sequential property of same the front and back request on the virtual stream media server, use the interval buffer memory to serve as the user.
With reference to shown in Figure 10, described is the interval cache policy of realizing on the virtual stream media server, does not consider the prefix part of files in stream media below, and the file content of the request of consideration is the prefix content afterwards of files in stream media:
Step1: on virtual stream media server M, for files in stream media θ, as request S
1When t arrived constantly, establishing it was first order request of θ, and virtual stream media server M serves to Hadoop storage cluster request msg;
Step2: as request S
2At t+t
1Arrive constantly, owing to there is S
1, just formed a coupling (S at interval
1, S
2), S
1At t+t
1Constantly beginning cache-time length is t
1Data, and the request S
2Read t from Hadoop storage cluster earlier
1After the data of time span, again from S
1Buffer memory in reading of data;
Step3: as request S
3Time t+t
1+ t
2Arrive S constantly
3Be t from Hadoop storage cluster time for reading length earlier
2The data of time span are again from S
2Buffer memory in reading of data.
(t-Δ t, t) in time, the time of each files in stream media is set to 1/10th of files in stream media playout length in the virtual stream media server interval cache responses time.Promptly when carrying out the interval coupling, maximum interval length match time is 1/10th of files in stream media playout length; When twice adjacent request time surpass the files in stream media playout length 1/10th the time, do not mate, promptly the Virtual Machine Manager node is thought and is not had the response to file in the Δ t time recently.
Dynamic cache policy at interval
With reference to shown in Figure 11, described is the dynamic interval cache policy of realizing on the virtual stream media server:
Step1: the virtual machine server management node is to Hadoop storage cluster request current service bandwidth occupancy rate φ, and Hadoop storage cluster accepts request, and returns current Hadoop storage cluster bandwidth occupancy rate φ.
Step2: the virtual machine server management node receives that Hadoop storage cluster returns bandwidth occupancy rate φ, if φ greater than 90%, step3 is jumped in the high capacity of Hadoop storage cluster service bandwidth; If φ is less than 10%, Hadoop storage cluster service bandwidth underload jumps to step4;
Step3: the virtual machine server management node sends to each virtual stream media server increases the message of cache size at interval; Each virtual stream media server is received increases buffered message at interval, checks current internal memory available quantity E, and buffer memory increases E/2 at interval;
Step4: the virtual machine server management node sends the message of initialization interval cache size to each virtual stream media server; Each virtual stream media server is received the initialization interval buffered message, and buffer memory is set to initial value I at interval.