CN115981799A - Video analysis method, system, device and medium - Google Patents

Video analysis method, system, device and medium Download PDF

Info

Publication number
CN115981799A
CN115981799A CN202211477711.9A CN202211477711A CN115981799A CN 115981799 A CN115981799 A CN 115981799A CN 202211477711 A CN202211477711 A CN 202211477711A CN 115981799 A CN115981799 A CN 115981799A
Authority
CN
China
Prior art keywords
snapshot
video analysis
task
image shooting
video
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211477711.9A
Other languages
Chinese (zh)
Inventor
王均
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing Unisinsight Technology Co Ltd
Original Assignee
Chongqing Unisinsight Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chongqing Unisinsight Technology Co Ltd filed Critical Chongqing Unisinsight Technology Co Ltd
Priority to CN202211477711.9A priority Critical patent/CN115981799A/en
Publication of CN115981799A publication Critical patent/CN115981799A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Closed-Circuit Television Systems (AREA)

Abstract

The application provides a video analysis method, system, device and medium, comprising: acquiring a distributed timing task queue, and triggering a snapshot task and a video analysis task in the distributed timing task queue according to preset time; then according to the same image shooting equipment and the same snapshot interval, aggregating the snapshot tasks to generate a plurality of snapshot subtasks; aggregating the video analysis tasks according to the same image shooting equipment and the same analysis algorithm to generate a plurality of video analysis subtasks; executing the snapshot subtasks by utilizing the executing nodes of the cluster to obtain corresponding snapshot videos; and executing the video analysis subtasks by utilizing the execution nodes of the cluster, and analyzing the captured video obtained by each captured subtask. By scheduling tasks on the cluster, the method and the system realize the efficient utilization of image shooting equipment and algorithm resources and avoid the algorithm resource waste caused by repeated calculation; the camera snapshot times are reduced, and the network bandwidth and storage are saved.

Description

