Summary of the invention
The present invention proposes unmanned dispensing vehicle video flowing method for uploading, device and non-transitory computer-readable storage medium and electricity
Sub- equipment, to reduce the delay time of unmanned dispensing vehicle uploaded videos stream.
The technical scheme of the present invention is realized as follows:
A kind of unmanned dispensing vehicle video flowing method for uploading, this method comprises:
Video Distribution Server receives the video flowing that the control centre of unmanned dispensing vehicle uploads, and the video flowing is by unmanned dispatching
The camera of vehicle acquires;
Video Distribution Server determines unmanned dispatching according to the incidence relation of preset camera and destination server
The corresponding destination server of the camera of vehicle gives the video stream to corresponding destination server;
Video Distribution Server receives the mark for the camera to be monitored that monitor terminal is sent, and is taken the photograph according to preset
As the incidence relation of head and destination server, the mark of the corresponding destination server of the camera is returned into monitor terminal, with
So that: monitor terminal and the destination server establish connection, and monitor the video flowing that the destination server issues in the connection, and
The video flowing is played on monitor terminal.
The video stream includes: by the Video Distribution Server to corresponding destination server
The video flowing is pushed to the destination server via corresponding destination server by the Video Distribution Server
On WebSocket server;
And the monitor terminal and the destination server establish connection are as follows: the WebSocket client on the monitor terminal
End is established WebSocket with the WebSocket server on the destination server and is connect;
It is described to monitor the video flowing that the destination server issues in the connection are as follows: monitoring should in the WebSocket connection
The video flowing that WebSocket server issues.
The incidence relation of the camera and destination server are as follows: the camera and target established using regular expression are taken
The incidence relation of business device.
The video flowing that the control centre of the unmanned dispensing vehicle uploads further comprises: acquiring the camera of the video flowing
Mark and identifying code;
The Video Distribution Server receive unmanned dispensing vehicle control centre upload video flowing include:
The corresponding relationship of each camera identification and identifying code that Video Distribution Server is saved according to itself, judges that nobody matches
Whether the identifying code for sending the control centre of vehicle to send is correct, if so, receiving the video flowing;Otherwise, the video flowing is abandoned.
A kind of unmanned dispensing vehicle video flowing method for uploading, this method comprises:
Monitor terminal determination will monitor the video flowing of a camera of a unmanned dispensing vehicle, and the mark of the camera is sent
To Video Distribution Server;
Monitor terminal receives the mark for the associated destination server of the camera that Video Distribution Server returns, according to
The mark of the destination server establishes connection with the destination server, monitors the connection;
When monitor terminal listens to the video flowing for having the destination server to issue in the connection, the video flowing is downloaded, and
The video stream is given to the video player of this monitor terminal, so that: video player plays the video flowing,
Wherein, the video flowing are as follows: the video that the control centre of the received unmanned dispensing vehicle of Video Distribution Server uploads
Stream, which is acquired by the camera of unmanned dispensing vehicle, and Video Distribution Server is according to preset camera and mesh
The incidence relation for marking server, determines the corresponding destination server of the camera of unmanned dispensing vehicle, the video stream is given
Corresponding destination server.
The monitor terminal receives the mark for the associated destination server of the camera that Video Distribution Server returns
Further comprise later:
The mark of the destination server is sent to the WebSocket client of itself by monitor terminal;
And the mark according to the destination server, establishing connection with the destination server includes:
WebSocket client on monitor terminal is according to the mark of the destination server, on the destination server
WebSocket server establishes WebSocket connection;
Described monitoring connection includes:
Monitor the WebSocket connection;
The monitor terminal listens to the video flowing for having the destination server to issue in the connection
WebSocket client on monitor terminal, which listens in the WebSocket connection, has the destination server to send out
Video flowing out;
Described downloading video flowing are as follows:
The WebSocket client downloads video flowing on monitor terminal,
And the Video Distribution Server gives the video stream to corresponding destination server are as follows: the video point
The video flowing is pushed to the service of the WebSocket on the destination server via corresponding destination server by hair server
Device.
The video flowing that the monitor terminal determination will obtain a camera of a unmanned dispensing vehicle further comprises before:
Monitor terminal generates WebSocket client.
A kind of unmanned dispensing vehicle video flowing upload device, the device are located on Video Distribution Server, which includes:
Video flowing receiving module, the video flowing that the control centre for receiving unmanned dispensing vehicle uploads, the video flowing is by nothing
The camera of people's dispensing vehicle acquires;
Video flowing issues module, for the incidence relation according to preset camera and destination server, determines nothing
The corresponding destination server of the camera of people's dispensing vehicle gives the video stream to corresponding destination server;
Interactive module is monitored, for receiving the mark for the camera to be monitored that monitor terminal is sent, according to presetting
Camera and destination server incidence relation, by the mark of the corresponding destination server of the camera return to monitoring eventually
End, so that: monitor terminal and the destination server establish connection, and monitor the video that the destination server issues in the connection
Stream, and the video flowing is played on monitor terminal.
The video flowing issues module for the video stream
The video flowing is pushed to the service of the WebSocket on the destination server via corresponding destination server
Device;
And the monitor terminal and the destination server establish connection are as follows: the WebSocket client on the monitor terminal
End is established WebSocket with the WebSocket server on the destination server and is connect;
It is described to monitor the video flowing that the destination server issues in the connection are as follows: monitoring should in the WebSocket connection
The video flowing that WebSocket server issues.
The video flowing receiving module is further used for, when the video flowing that the control centre for receiving unmanned dispensing vehicle uploads
When, camera identification and identifying code are obtained from the video flowing, each camera identification for being saved according to itself and identifying code
Corresponding relationship judges whether the identifying code that the control centre of unmanned dispensing vehicle sends is correct, if so, receiving the video flowing;
Otherwise, the video flowing is abandoned.
A kind of unmanned dispensing vehicle video flowing upload device, the device are located on monitor terminal, which includes:
Destination server identifier acquisition module, the video of the camera for monitor a unmanned dispensing vehicle in determination
The mark of the camera is sent to Video Distribution Server by stream, is received the camera that Video Distribution Server returns and is closed
The mark of the destination server of connection;
Video flowing acquisition module, the mark of the destination server for being sent according to destination server identifier acquisition module,
Connection is established with the destination server, monitors the connection, when listening in the connection video for having the destination server to issue
When stream, the video flowing is downloaded, by the video stream to video player, wherein the video flowing are as follows: Video Distribution Server
The video flowing that the control centre of received unmanned dispensing vehicle uploads, which is acquired by the camera of unmanned dispensing vehicle, and is regarded
Frequency the distribution server determines the camera of unmanned dispensing vehicle according to the incidence relation of preset camera and destination server
Corresponding destination server gives the video stream to corresponding destination server;
Video player, for playing the video flowing on monitor terminal.
It is WebSocket client that the video flowing, which obtains module,
The destination server identifier acquisition module further comprises:
The mark for the destination server that Video Distribution Server returns is sent to WebSocket client;
And the WebSocket client establishes connection with the destination server and includes:
WebSocket is established with the WebSocket server on the destination server to connect;
And the WebSocket client monitors the connection and includes:
Monitor the WebSocket connection;
And the WebSocket client listens to the video flowing for having the destination server to issue in the connection and includes:
Listen to the video flowing for thering is the destination server to issue in the WebSocket connection;
And the Video Distribution Server gives the video stream to corresponding destination server are as follows: the video point
The video flowing is pushed to the service of the WebSocket on the destination server via corresponding destination server by hair server
Device.
The monitor terminal further comprises: WebSocket client generation module, for generating WebSocket client
End.
A kind of non-transitory computer-readable storage medium, the non-transitory computer-readable storage medium store instruction, institute
State instruction makes the processor execute as above described in any item unmanned dispensing vehicle video flowings uploads when executed by the processor
The step of method, or the step of executing as above described in any item unmanned dispensing vehicle video flowing method for uploading.
A kind of electronic equipment, including as above any non-transitory computer-readable storage medium and addressable institute
State the processor of non-transitory computer-readable storage medium.
The present invention is by after the video flowing that Video Distribution Server receives that unmanned dispensing vehicle is sent, by video stream distribution
To each destination server, video stream is gone out by destination server, and monitor terminal is establishing connection with destination server
Afterwards, video flowing is obtained by monitoring the connection, so that the video flowing for greatly reducing unmanned dispensing vehicle uploads to monitor terminal
Delay time.
Specific embodiment
With reference to the accompanying drawing and specific embodiment the present invention is further described in more detail.
Fig. 1 is the unmanned dispensing vehicle video flowing method for uploading flow chart that one embodiment of the invention provides, and specific steps are such as
Under:
Step 101: Video Distribution Server receive unmanned dispensing vehicle control centre upload video flowing, the video flowing by
The camera of unmanned dispensing vehicle acquires.
Step 102: Video Distribution Server is determined according to the incidence relation of preset camera and destination server
The corresponding destination server of the camera of unmanned dispensing vehicle gives received video stream to corresponding destination server, so that
: the pushing video streaming is given WebSocket (web socket) server of itself by the destination server.
Step 103: Video Distribution Server receives the mark for the camera to be monitored that monitor terminal is sent, according to preparatory
The mark of the corresponding destination server of the camera is returned to monitoring by the camera of setting and the incidence relation of destination server
Terminal, so that: the WebSocket server in WebSocket client and the destination server on monitor terminal is established
WebSocket connection, and the video flowing that the WebSocket server issues in the WebSocket connection is monitored, and whole in monitoring
The video is played on the painting canvas of HTML (Hypertext Markup Language, the hyper text markup language) page at end
Stream.
Fig. 2 be another embodiment of the present invention provides unmanned dispensing vehicle video flowing method for uploading flow chart, specific steps
It is as follows:
Step 201: monitor terminal determination will monitor the video flowing of a camera of a unmanned dispensing vehicle, by the camera
Mark is sent to Video Distribution Server.
Step 202: monitor terminal receives the mark for the associated destination server of the camera that Video Distribution Server returns
Know, the mark of the destination server is sent to the WebSocket client of itself.
Step 203: the WebSocket client on monitor terminal takes according to the mark of the destination server with the target
WebSocket server on business device establishes WebSocket connection, monitors the WebSocket connection.
Step 204: the WebSocket client on monitor terminal, which listens in the WebSocket connection, the target
When the video flowing that server issues, the video flowing is downloaded, and by the video stream to the video player of monitor terminal, so that
: video player plays the video flowing on the painting canvas of the html page of monitor terminal.
Wherein, the video flowing are as follows: the video flowing that the control centre of the received unmanned dispensing vehicle of Video Distribution Server uploads,
The video flowing is acquired by the camera of unmanned dispensing vehicle, and Video Distribution Server takes according to preset camera and target
The incidence relation of business device, determines the corresponding destination server of the camera of unmanned dispensing vehicle, by the video stream to corresponding
Destination server, so that: the pushing video streaming is given the WebSocket server of itself by the destination server.
Fig. 3 is the unmanned dispensing vehicle video flowing method for uploading flow chart that further embodiment of this invention provides, specific steps
It is as follows:
Step 301: preset a Video Distribution Server and multiple destination servers, it is pre- on each destination server
First generate WebSocket Server.
WebSocket Server is the virtual Server for supporting WebSocket agreement.
Step 302: configuring each camera and destination server of each unmanned dispensing vehicle on Video Distribution Server in advance
Incidence relation.
The incidence relation between camera identification and destination server mark can be established using regular expression.Such as:
1) if camera identification matches regular expression: ^/[0-9_a-z] */[0-9_a-z] * [a-g0-2] { 1 } $ takes the photograph
As head corresponds to destination server A;
2) if camera identification matches regular expression: ^/[0-9_a-z] */[0-9_a-z] * [h-n3-5] { 1 } $ takes the photograph
As head corresponds to destination server B;
3) if camera identification matches regular expression: ^/[0-9_a-z] */[0-9_a-z] * [o-u6-7] { 1 } $ takes the photograph
As head corresponds to destination server C;
4) if camera identification matches regular expression: ^/[0-9_a-z] */[0-9_a-z] * [v-z8-9] { 1 } $ takes the photograph
As head corresponds to destination server D;
……
Step 303: the control centre of unmanned dispensing vehicle obtains the video flowing of each camera acquisition on vehicle in real time.
Specifically, control centre first passes through order ffmpeg-list_devices true-f dshow-i dummy and lists
Then all devices on unmanned dispensing vehicle find camera such as wherein: Integrated Camera, then to camera
Obtain the video flowing of its acquisition.
Step 304: the control centre of unmanned dispensing vehicle respectively in real time encodes the video flowing of each camera acquisition, will
Video Distribution Server is sent in the video flowing of corresponding camera identification encapsulation in encoded.
Specifically, plug-flow order: ffmpeg-s 1280x720-f dshow-i video=" can be used in control centre
Integrated Camera"-f mpegts -codec:v mpeg1video -muxdelay 0.001 -s640x480 -b:
30-bf of v 800k-r, 0 http: // 192.168.180.122/live/ugv01 shifts the video flowing that camera acquires onto
Video Distribution Server, wherein 192.168.180.122 is the IP address of Video Distribution Server, and live is password, ugv01
For camera identification.
Step 305: Video Distribution Server receives video flowing, according to the mark of the camera of the acquisition video flowing,
And each unmanned dispensing vehicle each camera and destination server incidence relation, find the associated destination service of the camera
The mark of device.
Further, identifying code can be also encapsulated into the video flowing after encoding by control centre, and Video Distribution Server connects
After receiving video flowing, the identifying code of itself preservation is first found according to the camera identification, by the identifying code found and reception
To identifying code be compared, if unanimously, receiving video flowing;Otherwise, video flowing is abandoned.
Step 306: Video Distribution Server gives the video stream to the associated destination server.
Such as: destination server receives Video Distribution Server by the http server that nodejs service is established and sends
Video flowing, such as: var streamServer=http.createServer (function (request, response) { }.
Step 307: the video flowing is pushed to the WebSocket Server of itself by destination server in real time,
WebSocket Server will be in the video flowing real-time transmission to each Websocekt connection itself established.
Video flowing is pushed to the WebSocket Server of itself by such as issuing orders by destination server in real time:
Fig. 4 is the unmanned dispensing vehicle video flowing method for uploading flow chart that further embodiment of this invention provides, specific steps
It is as follows:
Step 401: generating WebSocket Client on monitor terminal in advance.
WebSocket Client is the virtual Client for supporting WebSocket agreement.
Step 402: monitor terminal determination will monitor the video flowing of a camera of a unmanned dispensing vehicle, by the camera
Mark is sent to Video Distribution Server.
This step can pass through realization of such as issuing orders:
Var url='ws: // 192.168.180.122:2008/ugv01'.
Step 403: Video Distribution Server receives the camera identification, according to each camera and mesh of each unmanned dispensing vehicle
The incidence relation for marking server, finds the mark of the associated destination server of the camera, by the mark of the destination server
Return to monitor terminal.
Step 404: destination server mark is sent to the WebSocket Client of itself by monitor terminal,
WebSocket Client is identified according to the destination server, is established with the WebSocket Server on the destination server
WebSocket connection.
Step 405:WebSocket Client monitors WebSocket connection in real time, when listening in WebSocket connection
When having video flowing, the video flowing is downloaded, by the video stream to the video player on monitor terminal.
Step 406: the video player on monitor terminal is decoded the video flowing, and decoded video flowing is being supervised
It is played on the painting canvas of the html page of control terminal.
The broadcasting of video flowing can be realized by such as issuing orders:
Var player=new JSMpeg.Player (url, { canvas:canvas }).
Specifically, video player pre-saves position of the painting canvas on html page, after receiving video flowing, uses
Video flowing is on a frame-by-frame basis plotted on painting canvas by renderer.
Specifically, can be used JavaScript generate video player, video player can by MPEG-TS decoder,
MPEG1 video and MP2 audio decoder, WebGL&Canvas2D renderer and WebAudio sound output composition.
Each painting canvas has unique canvas id, such as:<canvas id="video-canvas"></canvas>,
Video player gets the canvas id of painting canvas in advance, finds painting canvas on html page according to canvas id, then adopts
Video flowing is plotted on painting canvas one by one with Canvas2D renderer.
Advantageous effects of the invention are as follows:
The embodiment of the present invention is by after the video flowing that Video Distribution Server receives that unmanned dispensing vehicle is sent, by video
Flow point issues each destination server, video stream is gone out by destination server, and monitor terminal is built with destination server
After vertical connection, video flowing is obtained by monitoring the connection, so that the video flowing for greatly reducing unmanned dispensing vehicle uploads to monitoring
The delay time of terminal.
Further, the embodiment of the present invention on destination server by generating Websocket server, in monitor terminal
Upper generation Websocket client, Websocket client is established Websocket with Websocket server and is connect, and leads to
Websocket connection transmitting video-frequency flow is crossed, the video flowing that further reduced unmanned dispensing vehicle uploads to the delay of monitor terminal
Time, the usual delay time can be controlled in 1 second, are can be controlled within 200 milliseconds in specific experiment.
Fig. 5 is the structural schematic diagram that the unmanned dispensing vehicle video flowing that one embodiment of the invention provides uploads device, the device
On Video Distribution Server, the device mainly includes: video flowing receiving module 51, video flowing issue module 52 and monitoring is handed over
Mutual module 53, in which:
Video flowing receiving module 51, for receive unmanned dispensing vehicle control centre upload video flowing, the video flowing by
The camera of unmanned dispensing vehicle acquires.
Video flowing issues module 52, for the incidence relation according to preset camera and destination server, determines
The received video flowing of video flowing receiving module 51 is sent to pair by the corresponding destination server of the camera of unmanned dispensing vehicle in real time
The destination server answered.
Interactive module 53 is monitored, for receiving the mark for the camera to be monitored that monitor terminal is sent, according to setting in advance
The mark of the corresponding destination server of the camera is returned to monitoring eventually by the incidence relation of fixed camera and destination server
End, so that: monitor terminal and the destination server establish connection, and monitor the video that the destination server issues in the connection
Stream, and the video flowing is played on monitor terminal.
In practical applications, video flowing receiving module 51 is further used for, when the control centre for receiving unmanned dispensing vehicle
When the video flowing of upload, camera identification and identifying code are obtained from video flowing, according to each camera identification itself saved with
The corresponding relationship of identifying code judges whether the identifying code that the control centre of unmanned dispensing vehicle sends is correct, if so, receiving video
Stream;Otherwise, video flowing is abandoned.
In practical applications, video flowing, which issues module 52 video flowing is sent to corresponding destination server in real time, includes:
Video flowing is pushed to the service of the WebSocket on the destination server via corresponding destination server in real time
Device;
And monitor terminal and the destination server establish connection are as follows: WebSocket client and the mesh on monitor terminal
WebSocket server on mark server establishes WebSocket connection;
Monitor the video flowing that the destination server issues in the connection are as follows: monitoring should in the WebSocket connection
The video flowing that WebSocket server issues.
Fig. 6 is the structural schematic diagram that the unmanned dispensing vehicle video flowing that further embodiment of this invention provides uploads device, the dress
Setting on monitor terminal, the device mainly includes: destination server identifier acquisition module 61, video flowing obtain module 62 and view
Frequency player 63, in which:
Destination server identifier acquisition module 61, the video of the camera for monitor a unmanned dispensing vehicle in determination
The mark of the camera is sent to Video Distribution Server by stream, receives the camera association that Video Distribution Server returns
Destination server mark.
Video flowing obtains module 62, the mark of the destination server for sending according to destination server identifier acquisition module 61
Know, establish connection with the destination server, monitor the connection, when listen in the connection have the destination server issue video
When stream, the video flowing is downloaded, by the video stream to video player 63, wherein the video flowing are as follows: Video Distribution Server
The video flowing that the control centre of received unmanned dispensing vehicle uploads, which is acquired by the camera of unmanned dispensing vehicle, and is regarded
Frequency the distribution server determines the camera of unmanned dispensing vehicle according to the incidence relation of preset camera and destination server
Corresponding destination server gives the video stream to corresponding destination server.
Video player is downloaded for playing WebSocket client 62 on the painting canvas of the html page of monitor terminal
Video flowing.
In practical applications, monitor terminal further comprises: WebSocket client generation module, for generating
WebSocket client.
In practical applications, it can be WebSocket client that video flowing, which obtains module 62,
Destination server identifier acquisition module 61 further comprises: the destination server that Video Distribution Server is returned
Mark is sent to WebSocket client;
And WebSocket client 62 and the destination server establish connection include: on the destination server
WebSocket server establishes WebSocket connection;
And it includes: to monitor the WebSocket connection that WebSocket client 62, which monitors the connection,;
And it includes: prison that WebSocket client 62, which listens to the video flowing for having the destination server to issue in the connection,
Hear the video flowing for thering is the destination server to issue in the WebSocket connection;
And Video Distribution Server gives video stream to corresponding destination server are as follows: Video Distribution Server will regard
Frequency flows through the WebSocket server being pushed on the destination server by corresponding destination server.
The embodiment of the present invention also provides a kind of non-transitory computer-readable storage medium, the non-instantaneous computer-readable storage
Medium storing instructions, the instruction execute the processor such as step 101-103, or such as step
201-204, perhaps such as the step of step 301-307 or the unmanned dispensing vehicle video flowing method for uploading as described in step 401-406
Suddenly.
The embodiment of the present invention also provides a kind of electronic equipment, including non-instantaneous computer-readable storage medium as described above
Matter and the processor that may have access to the non-transitory computer-readable storage medium.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all in essence of the invention
Within mind and principle, any modification, equivalent substitution, improvement and etc. done be should be included within the scope of the present invention.