A kind of remote synchronization virtual monitor method and systemTechnical field
The invention belongs to computer application field, particularly relate to a kind of remote synchronization virtual monitor method and system.
Background technology
Remote dummy monitoring technology is a kind of technology being widely used on digital signage system, can easily be rightHaving a very wide distribution, region disperses, and the broadcasting situation of large number of digital signage terminal monitors in real time.And in existing digital signage system, commonly used screen of grabbing realizes the monitoring to terminal presentation facility, it may be assumed thatTerminal presentation facility grabs screen by sectional drawing, sectional drawing returns to server and monitors to realize remote dummy, but,This method is not only not convenient to use, and is grabbing screen frequency height, also can take too much net when the sectional drawing of transmission is manyNetwork resource, and data transmission more slowly also result in monitoring asynchronous.
Summary of the invention
The purpose of the embodiment of the present invention is to provide a kind of remote synchronization virtual monitor method and system, it is intended to solveCertainly existing remote dummy monitors the problem that technology synchronizing speed is relatively slow and takies Internet resources.
The embodiment of the present invention is achieved in that a kind of remote synchronization virtual monitor method, and described method includes:
Terminal presentation facility is set up socket with server and is connected;
Current play status information, after receiving the monitor command that server sends, is sent out by terminal presentation facilityGive server;
Server is according to playing resource corresponding in described current play status information searching to server and synchronizesPlay.
The another object of the embodiment of the present invention is to provide a kind of remote synchronization virtual monitor system, described systemIncluding terminal presentation facility and server, wherein:
Terminal presentation facility includes:
Terminal connection establishment module, is connected for setting up socket with server;
Status information returns module, for after receiving the monitor command that server sends, by currently playingStatus information is sent to server;
Server includes:
Server connection establishment module, is connected for setting up socket with terminal presentation facility;
Monitor command sending module, for being sent to terminal presentation facility by monitor command;
Synchronize playing module, for server according to described current play status information searching to phase in serverThe playing resource answered also synchronizes to play.
In embodiments of the present invention, the resource play due to terminal presentation facility is stored in server end,Thus after when server transmission monitor command to terminal presentation facility, as long as terminal presentation facility will currently be broadcastPutting status information and be sent to server, server just can be looked at server end by this current play status informationPlay to corresponding playing resource synchronous preview, thus realize remote synchronization virtual monitor.Additionally, due toDuring monitoring, it is only necessary to the current play status information of terminal presentation facility is sent to server, and works asFront broadcast state capacity is little, is not take up Internet resources, thus alleviates network burden, and due to the number of transmissionLittle according to amount, spread speed is fast, accelerates the speed of synchronization monitoring.
Accompanying drawing explanation
Fig. 1 is the remote synchronization virtual monitor method flow diagram that first embodiment of the invention provides;
Fig. 2 is the remote synchronization virtual monitor method flow diagram that second embodiment of the invention provides;
Fig. 3 is the remote synchronization virtual monitor system structure schematic diagram that third embodiment of the invention provides.
Detailed description of the invention
In order to make the purpose of the present invention, technical scheme and advantage clearer, below in conjunction with accompanying drawing and realityExecute example, the present invention is further elaborated.Only should be appreciated that specific embodiment described hereinOnly in order to explain the present invention, it is not intended to limit the present invention.
The embodiment of the present invention provides a kind of remote synchronization virtual monitor method, at terminal presentation facility and serverAfter setting up network connection, current play status information is sent to server by terminal presentation facility so that serviceDevice finds the playing resource of correspondence according to current state information at server end and synchronizes to play, and comes real with thisExisting terminal presentation facility monitors with the remote synchronization of server.
In order to technical solutions according to the invention are described, illustrate below by specific embodiment.
Embodiment one:
It is illustrated in figure 1 the flow chart of the remote synchronization virtual monitor method that first embodiment of the invention provides,For convenience of description, illustrate only the part relevant to the embodiment of the present invention.
In step s 11, terminal presentation facility is set up socket (socket) and is connected with server.
In embodiments of the present invention, terminal presentation facility is connected to server by network, and builds with serverAfter vertical socket connects, interacted with server by procotol.Terminal presentation facility can pass through hereinCable network or wireless network are connected to server, and the network that terminal presentation facility interacts with serverAgreement can include multiple, does not limits at this.As: multiple terminal presentation facilities can pass through wireless WIFI netNetwork is connected to server, and after successful connection, terminal presentation facility and server can set up socket by Transmission Control ProtocolWord connection interacts.When server sends request to terminal, terminal presentation facility is according to receivedRequest returns data to server, thus completes an interaction.Wherein, terminal presentation facility include butIt is not limited to: advertisement machine, mobile phone, notebook computer, panel computer, TV etc..
In step s 12, monitor command is sent to terminal presentation facility by server.
In step s 13, current play status information is sent to server by terminal presentation facility.
In embodiments of the present invention, terminal presentation facility is after starting and being connected with server foundation, and terminal showsShowing that equipment just records current play status information, the monitor command sent upon receipt of server, just by instituteThe current state information of record is sent to server.Wherein, current play status includes but not limited to: currentThe tag number of playing resource and reproduction time.
In step S14, server is play accordingly according in current play status information searching to serverResource also synchronizes to play.
In embodiments of the present invention, due in resource all presence servers that terminal presentation facility is play, because ofAnd after server receives the current play status information that terminal presentation facility returns, according to current play statusInformation searching is to playing resource corresponding in server, and synchronizes to play this playing resource at server end, withThis realizes the remote synchronization virtual monitor of server and terminal presentation facility.
In embodiments of the present invention, the resource play due to terminal presentation facility is stored in server end,Thus after when server transmission monitor command to terminal presentation facility, as long as terminal presentation facility will currently be broadcastPutting status information and be sent to server, server just can be looked at server end by this current play status informationPlay to corresponding playing resource synchronous preview, thus realize remote synchronization virtual monitor.Additionally, due toDuring monitoring, it is only necessary to the current play status information of terminal presentation facility is sent to server, and works asFront broadcast state capacity is little, is not take up Internet resources, thus alleviates network burden, and due to the number of transmissionLittle according to amount, spread speed is fast, accelerates the speed of synchronization monitoring.
Embodiment two:
It is illustrated in figure 2 the flow chart of the remote synchronization virtual monitor method that second embodiment of the invention provides,For convenience of description, illustrate only the part relevant to the embodiment of the present invention.
In the step s 21, terminal presentation facility is set up socket with server and is connected.
In step S22, terminal presentation facility monitors the monitor command that server sends.
In embodiments of the present invention, when server and terminal presentation facility all start, terminal presentation facilityOne thread can be responsible for setting up socket with server and be connected, and starts listening port, monitors server and sendsMonitor command.
In step S23, terminal presentation facility resolves playlist and obtains current play status information.
In embodiments of the present invention, a thread of terminal presentation facility is setting up the socket with server evenConnect, and when monitoring the monitor command of server transmission, another thread of terminal presentation facility is to played columnAfter table is decrypted, resolves the content of playlist, from the playlist resolved, obtain currently playing shapeState information.
Wherein, the playlists records broadcasting content information of terminal presentation facility, as terminal presentation facility is wantedThe information such as the playing resource of broadcasting, reproduction time, type-setting mode.Wherein, the playing resource that terminal is to be playInclude but not limited to: the playing resource such as video, picture, background music, captions.Wherein, playlistForm can be XML, javascript etc., does not limits at this.This sentences playlist is that XML format isExample, if playlist is playlist.xml, then includes video, picture, background sound in this playlistThese playing resource are integrated into multiple unit in this playlist by the playing resource such as pleasure, captions simultaneouslyUnit, each unit unit, in addition to including above-mentioned playing resource, also include the row playing these playing resourceVersion mode and reproduction time etc..
In step s 24, monitor command is sent to terminal presentation facility by server.
In step s 25, current play status information is sent to server by terminal presentation facility.
In embodiments of the present invention, terminal presentation facility, after listening to the monitor command that server sends, connectsReceive monitor command, and according to monitor command, current play status information is sent to server.Due to herein eventuallyWhat end display device was set up with server is that socket is connected, then terminal presentation facility often receives a serverThe monitor command sent, then return a current play status information to server.
The most still as a example by above-mentioned playlist playlist.xml, then terminal presentation facility is receiving monitoringAfter order, send following code to server and to return currently playing information to server.
MO,unit=167_1,vi=567,pi1=586,pi2=583,pi3=581,su=579,mp=576,ti=10;
Wherein, MO is head, represents the meaning of monitoring;Unit=167_1 represents and is currently played resource instituteUnit unit number in playlist playlist.xml be 167_1;Vi=567 represents currently playingVideo features number is 567;Pi1=586 represents that the first currently playing pictures tag number is 586;pi2=583The the second pictures tag number representing currently playing is 583;Pi3=581 represents the 3rd currently playing picturesTag number is 581;Su=579 represents that currently playing subtitles appearances number is 579;Mp=576 represents and currently broadcastsThe background music tag number put is 576;Ti represents the reproduction time of currently playing resource, and unit is ms.
In embodiments of the present invention, only need due to terminal current play status information is sent to server, andCurrent play status information is only the shortest data slot, takies Internet resources less.
In step S26, server obtains currently playing by current play status information analysis playlistThe type-setting mode of resource.
In embodiments of the present invention, owing in server, storage has the playlist identical with terminal presentation facility,Therefore after receiving the current play status information that terminal presentation facility sends, just can be by resolving played columnTable obtains the type-setting mode of currently playing resource.
In step s 27, server is looked into according to the tag number of resource currently playing in current play status informationFind the corresponding playing resource of storage in server.
In embodiments of the present invention, due in resource all presence servers that terminal presentation facility is play, because ofAnd server just can find server according to the tag number of the currently playing resource in current play status informationIn the playing resource corresponding with these tag numbers.
In step S28, server is according to the type-setting mode of currently playing resource and current play status informationIn the reproduction time of currently playing resource synchronize to play the corresponding playing resource that found at server end.
In embodiments of the present invention, it is determined that the playing resource play with terminal presentation facility is correspondingAfter playing resource, according to the type-setting mode of currently playing resource, playing resource carried out typesetting, and according to currentlyThe reproduction time of playing resource synchronizes to play corresponding playing resource at server end.
In embodiments of the present invention, the resource play due to terminal presentation facility is stored in server end,Thus after when server transmission monitor command to terminal presentation facility, as long as terminal presentation facility will currently be broadcastPutting status information and be sent to server, server just can be looked at server end by this current play status informationPlay to corresponding playing resource synchronous preview, thus realize remote synchronization virtual monitor.Additionally, due toDuring monitoring, it is only necessary to the current play status information of terminal presentation facility is sent to server, and works asFront broadcast state capacity is little, is not take up Internet resources, thus alleviates network burden, and due to the number of transmissionLittle according to amount, spread speed is fast, accelerates the speed of synchronization monitoring.
Embodiment three:
The remote synchronization virtual monitor system structure schematic diagram that Fig. 3 provides for the embodiment of the present invention, for the ease ofIllustrate, illustrate only the part relevant to the embodiment of the present invention.Wherein:
In embodiments of the present invention, remote synchronization virtual monitor system includes terminal presentation facility 31 and server32.Wherein, terminal presentation facility 31 includes: terminal connection establishment module 311, monitoring module 312, shapeState data obtaining module 313 and status information return module 314.Server 32 includes: server connects to be builtFormwork erection block 321, monitor command sending module 322 and synchronization playing module 323.Wherein:
For terminal presentation facility 31,
Terminal connection establishment module 311, is connected for setting up socket with server.
Monitor module 312, for monitoring the monitor command that server sends.
State information acquisition module 313, is used for resolving playlist and obtains current play status information.
Status information returns module 314, for after receiving the monitor command that server sends, by currentBroadcast state information is sent to server.
For server 32,
Server connection establishment module 321, is connected for setting up socket with terminal presentation facility.
Monitor command sending module 322, for being sent to terminal presentation facility by monitor command.
Synchronize playing module 323, for server according to phase in current play status information searching to serverThe playing resource answered also synchronizes to play.
In embodiments of the present invention, synchronize playing module 323 and include three subelements, be respectively as follows:
Typesetting determines module 3231, currently broadcasts for being obtained by current play status information analysis playlistPut the type-setting mode of resource.
Playing resource searches module 3232, for the spy according to resource currently playing in current play status informationThe number of levying finds the corresponding playing resource of storage in server.
Synchronize to play submodule 3233, be used for the type-setting mode according to currently playing resource and current play statusIn information, the reproduction time of currently playing resource is play money accordingly what server end synchronization broadcasting foundSource.
In embodiments of the present invention, the resource play due to terminal presentation facility is stored in server end,Thus after when server transmission monitor command to terminal presentation facility, as long as terminal presentation facility will currently be broadcastPutting status information and be sent to server, server just can be looked at server end by this current play status informationPlay to corresponding playing resource synchronous preview, thus realize remote synchronization virtual monitor.Additionally, due toDuring monitoring, it is only necessary to the current play status information of terminal presentation facility is sent to server, and works asFront broadcast state capacity is little, is not take up Internet resources, thus alleviates network burden, and due to the number of transmissionLittle according to amount, spread speed is fast, accelerates the speed of synchronization monitoring.
It will appreciated by the skilled person that all or part of step realizing in above-described embodiment methodThe program that can be by completes to instruct relevant hardware, and described program can be stored in a computerIn read/write memory medium, described storage medium, such as ROM/RAM, disk, CD etc..
The foregoing is only presently preferred embodiments of the present invention, not in order to limit the present invention, all at thisAny amendment, equivalent and the improvement etc. made within bright spirit and principle, should be included in the present inventionProtection domain within.