Video analysis method, system, device and medium
Technical Field
The application relates to the technical field of security protection, in particular to a video analysis method, a system, equipment and a medium.
Background
At present, thousands of cameras for various monitoring are installed in many cities, and the cameras are applied to scenes such as traffic control, safety monitoring, industrial and commercial management and the like. Due to the large number of cameras, it is impractical to use both human and visual means to perform analysis of these videos.
With the rapid development of technologies such as artificial intelligence (e.g., neural network), a large number of algorithms for video analysis are used for processing real-time video streams and analyzing video capture pictures, so that a user can realize intelligent monitoring only by submitting requirements to a corresponding algorithm system, and the corresponding algorithm system has analysis efficiency far exceeding that of human and relatively high analysis accuracy. However, the requirements of the algorithm system on computing resources and storage are more severe compared with the conventional application; meanwhile, user requirements are various, and cameras and analysis algorithms are relatively fixed, so that how to reasonably utilize computing resources becomes important.
Disclosure of Invention
In view of the above-mentioned shortcomings of the prior art, the present application aims to provide a video analysis method, system, device and medium, which are used to solve the problem of how to make reasonable use of computing resources.
To achieve the above and other related objects, the present application provides a video analysis method, comprising the steps of:
acquiring a distributed timing task queue which is created in advance or in real time;
triggering a snapshot task and a video analysis task in the distributed timing task queue according to preset time;
aggregating the snapshot tasks according to the same image shooting equipment and the same snapshot interval to generate a plurality of snapshot subtasks; aggregating the video analysis tasks according to the same image shooting equipment and the same analysis algorithm to generate a plurality of video analysis subtasks;
executing the plurality of snapshot subtasks by utilizing the execution node of the target cluster to obtain a corresponding snapshot video; and executing the plurality of video analysis subtasks by using the execution node of the target cluster, and analyzing the snapshot video obtained by each snapshot subtask.
In an embodiment of the present application, the generating process of the distributed timed task queue includes:
initializing a global counter, and after the global counter reaches a preset duration, adding one to the global counter;
initializing an asynchronous thread pool, creating a task queue, monitoring queue data by using an asynchronous thread, and creating a video analysis task and a snapshot task; and the number of the first and second groups,
configuring image shooting equipment, a snapshot interval and preset points of the image shooting equipment which are associated with the snapshot task; configuring an analysis algorithm, an analysis time and an analysis rule associated with the video analysis task, and generating an image shooting equipment execution plan;
and adding the image shooting equipment execution plan, the video analysis task and the snapshot task into the task base conflict to generate the distributed timing task queue.
In an embodiment of the present application, the process of aggregating the capturing tasks according to the same image capturing device and the same capturing interval to generate a plurality of capturing subtasks includes:
performing integer division operation on the snapshot interval by using a global counter;
if the snapshot interval can be divided by the global counter, marking the snapshot task as execution; if the snapshot interval cannot be divided by the global counter, marking the snapshot task as not executed;
traversing all snapshot tasks marked as execution, and aggregating the snapshot tasks into different groups according to the serial numbers of the image shooting devices;
and generating a capturing subtask for each group to obtain the plurality of capturing subtasks.
In an embodiment of the application, the plurality of snapshot subtasks are executed by using the execution node of the target cluster to obtain a corresponding snapshot video; and executing the plurality of video analysis subtasks by using the execution node of the target cluster, wherein the process of analyzing the snapshot video obtained by each snapshot subtask comprises the following steps:
calling an execution node of the target cluster to perform video snapshot according to the image shooting equipment associated with each snapshot subtask, and storing the snapshot video;
and calling an execution node of the target cluster to analyze the stored snapshot videos one by one according to the analysis algorithm associated with each video analysis subtask to obtain a corresponding video analysis result.
In an embodiment of the application, the multiple video analysis subtasks are executed by using the execution node of the target cluster, and after the analysis is performed on the captured video obtained by each captured subtask, the method further includes:
pushing the video analysis result to a specified message queue;
receiving processing logic instructions generated by a subscriber based on the specified message queue;
and responding to the processing logic instruction, and feeding back the video analysis result to a target user or an alarm center.
In an embodiment of the present application, the process of generating the execution plan of the image capturing apparatus includes:
acquiring a video analysis requirement;
applying for a plurality of preset point positions of image shooting equipment according to the video analysis requirement; the plurality of preset point positions of the image shooting equipment are used for switching the image shooting equipment of a plurality of target objects in the same time interval;
associating the scheduling time of the image shooting equipment with the execution time of the video analysis task;
and generating an execution plan of the image shooting equipment according to the preset point positions of the plurality of image shooting equipment and the execution time of the video analysis task.
In an embodiment of the application, after the image capturing device execution plan is generated, the method further includes:
the asynchronous thread monitors a scheduling queue of the image shooting equipment, extracts an execution plan of the image shooting equipment, and finds the corresponding image shooting equipment and preset points of the image shooting equipment;
sending an execution instruction to the image shooting equipment so that the image shooting equipment rotates to a preset point position of the image shooting equipment;
and controlling the image shooting equipment to stay for a preset time length, and controlling the image shooting equipment to keep a locking state in the preset time length.
The present application further provides a video analysis system, comprising:
the task queue module is used for acquiring a distributed timing task queue which is created in advance or in real time;
the task triggering module is used for triggering the snapshot task and the video analysis task in the distributed timing task queue according to preset time;
the task sub-module is used for aggregating the snapshot tasks according to the same image shooting equipment and the same snapshot interval to generate a plurality of snapshot sub-tasks; the video analysis system comprises a video analysis task processing unit, a video analysis subtask generating unit and a video analysis subtask generating unit, wherein the video analysis subtask processing unit is used for aggregating the video analysis tasks according to the same image shooting equipment and the same analysis algorithm to generate a plurality of video analysis subtasks;
the snapshot module is used for executing the plurality of snapshot subtasks by utilizing the execution node of the target cluster to obtain a corresponding snapshot video;
and the video analysis module is used for executing the plurality of video analysis subtasks by utilizing the execution node of the target cluster and analyzing the snapshot video obtained by each snapshot subtask.
The present application further provides a video analysis device, comprising:
a processor; and the combination of (a) and (b),
a computer readable medium having stored thereon instructions that, when executed by the processor, cause the apparatus to perform a video analytics method as described in any one of the above.
The present application further provides a computer readable medium having stored thereon instructions that are loaded by a processor and that perform the video analytics method as described in any of the above.
As described above, the present application provides a video analysis method, system, device, and medium, which have the following beneficial effects: the method comprises the steps of acquiring a distributed timing task queue created in advance or in real time, and triggering a snapshot task and a video analysis task in the distributed timing task queue according to preset time; aggregating the snapshot tasks according to the same image shooting equipment and the same snapshot interval to generate a plurality of snapshot subtasks; aggregating the video analysis tasks according to the same image shooting equipment and the same analysis algorithm to generate a plurality of video analysis subtasks; finally, executing the plurality of snapshot subtasks by utilizing the execution node of the target cluster to obtain a corresponding snapshot video; and executing the plurality of video analysis subtasks by using the execution node of the target cluster, and analyzing the snapshot video obtained by each snapshot subtask. Therefore, the requirements of different users on the image shooting equipment and the analysis algorithm are highly aggregated under the condition that the equipment, the algorithm and the analysis time are the same, so that the image shooting equipment and the algorithm resource can be highly shared, the calculation resources are fully utilized, and the waste of the calculation resources and the repeated calculation are reduced. In addition, this application carries out high aggregation with different users to image equipment, the demand of taking a candid photograph interval under the condition that image equipment, the candid photograph step are unanimous, has realized taking a candid photograph high-efficient utilization of equipment, network bandwidth and storage to the image: moreover, high aggregation execution can be carried out on the snapshot requirements of the user in a background noninductive manner, the camera snapshot times are reduced, and the snapshot success rate is improved. Simultaneously, this application still presets the position through a plurality of image shooting equipment, can switch the visual angle of image shooting equipment, conveniently carries out video snapshot and video analysis. The method and the device are equivalent to that task scheduling is carried out on the cluster, so that high-efficiency utilization of image shooting equipment and algorithm resources is realized, and the algorithm resource waste caused by repeated calculation of similar video analysis tasks is avoided; the camera snapshot times are reduced, and the network bandwidth and storage are saved.
Drawings
FIG. 1 is a schematic diagram of an exemplary system architecture to which aspects of one or more embodiments of the present application may be applied;
fig. 2 is a schematic flowchart of a video analysis method according to an embodiment of the present application;
fig. 3 is a schematic diagram of a task aggregation execution flow provided by an embodiment of the present application;
fig. 4 is a schematic flow chart of ball machine scheduling provided in an embodiment of the present application;
fig. 5 is a schematic hardware structure diagram of a video analysis system according to an embodiment of the present application;
fig. 6 is a schematic hardware configuration diagram of a video analysis device suitable for implementing one or more embodiments in the present application.
Detailed Description
The following description of the embodiments of the present application is provided by way of specific examples, and other advantages and effects of the present application will be readily apparent to those skilled in the art from the disclosure herein. The present application is capable of other and different embodiments and its several details are capable of modifications and/or changes in various respects, all without departing from the spirit of the present application. It is to be noted that the features in the following embodiments and examples may be combined with each other without conflict.
It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present application, and the drawings only show the components related to the present application and are not drawn according to the number, shape and size of the components in actual implementation, and the type, number and proportion of the components in actual implementation may be changed freely, and the layout of the components may be more complicated.
Fig. 1 shows a schematic diagram of an exemplary system architecture to which technical solutions in one or more embodiments of the present application may be applied. As shown in fig. 1, system architecture 100 may include a terminal device 110, a network 120, and a server 130. The terminal device 110 may include various electronic devices such as a smart phone, a tablet computer, a notebook computer, and a desktop computer. The server 130 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing a cloud computing service. Network 120 may be a communication medium of various connection types capable of providing a communication link between terminal device 110 and server 130, such as a wired communication link or a wireless communication link.
The system architecture in the embodiments of the present application may have any number of terminal devices, networks, and servers, according to implementation needs. For example, the server 130 may be a server group composed of a plurality of server devices. In addition, the technical solution provided in the embodiment of the present application may be applied to the terminal device 110, or may be applied to the server 130, or may be implemented by both the terminal device 110 and the server 130, which is not particularly limited in this application.
In an embodiment of the present application, the terminal device 110 or the server 130 of the present application may trigger a snapshot task and a video analysis task in a distributed timing task queue according to a preset time by acquiring the distributed timing task queue created in advance or in real time; aggregating the snapshot tasks according to the same image shooting equipment and the same snapshot interval to generate a plurality of snapshot subtasks; aggregating the video analysis tasks according to the same image shooting equipment and the same analysis algorithm to generate a plurality of video analysis subtasks; finally, executing the plurality of snapshot subtasks by utilizing the execution node of the target cluster to obtain a corresponding snapshot video; and executing the plurality of video analysis subtasks by using the execution node of the target cluster, and analyzing the captured video obtained by each captured subtask. The video analysis method is executed by using the terminal device 110 or the server 130, and the requirements of different users on image shooting devices and analysis algorithms are highly aggregated under the condition of equal device, algorithm and analysis time, so that the image shooting devices and algorithm resources can be highly shared, the computing resources are fully utilized, and the waste of the computing resources and repeated computation are reduced. In addition, the requirements of different users on the image shooting equipment and the snapshot interval are highly aggregated under the condition that the image shooting equipment and the snapshot pace are consistent, so that the efficient utilization of the image shooting equipment, the network bandwidth and the storage is realized: moreover, high aggregation execution can be carried out on the snapshot requirements of the user in a background noninductive manner, the camera snapshot times are reduced, and the snapshot success rate is improved. Meanwhile, the point positions are preset through a plurality of image shooting devices, the visual angles of the image shooting devices can be switched, and video snapshot and video analysis are conveniently executed. The task scheduling is equivalent to the task scheduling on the cluster, so that the high-efficiency utilization of image shooting equipment and algorithm resources is realized, and the algorithm resource waste caused by the repeated calculation of similar video analysis tasks is avoided; the camera snapshot times are reduced, and the network bandwidth and storage are saved.
The above section describes the content of an exemplary system architecture to which the technical solution of the present application is applied, and the following continues to describe the video analysis method of the present application.
Fig. 2 shows a schematic flow chart of a video analysis method according to an embodiment of the present application. Specifically, in an exemplary embodiment, as shown in fig. 2, the present embodiment provides a video analysis method, which includes the steps of:
s210, acquiring a distributed timing task queue which is created in advance or in real time;
s220, triggering the snapshot task and the video analysis task in the distributed timing task queue according to preset time;
s230, aggregating the snapshot tasks according to the same image shooting equipment and the same snapshot interval to generate a plurality of snapshot subtasks; aggregating the video analysis tasks according to the same image shooting equipment and the same analysis algorithm to generate a plurality of video analysis subtasks;
s240, executing the plurality of snapshot subtasks by utilizing the execution node of the target cluster to obtain a corresponding snapshot video; and executing the plurality of video analysis subtasks by using the execution node of the target cluster, and analyzing the snapshot video obtained by each snapshot subtask.
Therefore, the requirements of different users on the image shooting equipment and the analysis algorithm are highly aggregated under the condition that the equipment, the algorithm and the analysis time are the same, so that the high sharing of the image shooting equipment and the algorithm resources can be realized, the calculation resources are fully utilized, and the waste of the calculation resources and the repeated calculation are reduced. In addition, the embodiment highly aggregates the requirements of different users on the image shooting equipment and the snapshot interval under the condition that the image shooting equipment and the snapshot pace are consistent, and realizes the efficient utilization of the image shooting equipment, the network bandwidth and the storage: moreover, high aggregation execution can be carried out on the snapshot requirements of the user in a background noninductive manner, the camera snapshot times are reduced, and the snapshot success rate is improved. In the embodiment, by scheduling the tasks on the clusters, the image shooting equipment and algorithm resources are efficiently utilized, and the algorithm resource waste caused by repeated calculation of similar video analysis tasks is avoided; the camera snapshot times are reduced, and the network bandwidth and storage are saved. As an example, the image capturing apparatus in the present embodiment may be a ball machine. As another example, the image capturing apparatus in the present embodiment may also be a ball machine or a gun with a pan and tilt head.
In an exemplary embodiment, the generating of the distributed timed task queue includes: initializing a global counter, and adding one to the global counter after the global counter reaches a preset time length; initializing an asynchronous thread pool, creating a task queue, monitoring queue data by using an asynchronous thread, and creating a video analysis task and a snapshot task; configuring image shooting equipment, a snapshot interval and preset points of the image shooting equipment associated with the snapshot task; configuring an analysis algorithm, an analysis time and an analysis rule associated with the video analysis task, and generating an image shooting equipment execution plan; and adding the image shooting equipment execution plan, the video analysis task and the snapshot task into the task base conflict to generate the distributed timing task queue. As an example, in particular, a global counter (counter) is initialized, which is incremented by one (counter + +) every minute, the global counter remaining always incremented; initializing an asynchronous thread pool, creating a required task queue, and monitoring queue data by an asynchronous thread; creating an analysis task, configuring necessary parameters of a snapshot device, an analysis algorithm, analysis time, a snapshot interval, a dome camera preset point, an analysis rule and the like of the task, generating a dome camera execution plan, and storing data into a DataBase DB (DataBase, DB for short); wherein the granularity of the snapshot interval is minutes.
In an exemplary embodiment, the process of aggregating the capturing tasks according to the same image capturing device and the same capturing interval to generate a plurality of capturing subtasks includes: performing integer division operation on the snapshot interval by using a global counter; if the snapshot interval can be divided by the global counter, marking the snapshot task as execution; if the snapshot interval cannot be divided by the global counter, marking the snapshot task as not executed; traversing all the snapshot tasks marked as execution, and aggregating the snapshot tasks into different groups according to the serial numbers of the image shooting devices; and generating a capturing subtask for each group to obtain the plurality of capturing subtasks. Specifically, the snapshot task processes: traversing the snapshot task queue by the asynchronous thread, and dividing a task snapshot interval (duration) by using a global counter: counter% duration = =0, if the condition is true, the task is marked as executing; otherwise, the task is marked as not executed. And after traversing is finished, extracting all tasks marked as execution, aggregating the tasks into different groups according to equipment codes, generating a new subtask for each group, and adding the subtask into a snapshot execution queue. The new subtask includes device information, algorithm information, and an aggregation task list: for the same device, the multiple task capturing paces are executed in an aggregating mode under the condition that the task capturing paces are consistent, and the capturing paces are consistent when the task capturing intervals are the same or when the least common multiple of the capturing intervals is reached. As an example, the task A, B, C snapshot intervals are respectively 5, 5 and 7 (minutes), when the counter =5, A, B is executed, and the aggregation A, B only needs to perform one snapshot; when counter =7, executing C, and carrying out one snapshot; when counter =35 (A, B, C least common multiple of snapshot interval), A, B, C is executed, and the aggregation A, B, C performs one snapshot, namely all users can be satisfied.
In an exemplary embodiment, the plurality of snapshot subtasks are executed by using the execution node of the target cluster to obtain a corresponding snapshot video; and executing the plurality of video analysis subtasks by using the execution node of the target cluster, wherein the process of analyzing the snapshot video obtained by each snapshot subtask comprises the following steps: calling an execution node of the target cluster to perform video snapshot according to the image shooting equipment associated with each snapshot subtask, and storing the snapshot video; and calling an execution node of the target cluster to analyze the stored snapshot videos one by one according to the analysis algorithm associated with each video analysis subtask to obtain a corresponding video analysis result. In addition, after the plurality of video analysis subtasks are executed by using the execution node of the target cluster and the captured video obtained by each captured subtask is analyzed, the embodiment may further include: pushing a video analysis result to a specified message queue, and receiving a processing logic instruction generated by a subscriber based on the specified message queue; and responding to the processing logic instruction, and feeding back the video analysis result to a target user or an alarm center. As an example, according to the device ID carried by the snapshot task, a camera snapshot interface of the cluster is called to snapshot a picture, and after the snapshot is completed, the snapshot picture is written into the cloud storage for standby; taking the snap pictures, and carrying out algorithm analysis on the algorithm capacities in the list by using the snap pictures one by one according to an algorithm list carried by the video analysis subtask; and pushing the analysis result to a message queue after the completion, processing subsequent logic by a message subscriber, and feeding the algorithm analysis result back to a specific user or an alarm center.
In an exemplary embodiment, the process of generating the image capturing apparatus execution plan includes: acquiring a video analysis demand, and applying for a plurality of preset point locations of image shooting equipment according to the video analysis demand; the plurality of preset point positions of the image shooting equipment are used for switching the image shooting equipment of a plurality of target objects in the same time interval; associating the scheduling time of the image shooting equipment with the execution time of the video analysis task; and generating an execution plan of the image shooting equipment according to the preset point positions of the plurality of image shooting equipment and the execution time of the video analysis task. After generating the image capturing device execution plan, the embodiment may further include: the asynchronous thread monitors a scheduling queue of the image shooting equipment, extracts an execution plan of the image shooting equipment, and finds the corresponding image shooting equipment and preset points of the image shooting equipment; sending an execution instruction to the image shooting equipment so that the image shooting equipment rotates to a preset point position of the image shooting equipment; and controlling the image shooting equipment to stay for a preset time length, and controlling the image shooting equipment to keep a locking state in the preset time length. If the image capturing device in this embodiment is a dome camera, the process of executing the plan by the dome camera includes: the ball machine is more flexible relative to the gunlock, the visual angle is larger, and a plurality of preset point positions (visual angles) can be configured. The users can apply for a plurality of preset points to carry out monitoring analysis when establishing tasks according to respective requirements, and due to the fact that the preset points are switched back and forth, in order to guarantee the stopping accuracy of the preset points of the dome camera, the users need to keep mutual exclusion when applying for the dome camera analysis in the same time interval, and conflict is avoided. The scheduling time of the dome camera is consistent with the task analysis time, and a dome camera scheduling execution plan can be generated according to the task analysis time and the preset point information when a task is created, and the residence time of each preset point is distributed. The asynchronous thread monitors a ball machine scheduling queue, extracts a ball machine execution plan, finds information corresponding to the ball machine and a preset point, sends an instruction to the ball machine, enables the ball machine to rotate to the preset point (visual angle) expressed by the execution plan, stays for the duration expressed by the execution plan, keeps the ball machine in a locked state within the stay duration range, avoids errors, and periodically monitors the state. As an example, for example, task a application analysis 10:00-11: the method comprises the following steps that (1) the ball machine D in a time period of 00 hours is configured, two view angles of a preset point 1,2 are configured, and when a task is submitted, a ball machine execution plan 10 can be generated: 00-10:30, switching the execution equipment D to a preset point 1, and staying for 30 minutes; 10:30-11:00 execution device D switches to preset point 2 and stays for 30 minutes.
In another exemplary embodiment of the present application, as shown in fig. 3 and 4, the embodiment further provides a video analysis method, including the steps of:
step 1: starting a service, initializing a global counter (counter), adding one to the counter every minute (counter + +), and keeping the global counter to be always accumulated; initializing an asynchronous thread pool, creating a required task queue, and monitoring queue data by an asynchronous thread; creating an analysis task, configuring necessary parameters of a snapshot device, an analysis algorithm, analysis time, a snapshot interval (granularity is minutes), a preset point location of the dome camera, an analysis rule and the like of the task, generating a dome camera execution plan, and storing data into a DB.
Step 2: the cluster starts a distributed timing task, the service node periodically polls the DB, retrieves the task to be executed at the current moment in the DB, and enqueues the task after distinguishing according to the algorithm types: the video snapshot task is added into a snapshot task queue, and the real-time video stream analysis task is added into a video analysis task queue; and loading the execution plan of the ball machine, and adding the execution plan into a ball machine scheduling queue.
And step 3: video snapshot task processing: traversing the snapshot task queue by the asynchronous thread, and dividing a task snapshot interval (duration) by using a global counter: counter% duration = =0, if the condition is true, the task is marked as executing; otherwise, the task is marked as not executing. And after traversing is finished, extracting all tasks marked as execution, aggregating the tasks into different groups according to equipment codes, generating a new subtask for each group, and adding the subtask into a snapshot execution queue. The new subtask includes device information, algorithm information, and an aggregation task list: for the same device, the multiple task capturing paces are executed in an aggregating mode under the condition that the task capturing paces are consistent, and the capturing paces are consistent when the task capturing intervals are the same or when the least common multiple of the capturing intervals is reached. For example: the task A, B, C is in snapshot intervals of 5, 5 and 7 (minutes), A, B is executed when counter =5, and the aggregation A, B is subjected to one snapshot; when counter =7, executing C, and carrying out one snapshot; when counter =35 (A, B, C is the least common multiple of the snapshot interval), A, B, C is executed, and the aggregation A, B, C performs one snapshot, namely all users can be met.
And 4, step 4: and each executing node of the cluster acquires the aggregated subtasks from the snapshot executing task queue to execute: calling a camera snapshot interface of the cluster to snapshot pictures according to the equipment ID carried by the task, and writing the snapshot pictures into cloud storage for later use after the snapshot is finished; taking the snapshot pictures, and carrying out algorithm analysis on the algorithm capabilities in the list by using the snapshot pictures one by one according to an algorithm list carried by the task; and after the analysis is finished, pushing the analysis result to a message queue, processing subsequent logic by a message subscriber, and feeding back the algorithm analysis result to a specific user or an alarm center.
And 5: video analysis task processing: traversing the video analysis queue, aggregating the tasks into different groups according to the dimension of the equipment and the analysis algorithm, generating a new subtask for each group and adding the new subtask into the video analysis execution queue, wherein the subtask comprises information: device ID, algorithm information, aggregation task list: the method comprises the steps of aggregating tasks with the same equipment and the same algorithm, wherein the tasks come from different users, and gathering and executing the common points of the requirements of a plurality of users, so that repeated calculation is avoided, and the calculation resources are utilized to the maximum extent.
Step 6: the cluster execution node acquires the aggregated subtasks from the video analysis task execution queue for execution, calls a bottom algorithm interface according to the equipment ID and the algorithm information to issue the tasks to a bottom algorithm cluster, monitors the algorithm analysis result, pushes the algorithm analysis result to a specified message queue, completes subsequent processing logic by a subscriber, and feeds the algorithm analysis result back to a specific user or an alarm center.
And 7: the ball machine executes planning treatment: the ball machine is more flexible relative to the gunlock, the visual angle is larger, and a plurality of preset point positions (visual angles) can be configured. The users can apply for a plurality of preset points to carry out monitoring analysis when establishing tasks according to respective requirements, and due to the fact that the preset points are switched back and forth, in order to guarantee the stopping accuracy of the preset points of the dome camera, the users need to keep mutual exclusion when applying for the dome camera analysis in the same time interval, and conflict is avoided. The scheduling time of the dome camera is consistent with the task analysis time, and a dome camera scheduling execution plan can be generated according to the task analysis time and the preset point information when a task is created, and the residence time of each preset point is distributed. The asynchronous thread monitors a ball machine scheduling queue, extracts a ball machine execution plan, finds information corresponding to the ball machine and a preset point, sends an instruction to the ball machine, enables the ball machine to rotate to the preset point (visual angle) expressed by the execution plan, stays for the duration expressed by the execution plan, keeps the ball machine in a locked state within the stay duration range, avoids errors, and periodically monitors the state. For example: task a application analysis 10:00-11: the method comprises the following steps that (1) the ball machine D in a time period of 00 hours is configured, two view angles of a preset point 1,2 are configured, and when a task is submitted, a ball machine execution plan 10 can be generated: 00-10:30, switching the execution equipment D to a preset point 1, and staying for 30 minutes; 10:30-11:00 execution device D switches to preset point 2 and stays for 30 minutes.
Therefore, the embodiment relates to an analysis execution method for routing inspection videos, which is used for realizing scheduling of a plurality of tasks on a cluster and achieving the purpose of sharing equipment and analysis algorithms by multiple users. The task or existence analysis device and the intersection on the analysis algorithm, and the method comprises the following steps: aggregating a plurality of real-time video stream tasks to different groups according to the dimension of a device plus algorithm, generating a new subtask for each group, and performing parallel subtask scheduling in a cluster by taking the subtask as a minimum scheduling unit; the method comprises the following steps: aggregating a plurality of video snapshot tasks into different groups according to the dimension of equipment and snapshot paces, generating a new subtask by a task with consistent snapshot paces in each group, and performing parallel subtask scheduling in a cluster by taking the subtask as a minimum scheduling unit; the method comprises the following steps: a plurality of ball machines are automatically switched according to different preset points (visual angles), stay for a certain time and perform video capture and algorithm analysis on the preset points. In the embodiment, by scheduling the tasks on the cluster, the high-efficiency utilization of equipment and algorithm resources is realized, and the algorithm resource waste caused by repeated calculation of similar video analysis tasks is avoided; the camera snapshot times are reduced, and the network bandwidth and storage are saved.
The application provides a video analysis method, which comprises the steps of acquiring a distributed timing task queue which is created in advance or in real time, and triggering a snapshot task and a video analysis task in the distributed timing task queue according to preset time; aggregating the snapshot tasks according to the same image shooting equipment and the same snapshot interval to generate a plurality of snapshot subtasks; aggregating the video analysis tasks according to the same image shooting equipment and the same analysis algorithm to generate a plurality of video analysis subtasks; finally, executing the plurality of snapshot subtasks by utilizing the execution node of the target cluster to obtain a corresponding snapshot video; and executing the plurality of video analysis subtasks by using the execution node of the target cluster, and analyzing the snapshot video obtained by each snapshot subtask. Therefore, the method can realize high sharing of image shooting equipment and algorithm resources by carrying out high aggregation on the requirements of different users on the image shooting equipment and the analysis algorithm under the condition of equal equipment, algorithm and analysis time, fully utilizes the computing resources, and reduces the waste of the computing resources and repeated computation. In addition, the method highly aggregates the requirements of different users on the image shooting equipment and the snapshot interval under the condition that the image shooting equipment and the snapshot pace are consistent, and realizes the efficient utilization of the image shooting equipment, the network bandwidth and the storage: moreover, high aggregation execution can be carried out on the snapshot requirements of the user in a background noninductive manner, the camera snapshot times are reduced, and the snapshot success rate is improved. Meanwhile, the method can switch the visual angle of the image shooting equipment through the preset point positions of the plurality of image shooting equipment, and is convenient for executing video snapshot and video analysis. The method is equivalent to the method, by scheduling the tasks on the cluster, the high-efficiency utilization of image shooting equipment and algorithm resources is realized, and the algorithm resource waste caused by repeated calculation of similar video analysis tasks is avoided; the camera snapshot times are reduced, and the network bandwidth and storage are saved.
As shown in fig. 5, the present application further provides a video analysis system, which includes:
a task queue module 510, configured to obtain a pre-established or real-time established distributed timing task queue;
the task triggering module 520 is configured to trigger the snapshot task and the video analysis task in the distributed timing task queue according to preset time;
the task sub-module 530 is configured to aggregate the snapshot tasks according to the same image capturing device and the same snapshot interval, and generate a plurality of snapshot sub-tasks; the video analysis system comprises a video analysis task processing unit, a video analysis subtask generating unit and a video analysis processing unit, wherein the video analysis subtask processing unit is used for aggregating the video analysis tasks according to the same image shooting equipment and the same analysis algorithm to generate a plurality of video analysis subtasks;
the snapshot module 540 is configured to execute the plurality of snapshot subtasks by using the execution node of the target cluster to obtain a corresponding snapshot video;
and a video analysis module 550, configured to execute the multiple video analysis subtasks by using an execution node of the target cluster, and analyze a captured video obtained by each capture subtask.
Therefore, the requirements of different users on the image shooting equipment and the analysis algorithm are highly aggregated under the condition that the equipment, the algorithm and the analysis time are the same, so that the high sharing of the image shooting equipment and the algorithm resources can be realized, the calculation resources are fully utilized, and the waste of the calculation resources and the repeated calculation are reduced. In addition, in this embodiment, the requirements of different users on the image capturing device and the capturing interval are highly aggregated under the condition that the image capturing device and the capturing pace are consistent, so that the efficient utilization of the image capturing device, the network bandwidth and the storage is realized: moreover, high aggregation execution can be carried out on the snapshot requirements of the user in a background noninductive manner, the camera snapshot times are reduced, and the snapshot success rate is improved. In the embodiment, by performing task scheduling on the cluster, efficient utilization of image shooting equipment and algorithm resources is realized, and algorithm resource waste caused by repeated calculation of similar video analysis tasks is avoided; the camera snapshot times are reduced, and the network bandwidth and storage are saved. As an example, the image capturing apparatus in the present embodiment may be a ball machine. As another example, the image capturing apparatus in the present embodiment may also be a ball machine or a gun with a pan and tilt head.
In an exemplary embodiment, the generating of the distributed timed task queue includes: initializing a global counter, and adding one to the global counter after the global counter reaches a preset time length; initializing an asynchronous thread pool, creating a task queue, monitoring queue data by using an asynchronous thread, and creating a video analysis task and a snapshot task; configuring image shooting equipment, a snapshot interval and preset points of the image shooting equipment associated with the snapshot task; configuring an analysis algorithm, an analysis time and an analysis rule associated with the video analysis task, and generating an image shooting equipment execution plan; and adding the image shooting equipment execution plan, the video analysis task and the snapshot task into the task base conflict to generate the distributed timing task queue. As an example, in particular, a global counter (counter) is initialized, which is incremented by one (counter + +) every minute, the global counter remaining always incremented; initializing an asynchronous thread pool, creating a required task queue, and monitoring queue data by an asynchronous thread; creating an analysis task, configuring necessary parameters of a snapshot device, an analysis algorithm, analysis time, a snapshot interval, a dome camera preset point, an analysis rule and the like of the task, generating a dome camera execution plan, and storing data into a DataBase DB (DataBase, DB for short); wherein the granularity of the snapshot interval is minutes.
In an exemplary embodiment, the process of aggregating the capturing tasks according to the same image capturing device and the same capturing interval to generate a plurality of capturing subtasks includes: performing integer division operation on the snapshot interval by using a global counter; if the snapshot interval can be divided by the global counter, marking the snapshot task as execution; if the snapshot interval cannot be divided by the global counter, marking the snapshot task as not executed; traversing all the snapshot tasks marked as execution, and aggregating the snapshot tasks into different groups according to the serial numbers of the image shooting devices; and generating a capturing subtask for each group to obtain the plurality of capturing subtasks. Specifically, the snapshot task processes: traversing the snapshot task queue by the asynchronous thread, and dividing the task snapshot interval (duration) by using a global counter: counter% duration = =0, if the condition is true, the task is marked as executing; otherwise, the task is marked as not executed. And after traversing, extracting all tasks marked as execution, aggregating the tasks into different groups according to equipment codes, generating a new subtask for each group, and adding the new subtask into a snapshot execution queue. The new subtask includes device information, algorithm information, and an aggregation task list: for the same device, the multiple task capturing paces are executed in an aggregating mode under the condition that the task capturing paces are consistent, and the capturing paces are consistent when the task capturing intervals are the same or when the least common multiple of the capturing intervals is reached. As an example, the task A, B, C snapshot intervals are respectively 5, 5 and 7 (minutes), when the counter =5, A, B is executed, and the aggregation A, B only needs to perform one snapshot; c is executed when the counter =7, and one snapshot is carried out; when counter =35 (A, B, C is the least common multiple of the snapshot interval), A, B, C is executed, and the aggregation A, B, C performs one snapshot, namely all users can be met.
In an exemplary embodiment, the plurality of snapshot subtasks are executed by using the execution node of the target cluster to obtain a corresponding snapshot video; and executing the plurality of video analysis subtasks by using the execution node of the target cluster, wherein the process of analyzing the snap-shot video obtained by each snap-shot subtask comprises the following steps: calling an execution node of the target cluster to perform video snapshot according to the image shooting equipment associated with each snapshot subtask, and storing the snapshot video; and calling an execution node of the target cluster to analyze the stored snapshot videos one by one according to the analysis algorithm associated with each video analysis subtask to obtain a corresponding video analysis result. In addition, after the plurality of video analysis subtasks are executed by using the execution node of the target cluster and the captured video obtained by each captured subtask is analyzed, this embodiment may further include: pushing a video analysis result to a specified message queue, and receiving a processing logic instruction generated by a subscriber based on the specified message queue; and responding to the processing logic instruction, and feeding back the video analysis result to a target user or an alarm center. As an example, according to the device ID carried by the snapshot task, a camera snapshot interface of the cluster is called to snapshot a picture, and after the snapshot is completed, the snapshot picture is written into the cloud storage for standby; taking the snapshot pictures, and performing algorithm analysis on the algorithm capabilities in the list by using the snapshot pictures one by one according to an algorithm list carried by the video analysis subtask; and after the analysis is finished, pushing the analysis result to a message queue, processing subsequent logic by a message subscriber, and feeding back the algorithm analysis result to a specific user or an alarm center.
In an exemplary embodiment, the process of generating the image capturing apparatus execution plan includes: acquiring a video analysis demand, and applying for a plurality of preset point locations of image shooting equipment according to the video analysis demand; the plurality of preset point positions of the image shooting equipment are used for switching the image shooting equipment of a plurality of target objects in the same time interval; associating the scheduling time of the image shooting equipment with the execution time of the video analysis task; and generating an execution plan of the image shooting equipment according to the preset point positions of the plurality of image shooting equipment and the execution time of the video analysis task. After generating the image capturing device execution plan, the embodiment may further include: the asynchronous thread monitors a scheduling queue of the image shooting equipment, extracts an execution plan of the image shooting equipment, and finds the corresponding image shooting equipment and preset points of the image shooting equipment; sending an execution instruction to the image shooting equipment so as to enable the image shooting equipment to rotate to a preset point position of the image shooting equipment; and controlling the image shooting equipment to stay for a preset time length, and controlling the image shooting equipment to keep a locking state in the preset time length. If the image capturing device in this embodiment is a dome camera, the process of executing the plan by the dome camera includes: the ball machine is more flexible relative to the gunlock, the visual angle is larger, and a plurality of preset point positions (visual angles) can be configured. The users can apply for a plurality of preset points for monitoring and analysis when establishing tasks according to respective requirements, and due to the fact that the preset points are switched back and forth, in order to guarantee the stopping accuracy of the preset points of the ball machine, the users need to keep mutual exclusion when applying for ball machine analysis in the same time interval, and conflict is avoided. The scheduling time of the dome camera is consistent with the task analysis time, and a dome camera scheduling execution plan can be generated according to the task analysis time and the preset point information when a task is created, and the residence time of each preset point is distributed. The asynchronous thread monitors a ball machine scheduling queue, extracts a ball machine execution plan, finds information corresponding to the ball machine and a preset point, sends an instruction to the ball machine, enables the ball machine to rotate to the preset point (visual angle) expressed by the execution plan, stays for the duration expressed by the execution plan, keeps the ball machine in a locked state within the stay duration range, avoids errors, and periodically monitors the state. As an example, for example, task a application analysis 10:00-11: the method comprises the following steps that (1) a ball machine D in a time period of 00 hours is configured with two view angles of a preset point 1,2, and when a task is submitted, a ball machine execution plan 10 can be generated: 00-10:30, switching the execution equipment D to a preset point 1, and staying for 30 minutes; 10:30-11:00 execution device D switches to preset point 2 and stays for 30 minutes.
In another exemplary embodiment of the present application, the embodiment further provides a video analysis system for performing the following steps:
step 1: starting a service, initializing a global counter (counter), adding one to the counter every minute (counter + +), and keeping the global counter to be always accumulated; initializing an asynchronous thread pool, creating a required task queue, and monitoring queue data by an asynchronous thread; and establishing an analysis task, configuring necessary parameters of a snapshot device, an analysis algorithm, analysis time, a snapshot interval (granularity is minutes), a preset point location of the dome camera, an analysis rule and the like of the task, generating a dome camera execution plan, and storing data into the DB.
And 2, step: the cluster starts a distributed timing task, the service node periodically polls the DB, retrieves the task to be executed at the current moment in the DB, and enqueues the task after distinguishing according to the algorithm types: a video snapshot task is added into a snapshot task queue, and a real-time video stream analysis task is added into a video analysis task queue; and loading the execution plan of the ball machine, and adding the execution plan into a ball machine scheduling queue.
And step 3: video snapshot task processing: traversing the snapshot task queue by the asynchronous thread, and dividing the task snapshot interval (duration) by using a global counter: counter% duration = =0, if the condition is true, the task is marked as executing; otherwise, the task is marked as not executing. And after traversing is finished, extracting all tasks marked as execution, aggregating the tasks into different groups according to equipment codes, generating a new subtask for each group, and adding the subtask into a snapshot execution queue. The new subtask includes device information, algorithm information, and an aggregation task list: for the same equipment, the multiple task capturing paces are executed in an aggregation manner under the condition that the task capturing paces are consistent, and the capturing paces reach consistency at the same task capturing interval or at the moment of the least common multiple of the capturing interval. For example: the task A, B, C snapshot intervals are respectively 5, 5 and 7 (minutes), when the counter =5, A, B is executed, and the aggregation A, B is subjected to one snapshot; when counter =7, executing C, and carrying out one snapshot; when counter =35 (A, B, C least common multiple of snapshot interval), A, B, C is executed, and the aggregation A, B, C performs one snapshot, namely all users can be satisfied.
And 4, step 4: and each executing node of the cluster acquires the aggregated subtasks from the snapshot executing task queue to execute: calling a camera snapshot interface of the cluster to snapshot pictures according to the equipment ID carried by the task, and writing the snapshot pictures into cloud storage for later use after the snapshot is finished; taking the snap pictures, and carrying out algorithm analysis on the algorithm capacities in the list by using the snap pictures one by one according to an algorithm list carried by the task; and after the analysis is finished, pushing the analysis result to a message queue, processing subsequent logic by a message subscriber, and feeding back the algorithm analysis result to a specific user or an alarm center.
And 5: video analysis task processing: traversing the video analysis queue, aggregating the tasks into different groups according to the dimension of the equipment and the analysis algorithm, generating a new subtask for each group and adding the new subtask into the video analysis execution queue, wherein the subtask comprises information: device ID, algorithm information, aggregation task list: the method comprises the steps of aggregating tasks with the same equipment and the same algorithm, wherein the tasks come from different users, and gathering and executing the common points of the requirements of a plurality of users, so that repeated calculation is avoided, and the calculation resources are utilized to the maximum extent.
Step 6: the cluster execution node acquires the aggregated subtasks from the video analysis task execution queue for execution, calls a bottom algorithm interface according to the equipment ID and the algorithm information to issue the tasks to a bottom algorithm cluster, monitors the algorithm analysis result, pushes the algorithm analysis result to a specified message queue, completes subsequent processing logic by a subscriber, and feeds the algorithm analysis result back to a specific user or an alarm center.
And 7: the ball machine executes planning treatment: the ball machine is more flexible relative to the gunlock, the visual angle is larger, and a plurality of preset point positions (visual angles) can be configured. The users can apply for a plurality of preset points for monitoring and analysis when establishing tasks according to respective requirements, and due to the fact that the preset points are switched back and forth, in order to guarantee the stopping accuracy of the preset points of the ball machine, the users need to keep mutual exclusion when applying for ball machine analysis in the same time interval, and conflict is avoided. The scheduling time of the dome camera is consistent with the task analysis time, and a scheduling execution plan of the dome camera can be generated according to the task analysis time and the preset point information when a task is created, and the stay time of each preset point is distributed. The asynchronous thread monitors a ball machine scheduling queue, extracts a ball machine execution plan, finds information corresponding to the ball machine and a preset point, sends an instruction to the ball machine, enables the ball machine to rotate to the preset point (visual angle) expressed by the execution plan, stays for the duration expressed by the execution plan, keeps the ball machine in a locked state within the stay duration range, avoids errors, and periodically monitors the state. For example: task a application analysis 10:00-11: the method comprises the following steps that (1) a ball machine D in a time period of 00 hours is configured with two view angles of a preset point 1,2, and when a task is submitted, a ball machine execution plan 10 can be generated: 00-10:30, switching the execution equipment D to a preset point 1, and staying for 30 minutes; 10:30-11:00 execution device D switches to preset point 2 and stays for 30 minutes.
Therefore, the embodiment relates to an analysis execution method for routing inspection videos, which is used for realizing scheduling of a plurality of tasks on a cluster and achieving the purpose of sharing equipment and analysis algorithms by multiple users. The task or existence analysis device and the intersection on the analysis algorithm comprise the following steps: aggregating a plurality of real-time video stream tasks to different groups according to the dimension of a device plus algorithm, generating a new subtask for each group, and performing parallel subtask scheduling in a cluster by taking the subtask as a minimum scheduling unit; the method comprises the following steps: aggregating a plurality of video snapshot tasks into different groups according to the dimension of equipment and snapshot paces, generating a new subtask by a task with consistent snapshot paces in each group, and performing parallel subtask scheduling in a cluster by taking the subtask as a minimum scheduling unit; the method comprises the following steps: a plurality of ball machines are automatically switched according to different preset points (visual angles), stay for a certain time and perform video capture and algorithm analysis on the preset points. In the embodiment, by scheduling the tasks on the cluster, the high-efficiency utilization of equipment and algorithm resources is realized, and the algorithm resource waste caused by repeated calculation of similar video analysis tasks is avoided; the camera snapshot times are reduced, and the network bandwidth and storage are saved.
The application provides a video analysis system, which comprises the steps of acquiring a distributed timing task queue which is created in advance or in real time, and triggering a snapshot task and a video analysis task in the distributed timing task queue according to preset time; aggregating the snapshot tasks according to the same image shooting equipment and the same snapshot interval to generate a plurality of snapshot subtasks; aggregating the video analysis tasks according to the same image shooting equipment and the same analysis algorithm to generate a plurality of video analysis subtasks; finally, executing the plurality of snapshot subtasks by utilizing the execution node of the target cluster to obtain a corresponding snapshot video; and executing the plurality of video analysis subtasks by using the execution node of the target cluster, and analyzing the snapshot video obtained by each snapshot subtask. Therefore, the system highly aggregates the requirements of different users on the image shooting equipment and the analysis algorithm under the condition that the equipment, the algorithm and the analysis time are the same, so that the high sharing of the image shooting equipment and the algorithm resources can be realized, the calculation resources are fully utilized, and the waste of the calculation resources and the repeated calculation are reduced. In addition, the system highly aggregates the requirements of different users on the image shooting equipment and the snapshot interval under the condition that the image shooting equipment and the snapshot are consistent, and realizes the efficient utilization of the image shooting equipment, the network bandwidth and the storage: moreover, high aggregation execution can be carried out on the snapshot requirements of the user in a background noninductive manner, the camera snapshot times are reduced, and the snapshot success rate is improved. Meanwhile, the system can switch the visual angle of the image shooting equipment through the preset point positions of the plurality of image shooting equipment, and is convenient for executing video snapshot and video analysis. The system realizes the high-efficiency utilization of image shooting equipment and algorithm resources by performing task scheduling on the cluster, and avoids the algorithm resource waste caused by repeated calculation of similar video analysis tasks; the camera snapshot times are reduced, and the network bandwidth and storage are saved.
It should be noted that the video analysis system provided in the foregoing embodiment and the video analysis method provided in the foregoing embodiment belong to the same concept, and specific ways for each module and unit to perform operations have been described in detail in the method embodiment, and are not described herein again. In practical applications, the video analysis system provided in the above embodiment may distribute the above functions by different functional modules according to needs, that is, the internal structure of the system is divided into different functional modules to complete all or part of the above described functions, which is not limited herein.
An embodiment of the present application further provides a video analysis device, where the device may include: one or more processors; and one or more machine readable media having instructions stored thereon that, when executed by the one or more processors, cause the apparatus to perform the video analytics method of fig. 2. Fig. 6 shows a schematic configuration of a video analysis apparatus 1000. Referring to fig. 6, the video analysis apparatus 1000 includes: a processor 1010, a memory 1020, a power source 1030, a display unit 1040, an input unit 1060.
The processor 1010 is a control center of the video analysis apparatus 1000, connects various components using various interfaces and lines, and performs various functions of the video analysis apparatus 1000 by running or executing software programs and/or data stored in the memory 1020, thereby performing overall monitoring of the video analysis apparatus 1000. In the embodiment of the present application, the processor 1010 executes the video analysis method as described in fig. 2 when calling the computer program stored in the memory 1020. Alternatively, processor 1010 may include one or more processing units; preferably, the processor 1010 may integrate an application processor, which primarily handles operating systems, user interfaces, applications, etc., and a modem processor, which primarily handles wireless communications. In some embodiments, the processor, memory, and memory may be implemented on a single chip, or in some embodiments, they may be implemented separately on separate chips.
The memory 1020 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, various applications, and the like; the storage data area may store data created according to the use of the video analysis apparatus 1000, and the like. Further, the memory 1020 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The video analysis device 1000 further includes a power supply 1030 (e.g., a battery) for supplying power to the various components, which may be logically coupled to the processor 1010 via a power management system, thereby providing management of charging, discharging, and power consumption via the power management system.
The display unit 1040 may be used to display information input by a user or information provided to the user, and various menus of the video analysis apparatus 1000, and is mainly used to display a display interface of each application in the video analysis apparatus 1000 and objects such as texts and pictures displayed in the display interface in the embodiment of the present application. The display unit 1040 may include a display panel 1050. The display panel 1050 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-emitting diode (OLED), or the like.
The input unit 1060 may be used to receive information such as numbers or characters input by a user. The input unit 1060 may include a touch panel 1070 and other input devices 1080. The touch panel 1070, also referred to as a touch screen, may collect touch operations by a user (e.g., operations by a user on the touch panel 1070 or near the touch panel 1070 using a finger, a stylus, or any other suitable object or attachment).
Specifically, the touch panel 1070 can detect a touch operation of a user, detect signals generated by the touch operation, convert the signals into touch point coordinates, transmit the touch point coordinates to the processor 1010, and receive and execute a command transmitted from the processor 1010. In addition, the touch panel 1070 may be implemented using various types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. Other input devices 1080 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, power on/off keys, etc.), a trackball, a mouse, a joystick, and the like.
Of course, the touch panel 1070 may cover the display panel 1050, and when the touch panel 1070 detects a touch operation thereon or nearby, the touch operation is transmitted to the processor 1010 to determine the type of the touch event, and then the processor 1010 provides a corresponding visual output on the display panel 1050 according to the type of the touch event. Although in fig. 6, the touch panel 1070 and the display panel 1050 are implemented as two separate components to implement the input and output functions of the video analysis apparatus 1000, in some embodiments, the touch panel 1070 and the display panel 1050 may be integrated to implement the input and output functions of the video analysis apparatus 1000.
The video analytics device 1000 may also include one or more sensors, such as pressure sensors, gravitational acceleration sensors, proximity light sensors, and the like. Of course, the video analysis apparatus 1000 may also include other components such as a camera, etc., as desired for a particular application.
Embodiments of the present application further provide a computer-readable storage medium, where instructions are stored in the storage medium, and when executed by one or more processors, enable the apparatus to perform the video analysis method described in fig. 2 in the present application.
It will be appreciated by those skilled in the art that fig. 6 is merely an example of a video analysis apparatus and is not intended to limit the apparatus, which may include more or fewer components than illustrated, or some of the components may be combined, or different components. For convenience of description, the above parts are separately described as modules (or units) according to functional division. Of course, the functionality of the various modules (or units) may be implemented in the same one or more pieces of software or hardware when implementing the present application.
Those skilled in the art will appreciate that the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein. The present application has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application, and it is understood that each flowchart illustration and/or block diagram block and combination of flowchart illustrations and/or block diagrams block and computer program instructions may be implemented by computer program instructions. These computer program instructions may be applied to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks. These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It should be understood that although the terms first, second, third, etc. may be used to describe preset ranges, etc. in the embodiments of the present application, these preset ranges should not be limited to these terms. These terms are only used to distinguish preset ranges from one another. For example, a first preset range may also be referred to as a second preset range, and similarly, a second preset range may also be referred to as a first preset range, without departing from the scope of embodiments of the present application.
The above embodiments are merely illustrative of the principles and utilities of the present application and are not intended to limit the application. Any person skilled in the art can modify or change the above-described embodiments without departing from the spirit and scope of the present application. Accordingly, it is intended that all equivalent modifications or changes which can be made by those skilled in the art without departing from the spirit and technical concepts disclosed in the present application shall be covered by the claims of the present application.

