Network camera scheduling method
Technical Field
The invention relates to the field, in particular to a network camera scheduling method.
Background
As a new security device, a network Camera (IP Camera, abbreviated as IPC) has been widely used in various production fields. Meanwhile, with the development of the chip industry and the rapid progress of the AI technology, the IPC undertakes more image processing tasks in the AI field, such as personnel identification, face snapshot, face comparison, action identification and the like. At present, such tasks are usually completed by a background server, IPC transmits original pictures or stream information to the background server through a network, and then the server issues and displays the identification result.
Network fluctuation, unstable data, no effective scheduling established between cameras, and difficulty in monitoring huge site information comprehensively and all the time under the limited condition of the cameras. The access of multiple IPCs also puts higher requirements on the real-time processing capability of the background server.
The invention is based on an Onvif protocol (namely an Open Network Video Interface protocol, an Open Network Video Interface Forum), aims to unify the calling specification of IPC through a standardized data model and an Interface, any IPC supporting the Onvif protocol can be called and controlled through the unified Onvif Interface, and designs a Network camera dispatching system for directly carrying out Network communication with a camera, wherein the Network camera dispatching system supports the access of multiple brands of IPCs or own cameras, and realizes the automatic processing of abnormal states of the camera through the unified management of the camera, including disconnection, stillness and the like.
Disclosure of Invention
The technical problem solved by the invention is as follows: the defects of the prior art are overcome, and the network camera scheduling method is provided.
The purpose of the invention is realized by the following technical scheme:
a network camera dispatching method is characterized in that,
polling cameras in the camera pool;
if the camera is found to be offline, carrying out replacement scheduling according to the adjacent relation or reliability of the camera.
Specifically, the method further comprises the camera pool establishing step:
and searching the cameras regularly in the network, and acquiring a current available list of the cameras, wherein the list comprises the state information of the cameras and the adjacent relation between the cameras.
Specifically, the camera state information includes four states of offline, unacknowledged, idle, and allocated.
Specifically, the adjacent relationship between the cameras is constructed by the following steps:
modeling a scene by using the image uploaded by the camera;
establishing an adjacent relation between the cameras by utilizing the cameras to correspond to a scene which can be detected in the model;
and obtaining the overlapping range of the cameras by rotary scanning.
Specifically, the camera replacement scheduling includes the following steps:
if a certain camera is offline, selecting the rest certain idle and online cameras according to the scheduling sequence, and changing the identity of the rest certain idle and online cameras into the allocated identity;
resetting the new camera by using the parameters of the original camera;
and if the camera is on line again, adding the idle queue to wait for replacing the scheduling again.
Specifically, the determining of the scheduling sequence includes the following steps:
uploading a scene image by a camera;
a scene is mapped into a data model, and each camera corresponds to the position of the camera in reality in the data model;
and obtaining a camera scheduling sequence according to the data model.
Specifically, the determining of the scheduling sequence includes the following steps:
establishing a state model for each camera, wherein each state model represents the reliability of the camera under various conditions;
calculating the priority of the camera under the current requirement for each specific use requirement according to the reliability model of the camera;
the scheduling order is determined from high to low in the calculated priority.
Specifically, the method further comprises a camera hotspot tracking step: a list of hot spot statuses is maintained for each camera.
Specifically, the hot spot status list is only valid when the camera is online.
Specifically, the method further comprises the following image pickup task execution steps:
the camera obtains a task through a central scheduling unit;
the camera returns the screenshot and the stream taking operation result to the scheduling unit;
the dispatching unit is used for storing after further processing and providing service through an external interface.
The invention has the beneficial effects that:
1. through unified management of the cameras, automatic processing of abnormal states of the cameras, including disconnection, stillness and the like, is achieved.
2. And unifying the calling specification of the network camera through a standardized data model and an interface.
3. And transferring a part of image processing tasks to the edge computing power for computing so as to reduce the burden of the central server.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the structures shown in the drawings without creative efforts.
FIG. 1 is a technical flow diagram of the present invention;
fig. 2 is an overall architecture diagram of the present invention.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not limit the invention.
The following detailed description will be selected to more clearly understand the technical features, objects and advantages of the present invention. It should be understood that the embodiments described are illustrative of some, but not all embodiments of the invention, and should not be taken to limit the scope of the invention. All other embodiments that can be obtained by a person skilled in the art based on the embodiments of the present invention without any inventive step are within the scope of the present invention.
Example 1
As shown in fig. 1-2, the present invention is based on the Onvif protocol ((i.e., open Network Video Interface form) and launched in 11 months of 2008, and aims to unify the IPC calling specification by standardizing a data model and an Interface. The system supports access of multiple IPCs or cameras, and realizes automatic processing of abnormal states of the cameras, including disconnection, stillness and the like, through unified management of the cameras. Meanwhile, in order to save the computing power of the background server, the invention transfers a part of image processing tasks to the edge computing power for computing so as to reduce the burden of the central server.
The principle and idea of operation are as follows:
1. server scheduling method
The server controls the network camera by using an onvif protocol, and only the use condition of the camera needs to be determined. The server will formulate a method to schedule the cameras in conjunction with the usage scenarios and requirements. The server searches the cameras periodically in the network and obtains the current available list of the cameras, and updates the information of the cameras according to the search result. Meanwhile, the camera is possibly instantaneously offline or jammed in a network, if and only if the unanswered times of the camera are too high, the camera is judged to be physically offline, otherwise, the camera is in an unanswered state. And for each scanned camera, combining the online state of the camera, and allocating role tasks according to requirements, wherein the role tasks comprise an offline state, an unanswered state, an idle state and an allocated state. And the cameras are abstracted into a camera pool by the server and represent available camera resources.
After a certain camera is offline, the system automatically selects the rest of the idle and online cameras, changes the identity of the idle and online cameras into the distributed identity, and resets the new camera by using the parameters of the original camera. And if the original camera is on-line again, adding the original camera into the idle queue to wait for replacement again. For the free queue selection problem, various methods can be introduced in the future to select according to requirements, and two methods are provided firstly: a method based on spatially distributed positions and a method based on a reliability state.
The method comprises the following steps: the method based on the spatial distribution position refers to modeling a scene by using an image transmitted back by a camera, and establishing an adjacent incidence relation between the cameras, so that the overlapping range of the cameras is obtained by the rotation scanning of the cameras. The real scene is mapped into a data model by the server, and each camera corresponds to the position of the camera in the real scene in the model. And scheduling according to the camera scheduling sequence given by the model.
The second method comprises the following steps: the reliability state-based method is characterized in that a state model is maintained for each camera, each model represents the reliability degree of the camera under various conditions, and the model is called a reliability model. For example, when a camera cannot capture a useful picture, or physical disconnection is frequent in the near term, or a returned image is unclear, the reliability of the camera is reduced, and if the definition of the picture returned by the camera is higher, the required information amount in the picture is larger, the number of times of disconnection of the camera is small, and the corresponding reliability is increased. And calculating the priority of the camera under the current requirement for each specific use requirement according to the reliability model of the camera, wherein the priorities obtained by calculating different requirement reliability models are different. The selection of the camera is performed from high to low according to the calculated priority.
2. Camera hotspot tracking and task processing
To prevent camera scan inefficiencies, a hotspot status list is maintained for each camera. Colloquially, a hotspot is the average of recent locations where we want to observe. And when the list is not empty, point scanning is carried out according to the hot spot list, so that low-efficiency scanning is avoided. Meanwhile, the camera regularly and forcibly updates the hot spot, and determines the hot spot state through full scanning to prevent the hot spot from failing, namely, what we want to observe may change its position due to time, so that the camera regularly searches for its position and updates the hot spot. The hotspot list is only valid when the camera is online.
The camera obtains tasks through the central scheduling unit, returns operation results such as screenshot and stream taking back to the scheduling unit, and the scheduling unit further processes and stores the operation results to obtain information needed by people and provides services through an external interface.
The foregoing shows and describes the general principles, essential features, and advantages of the invention. It will be understood by those skilled in the art that the present invention is not limited to the embodiments described above, which are described in the specification and illustrated only to illustrate the principle of the present invention, but that various changes and modifications may be made therein without departing from the spirit and scope of the present invention, which fall within the scope of the invention as claimed. The scope of the invention is defined by the appended claims and equivalents thereof.
It should be noted that, for simplicity of description, the above-mentioned embodiments of the method are described as a series of acts, but those skilled in the art should understand that the present application is not limited by the described order of acts, as some steps may be performed in other orders or simultaneously according to the present application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and elements referred to are not necessarily required in this application.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a ROM, a RAM, etc.
While the invention has been described in connection with what is presently considered to be the most practical and preferred embodiment, it is to be understood that the invention is not to be limited to the disclosed embodiment, but on the contrary, is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.