A kind of adaptive network download schedule system and method
Technical field
The present invention relates to a kind of adaptive network download schedule system and method, belong to multimedia video program request technical field.
Background technology
Along with network technology and Development of Multimedia Technology, internet multimedia is used and is rooted in the hearts of the people.Multi-media network is a lot of with the application in the life in our work.Such as, long-distance education, tele-medicine or the like.This class is used and is equivalent to long-rangely provide some virtual environments, and the real-time, interactive function is provided, and helps the two-way exchange between local terminal and the remote terminal.This class is used the performance of network and real-time is required than higher.This is that a kind of more common application is the multimedia video program request, mainly is preprepared multimedia video frequency file to be put into the web server play for client downloads.
C/S framework that is client-server architecture are adopted in traditional multimedia video program request website more, and such benefit is exactly be easy to daily operation and maintenance simple in structure.Yet, if online user's quantity acquires a certain degree and and server between bandwidth the broadcast point that download point is far longer than video will appear relatively more rich again the time, will bring the problem of bandwidth waste like this, if more online user's concurrency so just can be provided for other user to this part bandwidth conservation.The solution of oneself has been proposed one after another based on some video website of this problem, more representational is exactly to the solution of file physics section, by physics section to file, make client be played to a slice ending time at every turn, reached the purpose of saving bandwidth again by sheet request video file.But, can bring another problem so again, that is exactly the problem to the storage of section file, and too much fragment has brought stern challenge again to the storage system of whole system, has brought higher complexity for the daily O﹠M work in website.
Summary of the invention
In order to solve the problems of the technologies described above, the present invention proposes a kind of adaptive network download schedule system and method, by the multimedia video frequency file being carried out the mode of logic section, it goes without doing any modification of the operation logic of client, not only fundamentally solved the complexity of storage system, alleviate the pressure of O﹠M greatly, and better realized playing end adaptive network download schedule technology.At first, the invention provides a kind of adaptive network download schedule system, comprise that a web server end and plays end,
Described Web server is used for file is carried out the logic section, and the descriptor of production logic section; Described broadcast end is used for obtaining the descriptor that logic is cut into slices from described Web server; And according to the broadcast point of current video broadcast section and the descriptor of described logic section, and when the decision of the bandwidth of Web server arrives the data of which sheet of server requests.Described broadcast end sends the information of the video heads information of obtaining corresponding logic section and the logic chip of being asked according to the determined time to the web server; Playing end is to obtain data by the http request mode.Described file is a video file, comprises a video heads information, is used for that section is described to the logic of this video, the quantity of include file length, logic section at least in this document head, and the information such as original position of each logic section.
Further, described web server end strategy that video file is carried out the logic burst adopts one of following:
A is divided into N section with video file according to playing total duration, and the duration of each section equates;
B is divided into M section with video file according to its shared bit number, and the bit number of each section equates;
C, to the video file division of cutting into slices, each sheet is all begun by key frame, and the big or small 1M-3M of each piece according to key frame, described key frame be role or object of which movement or change in residing that frame of key operations; It perhaps is the frame of handling with intraframe coding method in the cataloged procedure.
Described Web server when playing end response data sheet, is sent to broadcast end with video heads information for each request of broadcast end.
Further, playing end is downloaded to tail by head successively according to the logic chip block information of the video presentation file that is obtained; In downloading process, play the end real-time statistics and go out one to the bandwidth value between the web server, calculate away the concrete time that the web server is downloaded next section according to this bandwidth value, computational methods are: promptly current broadcast section remaining time-(next section/current bandwidth).
Secondly, the invention provides a kind of network download dispatching method, use a web server end and to play end in this method, comprise following steps: step 1, described Web server carries out the logic section to file, and the descriptor of production logic section; Step 2, described broadcast end are obtained the descriptor of logic section from described Web server; And according to the broadcast point of current video broadcast section and the descriptor of described logic section, and when the decision of the bandwidth of Web server arrives the data of which sheet of server requests.Described file is a video file, and in described step 1, comprise a video heads information, be used for the logic section of this video is described, at least the quantity of include file length, logic section in this document head, and the information such as original position of each logic section.
Further, described web server end strategy that video file is carried out the logic burst adopts one of following:
A is divided into N section with video file according to playing total duration, and the duration of each section equates;
B is divided into M section with video file according to its shared bit number, and the bit number of each section equates;
C, to the video file division of cutting into slices, each sheet is all begun by key frame, and the big or small 1M-3M of each piece according to key frame, described key frame be role or object of which movement or change in residing that frame of key operations; It perhaps is the frame of handling with intraframe coding method in the cataloged procedure.
In the described step 2, the step that described broadcast end is downloaded section according to the description of logic section from Web server further comprises: play end and downloaded successively to tail by head according to the logic chip block information of the video presentation file that is obtained, wherein in downloading process, play the end real-time statistics and go out one to the bandwidth value between the web server, next is cut into slices the needed time calculate download according to this bandwidth value, residue reproduction time last and current slice subtracts each other to draw and when goes the web server to download the big concrete time of next section, this concrete time be current broadcast cut into slices the remaining time-(next section/current bandwidth); The time of downloading next section is current broadcast section remaining time-(next section/current bandwidth)+T, and the T value is 5-10 second.
Further, this method also comprises step 3: described Web server when playing end response data sheet, is sent to broadcast end with video heads information for each request of broadcast end.
Description of drawings
Fig. 1 is the present invention carries out piecemeal to file a schematic diagram.
Embodiment
Describe technical scheme of the present invention in detail below in conjunction with embodiment.At first, the invention provides a kind of network download dispatching patcher.One preferred embodiment in, this network download dispatching patcher comprises that a web server end and plays end.Described Web server is used for file is carried out the logic section, and the descriptor of production logic section.The logic chip that when playing logic chip of end request, returns video heads information and asked.
Described broadcast end, be used for request mode by http, obtain the descriptor of logic section from described Web server, according to the current video broadcast point with when arrive the data of which sheet of server requests to the decision of the bandwidth of Web server, promptly, according to the bandwidth of current broadcast point and Web server, be determined to the time of obtaining next logic section on the Web server.And, send the information of the video heads information of obtaining corresponding logic section and the logic chip of being asked to the web server according to the determined time.
Playing end is to obtain data by the http request mode.
In a more detailed execution mode, for each video file is provided with a video heads information, be used for the logic section of this video is described, comprise following data in this document head at least: as shown in the table,
Field |
Explanation |
File_length |
File size |
Block_count |
The logic chip quantity of being cut |
Block_array |
The original position of each logic chip data |
Table 1
Described web server end carries out the logic burst to video file, and the section principle can be set according to practical application, and for example the equal time burst is about to video file and is divided into N section according to playing total duration, and the duration of each section equates.The tactful burst of size such as for example adopt again, be about to video file and be divided into M section according to its shared bit number, the bit number of each section is equal.One preferred embodiment in, according to key frame to the video file division of cutting into slices, each sheet is all begun by key frame, the granularity of while in order to guarantee to cut into slices, repeatedly test through the inventor, find that each section all has key frame to begin, and during the big or small 1M-3M of each piece, can obtain better transmission property.Just the data cell that begins with key frame begins to travel through backward the data cell of 2M left and right sides byte-sized, and continue to search the data cell with key frame backward in this position, find the back with the cut-point of this data cell as this film data and its preceding a slice.Described key frame can be meant residing that frame of key operations in role or object of which movement or the variation.It also can be the frame of handling with intraframe coding method in the cataloged procedure (being the I frame).
As shown in Figure 1, accompanying drawing 1 shows the schematic diagram that file is carried out piecemeal.When video file is encoded, with certain interval key frame is set, in Fig. 1, a key frame is set every about 2M, [17500-2270300] is divided into a logic section between logic area.
Described Web server when playing end response data sheet, is sent to broadcast end with video heads information for each request of broadcast end.Precompute the time of obtaining the section of residue logic from Web server so that play end, make that playing time-delay reduces to minimum.
Playing end is downloaded to tail by head successively according to the logic chip block information (Block_Array) of the video presentation file that is obtained.Wherein in downloading process, to play the end real-time statistics and go out a value to the bandwidth between the web server, this value is meant that the instructor in broadcasting puts end when to the key factor of web server requests data.Because description document comprises the block information of all logic sections, so just calculate next slice size of the section of current broadcast, download next and cut into slices the needed time calculating according to current bandwidth value, residue reproduction time last and current slice subtracts each other to draw and when goes the web server to download next to cut into slices the big concrete time.Be current broadcast section remaining time-(next section/current bandwidth).Consider the situation that bandwidth value can occur shaking, downloading down, the time of a slice can shift to an earlier date a period of time usually.Current broadcast section remaining time-(next section/current bandwidth)+T, the T value is generally 5-10 second.
On the other hand, the invention provides a kind of network download dispatching method.Use a web server end and to play end in the method.It comprises following steps:
Step 1, described Web server carries out the logic section to file, and the descriptor of production logic section.
Step 2, described broadcast end is downloaded section according to the description of logic section from Web server.Play end and be used for request mode by http, obtain the descriptor of logic section from described Web server, according to the current video broadcast point with when arrive the data of which sheet of server requests to the decision of the bandwidth of Web server, promptly, according to the bandwidth of current broadcast point and Web server, be determined to the time of obtaining next logic section on the Web server.And, send the information of the video heads information of obtaining corresponding logic section and the logic chip of being asked to the web server according to the determined time.
Playing end is to obtain data by the http request mode.
In a more detailed execution mode, in step 1,, be used for the logic section of this video is described for each video file is provided with a video heads information, comprise the data in the table 1 in this document head at least.
In the step 1, described web server end carries out the logic section to video file, and the section principle can be set according to practical application, and for example the equal time burst is about to video file and is divided into N section according to playing total duration, and the duration of each section equates.The tactful burst of size such as for example adopt again, be about to video file and be divided into M section according to its shared bit number, the bit number of each section is equal.One preferred embodiment in, according to key frame to the video file division of cutting into slices, each sheet is all begun by key frame, the granularity of while in order to guarantee to cut into slices, repeatedly test through the inventor, find that each section all has key frame to begin, and during the big or small 1M-3M of each piece, can obtain better transmission property.Just the data cell that begins with key frame begins to travel through backward the data cell of 2M left and right sides byte-sized, and continue to search the data cell with key frame backward in this position, find the back with the cut-point of this data cell as this film data and its preceding a slice.Described key frame can be meant residing that frame of key operations in role or object of which movement or the variation.It also can be the frame of handling with intraframe coding method in the cataloged procedure (being the I frame).
Further, said method also comprises step 3: described Web server when playing end response data sheet, is sent to broadcast end with video heads information for each request of broadcast end.Precompute the time of obtaining the section of residue logic from Web server so that play end, make that playing time-delay reduces to minimum.
In the described step 2, the step that described broadcast end is downloaded section according to the description of logic section from Web server further comprises: play end and downloaded successively to tail by head according to the logic chip block information (Block_Array) of the video presentation file that is obtained.Wherein in downloading process, to play the end real-time statistics and go out a value to the bandwidth between the web server, this value is meant that the instructor in broadcasting puts end when to the key factor of web server requests data.Because description document comprises the block information of all logic sections, so just calculate next slice size of the section of current broadcast, download next and cut into slices the needed time calculating according to current bandwidth value, residue reproduction time last and current slice subtracts each other to draw and when goes the web server to download next to cut into slices the big concrete time.Be current broadcast section remaining time-(next section/current bandwidth).Consider the situation that bandwidth value can occur shaking, downloading down, the time of a slice can shift to an earlier date a period of time usually.Current broadcast section remaining time-(next section/current bandwidth)+T, the T value is generally 5-10 second.
Technical scheme provided by the present invention is carried out cutting with the mode of logic section to file at web server in the multi-media network, plays after the descriptor that end obtains video file to decide according to current bandwidth and when goes server to obtain down a slice data.Can not increase the complexity of storage system, alleviate the pressure of O﹠M greatly, and better realize playing end adaptive network download schedule technology.