Summary of the invention
Technical problem to be solved by this invention is: cannot monitor in real time its screen buffer for video playing terminal in existing network video on-demand system, picture is intermittent to cause playing process to occur, the defect that user's viewing experience is not good, the present invention proposes a kind of method of screen buffer being carried out to monitoring in real time in playback terminal, by the enforcement of the method, the desultory defect of broadcasting pictures when network state is not good can be solved in video display process, promote user's viewing experience, reduce the misoperation of user.
The technical solution used in the present invention is as follows:
A kind of method of screen buffer monitoring comprises
Step 1: playback terminal for parameter, starts total activation device program with the URL address of http network file server video data, carries out this locality and preserves by URL address after total activation device program starts;
Step 2: the serve port address of local http server is chosen and set to total activation device, and start the download that local http server carries out http network file server video data;
Step 3: total activation device constructs with network loop-back address and local http server port address the local URL address made new advances, and with this new local URL address for parameter, adopt the program Starting mode that system (Windows or Linux) is general to start player program and Real time buffer watch-dog program;
Step 4: obtain video data by the local http server of request and carry out decoding after player starts and play;
Step 5: after Real time buffer watch-dog starts, Real-time Obtaining local http server buffering area current video data amount, and data volume monitoring is carried out to current video data amount size, and control player current state by total activation device.
In described step 2, total activation device is chosen and is set the process of local http server serve port address and is:
Step 21: setting local http server port numbers initiation threshold is ∏ p;
Step 22: produce interface random () with the ∏ p pseudo random number that local http server provides for seed calls, generate a pseudo random number γ, now local http server port numbers P=∏ p+ γ;
Step 23: the port P adopting general access to netwoks mode Sampling network loop-back address, if port P access to netwoks is unreachable, then setting this port numbers P is service port number; If port P access can reach, this port is then described shared by other application programs, cause in order to avoid port collision local http network service normally to provide, regenerate server end slogan P, until get an inaccessible port numbers P of access to netwoks.
In described step 4, player after starting by request local http server acquisition video data detailed process is: player initiatively sends request data command to local http server by total activation device, after local http server receives request command by total activation device, send from video data to player.
In described step 3, new local URL address format is: http protocol tag head+network loop-back address+colon+local http server port numbers+local http server video path.
In described step 5, local http server buffering area current video data gauge calculation detailed process is:
Step 51: obtain current local http server buffering area total amount of data ∏ z, unit is byte;
Step 52: obtain current player and read data original position ∏ r and data volume ∏ s, unit is byte;
Step 53: then local http server buffering area current data amount θ a=∏ z-∏ r-∏ s, unit is byte.
After in described step 5, Real time buffer watch-dog starts, the local http server buffering area current video data amount of Real-time Obtaining is also monitored current video data amount size, and by total activation device control player current state detailed process is:
Step 511: arranging Real time buffer watch-dog, to access local http server buffering area interval time be ∏ t, Real time buffer watch-dog every ∏ t and with http protocol mode by total activation device to local http server acquisition request buffer data, Real time buffer watch-dog setting buffering area minimal buffering threshold value θ n;
Step 512: Real time buffer watch-dog obtains local http server buffering area current video data and calculates current video data amount, if when local http server buffering area current data amount is lower than minimal buffering threshold value θ n, Real time buffer watch-dog sends pause command to total activation device, and total activation device controls player and enters time-out broadcast state; If when local http server buffering area current data amount is not less than minimal buffering threshold value θ n, Real time buffer watch-dog sends play command to total activation device, then total activation device controls player and is in broadcast state.
A kind of screen buffer supervising device comprises local http server, Real time buffer watch-dog, total activation device, player,
Local http server, for http network file server video data is downloaded to local http server buffering area, and provides local HTTP video data services function;
Real time buffer watch-dog, for the video data of the local http server buffering area of Real-time Obtaining, and carries out the monitoring of current video data amount size, then sends control command by total activation device and controls player current state;
Player, for being obtained the video data of local http server download by total activation device and carrying out decoding broadcasting, carries out state control by Real time buffer watch-dog simultaneously;
Total activation device, for starting and dispatching local http server, player and Real time buffer watch-dog, thus realizes broadcasting and the Real Time Control Function of http network file server video data.
Described total activation device starts and also comprises before dispatching local http server, player, the work of Real time buffer watch-dog and starts total activation device, concrete start-up course is: playback terminal based on http protocol with the URL address of http network file server video data for parameter starts total activation device, and preserve URL address.
Described total activation device is in scheduling Real time buffer watch-dog detailed process: Real time buffer watch-dog ∏ interval time t sends request the request obtaining local http server data, be sent to local http server by total activation device, after local http server obtains request command, returned the video data volume of local http server buffering area by total activation device; Real time buffer watch-dog controls player plays state by comparing the threshold value of local http server number of buffer the video data volume and its setting.
Described total activation device in the local http server work detailed process of scheduling is: local http server returns current local http server buffering area video data to Real time buffer watch-dog by total activation device received the request msg order of Real time buffer watch-dog by total activation device after.
In sum, owing to have employed technique scheme, the invention has the beneficial effects as follows:
1, local http server, player, Real time buffer watch-dog coordinated is dispatched by total activation device, by Real time buffer watch-dog indirectly to the real-time monitoring that local http server buffer area data volume carries out, make it possible to when local http server buffer data deficiency, suspend in advance and to play and thus can the suitable prompting of user;
2, by the port address of the local http server of total activation device Dynamic Acquisition, download and the transmission of data can be facilitated;
3, Real time buffer watch-dog indirectly obtains local http server flow and compares in real time with the threshold value of its setting; there is provided the control control command that player suspends or plays in real time can in advance total activation device, allow user know the data volume that local http server is current in advance.
Embodiment
All features disclosed in this specification, or the step in disclosed all methods or process, except mutually exclusive feature and/or step, all can combine by any way.
Arbitrary feature disclosed in this specification (comprising any accessory claim, summary and accompanying drawing), unless specifically stated otherwise, all can be replaced by other equivalences or the alternative features with similar object.That is, unless specifically stated otherwise, each feature is an example in a series of equivalence or similar characteristics.
Related description of the present invention:
1, playback terminal comprises hardware platform, the operating system of running software and the screen buffer real time monitoring apparatus of the design and other module, hardware platform provides the hardware environment of running software, the operating system of running software is as LINUX, WINDOWS etc., it is responsible for application software and provides software running platform, and the screen buffer real time monitoring apparatus of the design and other software modules are the programs run on operating system;
2, the network loop-back address of equipment defined by ICP/IP protocol, the http protocol that the present invention relates to, be based on ICP/IP protocol on a kind of application layer protocol.
3, access to netwoks mode: the mode such as adopting PING.
4, http network file server as shown in Figure 1, it is website the Internet providing network video-on-demand serve, as extremely excellent, potato, like strange skill etc., http network file server saves all its and URL address of the network video data of service is provided, playback terminal system of the present invention is undertaken alternately by http protocol and http network file server, get the URL address of the network video data wanting program request, playback terminal of the present invention is after the URL address getting http network file server network video data, can with this URL address for parameter starts total activation device program, and start other three programs by total activation device, realize the broadcasting of Internet video and control in real time,
5, when described local http server buffering area current data amount is not less than minimal buffering threshold value θ n, Real time buffer watch-dog sends play command to total activation device, if player is current be in halted state, then total activation device controls player and enters broadcast state; If player is current be in normal playing status, then total activation device directly abandons Play Control order and does not do task process;
6, in step 3, total activation device startup player and Real time buffer watch-dog detailed process are: total activation device for input parameter, adopts the generic way of system (Windows or Linux) start-up routine to start player program and Real time buffer watch-dog program with new URL address;
7, local http server effect
Http network file server video data content can be downloaded.Itself do not have any video content data in local http server, its content-data derives from it and download to video data from http network file server.Local http server provides HTTP data, services by the network loop-back address (127.0.0.1) of equipment self to this locality.Network loop-back address is a public server address, in order to avoid with the conflicting of other programs, be necessary to select its serve port and set, the present invention adopts following method to choose and sets the service port number of local http server:
1. set port numbers initiation threshold, represent with ∏ p in the present invention;
2. produce interface random () with the ∏ p pseudo random number that local http server provides for seed calls, generate a pseudo random number γ, now server end slogan P=∏ p+ γ;
3. adopt the port P of general access to netwoks mode (mode as PING) Sampling network loop-back address, if port P is unreachable, then setting this port numbers P is service port number; If port P access can reach, this port is then described shared by other application programs, cause in order to avoid port collision local http network service normally to provide, regenerate server end slogan P, until get an inaccessible port numbers P of access to netwoks.
Local http server also outwards provides buffer area data volume information, and circular is as follows:
1. obtain current local http server buffering area total amount of data ∏ z, unit is byte;
2. obtain current player and read data original position ∏ r and data volume ∏ s, unit is byte;
3. draw current buffer data volume θ a=∏ z-∏ r-∏ s, unit is byte;
8, Real time buffer watch-dog effect
Real time buffer watch-dog is the client of a HTTP, to be responsible in video display process Real-time Obtaining to local http server buffer area data volume.The mode of HTTP is adopted to carry out interactive information between Real time buffer watch-dog and local http server, the time interval that local http server accessed by Real time buffer watch-dog is set to ∏ t millisecond, the data volume θ a of local http server buffering area is obtained once every ∏ t millisecond, if the value of θ a is less than the minimum value θ n of buffering area monitoring, real-time buffer watch-dog sends a message to total activation device, inform that player data volume suspends broadcasting not, if the value of θ n is more than or equal to the minimum value of buffering area monitoring, sends message and inform that total activation device buffer area data volume is enough, total activation device recovers normal playing status according to player status.
9, player effect
Be responsible for by total activation device indirectly from local http server request msg, and carry out decoding broadcasting.The HTTP mode of standard is adopted to communicate between player with local http server.The information of player meeting reception buffer zone watch-dog, and carry out the corresponding operation suspending broadcasting and recover broadcasting.
10, total activation device effect
Be responsible for the coordinated between first three part, the startup and stopping comprising local http server controls, the startup of Real time buffer watch-dog and exit control and player startup, time-out, recover, the controlling functions such as to exit, and receive the message that Real time buffer watch-dog sends.Complete perfect cooperation between three and collaborative by the scheduling of total activation device and control, form a complete video request program terminal system.
Embodiment one: the method for a kind of playback terminal screen buffer monitoring comprise playback terminal based on http protocol with the URL address of http network file server video data for parameter, start total activation device program, when total activation device program starts, URL address is carried out this locality and preserve;
Step 2: the serve port address of local http server is chosen and set to total activation device, and start the download that local http server carries out http network file server video data;
Step 3: total activation device constructs with network loop-back address and local http server port address the local URL address made new advances, and with this new local URL address for parameter, adopt the program Starting mode that system (Windows or Linux) is general to start player program and Real time buffer watch-dog program;
Step 4: obtain video data by the local http server of request and carry out decoding after player starts and play;
Step 5: after Real time buffer watch-dog starts, Real-time Obtaining local http server buffering area current video data amount, and data volume monitoring is carried out to current video data amount size, and control player current state by total activation device.
Embodiment two: at embodiment one basis row, in described step 2, total activation device is chosen and set the process of local http server serve port address and is:
Step 21: setting local http server port numbers initiation threshold is ∏ p;
Step 22: produce interface random () with the ∏ p pseudo random number that local http server provides for seed calls, generate a pseudo random number γ, now local http server port numbers P=∏ p+ γ;
Step 23: the port P adopting general access to netwoks mode Sampling network loop-back address, if port P access to netwoks is unreachable, then setting this port numbers P is service port number; If port P access can reach, this port is then described shared by other application programs, cause in order to avoid port collision local http network service normally to provide, regenerate server end slogan P, until get an inaccessible port numbers P of access to netwoks.
Embodiment three: on embodiment one or two basis, in described step 4, player after starting by request local http server acquisition video data detailed process is: player initiatively sends request data command to local http server by total activation device, after local http server receives request command by total activation device, send from video data to player.
Embodiment four: on one of embodiment one to three basis, in described step 3, new local URL address format is: http protocol tag head+network loop-back address+colon+local http server port numbers+local http server video path, as http: // 127.0.0.1:15678/fcwr.avi.
Embodiment five: on one of embodiment one to four basis, in described step 5, local http server buffering area current video data gauge calculation detailed process is:
Step 51: obtain current local http server buffering area total amount of data ∏ z, unit is byte;
Step 52: obtain current player and read data original position ∏ r and data volume ∏ s, unit is byte;
Step 53: then local http server buffering area current data amount θ a=∏ z-∏ r-∏ s, unit is byte.
Embodiment six: on one of embodiment one to five basis, after in described step 5, Real time buffer watch-dog starts, the local http server buffering area current video data amount of Real-time Obtaining is also monitored current video data amount size, and by total activation device control player current state detailed process is:
Step 511: arranging Real time buffer watch-dog, to access local http server buffering area interval time be ∏ t, Real time buffer watch-dog every ∏ t and with http protocol mode by total activation device to local http server acquisition request buffer data, Real time buffer watch-dog setting buffering area minimal buffering threshold value θ n;
Step 512: Real time buffer watch-dog obtains local http server buffering area current video data and calculates current video data amount, if when local http server buffering area current data amount is lower than minimal buffering threshold value θ n, Real time buffer watch-dog sends pause command to total activation device, and total activation device controls player and enters time-out broadcast state; If when local http server buffering area current data amount is not less than minimal buffering threshold value θ n, Real time buffer watch-dog sends play command to total activation device, then total activation device controls player and is in broadcast state.
Embodiment seven: in embodiment one, a kind of playback terminal screen buffer supervising device comprises local http server, Real time buffer watch-dog, total activation device, player,
Local http server, for http network file server video data is downloaded to local http server buffering area, and provides local HTTP video data services function;
Real time buffer watch-dog, for the video data of the local http server buffering area of Real-time Obtaining, and carries out the monitoring of current video data amount size, then sends control command by total activation device and controls player current state;
Player, for being obtained the video data of local http server download by total activation device and carrying out decoding broadcasting, carries out state control by Real time buffer watch-dog simultaneously;
Total activation device, for starting and dispatching local http server, player and Real time buffer watch-dog, thus realizes broadcasting and the Real Time Control Function of http network file server video data.
Embodiment eight: on one of embodiment one or seven basis, described total activation device starts and also comprises before dispatching local http server, player, the work of Real time buffer watch-dog and starts total activation device, concrete start-up course is: playback terminal based on http protocol with the URL address of http network file server video data for parameter starts total activation device, and preserve URL address.
Embodiment nine: on one of embodiment one, seven or eight basis, described total activation device is in scheduling Real time buffer watch-dog detailed process: Real time buffer watch-dog ∏ interval time t sends request the request obtaining local http server data, is sent to local http server by total activation device.
Implement ten: on one of embodiment one, seven, eight or nine basis, described total activation device in the local http server work detailed process of scheduling is: local http server returns current local http server buffering area video data to Real time buffer watch-dog by total activation device received the request msg order of Real time buffer watch-dog by total activation device after.
Preferred embodiment: as shown in Figure 2, is running status of the present invention transfer schematic diagram, is described as follows below in conjunction with this schematic diagram to the specific embodiment of the present invention:
Step 1: the film (network video data) being named as " blame sincere not faze " on program request http network file server, getting its URL address is http://www.movie.com/movie/fcwr.avi, with this URL address for input parameter, adopt general program Starting mode to start total activation device program, total activation device startup optimization is also preserved the URL address of input;
Step 2: the initiation threshold ∏ p of total activation device setting port numbers is 10000, and generate pseudo random number γ=5678 with the ∏ p value pseudo random number that local http server provides for seed calls generation interface random () interface, calculate port numbers P=15678, total activation device adopts general access to netwoks detection mode (mode of such as PING) to detect that port P(value is 15678) unreachable, illustrate that total activation device determination port numbers P(value is 15678) effectively, and this value is preserved;
Step 3: total activation device with the serve port P of the URL address of step 1 and step 2 for parameter, general program Starting mode is adopted to start local http server, local http server starts the data buffer zone from web download video data to local http server after starting, and opens local HTTP simultaneously and serve;
Step 4: total activation device constructs the data, services URL address of local http server with network loop-back address (127.0.0.1), service port number P and network URL address, i.e. " http: // 127.0.0.1:15678/movie/fcwr.avi ", total activation device for parameter, adopts the program Starting mode that system (Windows or Linux) is general to start video player program with this new URL address.
Step 5: total activation device for parameter, adopts general program Starting mode to start Real time buffer watch-dog program with the new URL constructed in step 4.
Step 6: according to step 4, player begins through the mode of HTTP to local http server request video data after starting, and after getting enough data, start decoding broadcasting, and can accept the Play Control order of total activation device at any time;
Step 7: according to step 5, Real time buffer watch-dog setting access time interval ∏ t=500ms, every 500ms to the mode by HTTP to local http server request amount of buffered data information.Real time buffer watch-dog setting buffering area minimal buffering threshold value θ n=512K byte.
Step 8: according to step 8, when Real time buffer watch-dog gets amount of buffered data lower than threshold value, can send the inadequate message of data volume to total activation device, total activation device controls player and enters time-out broadcast state, and on UI interface, point out user's players just please wait at buffered data.
Step 9: according in step 7, when Real time buffer watch-dog gets amount of buffered data higher than threshold value, Real time buffer watch-dog can send the enough message of data volume to total activation device, if player is current be in halted state, then total activation device recovery player enters normal playing status;
Step 10: above step 6,7,8,9 circular flows always after system cloud gray model gets up, until terminal system exits broadcasting.
The present invention is not limited to aforesaid embodiment.The present invention expands to any new feature of disclosing in this manual or any combination newly, and the step of the arbitrary new method disclosed or process or any combination newly.