Claims (10)

1. A method of video analysis, the method comprising the steps of:
acquiring a distributed timing task queue which is created in advance or in real time;
triggering a snapshot task and a video analysis task in the distributed timing task queue according to preset time;
aggregating the capturing tasks according to the same image capturing device and the same capturing interval to generate a plurality of capturing subtasks; aggregating the video analysis tasks according to the same image shooting equipment and the same analysis algorithm to generate a plurality of video analysis subtasks;
executing the plurality of snapshot subtasks by using the execution node of the target cluster to obtain a corresponding snapshot video; and executing the plurality of video analysis subtasks by using the execution node of the target cluster, and analyzing the snapshot video obtained by each snapshot subtask.
2. The video analysis method according to claim 1, wherein the generating process of the distributed timed task queue comprises:
initializing a global counter, and adding one to the global counter after the global counter reaches a preset time length;
initializing an asynchronous thread pool, creating a task queue, monitoring queue data by using an asynchronous thread, and creating a video analysis task and a snapshot task; and the number of the first and second groups,
configuring image shooting equipment, a snapshot interval and preset points of the image shooting equipment associated with the snapshot task; configuring an analysis algorithm, an analysis time and an analysis rule associated with the video analysis task, and generating an image shooting equipment execution plan;
and adding the image shooting equipment execution plan, the video analysis task and the snapshot task into the task base conflict to generate the distributed timing task queue.
3. The video analysis method according to claim 2, wherein the process of aggregating the capturing tasks according to the same image capturing device and the same capturing interval to generate a plurality of capturing subtasks comprises:
performing integer division operation on the snapshot interval by using a global counter;
if the snapshot interval can be divided by the global counter, marking the snapshot task as execution; if the snapshot interval cannot be divided by the global counter, marking the snapshot task as not executed;
traversing all snapshot tasks marked as execution, and aggregating the snapshot tasks into different groups according to the serial numbers of the image shooting devices;
and generating a capturing subtask for each group to obtain the plurality of capturing subtasks.
4. The video analysis method according to claim 3, wherein the plurality of snapshot subtasks are executed by using an execution node of the target cluster to obtain a corresponding snapshot video; and executing the plurality of video analysis subtasks by using the execution node of the target cluster, wherein the process of analyzing the snapshot video obtained by each snapshot subtask comprises the following steps:
calling an execution node of the target cluster to perform video snapshot according to the image shooting equipment associated with each snapshot subtask, and storing the snapshot video;
and calling an execution node of the target cluster to analyze the stored snapshot videos one by one according to the analysis algorithm associated with each video analysis subtask to obtain a corresponding video analysis result.
5. The video analysis method according to claim 1 or 4, wherein the plurality of video analysis subtasks are executed by using an execution node of the target cluster, and after the analysis is performed on the captured video obtained by each capturing subtask, the method further comprises:
pushing the video analysis result to a specified message queue;
receiving processing logic instructions generated by a subscriber based on the specified message queue;
and responding to the processing logic instruction, and feeding back the video analysis result to a target user or an alarm center.
6. The video analysis method according to claim 2, wherein the process of generating the image capturing apparatus execution plan includes:
acquiring a video analysis requirement;
applying for a plurality of preset point positions of image shooting equipment according to the video analysis requirement; the plurality of preset point positions of the image shooting equipment are used for switching the image shooting equipment of a plurality of target objects in the same time interval;
associating the scheduling time of the image shooting equipment with the execution time of the video analysis task;
and generating an execution plan of the image shooting equipment according to the preset point positions of the plurality of image shooting equipment and the execution time of the video analysis task.
7. The video analysis method of claim 6, wherein after generating the image capture device execution plan, the method further comprises:
the asynchronous thread monitors a scheduling queue of the image shooting equipment, extracts an execution plan of the image shooting equipment, and finds the corresponding image shooting equipment and preset points of the image shooting equipment;
sending an execution instruction to the image shooting equipment so that the image shooting equipment rotates to a preset point position of the image shooting equipment;
and controlling the image shooting equipment to stay for a preset time length, and controlling the image shooting equipment to keep a locking state in the preset time length.
8. A video analysis system, said system comprising:
the task queue module is used for acquiring a distributed timing task queue which is created in advance or in real time;
the task triggering module is used for triggering the snapshot task and the video analysis task in the distributed timing task queue according to preset time;
the task sub-module is used for aggregating the snapshot tasks according to the same image shooting equipment and the same snapshot interval to generate a plurality of snapshot sub-tasks; the video analysis system comprises a video analysis task processing unit, a video analysis subtask generating unit and a video analysis subtask generating unit, wherein the video analysis subtask processing unit is used for aggregating the video analysis tasks according to the same image shooting equipment and the same analysis algorithm to generate a plurality of video analysis subtasks;
the snapshot module is used for executing the plurality of snapshot subtasks by utilizing the execution node of the target cluster to obtain a corresponding snapshot video;
and the video analysis module is used for executing the plurality of video analysis subtasks by utilizing the execution node of the target cluster and analyzing the snapshot video obtained by each snapshot subtask.
9. A video analysis apparatus, comprising:
a processor; and the combination of (a) and (b),
a computer readable medium having stored thereon instructions that, when executed by the processor, cause the apparatus to perform the video analytics method of any of claims 1 to 7.
10. A computer-readable medium having stored thereon instructions which are loaded by a processor and which perform the video analysis method of any one of claims 1 to 7.
CN202211477711.9A 2022-11-23 2022-11-23 Video analysis method, system, device and medium Pending CN115981799A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211477711.9A CN115981799A (en) 2022-11-23 2022-11-23 Video analysis method, system, device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211477711.9A CN115981799A (en) 2022-11-23 2022-11-23 Video analysis method, system, device and medium

