Disclosure of Invention
Based on the above, the invention aims to provide a video access method, an access balance server, a central server and a system which can meet the video access requirements of massive users.
The video access method according to the embodiment of the invention is applied to an access balancing server, and comprises the following steps:
when a video access request sent by a client is received, scheduling one access server;
and forwarding the video access request to a scheduled current access server so as to enable the current access server to send a real-time video request to a central server scheduled by a central balance server after authenticating the login of the client.
In addition, the video access method according to the above embodiment of the present invention may further have the following additional technical features:
further, after the step of forwarding the video access request to the scheduled current access server, the method further includes:
and when the current access server is detected to be down, the video access request is dispatched to another access server.
The video access method according to the embodiment of the invention is applied to a central server, the central server is connected with an equipment access gateway and at least one first-class server, the equipment access gateway is connected with monitoring equipment, and the method comprises the following steps:
responding to the dispatching of the central balance server;
when a real-time video request sent by an access server is received, scheduling one streaming server, and acquiring a stream receiving address of the current scheduled streaming server;
sending an instruction for pushing a real-time video stream to the current streaming server to the device access gateway, wherein the real-time video stream is shot by the monitoring device, and the instruction comprises the streaming receiving address;
and when the fact that the equipment access gateway successfully pushes the real-time video stream to the current streaming server is detected, the stream receiving address is responded to a client through the access server, so that the client obtains the real-time video stream from the current streaming server according to the stream receiving address, and the client is authenticated and logged in through the access server.
In addition, the video access method according to the above embodiment of the present invention may further have the following additional technical features:
further, after the step of sending the instruction for pushing the real-time video stream to the current streaming server to the device access gateway, the method further includes:
and when the fact that the equipment access gateway does not successfully push the real-time video stream to the current stream server is detected, responding an error code to the client through the access server.
Further, after the step of answering the flow receiving address to the client through the access server, the method further includes:
and when receiving a video access end notification sent by the current streaming server, sending an instruction for stopping pushing the real-time video stream to the current streaming server to the device access gateway, wherein the video access end notification is generated after the current streaming server detects that the client disconnects video access and a preset time elapses.
An access balancing server according to an embodiment of the present invention includes:
the first scheduling module is used for scheduling an access server when receiving a video access request sent by a client;
and the request sending module is used for forwarding the video access request to the scheduled current access server so as to send a real-time video request to a central server scheduled by a central balance server after the current access server authenticates the login of the client.
In addition, the access balancing server according to the above embodiment of the present invention may further have the following additional technical features:
further, the access balancing server further comprises:
and the second scheduling module is used for scheduling the video access request to another access server when the current access server is detected to be down.
According to an embodiment of the present invention, a central server is connected to an equipment access gateway and at least one first-class server, the equipment access gateway is connected to a monitoring device, and the central server includes:
the dispatching response module is used for responding the dispatching of the central balance server;
the stream server scheduling module is used for scheduling one stream server when receiving a real-time video request sent by an access server, and acquiring a stream receiving address of the scheduled current stream server;
a push instruction sending module, configured to send, to the device access gateway, an instruction for pushing a real-time video stream to the current streaming server, where the real-time video stream is shot by the monitoring device, and the instruction includes the streaming receiving address;
and the stream receiving address response module is used for responding the stream receiving address to a client through the access server when the fact that the equipment access gateway successfully pushes the real-time video stream to the current stream server is detected, so that the client acquires the real-time video stream from the current stream server according to the stream receiving address, and the client is authenticated and logged in through the access server.
In addition, the central server according to the above embodiment of the present invention may further have the following additional technical features:
further, the central server further includes:
and the error code response module is used for responding an error code to the client through the access server when the fact that the equipment access gateway does not successfully push the real-time video stream to the current stream server is detected.
The video access system according to the embodiment of the invention comprises a client, an access balancing server, a central server, a device access gateway, a monitoring device, at least one access server and at least one stream server, wherein,
the client is used for initiating or stopping video access;
the access balancing server is used for receiving the video access request of the client and dispatching the access server;
the access server is used for authenticating the login of the client and sending a real-time video request to the central balance server;
the central balance server is used for scheduling the central server and forwarding the real-time video request to the scheduled central server;
the central server is used for scheduling the stream server and sending a video stream pushing instruction to the equipment access gateway;
the equipment access gateway is used for pushing the real-time video stream shot by the monitoring equipment to a scheduled current stream server when receiving the video stream pushing instruction;
the stream server is used for receiving the connection request of the client and the equipment access gateway and sending the real-time video stream pushed by the equipment access gateway to the client.
According to the video access method, the access equalization server, the central server and the system, the access equalization service dynamically allocates one access server to each client requiring to be logged in the monitoring platform, so that massive users can be logged in, high concurrency request service can be provided for the users, and the client access server can be dynamically expanded, so that the capacity expansion of the concurrent access of the massive users is achieved. Therefore, the video access method can meet the video access requirements of massive users, can meet the video access request of each user when meeting the high concurrency and high availability requirements on video access brought by the massive users, is not easy to have the phenomena of incapability of access, running system, queuing access and the like, and has good experience.
Detailed Description
To facilitate an understanding of the invention, the invention will now be described more fully with reference to the accompanying drawings. Several embodiments of the invention are presented in the drawings. This invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
It will be understood that when an element is referred to as being "secured to" another element, it can be directly on the other element or intervening elements may also be present. When an element is referred to as being "connected" to another element, it can be directly connected to the other element or intervening elements may also be present. The terms "vertical," "horizontal," "left," "right," and the like as used herein are for illustrative purposes only.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
Referring to fig. 1, a structural diagram of a video access system according to the present invention is shown, and the following embodiments may be applied to the video access system shown in fig. 1, where the video access system includes a client 11, an access balance server 12, a central balance server 13, a device access gateway 14, a monitoring device 15, multiple access servers 16, multiple central servers 17, and multiple stream servers 18. The access balance server 12, the central balance server 13, the equipment access gateway 14, the access server 16, the central server 17 and the stream server 18 form a monitoring platform, which is composed of a local area intranet, and an internet access port is opened when the internet service is provided.
The client 11 is used for initiating or stopping video access, the client 11 is client software which provides services such as logging in a monitoring platform, querying an equipment list, starting or stopping video access and the like for a user, the client 11 can be connected with the monitoring platform through a user network, and the network can be the internet or a local area network.
Wherein, the access balance server 12 is connected with each access server 17, and is used for receiving the video access request of the client 11 and dispatching the access server 17.
The access server 16 is configured to authenticate login of the client, and send a real-time video request to the central equalization server 13;
the central balance server 13 is connected with each access balance server 12 and each central server, and the central balance server 13 is used for scheduling the central server 17 and forwarding a real-time video request to the scheduled central server 17;
wherein, the central server 17 is connected with each streaming server 18, and is used for scheduling the streaming server 18 and sending a video stream pushing instruction to the device access gateway 14;
the device access gateway 14 is configured to, when receiving a video stream pushing instruction, push a real-time video stream shot by the monitoring device 15 to the scheduled current streaming server 18;
the streaming server 18 is configured to receive a connection request between the client 11 and the device access gateway 14, and send a real-time video stream pushed by the device access gateway 14 to the client 11.
The monitoring device 15 is located on the monitoring network side and used for shooting a real-time video stream, and the monitoring device 15 may establish a connection with the device access gateway 14 through a local area network.
Referring to fig. 2 to 3, a video access method according to a first embodiment of the present invention is shown, including steps S01 to S10.
And step S01, the client sends a video access request to the access balancing server.
In specific implementation, a user can open client software and start the service of logging in the monitoring platform, and at the moment, the client automatically sends a video access request to the access balancing server.
The monitoring platform provides service address information accessed by the Internet in a DR mode by accessing the balance server and providing a virtual IP mode.
And S02, the access balancing server schedules an access server and forwards the video access request to the scheduled current access server.
It is understood that a scheduling policy may be preset to the access balancing server, so that the access balancing server schedules the idle, relatively idle, or newly added access server according to the scheduling policy.
When the access equilibrium server schedules the access server, the scheduled access server responds to the scheduling of the access equilibrium server.
And S03, the current access server authenticates the login of the client and then sends a real-time video request to a central balance server.
It should be noted that when the access balancing server schedules an access server to respond to a video access request, the client will log in to the monitoring platform through the scheduled current access server. Therefore, the current access server needs to authenticate the client (for example, verify the correctness of the IP and the password) to verify whether the user has the right to access the system, and after the authentication is successful, the client logs in the monitoring platform successfully through the current access server.
And S04, the central balance server schedules a central server and forwards the real-time video request to the scheduled current central server.
It is understood that a scheduling policy may be preset to the central equilibrium server, so that the access equilibrium server schedules the idle, relatively idle or newly added central server according to the scheduling policy.
Wherein, when the central equalization server schedules the central server, the scheduled central server will respond to the scheduling of the central equalization server.
And step S05, the current central server schedules a stream server and acquires a stream receiving address of the scheduled current stream server.
It should be noted that the streaming address is a sending address of the subsequent real-time video stream, and there is a difference in the streaming addresses of each streaming server.
Wherein, when the central server schedules the streaming server, the scheduled streaming server will respond to the scheduling of the central server.
It is understood that a scheduling policy may be preset to the central server, so that the central server schedules idle, relatively idle or newly added streaming servers according to the scheduling policy.
And S06, the current central server sends an instruction for pushing a real-time video stream to the current streaming server to the equipment access gateway, wherein the real-time video stream is shot by the monitoring equipment, and the instruction comprises the streaming receiving address.
And step S07, after receiving the instruction, the equipment access gateway establishes connection to the current streaming server according to the streaming receiving address and sends a request for pushing a real-time video to the monitoring equipment.
It should be noted that, since the instruction includes the stream receiving address, the stream server receiving the video stream, that is, the current stream server, can be determined according to the stream receiving address.
It can be understood that when the monitoring device receives a request for pushing a real-time video, the video obtained by shooting is sent to the device access gateway in real time.
And step S08, when receiving the real-time video stream pushed by the monitoring equipment, the equipment access gateway forwards the real-time video stream to the current stream server, and returns the execution result of the instruction to the current central server.
And step S09, when detecting that the equipment access gateway successfully pushes the real-time video stream to the current stream server, the current central server responds the stream receiving address to the client through the current access server.
It should be noted that, if the device access gateway successfully pushes the real-time video stream to the current stream server, the device access gateway returns the execution result of the normal response to the current central server, otherwise, the device access gateway returns the execution result of the abnormal response to the current central server.
And step S10, the client acquires the real-time video stream from the current stream server according to the stream receiving address.
It should be noted that, after receiving the streaming address, the client assembles an RTSP address according to a preset rule, and connects to the current streaming server through an RTSP protocol to obtain real-time video data from the current streaming server, and after successful obtaining, the client decodes and plays the real-time video data to complete real-time video detection of the user.
In summary, in the video access method in the above embodiment of the present invention, an access server is dynamically allocated to each client requiring to log in to a monitoring platform through an access balancing service, so as to achieve capacity expansion of concurrent access of massive users, and enable the login of massive users, and ensure that a high concurrent request service is provided for the users, in addition, through scheduling of the central balancing service and the central server, a video access request of each client can be responded in the respectively scheduled central server, and a real-time video stream pushed by a device access gateway can be received in the respectively scheduled stream servers, so that each client can obtain the real-time video stream in the respectively scheduled stream servers, and responses of the entire video access request are not interfered with each other, and in addition, a module of a real-time video access service is split through a reasonable architecture, and through reasonable scheduling configuration, high availability of the video access service is improved. Therefore, the video access method can meet the video access requirements of massive users, can meet the video access request of each user when meeting the high concurrency and high availability requirements on video access brought by the massive users, is not easy to have the phenomena of incapability of access, running system, queuing access and the like, and has good experience.
Referring to fig. 4 to 5, a video access method according to a second embodiment of the present invention is shown, including steps S11 to S25.
And step S11, the client sends a video access request to the access balancing server.
And step S12, the access balancing server schedules an access server according to a scheduling strategy and forwards the video access request to the scheduled current access server.
And S13, the current access server authenticates the login of the client and then sends a real-time video request to a central balance server.
And S14, the central balance server schedules a central server according to a scheduling strategy and forwards the real-time video request to the current scheduled central server.
And step S15, the current central server schedules a stream server according to the scheduling strategy and acquires the stream receiving address of the scheduled current stream server.
And S16, the current central server sends an instruction for pushing a real-time video stream to the current streaming server to the equipment access gateway, wherein the real-time video stream is shot by the monitoring equipment, and the instruction comprises the streaming receiving address.
And step S17, after receiving the instruction, the equipment access gateway establishes connection to the current streaming server according to the streaming receiving address and sends a request for pushing a real-time video to the monitoring equipment.
Step S18, when receiving the real-time video stream pushed by the monitoring device, the device access gateway forwards the real-time video stream to the current stream server, and returns the execution result of the instruction to the current central server.
Step S19, the current central server judges whether the equipment access gateway successfully pushes the real-time video stream to the current streaming server according to the execution result.
When it is determined that the device access gateway does not successfully push the real-time video stream to the current streaming server, step S20 is executed, and when it is determined that the device access gateway successfully pushes the real-time video stream to the current streaming server, steps S21 to S25 are executed.
And step S20, the current central server responds an error code to the client through the current access server.
The error code may be preset, so that when the device access gateway does not successfully push the real-time video stream to the current streaming server, the preset error code is returned to the current access server, so that the current access server rotates the preset error code to the client, and the client can know that the video access request sent by the client fails according to the preset error code.
And step S21, the current central server responds the stream receiving address to the client through the current access server.
And step S22, the client acquires the real-time video stream from the current stream server according to the stream receiving address.
Step S23, when it is detected that the client disconnects the video access and a preset time elapses, the current streaming server generates a video access end notification, and sends the video access end notification to the current central server.
And step S24, the current central server sends an instruction for stopping pushing the real-time video stream to the current stream server to the equipment access gateway.
And step S25, the equipment access gateway removes the connection with the current streaming server, sends a request for stopping pushing the real-time video to the monitoring equipment, and returns an execution result to the central server.
It can be understood that, when receiving the request for stopping pushing the real-time video, the monitoring device stops pushing the shot real-time video stream to the device access gateway.
In addition, after the step of scheduling, by the access balancing server, one access server according to a scheduling policy, the video access method further includes:
and when the access balancing server detects that the current access server is down, the access balancing server dispatches the video access request to another access server.
In summary, compared with the video access method in the first embodiment, the video access method in this embodiment implements service keep-alive detection of the access servers by accessing the balancing server, and when any access server is found to be down, the video access request responded by the access server can be dispatched to other idle or relatively idle access servers for responding, thereby ensuring high availability of the video access service. In addition, after the user disconnects the video connection between the client and the streaming server, the streaming server sends a notification of stopping video push to the central server after waiting for a period of time, so that the user can quickly recover the video connection when the client network shakes (becomes unstable).
Referring to fig. 6, the access balancing server 12 in the third embodiment of the present invention is described, where the access balancing server 12 includes:
a first scheduling module 121, configured to schedule one access server according to a scheduling policy when receiving a video access request sent by a client;
a request sending module 122, configured to forward the video access request to the scheduled current access server, so that after the current access server authenticates that the client logs in, the real-time video request is sent to a central server scheduled by a central balancing server.
Further, the access balancing server 12 further includes:
and the second scheduling module 123 is configured to schedule the video access request to another access server according to the scheduling policy when the current access server is detected to be down.
Referring to fig. 7, a center server 17 according to a fourth embodiment of the present invention is described, where the center server 17 includes:
a scheduling response module 171, configured to respond to scheduling of the central balancing server;
the streaming server scheduling module 172 is configured to schedule one streaming server according to a scheduling policy and obtain a stream receiving address of a scheduled current streaming server when receiving a real-time video request sent by an access server;
a push instruction sending module 173, configured to send, to the device access gateway, an instruction for pushing a real-time video stream to the current streaming server, where the real-time video stream is shot by the monitoring device, and the instruction includes the streaming receiving address;
and a flow receiving address response module 174, configured to, when it is detected that the device access gateway successfully pushes the real-time video flow to the current flow server, respond the flow receiving address to a client through the access server, so that the client obtains the real-time video flow from the current flow server according to the flow receiving address, and the client logs in through authentication of the access server.
Further, the central server 17 further includes:
an error code response module 175, configured to respond to the client through the access server with an error code when it is detected that the device access gateway does not successfully push the real-time video stream to the current streaming server.
Further, the central server 17 further includes:
a stop instruction sending module 176, configured to send, to the device access gateway, an instruction to stop pushing the real-time video stream to the current streaming server when receiving a video access end notification sent by the current streaming server, where the video access end notification is generated by the current streaming server after detecting that the client disconnects video access and a preset time elapses.
Those of skill in the art will understand that the logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be viewed as implementing logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.