Summary of the invention
One of technical problem to be solved by this invention is need to provide a kind of not to be subject to that host node or other nodes are delayed machine and the network video group system that exerts an influence.
In order to solve the problems of the technologies described above, the invention provides a kind of network video group system, comprising: a plurality of network video nodes, a plurality of IP video camera, a plurality of client and IP network, wherein,
Each IP video camera accesses in the described IP network, for generation of relevant informations such as audio frequency and video code streams; Each network video node interconnects, and accesses in the described IP network to consist of a group system without Centroid full-mesh topological structure; Each client is connected with each network video node by described IP network, and it sends request to described each network video node; Collaborative work is to realize the request of each client mutually between described each network video node, and wherein, described each network video node is preserved the information of all-network video record node in the cluster.
Further, this network video group system also comprises, when the information that detects arbitrary network video node changes, this network video node is to other network video node issue change message, other network video nodes upgrade the information of corresponding network video record node according to described changed information, wherein, described change message comprises the IP address of the network video node that information changes, the information that changes, timestamp and message check value.
Further, this network video group system also comprises, receive that at a network video node client is when adding the request of an IP video camera, the quantity of the IP video camera that each the network video node in the current described group system of this network video querying node has been taken over, with one of network video node of the described quantity minimum that is sent to the IP video camera of having taken over about the request of adding an IP video camera to finish the interpolation to an IP video camera.
Further, this network video group system also comprises, when a network video node is received a client about request that an IP video camera of not taken over is recorded a video, this network video node calculates the load value of each the network video node in the current described group system, with one of described network video node that is sent to the load value minimum about the request that an IP video camera of not taken over is recorded a video to finish the video recording to this IP video camera, wherein, described load value is that the size of the audio frequency and video code stream of recording a video according to each network video node obtains.
Further, this network video group system also comprises, when a network video node is received a client about request that an IP video camera of having been taken over is recorded a video, this network video querying node is to the network video node of taking over this IP video camera, described request is sent in the network video node of taking over this IP video camera to finish the video recording to this IP video camera, and the video file after will record a video is stored to for the storage pool of storing all video files; Simultaneously, this network video node calculates the load value of each the network video node in the current described cluster, and one of network video node of control load value minimum records a video to obtain backing up video file to this IP video camera.
Further, this network video group system also comprises, when detecting a network video node and break down, this network video node calculates the load value of each the network video node in the current described cluster, the network video node that one of network video node of current load value minimum is broken down as adapter, and send unsuccessfully adapter task notice to other network video nodes.
Further, this network video group system also comprises, whether detect a network video node by following steps and break down, each network video node connects to other network video node broadcasts heartbeat message, the heartbeat kept between each network video node at each setting-up time in the described cluster; If during the heartbeat Joint failure of a network video node, other network video nodes carry out the fault recognition request to this network video node, if receive that this network video node is to the response of described fault recognition request, judge that then its fault-free exists, otherwise, judge that it breaks down.
Further, this network video group system also comprises, receive that at a network video node client is when searching for the request of IP video camera video/audio code stream at a time, this network video node calculates the load value of each the network video node in the current described cluster, is sent to one of network video node of load value minimum with described about the request of searching for IP video camera video/audio code stream at a time; One of network video node of described load value minimum sends this request to other network video nodes; One of network video node of described load value minimum is searched for and Search Results is returned to the video file that other network video nodes are preserved self; One of network video node of described load value minimum merges to obtain the video file corresponding with the video/audio code stream in this a certain moment of IP video camera and network video node with Search Results; Described client according to the described video file of IP address acquisition of the corresponding network video node of video/audio code stream in this a certain moment of IP video camera.
Further, this network video group system also comprises, when the load value that detects a network video node surpassed the setting multiple of described network video supervisory control system average load, one of network video node of controlling described load value minimum was taken over the fractional load of this network video node.
Further, this network video group system also comprises, when a network video node is received a client about the request of the real-time video audio code stream of playing an IP video camera, this network video node is according to the information of all-network video record node in the described cluster, find the network video node of taking over this IP video camera, and to its request forwarding real-time video audio code stream, then transmit the network video address of node of taking over this IP video camera to described client.
Further, this network video group system also comprises, when the user logs on a network video node by described client, judge whether described client exists redirect notification, if judged result is yes, then this user is forwarded in the network video node in the described redirect notification and login, otherwise, carry out following steps: judge whether the number of users that signs in to described this network video node exceeds the setting multiple of described network video supervisory control system number of users average, and this number of users average is greater than setting numerical value, if judged result is yes, then this network video node is chosen in the network video node of described load value minimum, this user is forwarded in the selected network video node login.
Further, this network video group system comprises that also before described network video group system work operation, each network video node is to the Web broadcast heartbeat message at its place; After each network video node receives with it the heartbeat message of adjacent network video node, judge to send the network video node of heartbeat message whether in the information list of self, if do not exist, then send and obtain in the network video node of asking this heartbeat message of transmission to obtain the information of this network video node, wherein, described heartbeat message comprises IP address, storage capacity information, timestamp and the message check value of described network video node self.
Compared with prior art, one or more embodiment of the present invention can have following advantage:
Network video group system provided by the invention comprises a plurality of network video nodes.Each network video node is finished and is taken over IP video camera (being called for short IPC), video recording, backup, playback, load balancing, unsuccessfully takes over, and receive the functions such as client-requested and return results by the information interchange collaborative work.For client, it logins any network video node, can inquire about the information and the video recording that obtain whole cluster, makes the existence of its imperceptible independently network video machine.
The invention solves separate unit network video machine (NVR) performance bottleneck, the video recording of generation can not lost with the fault of some equipment; Simultaneously also solved in the prior art, the host node single-point performance bottleneck that principal and subordinate's clustering causes, owing to eliminated central point, the various impact that produces so that cluster can not be subjected to the delaying machine of host node, further, arbitrary node breaks down in the whole cluster can not affect the operation of cluster, has improved system reliability and stability.
The invention provides the dynamic capacity-expanding of single network video node in the non-stop-machine situation; Keeping only by increasing the memory space of network video node, can realizing the dilatation of whole cluster memory space under the constant prerequisite of number of devices, save the System Expansion cost simultaneously, improved autgmentability and the manageability of system.Further, because without Centroid, not acceptor center joint behavior restriction of cluster dilatation is so that power system capacity significantly is promoted to the PB rank.
Other features and advantages of the present invention will be set forth in the following description, and, partly from specification, become apparent, perhaps understand by implementing the present invention.Purpose of the present invention and other advantages can realize and obtain by specifically noted structure in specification, claims and accompanying drawing.
Embodiment
Describe embodiments of the present invention in detail below with reference to drawings and Examples, how the application technology means solve technical problem to the present invention whereby, and the implementation procedure of reaching technique effect can fully understand and implements according to this.Need to prove that only otherwise consist of conflict, each embodiment among the present invention and each feature among each embodiment can mutually combine, formed technical scheme is all within protection scope of the present invention.
In addition, can in the computer system such as one group of computer executable instructions, carry out in the step shown in the flow chart of accompanying drawing, and, although there is shown logical order in flow process, but in some cases, can carry out step shown or that describe with the order that is different from herein.
Fig. 1 is the structural representation according to the network video group system of the embodiment of the invention, describes each part of native system and the function of various piece in detail below with reference to Fig. 1.
As shown in Figure 1, this system (can be called for short the NVCR system) comprises a plurality of network video nodes (hereinafter to be referred as the NVCR node), a plurality of IP video cameras (hereinafter to be referred as IPC), a plurality of clients, and IP network.Wherein, each NVCR node accesses in the IP network jointly, interconnects between each NVCR node, forms the group system without Centroid full-mesh network topology structure.Each IPC accesses in the IP network, for generation of relevant informations such as audio frequency and video code streams.Each client links to each other with each NVCR node by IP network.Each client provides the user to use authentication and each NVCR node to connect, and sends request to each NVCR node.Can obtain the audio and video streams of storage from each NVCR node by the request that sends, perhaps by each NVCR, directly obtain the instant audio and video streams that each IPC produces.
Need to prove that in the embodiment of the invention, client runs in user's the browser in the WEB mode.IPC must support ONVIF agreement or RTSP agreement.Each NVCR node is preserved the information of all NVCR nodes in the cluster.Accept the request of client at the NVCR node after, between each NVCR node mutually collaborative work and return corresponding result realizing the request of each client.According to the instruction of client, can carry out to the audio and video streams that IPC produces many memory point backup video recordings, also can transmit the real-time audio video flowing of IPC, by transmitting, break through the connection restriction of IPC self.
The below describes the workflow about native system in detail.
(1) before the network video group system is carried out the work operation, this system is carried out initialization.
Particularly, after each NVCR node access IP network, each network video node exists to declare self to the Web broadcast heartbeat message at its place.Wherein, heartbeat message comprises the information such as IP address, memory capacity, timestamp and message check value of NVCR node self.
After each NVCR node receives with it the broadcast packet (being heartbeat message) that adjacent NVCR node sends, judge that first the NVCR node that sends heartbeat message whether in the information list of self, then keeps mourning in silence if exist; Otherwise then send the request of obtaining in the NVCR node that sends this heartbeat message obtaining the information of this NVCR node, and upgrade local tabulation according to the information that gets access to.Until each nodal information all collect upgrade complete after, initialization finishes, system brings into operation.
(2) after network video group system work operation, each NVCR node is safeguarded the integrality of whole system by mutual transmission message, so that the information synchronization of each NVCR node.
Concrete, when the information on detecting arbitrary NVCR node changed, this NVCR node was to other NVCR node issue change message.Change etc. such as taking over IPC that IPC changes, records a video, can be by to IP network broadcast transmission change message, other NVCR nodes upgrade the information of corresponding network video record node according to changed information.Particular content, timestamp and message check value that IP address, the information that changes, the information of the NVCR node that change message inclusion information changes changes.
For example, when adapter IPC changes, should comprise IP address, IPC management address, the video/audio forwarding address of IPC.For example, when the IPC of video recording changes, should comprise the IP address of the IPC that records a video, the beginning and ending time of video recording.By said method, can make other NVCR node time update records, the consistency of keeping system.
Need to prove that for the consistency of keeping system, every setting-up time, in the present embodiment at the most every one minute, the equal broadcast transmission alive message of each NVCR node shows that self is still working properly.General basic alive message only comprises self IP address, and the alive message that heartbeat message and change message are considered as expanding.
It should be noted that above-described all message also comprise timestamp and the message check value of NVCR node self system that sends message.Owing to all add the timestamp of self system when releasing news, guarantee when other NVCR nodes are received many information of same information source, record up-to-date information, the timestamp in different messages source does not need presynchronization, do not adjust when each NVCR node assurance self system time moves in cluster, can guarantee the consistency of message on time shaft of same message source.Any NVCR node extracts up-to-date message according to timestamp and notes down when receiving same message source about a plurality of message of same content.All add the check value of information when releasing news, guarantee the information that other NVCR nodes records are correct.After the information of a NVCR changes, immediately by other all NVCR amendment record information of broadcast announcement; The moment of any necessity is when a NVCR need to obtain or confirm the information of another NVCR, immediately by the point-to-point communication exchange message.
Pass through above-mentioned steps, so that each NVCR node logically with function on identical, on each NVCR node, all preserve the information of all NVCR nodes in the cluster, finish information synchronization with this, the common integrality of safeguarding whole cluster information, the node that does not have Centroid or similarly have with it administrative functions.Each NVCR node all is responsible for the information about self, and releases news to other NVCR nodes by broadcast announcement or point-to-point communication mode.
(3) when the user logins certain NVCR node by client, the user is shunted.
When the user logs on a network video node by client, judge whether client exists redirect notification, if judged result is yes, then this user is forwarded in the network video node in the redirect notification and login, otherwise, carry out following steps: judge whether the number of users that signs in to this network video node exceeds the setting multiple of network video supervisory control system number of users average, and this number of users average is greater than setting numerical value, if judged result is yes, then this network video node is chosen in the network video node of load value minimum, this user is forwarded in the selected network video node login.
Particularly, Fig. 2 is that the user of the network video group system of the embodiment of the invention shunts the handling process schematic diagram, as shown in Figure 2, at first client judges whether to exist the redirect notification of NVCR node, if judged result is yes, IP=B(B in the logging request (Login request) then is set to be present in the redirect notification that A returns), be redirected (Redirect)=true; If do not exist, IP=A in the Login request then is set, be redirected (Redirect)=false.After the NVCR node is received this Login request, check first and be redirected, if false then carries out login number (Login Number) check process; If true then skips Login Number check process.
At Login Number examination phase, the number of users (Login Number) of logining when this NVCR node self surpasses all NVCR node average twices of system (namely above 2
), and this average
Greater than 0.5 o'clock, this NVCR node selected a NVCR node as equipment B from current NVCR node with minimal user number at random, and the redirect notification that will comprise the IP address of equipment B returns to client.After the redirect notification that client returns to A, repeat the flow process that begins most and jump to equipment B to login.
Otherwise, when if the number of users of this NVCR node self login does not surpass all NVCR average twices of system, the NVCR node is confirmed this Login request, self login user number is added 1, and will comprise change message (Modify message) broadcasting of client ip address, notify other NVCR node amendment records.After this, carry out alternately other requests of customer in response end with client.
Can realize that by above-mentioned steps the user shunts, overcome the single-sign-on bottleneck, improve systematic function.
(4) after client is logined certain NVCR node A, initiate to add the IPC task or during task that certain IP video camera is recorded a video, realize balanced the distribution.
Particularly, when carrying out above-mentioned task, node A sends the search broadcast to IP network, and the IPC that receives the search broadcast responds broadcast, and node A collects the IPC echo message, the tabulation of obtaining all IPC, and the method and separate unit NVR are similar.All NVCR nodes records information that self obtain by comparison node A and the tabulation of all IPC, the IPC that differential display is not yet taken over and the IPC that has been taken over return to client.
But, need to prove, to the mapping relations of client hidden IPC and NVCR node.Like this, this system can dynamically change the mapping relations of IPC and NVCR node according to the operation conditions of each node, and the user only need to be concerned about load and the performance condition of whole NVCR system, need not to be concerned about the concrete situation of each NVCR node again.After client is initiated to take over the task of certain IPC, all NVCR nodes records information that node A retrieval obtains himself, be transferred to the NVCR Node B of taking over the IPC minimum number with taking over task balance, this request of taking over IPC comprises IP address and the management address of IPC.Node B will be taken over IPC according to management address, and according to the method for step (2), the newly-increased IPC that takes over of broadcast announcement.
More specifically, receive a client when adding the request of an IP video camera at a network video node, at first obtain the set N={n of the quantity of the IPC that each NVCR node has been taken in the cluster
1, n
2, n
3..., calculate separately the minimum value n=min{n that gathers N
1, n
2, n
3..., will be sent to about the request of adding an IP video camera in one of the network video node of quantity minimum of the IP video camera of having taken over.
In addition, when following situation occurring, also need to carry out balanced the distribution.
When a network video node is received a client about request that an IP video camera of not taken over is recorded a video, this network video node calculates the load value of each the network video node in the current group system, will about asking that an IP video camera of not taken over is recorded a video to one of network video node of load value minimum to finish the video recording to this IP video camera, wherein, load value is that the size of the audio frequency and video code stream of recording a video according to each network video node obtains.
In embodiments of the present invention, can be based on code check M, adapter IPC way n, the video recording parameters such as video recording fate D, NVCR node storage capacity S calculate load P, and computing formula is P=M*n*D/S.
Receive the request of a client about an IP video camera of having been taken over is recorded a video at a network video node, this NVCR querying node is to the NVCR node of taking over this IP video camera, will be about request that an IP video camera of having been taken over is recorded a video, be sent in the NVCR node of taking over this IP video camera to finish the video recording to this IP video camera, and the video file after will record a video is stored to for the storage pool of storing all video files; Simultaneously, this NVCR node calculates the load value of each the network video node in the current cluster, and one of network video node of control load value minimum records a video to obtain backing up video file to this IP video camera.
More specifically, obtain the video information of all NVCR node current times in the cluster, calculate separately the set L={l of the load of each NVCR node in the cluster
1, l
2, l
3..., l=∑ m, wherein l is the load capacity of each NVCR node, m be each NVCR node recording a video every day code stream size.Minimum value l=min{l according to set of computations L
1, l
2, l
3..., NVCR node corresponding to this minimum value transferred in the request that its certain IPC that receives records a video.After occuring that aforesaid IPC is balanced and distributing, it is synchronous that the NVCR node that changes all carries out cluster information according to step (2).
Need to prove that after unified storage pool was planned, the NVCR node A of client login initiated record task to the IPC that has been taken over.The kinescope method that also provides two memory points to back up in realtime.When any one NVCR node is recorded a video to the audio and video streams of some IP video camera generations of its adapter, can ask another network video node to be recorded a video simultaneously.
Be not the node of taking over IPC such as node A, then the node A notice NVCR Node B of taking over this IPC is recorded a video, and the request of record task should comprise the IP address of IPC, the video informations such as beginning and ending time recording channel of video recording.Video recording adopts unified storage pool, and the disk array virtualization that namely is useful on the storage video file is a unified storage pool, has overall naming space, and this storage pool of all nodes sharing is preserved video file.All NVCR nodes records information that while node A obtains by comparison step 1, according to the load-balancing algorithm of step (4), the NVCR node C of notice video recording least-loaded backs up video recording to this IPC simultaneously.Because copy has been preserved in the video recording of Node B and node C double copies, Node B or node C wherein arbitrary node break down, but also the node that do not break down of another one recovers, and guarantees the safe and reliable of video file.The NVCR node that relates to is all notified other NVCR by step (2) broadcast message after changing generation.
Because in embodiments of the present invention, any one NVCR node all checked all NVCR nodes records information that it obtains, the video recording load of calculating each NVCR node every one minute.As the load value that detects a NVCR node C is when surpassing the setting multiple (for example twice) of system's average load, and notice node C carries out the video recording balance equalizing task.After node C receives the video recording balance equalizing task, check immediately all NVCR nodes records information that himself obtain, examine the twice whether self load surpasses system's average load, if true, the then NVCR node D of the control load value minimum fractional load of taking over node C, and according to the variation of the information synchronization algorithm broadcast announcement video recording load of step (2).
(5) when some NVCR nodes break down, unsuccessfully take over and the fault transfer processing.
Each NVCR node connects to other NVCR node broadcasts heartbeat message, the heartbeat kept between each NVCR node at each setting-up time in the cluster; If during the heartbeat Joint failure of a NVCR node, other NVCR nodes carry out the fault recognition request to this NVCR node, if receive this NVCR node to the response of fault recognition request, judge that then its fault-free exists, otherwise, judge that it breaks down.
When detecting a NVCR node and break down, this NVCR node calculates the load value of each the NVCR node in the current cluster, the NVCR node that one of NVCR node of current load value minimum is broken down as adapter, and send unsuccessfully adapter task notice to other NVCR nodes.
In the present embodiment, each NVCR node is every alive message of one minute other NVCR node broadcasts of clockwise.In this process, the NVCR node that will elect according to the method in the step (4) least-loaded in per five minutes is unsuccessfully taken over the manager as one.
Because each NVCR node to other NVCR broadcasting primary informations, keep heartbeat and connect, so each NVCR can both be monitored separately the ruuning situation of other each NVCR nodes in the cluster at regular intervals.Behind certain NVCR node A heartbeat Joint failure, namely certain NVCR node A did not send alive message above one minute in group system, after the NVCR node of other normal operations is found this fault in the same time, wait for that all a backward fault NVCR node of random time makes fault recognition.The NVCR Node B of random time minimum, is eliminated random time and is waited for after the NVCR node of other normal operations is received this request at first to all NVCR node broadcasts fault recognition requests; If node A responds to this fault request, judge that then fault-free exists, otherwise predicate node A breaks down.
After obtaining fault recognition, other each nodes are updated to the IPC state that belongs to the adapter of A node in the tabulation separately unallocated.
The manager who is elected at first initiates unsuccessfully the adapter task and notifies to each node, to avoid occurring the situation of a plurality of manager's Processing tasks after confirming the A node failure.Then the manager utilizes again balanced distribution of step (4) according to all NVCR nodes records information that step (1) obtains.The NVCR node that relates to is all notified other NVCR nodes by step (2) broadcast message after changing generation.
(6) when some NVCR carried out in real time forwarding or video search, utilization is transmitted in real time and the video search algorithm is realized.
When a NVCR node is received a client about the request of the real-time video audio code stream of playing an IP video camera, this NVCR node is according to the information of all NVCR nodes in the cluster, find the NVCR node of taking over this IP video camera, and to its request forwarding real-time video audio code stream, then transmit the NVCR address of node of taking over this IP video camera to client.
For example, client is logined certain NVCR node A and is initiated live task, namely asks the real-time audio video flowing of certain IPC, and live task requests should comprise the IP address of IPC.All NVCR nodes records information that node A obtains according to step (1), request are taken over the NVCR Node B of this IPC and are transmitted the real-time audio video flowing.And node A only returns to the address that client is transmitted.Client is obtained the real-time audio video flowing by the NVCR Node B of this address this IPC of connecting tubes.Forwarding through Node B has broken through the restriction of IPC linking number, realizes that the multiple spot multichannel is simultaneously live.
Receive that at a network video node client is when searching for the request of IP video camera video/audio code stream at a time, this network video node calculates the load value of each the network video node in the current described cluster, is sent to one of network video node of load value minimum with described about the request of searching for IP video camera video/audio code stream at a time; One of network video node of described load value minimum sends this request to other network video nodes; One of network video node of described load value minimum is searched for and Search Results is returned to the video file that other network video nodes are preserved self; One of network video node of described load value minimum merges to obtain the video file corresponding with the video/audio code stream in this a certain moment of IP video camera and network video node with Search Results; Described client according to the described video file of IP address acquisition of the corresponding network video node of video/audio code stream in this a certain moment of IP video camera.
At client login node A, initiate the search video task, ask certain IPC video recording sometime, the request of search video task should comprise the IP address of IPC, the beginning and ending time of video etc. as search condition.All NVCR nodes records information that node A obtains according to step 1 are selected the NVCR node C of least-loaded according to the load-balancing algorithm of step 4, deliver the search video task to it.Node C is to all NVCR node broadcasts video search requests, and this request comprises the IP address of IPC, the beginning and ending time of video etc. as search condition.Other NVCR nodes are searched for the video file of self preserving, and Search Results is returned to node C.Node C obtains the mapping relations of a NVCR and video file, and this is the map stage.Node C merges all mappings, and this is the reduce stage.Amalgamation result will comprise a NVCR node D and corresponding video file.Node C returns to client with the result, and client again connected node D request sends video file.The open video recording of node D forwarding address, client is by this address acquisition video recording.The NVCR node that relates to is all notified other NVCR by step 2 broadcast message after changing generation.
The Internet video clustering video recording system of full-mesh provided by the present invention comprises a plurality of NVCR nodes.Each NVCR node is finished and is taken over IPC, video recording, backup, playback, load balancing, unsuccessfully takes over, and accept the functions such as client-requested and return results by the information interchange collaborative work.For client, it logins any NVCR node, can inquire about the information and the video recording that obtain whole cluster, makes the existence of its imperceptible independently network video machine.
The invention solves separate unit network video machine (NVR) performance bottleneck, the video recording of generation can not lost with the fault of some equipment; Simultaneously also solved in the prior art, the host node single-point performance bottleneck that principal and subordinate's clustering causes, owing to eliminated central point, the various impact that produces so that cluster can not be subjected to the delaying machine of host node, further, arbitrary node breaks down in the whole cluster can not affect the operation of cluster, has improved system reliability and stability.
The invention provides the dynamic capacity-expanding of single NVCR node in the non-stop-machine situation; Keeping only by increasing the memory space of NVCR node, can realizing the dilatation of whole cluster memory space under the constant prerequisite of number of devices, save the System Expansion cost simultaneously, improved autgmentability and the manageability of system.Further, because without Centroid, not acceptor center joint behavior restriction of cluster dilatation is so that power system capacity significantly is promoted to the PB rank.
Those skilled in the art should be understood that, above-mentioned each module of the present invention or each step can realize with general calculation element, they can concentrate on the single calculation element, perhaps be distributed on the network that a plurality of calculation elements form, alternatively, they can be realized with the executable program code of calculation element, thereby, they can be stored in the storage device and be carried out by calculation element, perhaps they are made into respectively each integrated circuit modules, perhaps a plurality of modules in them or step are made into the single integrated circuit module and realize.Like this, the present invention is not restricted to any specific hardware and software combination.
Although the disclosed execution mode of the present invention as above, the execution mode that described content just adopts for the ease of understanding the present invention is not to limit the present invention.Technical staff in any the technical field of the invention; under the prerequisite that does not break away from the disclosed spirit and scope of the present invention; can do any modification and variation in the details that reaches of implementing in form; but scope of patent protection of the present invention still must be as the criterion with the scope that appending claims was defined.