Publications (1)

Publication Number Publication Date
CN115981799A true CN115981799A (en) 2023-04-18

Family

ID=85972808

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211477711.9A Pending CN115981799A (en) 2022-11-23 2022-11-23 Video analysis method, system, device and medium

Country Status (1)

Country Link
CN (1) CN115981799A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116863408A (en) * 2023-09-04 2023-10-10 成都智慧城市信息技术有限公司 Parallel acceleration and dynamic scheduling implementation method based on monitoring camera AI algorithm
CN117294926A (en) * 2023-11-24 2023-12-26 深圳金三立视频科技股份有限公司 Snapshot strategy distribution method and device based on equipment distribution

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116863408A (en) * 2023-09-04 2023-10-10 成都智慧城市信息技术有限公司 Parallel acceleration and dynamic scheduling implementation method based on monitoring camera AI algorithm
CN116863408B (en) * 2023-09-04 2023-11-21 成都智慧城市信息技术有限公司 Parallel acceleration and dynamic scheduling implementation method based on monitoring camera AI algorithm
CN117294926A (en) * 2023-11-24 2023-12-26 深圳金三立视频科技股份有限公司 Snapshot strategy distribution method and device based on equipment distribution
CN117294926B (en) * 2023-11-24 2024-03-19 深圳金三立视频科技股份有限公司 Snapshot strategy distribution method and device based on equipment distribution

Similar Documents

Publication Publication Date Title
CN115981799A (en) Video analysis method, system, device and medium
CN109740732B (en) Neural network processor, convolutional neural network data multiplexing method and related equipment
CN107018175B (en) Scheduling method and device of mobile cloud computing platform
CN112105035A (en) Deployment method and device of mobile edge computing server
CN1759379A (en) System and method for dymanic ordering in a network processor
JP2023511327A (en) Model training method and apparatus
CN102789394B (en) Method, device and nodes for parallelly processing information and server cluster
CN111327692A (en) Model training method and device and cluster system
Padmanabhan et al. Gemel: Model Merging for {Memory-Efficient},{Real-Time} Video Analytics at the Edge
CN106790706A (en) A kind of method of data resource optimization, platform and system
CN112925607A (en) System capacity expansion and contraction method and device and electronic equipment
CN111338745B (en) Deployment method and device of virtual machine and intelligent device
US20100211680A1 (en) Apparatus and method to allocate limited resources
CN109598250A (en) Feature extracting method, device, electronic equipment and computer-readable medium
CN110096521A (en) Log information processing method and device
Liu et al. Stochastic optimal control for participatory sensing systems with heterogenous requests
CN114528104A (en) Task processing method and device
CN114090207A (en) Asynchronous task execution method
CN115562846A (en) Resource scheduling method and device and computing node
US10061676B2 (en) Remotely located timing method and device for a processing unit in an information processing system
CN102902593B (en) Agreement distributing and processing system based on caching mechanism
CN111376255B (en) Robot data acquisition method and device and terminal equipment
CN111190731A (en) Cluster task scheduling system based on weight
CN114003238B (en) Container deployment method, device, equipment and storage medium based on transcoding card
CN110708505B (en) Video alarm method, device, electronic equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination