WO2017008477A1 - 一种集群视频分析方法和系统 - Google Patents

一种集群视频分析方法和系统 Download PDF

Info

Publication number
WO2017008477A1
WO2017008477A1 PCT/CN2016/070437 CN2016070437W WO2017008477A1 WO 2017008477 A1 WO2017008477 A1 WO 2017008477A1 CN 2016070437 W CN2016070437 W CN 2016070437W WO 2017008477 A1 WO2017008477 A1 WO 2017008477A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
data segment
computing node
execution
executed
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.)
Ceased
Application number
PCT/CN2016/070437
Other languages
English (en)
French (fr)
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.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital 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 Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Publication of WO2017008477A1 publication Critical patent/WO2017008477A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/266Channel or content management, e.g. generation and management of keys and entitlement messages in a conditional access system, merging a VOD unicast channel into a multicast channel
    • H04N21/2662Controlling the complexity of the video stream, e.g. by scaling the resolution or bitrate of the video stream based on the client capabilities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/262Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/262Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists
    • H04N21/26208Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists the scheduling operation being performed under constraints
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • H04N21/8456Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments

Definitions

  • This application belongs to the field of intelligent video analysis, and in particular relates to a cluster video analysis method and system.
  • the cluster analysis system when performing a video analysis task, usually does not divide the task, even if the division is a rough division, and the division is not performed in units of the execution time length of the task, and the prior art non-division scheme Or the rough division scheme is not applicable to the field of video intelligent analysis, and it is easy to cause problems such as long execution time of tasks and large queues of tasks.
  • the prior art usually sorts the tasks in order of priority.
  • video analysis tasks have many factors to consider, such as task execution time, streaming time, hardware resource requirements, and so on.
  • the task is prioritized as the only condition for sorting, and when the task is actually executed, the task sequence is often confused.
  • the prior art When performing a video analysis task, the prior art generally adopts an active push mode, that is, the task scheduling node actively pushes the task to the computing node, and then the computing node performs the task.
  • this type of active push tends to cause the compute nodes to struggle with the task push of the task scheduling node.
  • There are also a few solutions in the prior art which adopt a way in which a computing node actively acquires a task, that is, a computing node master.
  • the task in the task scheduling node is dynamically acquired, but the manner of actively acquiring the task lacks a task scheduling scheme inside the computing node.
  • the purpose of the present application is to provide a cluster video analysis method and system.
  • the present application divides data segments according to duration, so that the processing time of the data segments is reduced, and the retention of data segments is prevented.
  • the multiple elements are sorted instead of being sorted according to the priority of the data segments, which can prevent the data segments from being confusing.
  • the scheduling method described in the present application can achieve reasonable task scheduling.
  • an aspect of the present application provides a cluster video analysis method for a cluster system, the cluster system including at least one primary computing node and a plurality of secondary computing nodes, the method comprising: based on to be executed a predetermined duration of video data, dividing the to-be-executed video data into at least one data segment; inserting the data segment into an execution data queue; acquiring a data segment from the execution data queue from a computing node and performing the data segment deal with.
  • the method further includes: dividing the video data to be analyzed according to the predetermined duration to generate the to-be-executed video data for the next predetermined duration.
  • the step of inserting the data segment into the execution data queue further includes: acquiring information of a priority of the data segment, a predetermined execution start time, a predetermined execution end time, a required number of compute node cores, and a resolution; Obtaining the information to determine that the data segment is Perform sorting in the data queue.
  • the method further includes: calculating, by the computing node, whether the computing resource has a spare space, and if there is a vacancy, executing the data The queue requests to get a piece of data.
  • the step of obtaining, by the computing node, the data segment from the execution data queue and processing the data segment further includes: determining whether a resource required by the data segment exceeds a current idle amount of the slave computing node; , the request for the data segment is re-executed, otherwise the data segment is acquired and the data segment is processed.
  • the step of re-performing the data segment includes: requesting the next data segment; or selecting to suspend the data segment currently being executed until the idle amount of the slave computing node satisfies the resource required by the data segment, and then The data fragment is requested.
  • the method further includes: real-time feedback of the execution of the data segment from the computing node and reporting of resource usage from the computing node.
  • a cluster video analysis system including at least one primary computing node and a plurality of secondary computing nodes, the primary computing node including: a data segment dividing unit, configured to: Decoding the to-be-executed video data into at least one data segment based on a predetermined duration of the video data to be executed; a data segment insertion unit for inserting the data segment into the execution data queue; the slave computing node comprising: a data segment And an acquiring unit, configured to acquire a data segment from the execution data queue; and a data segment processing unit, configured to process the acquired data segment.
  • the primary computing node further includes a periodic dividing unit, configured to divide video data to be analyzed according to a predetermined duration to generate video data to be executed for a next predetermined duration.
  • the data segment insertion unit includes: an information acquisition subunit, configured to acquire information of a priority of a data segment, a predetermined execution start time, a predetermined execution end time, a required number of calculation node cores, and a resolution; And determining, according to the obtained information, the ordering of the data segments in the execution data queue.
  • the slave computing node further includes a computing resource statistics unit, configured to calculate whether the computing resource has free space, and if there is space, the data segment acquiring unit applies to the executing data queue to acquire the data segment.
  • a computing resource statistics unit configured to calculate whether the computing resource has free space, and if there is space, the data segment acquiring unit applies to the executing data queue to acquire the data segment.
  • the slave computing node further includes a resource matching unit, configured to determine whether a resource required by the data segment exceeds a current idle amount of the computing node; and the data segment acquiring unit, if the resource matching unit determines that the resource is true Re-requesting the data fragment, otherwise acquiring the data fragment.
  • a resource matching unit configured to determine whether a resource required by the data segment exceeds a current idle amount of the computing node
  • the data segment obtaining unit re-executes the request of the data segment in the case that the resource matching unit determines to be YES, specifically: actively requesting the next data segment; or, selecting to suspend the data segment currently being executed until the slave computing The idle amount of the node satisfies the resources required by the data segment, and then the data segment is requested.
  • the slave computing node further includes a heartbeat reporting unit, configured to feed back the task execution status and the resource usage information of the computing node to the main computing node in real time.
  • a heartbeat reporting unit configured to feed back the task execution status and the resource usage information of the computing node to the main computing node in real time.
  • a storage medium for storing an application for executing the cluster video analysis method described at runtime.
  • a cluster video analysis device the device package a main compute node processor, a slave compute node processor, a communication interface, a memory, and a communication bus
  • the master compute node processor is configured to execute the to-be-executed video data based on a predetermined duration of video data to be executed Dividing into at least one data segment; inserting the data segment into an execution data queue; the slave computing node processor, configured to acquire a data segment from the execution data queue and process the data segment; a storage application;
  • the communication interface is disposed between the processor and the communication bus, and the communication bus is configured to transmit data between the host computing node processor and the memory through the communication interface And for transmitting data between the slave compute node processor and the memory through the communication interface.
  • the cluster video analysis method and system of the present application can prevent the stagnation of data segments and the confusing data segments, and can also achieve reasonable task scheduling.
  • FIG. 1 is a schematic flowchart of a cluster video analysis method of the present application
  • step S2 is a schematic flow chart of step S2 of the present application.
  • step S3 is a schematic flow chart of step S3 of the present application.
  • FIG. 4 and FIG. 5 are schematic structural diagrams of a cluster video analysis system of the present application.
  • FIG. 6 is a schematic structural diagram of a data segment insertion unit of the present application.
  • Cluster technology is a relatively new technology. Through cluster technology, relatively high performance in terms of performance, reliability, and flexibility can be obtained at a lower cost.
  • the task scheduling is in a cluster system.
  • a cluster is a group of independent computers interconnected by a high-speed network that form a group and are managed in a single system. When a user interacts with the cluster, the cluster acts like a standalone server.
  • the cluster configuration is used to improve availability and scalability.
  • the active computing node refers to the method of obtaining the active task, and the computing node decides whether to acquire the task autonomously. When the number of computing nodes required by the task is higher than the computing resource of the computing node, the computing node decides whether to perform the internal task adjustment. Get the task.
  • FIG. 1 is a schematic flow chart of a cluster video analysis method of the present application.
  • the cluster video analysis method of the present application is for a cluster system, the cluster system including at least one master computing node and a plurality of slave computing nodes.
  • the cluster video analysis method of the present application includes:
  • Step S1 The to-be-executed video data is divided into at least one data segment based on a predetermined duration of the video data to be executed.
  • the received video data to be analyzed is inserted into the execution plan table, and all the video data to be analyzed that are not marked as ending in the schedule is executed, and the video data to be analyzed is divided according to a predetermined period to generate the next
  • the video data to be executed in one cycle (for example, half an hour) divides the generated video data of the next cycle to be divided into at least one data segment.
  • the information of the to-be-executed video data includes, but is not limited to, an ID of the to-be-executed video data, an execution time of the to-be-executed video data, a streaming time of the to-be-executed video data, a priority of the to-be-executed video data, and a to-be-executed video data.
  • Information such as the stream address.
  • the execution time of the video data to be executed indicates the scheduled execution start time of the video data to be executed and the scheduled execution end time of the video data to be executed.
  • the take-off time of the video data to be executed refers to the start time and end time of the analysis of the video data to be analyzed.
  • the time period of the video data to be executed is 5:00-6:00
  • the time period 5:00-6:00 is the streaming time of the video data to be executed.
  • the streaming data of the video data to be executed, the video data to be analyzed is usually stored in a specific medium, for example, stored in an NVR (Network Video Recorder), when it is required to acquire the data to be analyzed stored in the NVR.
  • NVR Network Video Recorder
  • the video data is needed, it is necessary to know the address of the storage medium, which is the streaming address of the video data to be executed.
  • the time period from 11:00 to 11:30 in the morning is the peak of the flow of people, and the time period can be 10 minutes (that is, the predetermined duration) for each piece (ie, 11:00-11: 30)
  • the to-be-executed video data is divided into three pieces of data.
  • the daily midnight time is 11:00-11:30, which is a low peak of people flow.
  • the video data to be executed of the time period ie, 11:00-11:30 midnight
  • the data segments are directly processed by the data segment, the purpose of which is to reduce the retention time of the video data to be executed. Finally, the above data segment is inserted into the execution data queue.
  • the predetermined duration is an empirical value, which can be obtained by an empirical formula.
  • the predetermined duration varies continuously with each time the running time of the video data to be executed changes.
  • the predetermined duration of the video data to be executed may be set to an arbitrary duration (ie, an initial duration), such as 30 minutes, 40 minutes, or other values, assuming that the initial duration of the video data to be executed is 30 minutes,
  • the time period of the video data to be executed is 10:00-10:30 (that is, the streaming time of the video data to be executed), and the weight corresponding to the to-be-executed video data is fixed at this time.
  • Fixed value for example 1.
  • the weight is used as a reference value to divide the video data to be executed. For example, in the initialization, the video data to be executed is divided according to each slice for half an hour, and as the execution time of the video data to be executed increases, the weight is also continuously increased, and subsequently, when the video data to be executed is divided, it may be The to-be-executed video data is divided into 25 minutes each piece or 20 minutes each piece, and the like.
  • the dividing is to divide the to-be-executed video data into at least one data segment according to a predetermined duration of the video data to be executed, for intra-cluster concurrent execution and task scheduling.
  • step S2 the data segment is inserted into an execution data queue.
  • step S1 at least one data segment divided in step S1 is inserted into the execution data queue, waiting for acquisition and processing from the computing node.
  • Step S3 Acquire a data segment from the execution data queue from the computing node and process the data segment.
  • the data node is actively acquired from the execution data queue from the computing node, and the obtained data segment is processed.
  • the computing node needs to scan the execution data resource to acquire the computing resources required for each data segment in real time (or every predetermined cycle time, for example, 5 seconds), when the computing node finds that the computing resources have spare space (ie, the computing node core When the number is not empty, determining whether the resource required for the acquired data segment exceeds the current idle amount of the slave computing node, and when the determination result is no, acquiring the data segment and processing the data segment . Specifically, in a process in which the computing node processes the acquired data segment, modifying an execution state of the data segment, for example, executing The status changes to running or locking the data segment, and so on.
  • the video data to be executed is divided according to a predetermined duration, so that the processing time of each data segment is reduced, and the retention of the data segments is prevented; in addition, when sorting, sorting according to multiple elements of the data segment is performed instead of a single Sorting according to the priority of the data segments can prevent the order of the data segments from being confusing; when the tasks are actively acquired from the computing node, the task scheduling method provided by the present application can reasonably perform task scheduling.
  • the method before the step of dividing the to-be-executed video data into the at least one data segment, the method further includes: dividing the video data to be analyzed according to the predetermined duration to generate the next predetermined duration Perform video data.
  • the video data to be analyzed is divided according to the predetermined duration in step S1 to generate video data to be executed for the next predetermined duration.
  • the entire execution schedule is cyclically scanned in a half-hour cycle to generate the next half hour of pending video data.
  • the calculation formula and calculation process of the predetermined duration are the same as above, and will not be described here.
  • the task data to be executed is directly divided into tasks. Specifically, when the one-time to-be-executed video data is received, the execution plan table is not generated for the one-time to-be-executed video data, that is, the task division is directly performed.
  • the one-time to-be-executed video data refers to the to-be-executed video data that is executed only once, and is different from the planned to-be-executed video data, and the planned to-be-executed video data is repeatedly executed according to the configuration principle.
  • the to-be-executed video data By dividing the to-be-executed video data according to a predetermined duration, it is possible to determine the number of data segments generated by the video data to be analyzed in one day (ie, 24 hours) and the size of each data segment.
  • FIG. 2 is a schematic flow chart of step S2 of the present application.
  • step S2 inserts the data segment into the execution data queue to further include:
  • Step S21 Obtain information of a priority of the data segment, a predetermined execution start time, a predetermined execution end time, a required number of computing node cores, and a resolution.
  • the priority of each data segment, the predetermined execution start time, the predetermined execution end time, the required calculation node core number and resolution information, and the like are acquired, and the like.
  • the data segments are further sorted according to the information.
  • Step S22 determining, according to the obtained information, the ordering of the data segments in the execution data queue.
  • the data segment is determined according to the priority of each data segment acquired in step S21, the predetermined execution start time, the predetermined execution end time, the required calculation node core number and resolution information, and the like. Execute the order in the data queue.
  • the required number of compute node cores refers to the number of compute node cores that need to be used when executing the data segment.
  • the resolution is the screen resolution, for example, 1080P indicates that the screen resolution is 1920 ⁇ 1080.
  • sorting is performed according to a predetermined execution start time of the data segments, and when the predetermined execution start times of the plurality of data segments are the same, the execution end time is further performed according to the predetermined Sort, in the order described above, and so on.
  • a predetermined execution start time of one data segment is 11:00-11:15 and a predetermined execution start time of another data segment is 11:15-11:30
  • an early data segment will be executed (ie, The data segment that is scheduled to start early is listed first.
  • the predetermined execution start time of one data segment is 11:00-11:15 and the scheduled execution start time of another task is 11:00-11:10
  • the data segment whose execution end time is earlier is scheduled (ie, the scheduled execution end time) Early data fragments) are ranked first.
  • the data when sorting data segments, the data may be sorted according to information such as priority, predetermined execution start time, predetermined execution end time, required number of computing node cores, and resolution, but is not limited to the above information.
  • the data segments may be sorted according to one of the above information.
  • the data segments are comprehensively ordered according to the above several kinds of information described in the present application. For example, the data segments may be sorted only according to a predetermined execution start time, or the data segments may be sorted according to a predetermined execution start time and priority.
  • the method before the step of obtaining, by the computing node, the data segment from the execution data queue and processing the data segment, the method further includes: calculating from the computing node in real time (or every predetermined time period, for example, 5 Seconds) Statistics on whether there is room for the computing resources. If there is space, request the data segment to obtain the data segment. Specifically, in the process of acquiring a data segment from the computing node, the computing node needs to count whether the computing resource is free or not, and when there is space from the computing node resource, request the data segment to acquire the data segment.
  • FIG. 3 is a schematic flow chart of step S3 of the present application.
  • step S3 further includes:
  • Step S31 determining whether the resource required by the data segment exceeds the current idle amount of the computing node.
  • Step S32 if yes, re-send the request for the data segment.
  • Step S33 otherwise acquiring the data segment and processing the data segment.
  • step S2 When the result of the determination in step S2 is YES (that is, when the amount of idleness of the computing node is smaller than the resources required for the data segment), the request for the data segment is re-executed.
  • the judgment result of step S2 is No At the time (ie, when the amount of idleness of the compute node is greater than or equal to the resources required by the data segment), the data segment is obtained and processed.
  • the step of re-provisioning the request for the data segment further comprises: requesting the next data segment; or selecting to suspend the data segment currently being executed until the idle amount of the slave computing node satisfies the data segment The required resources are then requested for the data segment.
  • step S3 is performed to acquire the data segment from the computing node and process the data segment.
  • the user can customize the setting to pause the data segment being executed based on certain information of the data segment, including but not limited to priority, data segment remaining progress, and the like.
  • a certain data segment may be stopped according to the priority level, or a task may be stopped according to the remaining progress of the data segment, or may be stopped according to the priority level and the remaining progress of the task.
  • Data fragment Specifically, the data segment with a low priority level can be preferentially stopped, or the data segment with a long remaining progress can be preferentially stopped.
  • the method further includes: real-time feedback of the execution of the data segment from the computing node and reporting the resource usage of the slave computing node.
  • the slave computing node feeds back the execution of the data segment to the task scheduling service in real time (or every predetermined time period, for example, 3 seconds) (eg, executing, ending, etc.) And reporting the resource usage of the slave compute node (eg CPU usage, memory usage, etc.).
  • the task scheduling service performs task scheduling reasonably according to the execution state of the data segment reported from the computing node in real time and its own resource usage.
  • the task scheduling is a pointer to the segmented data segment and its priority, execution time, etc., combined with the resource usage reported from the computing node, the data segment is scheduled reasonably and efficiently.
  • Calculating the minimum unit state refers to the minimum computing resource unit that can perform a video analysis task using a video analysis algorithm.
  • the minimum calculation unit required to complete a video analysis task using the face algorithm can be calculated in advance, when the remaining calculation of the computing node When the unit is less than the minimum calculation unit, the data segment will not be requested.
  • the cluster video analysis method of the present application is described in detail.
  • the present application divides the execution of the video data according to the duration, so that the processing time of the data segment is reduced, and the retention of the data segment is prevented;
  • sorting sorting according to multiple elements of the data segment instead of single sorting according to the priority of the data segment can prevent the order of the data segments from being disordered;
  • the task scheduling method provided by the present application , can reasonably perform task scheduling.
  • 4 and 5 are schematic structural diagrams of a cluster video analysis system of the present application.
  • the cluster video analysis system of the present application includes at least one master computing node 1 and a plurality of slave computing nodes 2.
  • the main computing node 1 includes a data segment dividing unit 11
  • the data segment inserting unit 12 the slave computing node 2 includes a data segment obtaining unit 21 and a data segment processing unit 22.
  • the data segment dividing unit 11 is configured to divide the to-be-executed video data into at least one data segment based on a predetermined duration of video data to be executed. Specifically, the to-be-executed video data is divided into at least one data segment according to a predetermined duration of the video data to be executed, and the at least one data segment is sent to the execution data queue.
  • the data segment inserting unit 12 is connected to the data segment dividing unit 11 for inserting the data segment into the execution data queue. Specifically, the data segment insertion unit 12 sorts the received data segments by information such as priority, predetermined execution start time, predetermined execution end time, required number of calculation node cores, and resolution, but is not limited to the above. Several kinds of information.
  • the data segment obtaining unit 21 is connected to the data segment inserting unit 12 for acquiring a data segment from the execution data queue. Specifically, the data segment acquisition unit 21 in the calculation node acquires the data segment in the execution data queue, and when the idle amount from the calculation node satisfies the resource required by the data segment, the data segment acquisition unit 21 can acquire the data. Fragment.
  • the data segment processing unit 22 is connected to the data segment obtaining unit 21 for processing the acquired data segment. Specifically, when the data segment obtaining unit 21 acquires the data segment, the data segment is transmitted to the data segment processing unit 22 for processing.
  • the primary computing node 1 further includes a periodic dividing unit 13 for rooting
  • the video data to be analyzed is divided according to a predetermined duration to generate video data to be executed for the next predetermined duration.
  • FIG. 6 is a schematic structural diagram of a data segment insertion unit of the present application.
  • the data segment inserting unit 12 includes an information acquiring subunit 20 and a sorting subunit 30.
  • the information acquisition sub-unit 20 is configured to acquire information of a priority of the data segment, a predetermined execution start time, a predetermined execution end time, a required number of calculation node cores, and a resolution.
  • the sorting sub-unit 30 is connected to the information acquiring sub-unit 20 for determining the ordering of the data segments in the execution data queue according to the acquired information.
  • the slave computing node 2 further includes a computing resource statistics unit, configured to calculate whether the computing resource has a spare space, and if there is spare, the data segment obtaining unit 21 requests the data queue to acquire the data segment.
  • the computing node statistic unit counts whether the computing resource has a vacancy, and when there is vacancy, the notification data segment obtaining unit 21 sends a request for acquiring the data segment to the execution data queue.
  • the slave computing node further includes a resource matching unit, configured to determine whether a resource required by the data segment exceeds a current idle amount of the computing node, and the data segment acquiring unit 21 determines in the resource matching unit.
  • the request for the data segment is re-executed, otherwise the data segment is acquired.
  • the resource matching unit determines whether the resource required by the data segment exceeds the current idle amount of the computing node, and the judgment result of the resource matching unit is If yes, the request for the data segment is re-executed, and if the result of the resource matching unit is negative, the Data fragment.
  • the data segment obtaining unit 21 re-sends the request for the data segment if the resource matching unit determines to be YES, specifically: actively requesting the next data segment; or, selecting to suspend the data currently being executed.
  • the fragment requests the data segment until the idle amount of the computing node satisfies the resources required by the data segment.
  • the slave computing node 2 further includes a heartbeat reporting unit, configured to feed back the task execution status and the resource usage information of the computing node to the main computing node 1. Specifically, in the process of processing the data segment from the computing node 2, the heartbeat reporting unit reports the execution of the data segment and the resource usage information of the computing node to the task scheduling in real time (or every predetermined time period, for example, 3 seconds). service.
  • the present application provides a cluster video analysis method and system.
  • the present application divides the execution of video data according to the duration, so that the processing time of the data segments is reduced, and the retention of the data segments is prevented; and the data segments are sorted.
  • the order of the data segments is prevented from being disordered.
  • the computing node acquires the data segments, according to the scheduling method of the present application, the data segments can be reasonably scheduled.
  • the application also provides a storage medium for storing an application for executing the cluster video analysis method in any of the above embodiments at runtime.
  • the application also provides an application for performing the cluster video analysis method in any of the above embodiments at runtime.
  • the present application further provides a cluster video analysis device, the device comprising: a main compute node processor, a slave compute node processor, a communication interface, a memory, and a communication bus, wherein the main compute node processor is configured to The predetermined duration of the video data to be executed, the number of videos to be executed Divided into at least one data segment; inserts a data segment into an execution data queue; from a compute node processor, for acquiring data segments from the execution data queue and processing the data segments; the memory is for storing the application; the communication interface is set at Between the processor and the communication bus, the communication bus is for transmitting data between the host computing node processor and the memory through the communication interface, and for transmitting data from the compute node processor and the memory through the communication interface.
  • the instruction code can be stored in any type of computer-accessible memory (eg, permanent or modifiable, volatile or non-volatile, solid state Or non-solid, fixed or replaceable media, etc.).
  • the memory may be, for example, Programmable Array Logic ("PAL"), Random Access Memory (RAM), or Programmable Read Only Memory (PROM). "), Read-Only Memory (“ROM”), Electrically Erasable Programmable ROM (“EEPROM”), Disk, CD, Digital Versatile Disc , referred to as "DVD”) and so on.
  • PAL Programmable Array Logic
  • RAM Random Access Memory
  • PROM Programmable Read Only Memory
  • ROM Read-Only Memory
  • EEPROM Electrically Erasable Programmable ROM
  • Disk CD
  • DVD Digital Versatile Disc

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

一种集群视频分析方法和系统,所述方法和系统包括至少一个主计算节点和多个从计算节点,该方法包括:基于待执行视频数据的预定时长,将所述待执行视频数据划分为至少一个数据片段(S1);将所述数据片段插入到执行数据队列(S2);所述从计算节点从所述执行数据队列获取数据片段并对所述数据片段进行处理(S3)。根据时长对数据片段进行划分,使得数据片段的处理时间减少,防止了数据片段的滞留;另外,在排序时,根据数据片段的多个要素进行排序而非单一的根据数据片段的优先级进行排序,能够有效防止数据片段出现混乱;而在计算节点获取数据片段时,通过所述调度方法,能够实现合理的任务调度。

Description

一种集群视频分析方法和系统
本申请要求于2015年07月14日提交中国专利局、申请号为201510411837.X、发明名称为“一种集群视频分析方法和系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请属于智能视频分析领域,特别涉及一种集群视频分析方法和系统。
背景技术
现有技术中,集群分析系统在执行视频分析任务时,通常不会对任务进行划分,即使划分也是粗略划分,不会以任务的执行时间长度为单位进行划分,现有技术的不划分的方案或者粗划分的方案不适用于视频智能分析领域,且容易造成任务的执行时间过长、任务大量排队等问题。
另外,在任务进入任务调度队列后,现有技术通常将任务按照优先级顺序进行排序。实际上,视频分析任务有诸多因素需要考虑,例如任务的执行时间、取流时间、硬件资源需求等等。现有技术将任务以优先级作为排序的唯一条件,在实际执行任务时,往往容易造成任务顺序混乱等问题。
在执行视频分析任务时,现有技术通常采用主动推送的方式,即任务调度节点将任务主动推送到计算节点,然后计算节点执行该任务。然而,这种主动推送的方式往往会造成计算节点疲于应付任务调度节点的任务推送。现有技术中也有少许方案,采用计算节点主动获取任务的方式,即计算节点主 动获取任务调度节点中的任务,但是这种主动获取任务的方式缺少对计算节点内部的任务调度方案。
因此,有必要基于现有的集群视频分析方法提出一种新型的集群视频分析方法,降低任务执行时间、防止任务滞留、防止任务顺序混乱以及合理地进行任务调度。
发明内容
本申请的目的是提供一种集群视频分析方法和系统,本申请根据时长对数据片段进行划分,使得数据片段的处理时间减少,防止了数据片段的滞留;另外,在排序时,根据数据片段的多个要素进行排序而非单一地根据数据片段的优先级进行排序,能够防止数据片段出现混乱;而在计算节点获取数据片段时,通过本申请所述的调度方法,能够实现合理的任务调度。
为实现上述目的,本申请的一个方面提供了一种集群视频分析方法,该方法用于集群系统,所述集群系统包括至少一个主计算节点和多个从计算节点,该方法包括:基于待执行视频数据的预定时长,将所述待执行视频数据划分为至少一个数据片段;将所述数据片段插入到执行数据队列;从计算节点从所述执行数据队列获取数据片段并对所述数据片段进行处理。
其中,在所述将待执行视频数据划分为至少一个数据片段的步骤之前,还包括:根据预定时长对待分析的视频数据进行划分,以生成下一预定时长的待执行视频数据。
其中,所述将数据片段插入到执行数据队列的步骤进一步包括:获取所述数据片段的优先级、预定执行开始时间、预定执行结束时间、所需要的计算节点核数和分辨率的信息;根据获取到的所述信息以确定所述数据片段在 执行数据队列中的排序。
其中,在所述从计算节点从所述执行数据队列获取数据片段并对所述数据片段进行处理的步骤之前,还包括:从计算节点统计自身计算资源是否有空余,如果有空余则向执行数据队列请求获取数据片段。
其中,所述从计算节点从所述执行数据队列获取数据片段并对所述数据片段进行处理的步骤进一步包括:判断所述数据片段所需要的资源是否超过该从计算节点目前空闲量;如果是,则重新进行数据片段的请求,否则获取所述数据片段并对所述数据片段进行处理。
其中,所述重新进行数据片段的请求的步骤包括:请求下一个数据片段;或者,选择暂停目前正在执行的数据片段直到该从计算节点的空闲量满足所述数据片段所需要的资源,再对所述数据片段进行请求。
其中,该方法还包括:从计算节点实时反馈数据片段执行情况以及上报从计算节点的资源使用情况。
根据本申请的另一方面,提供了一种集群视频分析系统,所述集群视频分析系统包括至少一个主计算节点和多个从计算节点,所述主计算节点包括:数据片段划分单元,用于基于待执行视频数据的预定时长,将所述待执行视频数据划分为至少一个数据片段;数据片段插入单元,用于将所述数据片段插入到执行数据队列;所述从计算节点包括:数据片段获取单元,用于从所述执行数据队列获取数据片段;数据片段处理单元,用于对所述获取的数据片段进行处理。
其中,所述主计算节点还包括周期性划分单元,用于根据预定时长对待分析的视频数据进行划分,以生成下一预定时长的待执行视频数据。
其中,所述数据片段插入单元包括:信息获取子单元,用于获取数据片段的优先级、预定执行开始时间、预定执行结束时间、所需要的计算节点核数和分辨率的信息;排序子单元,用于根据获取到的所述信息确定所述数据片段在执行数据队列中的排序。
其中,所述从计算节点还包括计算资源统计单元,用于统计自身计算资源是否有空余,如果有空余,所述数据片段获取单元向执行数据队列申请获取数据片段。
其中,所述从计算节点还包括资源匹配单元,用于判断所述数据片段所需要的资源是否超过该计算节点目前空闲量;所述数据片段获取单元,在资源匹配单元判断为是的情况下,重新进行数据片段的请求,否则获取所述数据片段。
其中,所述数据片段获取单元在资源匹配单元判断为是的情况下,重新进行数据片段的请求,具体为:主动请求下一个数据片段;或者,选择暂停目前正在执行的数据片段直到该从计算节点的空闲量满足所述数据片段所需要的资源,再对所述数据片段进行请求。
优选的,所述从计算节点还包括心跳上报单元,用于向主计算节点实时反馈任务执行情况以及上报计算节点的资源使用情况信息。
根据本申请的第三方面,还提供了一种存储介质,所述存储介质用于存储应用程序,所述应用程序用于在运行时执行所述的一种集群视频分析方法。
根据本申请的第四方面,还提供了一种应用程序,所述应用程序用于在运行时执行所述的一种集群视频分析方法。
根据本申请的第五方面,还提供了一种集群视频分析设备,所述设备包 括主计算节点处理器、从计算节点处理器、通信接口、存储器、以及通信总线,其中,所述主计算节点处理器,用于基于待执行视频数据的预定时长,将所述待执行视频数据划分为至少一个数据片段;将所述数据片段插入到执行数据队列;所述从计算节点处理器,用于从所述执行数据队列获取数据片段并对所述数据片段进行处理;所述存储器用于存储应用程序;所述通信接口设置在所述处理器与所述通信总线之间,所述通信总线用于通过所述通信接口传输所述主计算节点处理器与所述存储器之间的数据,以及用于通过所述通信接口传输所述从计算节点处理器与所述存储器之间的数据。
如上所述,本申请的集群视频分析方法和系统,能够防止数据片段的滞留和数据片段出现混乱,还能够实现合理的任务调度。
附图说明
图1是本申请的集群视频分析方法的流程示意图;
图2是本申请的步骤S2的流程示意图;
图3是本申请的步骤S3的流程示意图;
图4和图5是本申请的集群视频分析系统的结构示意图;
图6是本申请的数据片段插入单元的结构示意图。
具体实施方式
为使本申请的目的、技术方案和优点更加清楚明了,下面结合具体实施方式并参照附图,对本申请进一步详细说明。应该理解,这些描述只是示例性的,而并非要限制本申请的范围。此外,在以下说明中,省略了对公知结构和技术的描述,以避免不必要地混淆本申请的概念。
集群技术(cluster)是一种较新的技术,通过集群技术,可以在付出较低成本的情况下获得在性能、可靠性、灵活性方面相对较高的收益,其中的任务调度是集群系统中的核心技术。集群是一组相互独立的、通过高速网络互联的计算机,它们构成了一个组,并以单一系统的模式加以管理。一个用户与集群相互作用时,集群像是一个独立的服务器。集群配置是用于提高可用性和可缩放性。
主动式计算节点是指通过主动式任务获取方式,由计算节点自主决定是否获取任务,当任务需要的计算节点核数高于计算节点自身计算资源时,由计算节点自行决定是否进行内部任务调整后获取该任务。
图1是本申请的集群视频分析方法的流程示意图。
本申请的集群视频分析方法用于集群系统,所述集群系统包括至少一个主计算节点和多个从计算节点。
如图1所示,本申请的集群视频分析方法包括:
步骤S1,基于待执行视频数据的预定时长,将所述待执行视频数据划分为至少一个数据片段。
本步骤中,将接收到的待分析的视频数据插入执行计划表中,将执行计划表内所有未标示为结束的待分析的视频数据,根据预定周期对待分析的视频数据进行划分,以生成下一周期(如半小时)的待执行视频数据,将生成的下一周期的待执行视频数据进行划分,划分为至少一个数据片段。
其中,所述待执行视频数据的信息包括但不限于待执行视频数据的ID、待执行视频数据的执行时间、待执行视频数据的取流时间、待执行视频数据的优先级和待执行视频数据的取流地址等信息。
待执行视频数据的执行时间标示了待执行视频数据预定执行开始时间和待执行视频数据的预定执行结束时间。
待执行视频数据的取流时间,是指待分析的视频数据的进行分析时的起始时间和结束时间。例如,待执行视频数据的时间段为5:00-6:00,该时间段5:00-6:00即为待执行视频数据的取流时间。
待执行视频数据的取流地址,待分析的视频数据通常存储在特定的介质中,例如,存储在NVR(Network Video Recorder,即网络硬盘录像机)中,当需要获取存储在NVR中的待分析的视频数据时,就需要知道该存储介质的地址,该地址即是待执行视频数据的取流地址。
举例来说,例如,商场环境下每天上午的11:00-11:30的时间段是人流高峰,可按照10分钟(即预定时长)每片将该时间段(即上午11:00-11:30)的待执行视频数据进行划分,即划分为3个数据片段。同样地,商场环境下每天的午夜时间11:00-11:30是人流低峰,此时可以不对该时间段(即午夜11:00-11:30)的待执行视频数据进行划分,即1个数据片段,直接对该数据片段进行处理,其目的是减少待执行视频数据的滞留时间。最后,将上述数据片段插入到执行数据队列。
本申请中,所述预定时长是一个经验值,可通过经验公式得到该预定时长。具体的,该预定时长随着待执行视频数据每次的运行时间的变化而不断变化。例如,在初始化时,可以设置该待执行视频数据的预定时长为任意时长(即初始时长),例如30分钟、40分钟或者其他值,假设一待执行视频数据的初始时长为30分钟,设该待执行视频数据的时间段为10:00-10:30(即待执行视频数据的取流时间),则此时该待执行视频数据对应的权重是固 定值,例如1。随着该时间段(即10:00-10:30)的待执行视频数据的运行时间不断增加,其权重也在不断增加。后续的,在对该时间段(即10:00-10:30)的待执行视频数据进行划分时,将该权重作为参考值对待执行视频数据进行划分。例如,在初始化时按照半小时每片对该待执行视频数据进行划分,随着待执行视频数据的执行时间的不断增加,权重也在不断增加,后续在对待执行视频数据进行划分时,可能将该待执行视频数据划分成25分钟每片或20分钟每片等等。
需要说明的是,划分是将待执行视频数据根据待执行视频数据的预定时长划分为至少一个数据片段,用于集群内部并发执行及任务调度。
步骤S2,将所述数据片段插入到执行数据队列。
本步骤中,将步骤S1中划分为的至少一个数据片段插入到执行数据队列中,等待从计算节点的获取和处理。
步骤S3,从计算节点从所述执行数据队列获取数据片段并对所述数据片段进行处理。
本步骤中,从计算节点主动从所述执行数据队列中获取数据片段,并对获取到的所述数据片段进行处理。
本步骤中,从计算节点实时(或每隔预定周期时间,例如5秒)扫描执行数据队列获取每个数据片段所需要的计算资源,当从计算节点发现自身计算资源有空余(即计算节点核数不为空)时,判断获取到的所述数据片段所需要的资源是否超过该从计算节点目前空闲量,当判断结果为否时,则获取所述数据片段并对所述数据片段进行处理。具体的,在计算节点对获取到的所述数据片段进行处理的过程中,修改该数据片段的执行状态,例如将执行 状态改为正在运行或将所述数据片段进行锁定等等。
通过上述方法,将待执行视频数据按照预定时长进行划分,使得每个数据片段的处理时间减少,防止了数据片段的滞留;另外,在排序时,根据数据片段的多个要素进行排序而非单一的根据数据片段的优先级进行排序,能够防止数据片段的顺序出现混乱;当从计算节点主动获取任务时,通过本申请提供的任务调度方法,能够合理的进行任务调度。
可选的,在一实施方式中,在所述将待执行视频数据划分为至少一个数据片段的步骤之前,还包括:根据预定时长对待分析的视频数据进行划分,以生成下一预定时长的待执行视频数据。
具体来说,根据步骤S1中的预定时长对待分析的视频数据进行划分,以生成下一个预定时长的待执行视频数据。例如,以半小时为周期循环扫描整个执行计划表,生成下一半小时的待执行视频数据。同样的,该预定时长的计算公式及计算过程同上,此处不再赘述。
当接收到的待执行视频数据是一次性待执行视频数据时,直接对该待执行视频数据进行任务划分。具体来说,当接收到一次性待执行视频数据时,对该一次性待执行视频数据不生成执行计划表,即直接进行任务划分。其中,一次性待执行视频数据是指只执行一次的待执行视频数据,有别于计划的待执行视频数据,计划的待执行视频数据会按照配置原则周而复始地执行。
通过将待执行视频数据根据预定时长进行划分,可以确定出一天(即24小时)的待分析的视频数据生成的数据片段的数量以及每个数据片段的大小。
图2是本申请的步骤S2的流程示意图。
如图2所示,前述步骤S2将所述数据片段插入到执行数据队列进一步 包括:
步骤S21,获取所述数据片段的优先级、预定执行开始时间、预定执行结束时间、所需要的计算节点核数和分辨率的信息。
本步骤中,在将所述数据片段插入执行数据队列时,获取每个数据片段的优先级、预定执行开始时间、预定执行结束时间、所需要的计算节点核数和分辨率的信息等等,进一步根据所述信息对所述数据片段进行排序。
步骤S22,根据获取到的所述信息以确定所述数据片段在执行数据队列中的排序。
本步骤中,根据步骤S21获取到的每个数据片段的优先级、预定执行开始时间、预定执行结束时间、所需要的计算节点核数和分辨率的信息等等,来确定所述数据片段在执行数据队列中的顺序。其中,所需要的计算节点核数是指在执行数据片段时所需要使用的计算节点核数。分辨率即画面分辨率,例如1080P表示画面分辨率为1920×1080。
具体的,当多个数据片段的优先级同为“高”时,进一步,按照数据片段的预定执行开始时间进行排序,当多个数据片段的预定执行开始时间相同时,进一步按照预定执行结束时间进行排序,按照前述顺序,以此类推。
举例来说,假设一个数据片段的预定执行开始时间是11:00-11:15,另一个数据片段的预定执行开始时间是11:15-11:30,则将执行时间早的数据片段(即预定执行开始时间早的数据片段)排在前面。假设一个数据片段的预定执行开始时间是11:00-11:15,另一任务的预定执行开始时间是11:00-11:10,则预定执行结束时间早的数据片段(即预定执行结束时间早的数据片段)排在前面。
本申请中,在对数据片段进行排序时可以按照优先级、预定执行开始时间、预定执行结束时间、所需要的计算节点核数和分辨率等信息进行排序,但不限于上述几种信息。可选的,可以根据上述某个信息进行数据片段的排序。优选的,根据本申请所述的上述几种信息对数据片段进行综合排序。举例来说,可以仅根据预定执行开始时间对数据片段进行排序,也可以根据预定执行开始时间和优先级对数据片段进行排序。
在一实施方式中,在所述从计算节点从所述执行数据队列获取数据片段并对所述数据片段进行处理的步骤之前,还包括:从计算节点实时(或每隔预定时间周期,例如5秒)统计自身计算资源是否有空余,如果有空余,则向执行数据队列请求获取数据片段。具体来说,在从计算节点获取数据片段的过程中,从计算节点需要统计自身计算资源是否空余,在从计算节点资源有空余时,向执行数据队列请求获取数据片段。
图3是本申请的步骤S3的流程示意图。
如图3所示,前述步骤S3进一步包括:
步骤S31,判断所述数据片段所需要的资源是否超过该计算节点目前空闲量。
本步骤中,对获取到的每个数据片段,判断每个所述数据片段所需要的资源是否超过该从计算节点目前空闲量。
步骤S32,如果是,则重新进行数据片段的请求。
步骤S33,否则获取所述数据片段并对所述数据片段进行处理。
当步骤S2的判断结果为是时(即从计算节点的空闲量小于所述数据片段所需要的资源时),重新进行数据片段的请求。当步骤S2的判断结果为否 时(即从计算节点的空闲量大于或等于所述数据片段所需要的资源时),获取所述数据片段并对所述数据片段进行处理。
在一实施方式中,前述所述重新进行数据片段的请求的步骤进一步包括:请求下一个数据片段;或者,选择暂停目前正在执行的数据片段直到该从计算节点的空闲量满足所述数据片段所需要的资源,再对所述数据片段进行请求。
具体来说,当判断结果为获取到的所述数据片段所需要的资源超过该从计算节点自身的目前空闲量时,表明计算节点无法承载所述数据片段,此时计算节点有两种处理方式:可以请求下一个数据片段;或者,选择暂停目前正在执行的数据片段(即在执行数据队列中,执行状态标示为正在执行或者锁定状态的数据片段)。当判断结果为获取到的所述数据片段未超过计算节点自身的目前空闲量时,执行步骤S3即该从计算节点获取所述数据片段并对所述数据片段进行处理。举例来说,当某个数据片段所需要的计算节点核数为2,而当前该计算节点的自身计算资源为1,此时该计算节点无法承接该数据片段,此时计算节点不请求该数据片段,而选择上述两种执行方式中的一种。
这里,用户可自定义设置根据数据片段的某些信息对正在执行的数据片段进行暂停,所述信息包括但不限于优先级、数据片段剩余进度等等。可选的,即可以单一的按照优先级的高低停止某个数据片段,或者可以单一的按照数据片段剩余进度停止某个任务,或者可以同时按照优先级的高低和任务剩余进度的长度停止某个数据片段。具体来说,可优先停止优先级别低的数据片段,或者优先停止剩余进度长的数据片段。
在一实施方式中,所述方法还包括:从计算节点实时反馈数据片段的执行情况以及上报该从计算节点的资源使用情况。
具体的,在从计算节点处理数据片段的过程中,该从计算节点实时(或每间隔预定时间周期,例如3秒)向任务调度服务反馈数据片段的执行情况(例如正在执行、或执行结束等)以及上报该从计算节点的资源使用情况(例如CPU占用情况、内存使用情况等等)。任务调度服务根据从计算节点实时上报的数据片段的执行状态以及自身的资源使用情况等,合理的进行任务调度。其中,任务调度是指针对划分完的数据片段及其优先级、执行时间等,结合从计算节点上报的资源使用情况,合理有效地进行数据片段的调度。计算最小单元状态是指能够使用视频分析算法完成一个视频分析任务的最小计算资源单位,例如,使用人脸算法完成一个视频分析任务需要的最小计算单元,可以提前计算出来,当计算节点的剩余计算单元不足最小计算单元时,不会申请数据片段。
如上所述,详细介绍了本申请的集群视频分析方法,如图1所示,本申请根据时长对待执行视频数据进行划分,使得数据片段的处理时间减少,防止了数据片段的滞留;另外,在排序时,根据数据片段的多个要素进行排序而非单一的根据数据片段的优先级进行排序,能够防止数据片段的顺序出现混乱;当计算节点主动获取任务时,通过本申请提供的任务调度方法,能够合理的进行任务调度。
图4和图5是本申请的集群视频分析系统的结构示意图。
如图4和图5所示,本申请的集群视频分析系统包括至少一个主计算节点1和多个从计算节点2。其中,主计算节点1包括数据片段划分单元11 和数据片段插入单元12,从计算节点2包括数据片段获取单元21和数据片段处理单元22。
数据片段划分单元11,用于基于待执行视频数据的预定时长,将所述待执行视频数据划分为至少一个数据片段。具体来说,根据待执行视频数据的预定时长,将所述待执行视频数据划分为至少一个数据片段,并将所述至少一个数据片段发送到执行数据队列。
该模块的处理过程可参见方法部分的描述。
数据片段插入单元12连接到所述数据片段划分单元11,用于将所述数据片段插入到执行数据队列。具体来说,数据片段插入单元12将接收到的所述数据片段按照优先级、预定执行开始时间、预定执行结束时间、所需要的计算节点核数和分辨率等信息进行排序,但不限于上述几种信息。
该模块的处理过程可参见方法部分的描述。
数据片段获取单元21与所述数据片段插入单元12连接,用于从所述执行数据队列获取数据片段。具体来说,从计算节点中的数据片段获取单元21获取执行数据队列中的数据片段,当从计算节点的空闲量满足所述数据片段所需要的资源时,数据片段获取单元21能够获取到数据片段。
该模块的处理过程可参见方法部分的描述。
数据片段处理单元22连接到所述数据片段获取单元21,用于对所述获取的数据片段进行处理。具体来说,当数据片段获取单元21获取到所述数据片段时,将所述数据片段发送给数据片段处理单元22进行处理。
该模块的处理过程可参见方法部分的描述。
在一实施方式中,所述主计算节点1还包括周期性划分单元13,用于根 据预定时长对待分析的视频数据进行划分,以生成下一个预定时长的待执行视频数据。
该模块的处理过程可参见方法部分的描述。
图6是本申请的数据片段插入单元的结构示意图。
如图6所示,所述数据片段插入单元12包括信息获取子单元20和排序子单元30。
信息获取子单元20,用于获取数据片段的优先级、预定执行开始时间、预定执行结束时间、所需要的计算节点核数和分辨率的信息。
排序子单元30与所述信息获取子单元20连接,用于根据获取到的所述信息确定所述数据片段在执行数据队列中的排序。
在一实施方式中,所述从计算节点2还包括计算资源统计单元,用于统计自身计算资源是否有空余,如果有空余所述数据片段获取单元21向执行数据队列申请获取数据片段。具体来说,计算节点统计单元统计自身计算资源是否有空余,当有空余时,通知数据片段获取单元21向执行数据队列发送数据片段获取的请求。
在一实施方式中,所述从计算节点还包括资源匹配单元,用于判断所述数据片段所需要的资源是否超过该计算节点目前空闲量,所述数据片段获取单元21,在资源匹配单元判断为是的情况下,重新进行数据片段的请求,否则获取所述数据片段。具体来说,在数据片段获取单元21向执行数据队列获取数据片段之前,所述资源匹配单元判断所述数据片段所需要的资源是否超过该计算节点目前空闲量,在资源匹配单元的判断结果为是的情况下,重新进行数据片段的请求,在资源匹配单元的判断结果为否的情况下,获取该 数据片段。
在一实施方式中,所述数据片段获取单元21在资源匹配单元判断为是的情况下,重新进行数据片段的请求,具体为:主动请求下一个数据片段;或者,选择暂停目前正在执行的数据片段直到该计算节点的空闲量满足所述数据片段所需要的资源,再对所述数据片段进行请求。
在一实施方式中,所述从计算节点2还包括心跳上报单元,用于向主计算节点1反馈任务执行情况以及上报计算节点的资源使用情况信息。具体来说,在从计算节点2处理数据片段的过程中,心跳上报单元实时(或每间隔预定时间周期,例如3秒)上报数据片段的执行情况以及上报计算节点的资源使用情况信息给任务调度服务。
如上所述,本申请提供了一种集群视频分析方法和系统,本申请根据时长对待执行视频数据进行划分,使得数据片段的处理时间减少,防止了数据片段的滞留;而且在对数据片段进行排序时,根据数据片段的多个要素进行排序,防止数据片段顺序的混乱;同时,在计算节点获取数据片段时,按照本申请的调度方法,能够合理的对数据片段进行调度。
本申请还提供了一种存储介质,该存储介质用于存储应用程序,该应用程序用于在运行时执行上述任一实施例中的集群视频分析方法。
本申请还提供了一种应用程序,该应用程序用于在运行时执行上述任一实施例中的集群视频分析方法。
此外,本申请还提供了一种集群视频分析设备,该设备包括:主计算节点处理器、从计算节点处理器、通信接口、存储器、以及通信总线,其中,主计算节点处理器,用于基于待执行视频数据的预定时长,将待执行视频数 据划分为至少一个数据片段;将数据片段插入到执行数据队列;从计算节点处理器,用于从执行数据队列获取数据片段并对数据片段进行处理;存储器用于存储应用程序;通信接口设置在处理器与通信总线之间,通信总线用于通过通信接口传输主计算节点处理器与存储器之间的数据,以及用于通过通信接口传输从计算节点处理器与存储器之间的数据。
应当理解的是,本领域普通技术人员可以理解实现上述方法实施方式中的全部或部分步骤是可以通过程序来指令相关的软件、硬件、固件等方式实现。不管本发明是以软件、硬件、还是固件方式实现,指令代码都可以存储在任何类型的计算机可访问的存储器中(例如永久的或者可修改的,易失性的或者非易失性的,固态的或者非固态的,固定的或者可更换的介质等等)。同样,存储器可以例如是可编程阵列逻辑(Programmable Array Logic,简称“PAL”)、随机存取存储器(Random Access Memory,简称“RAM”)、可编程只读存储器(Programmable Read Only Memory,简称“PROM”)、只读存储器(Read-Only Memory,简称“ROM”)、电可擦除可编程只读存储器(Electrically Erasable Programmable ROM,简称“EEPROM”)、磁盘、光盘、数字通用光盘(Digital Versatile Disc,简称“DVD”)等等。
应当理解的是,本申请的上述具体实施方式仅仅用于示例性说明或解释本申请的原理,而不构成对本申请的限制。因此,在不偏离本申请的精神和范围的情况下所做的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。此外,本申请所附权利要求旨在涵盖落入所附权利要求范围和边界、或者这种范围和边界的等同形式内的全部变化和修改例。

Claims (17)

  1. 一种集群视频分析方法,该方法用于集群系统,所述集群系统包括至少一个主计算节点和多个从计算节点,该方法包括:
    基于待执行视频数据的预定时长,将所述待执行视频数据划分为至少一个数据片段;
    将所述数据片段插入到执行数据队列;
    所述从计算节点从所述执行数据队列获取数据片段并对所述数据片段进行处理。
  2. 根据权利要求1所述的方法,在所述将所述待执行视频数据划分为至少一个数据片段的步骤之前,还包括:
    根据预定时长对待分析的视频数据进行划分,以生成下一预定时长的待执行视频数据。
  3. 根据权利要求1或2所述的方法,其中,所述将数据片段插入到执行数据队列的步骤包括:
    获取所述数据片段的优先级、预定执行开始时间、预定执行结束时间、所需要的计算节点核数和分辨率的信息;
    根据获取到的所述信息以确定所述数据片段在所述执行数据队列中的排序。
  4. 根据权利要求1或2所述的方法,在所述从计算节点从所述执行数据队列获取数据片段并对所述数据片段进行处理的步骤之前,还包括:
    所述从计算节点统计自身计算资源是否有空余,如果有空余则向所述执行数据队列请求获取数据片段。
  5. 根据权利要求1或2所述的方法,其中,所述从计算节点从所述执行数据队列获取数据片段并对所述数据片段进行处理的步骤包括:
    判断所述数据片段所需要的资源是否超过该从计算节点目前空闲量;
    如果是,则重新进行数据片段的请求,否则获取所述数据片段并对所述数据片段进行处理。
  6. 根据权利要求5所述的方法,所述重新进行数据片段的请求的步骤包括:
    请求下一个数据片段;
    或者,选择暂停目前正在执行的数据片段直到该从计算节点的空闲量满足所述数据片段所需要的资源,再对所述数据片段进行请求。
  7. 根据权利要求1或2所述的方法,该方法还包括:从计算节点实时反馈数据片段执行情况以及上报计算节点的资源使用情况。
  8. 一种集群视频分析系统,所述集群视频分析系统包括至少一个主计算节点和多个从计算节点,所述主计算节点(1)包括:
    数据片段划分单元(11),用于基于待执行视频数据的预定时长,将所述待执行视频数据划分为至少一个数据片段;
    数据片段插入单元(12),用于将所述数据片段插入到执行数据队列;
    所述从计算节点(2)包括:
    数据片段获取单元(21),用于从所述执行数据队列获取数据片段;
    数据片段处理单元(22),用于对所述获取的数据片段进行处理。
  9. 根据权利要求8所述的系统,所述主计算节点还包括周期性划分单元,用于根据预定时长对待分析的视频数据进行划分,以生成下一预定时长的待 执行视频数据。
  10. 根据权利要求8或9所述的系统,所述数据片段插入单元(12)包括:
    信息获取子单元(20),用于获取数据片段的优先级、预定执行开始时间、预定执行结束时间、所需要的计算节点核数和分辨率的信息;
    排序子单元(30),用于根据获取到的所述信息确定所述数据片段在执行数据队列中的排序。
  11. 根据权利要求8或9所述的系统,所述从计算节点(2)还包括计算资源统计单元,用于统计自身计算资源是否有空余,如果有空余,所述数据片段获取单元(21)向执行数据队列申请获取数据片段。
  12. 根据权利要求8或9所述的系统,所述从计算节点还包括资源匹配单元,用于判断所述数据片段所需要的资源是否超过该从计算节点目前空闲量;所述数据片段获取单元(21),在所述资源匹配单元判断为是的情况下,重新进行数据片段的请求,否则获取所述数据片段。
  13. 根据权利要求12所述的系统,所述数据片段获取单元(21)在资源匹配单元判断为是的情况下,重新进行数据片段的请求,具体为:主动请求下一个数据片段;
    或者,选择暂停目前正在执行的数据片段直到该从计算节点的空闲量满足所述数据片段所需要的资源,再对所述数据片段进行请求。
  14. 根据权利要求8或9所述的系统,所述从计算节点(2)还包括心跳上报单元,用于向所述主计算节点(1)实时反馈任务执行情况以及上报计算节点的资源使用情况信息。
  15. 一种存储介质,其特征在于,所述存储介质用于存储应用程序,所述应用程序用于在运行时执行权利要求1至7任一项所述的一种集群视频分析方法。
  16. 一种应用程序,其特征在于,所述应用程序用于在运行时执行权利要求1至7任一项所述的一种集群视频分析方法。
  17. 一种集群视频分析设备,其特征在于,包括主计算节点处理器、从计算节点处理器、通信接口、存储器、以及通信总线,其中,
    所述主计算节点处理器,用于基于待执行视频数据的预定时长,将所述待执行视频数据划分为至少一个数据片段;将所述数据片段插入到执行数据队列;
    所述从计算节点处理器,用于从所述执行数据队列获取数据片段并对所述数据片段进行处理;
    所述存储器用于存储权利要求16所述的应用程序;
    所述通信接口设置在所述处理器与所述通信总线之间,所述通信总线用于通过所述通信接口传输所述主计算节点处理器与所述存储器之间的数据,以及用于通过所述通信接口传输所述从计算节点处理器与所述存储器之间的数据。
PCT/CN2016/070437 2015-07-14 2016-01-07 一种集群视频分析方法和系统 Ceased WO2017008477A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510411837.X 2015-07-14
CN201510411837.XA CN106358054A (zh) 2015-07-14 2015-07-14 一种集群视频分析方法和系统

Publications (1)

Publication Number Publication Date
WO2017008477A1 true WO2017008477A1 (zh) 2017-01-19

Family

ID=57756775

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/070437 Ceased WO2017008477A1 (zh) 2015-07-14 2016-01-07 一种集群视频分析方法和系统

Country Status (2)

Country Link
CN (1) CN106358054A (zh)
WO (1) WO2017008477A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111061423A (zh) * 2018-10-17 2020-04-24 杭州海康威视系统技术有限公司 一种数据处理方法、装置和管理节点
CN111290841A (zh) * 2018-12-10 2020-06-16 北京沃东天骏信息技术有限公司 任务调度方法、装置、计算设备及存储介质
CN114449346A (zh) * 2022-02-14 2022-05-06 腾讯科技(深圳)有限公司 视频处理方法、装置、设备以及存储介质

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109753849B (zh) * 2017-11-03 2021-08-17 杭州海康威视数字技术股份有限公司 处理视频分析任务的方法和装置
CN109982066B (zh) * 2017-12-27 2021-02-02 浙江宇视科技有限公司 诊断颗粒计算方法、装置及可读存储介质
CN109561346A (zh) * 2018-12-25 2019-04-02 上海极链网络科技有限公司 一种视频的分布式解析方法及系统
CN112650880B (zh) * 2020-11-30 2022-06-03 重庆紫光华山智安科技有限公司 视频分析方法、装置、计算机设备及存储介质
CN119011951B (zh) * 2024-10-18 2025-01-24 北京轻松怡康信息技术有限公司 分布式视频生成方法、装置、存储介质、程序产品

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102883145A (zh) * 2012-09-28 2013-01-16 安科智慧城市技术(中国)有限公司 一种动态对象识别方法及系统
US20140043480A1 (en) * 2011-04-18 2014-02-13 Zte Corporation Video monitoring system and method
CN103902966A (zh) * 2012-12-28 2014-07-02 北京大学 基于序列时空立方体特征的视频交互事件分析方法及装置

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8645965B2 (en) * 2007-12-31 2014-02-04 Intel Corporation Supporting metered clients with manycore through time-limited partitioning
CN102104496B (zh) * 2010-12-23 2013-08-14 北京航空航天大学 一种云计算环境下中间数据的容错性优化方法
CN102866920B (zh) * 2012-08-02 2016-05-11 杭州海康威视数字技术股份有限公司 主从结构分布式视频处理系统及其调度方法
CN104915253B (zh) * 2014-03-12 2019-05-10 中国移动通信集团河北有限公司 一种作业调度的方法及作业处理器

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140043480A1 (en) * 2011-04-18 2014-02-13 Zte Corporation Video monitoring system and method
CN102883145A (zh) * 2012-09-28 2013-01-16 安科智慧城市技术(中国)有限公司 一种动态对象识别方法及系统
CN103902966A (zh) * 2012-12-28 2014-07-02 北京大学 基于序列时空立方体特征的视频交互事件分析方法及装置

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111061423A (zh) * 2018-10-17 2020-04-24 杭州海康威视系统技术有限公司 一种数据处理方法、装置和管理节点
CN111061423B (zh) * 2018-10-17 2023-09-26 杭州海康威视系统技术有限公司 一种数据处理方法、装置和管理节点
CN111290841A (zh) * 2018-12-10 2020-06-16 北京沃东天骏信息技术有限公司 任务调度方法、装置、计算设备及存储介质
CN111290841B (zh) * 2018-12-10 2024-04-05 北京沃东天骏信息技术有限公司 任务调度方法、装置、计算设备及存储介质
CN114449346A (zh) * 2022-02-14 2022-05-06 腾讯科技(深圳)有限公司 视频处理方法、装置、设备以及存储介质
CN114449346B (zh) * 2022-02-14 2023-08-15 腾讯科技(深圳)有限公司 视频处理方法、装置、设备以及存储介质

Also Published As

Publication number Publication date
CN106358054A (zh) 2017-01-25

Similar Documents

Publication Publication Date Title
WO2017008477A1 (zh) 一种集群视频分析方法和系统
US20150295970A1 (en) Method and device for augmenting and releasing capacity of computing resources in real-time stream computing system
US8799913B2 (en) Computing system, method and computer-readable medium for managing a processing of tasks
CN109564528B (zh) 分布式计算中计算资源分配的系统和方法
EP3285187B1 (en) Optimized merge-sorting of data retrieved from parallel storage units
WO2017133351A1 (zh) 一种资源分配方法及资源管理器
US10877790B2 (en) Information processing apparatus, control method and storage medium
US20150242254A1 (en) Method and apparatus for processing message between processors
US20100211954A1 (en) Practical contention-free distributed weighted fair-share scheduler
WO2017045553A1 (zh) 一种任务分配方法和系统
US9207964B1 (en) Distributed batch matching of videos with dynamic resource allocation based on global score and prioritized scheduling score in a heterogeneous computing environment
CN104850576B (zh) 一种基于海量视频的快速特征提取系统
US9141436B2 (en) Apparatus and method for partition scheduling for a processor with cores
CN114296891B (zh) 任务的调度方法、系统、计算设备、存储介质及程序产品
US20190286582A1 (en) Method for processing client requests in a cluster system, a method and an apparatus for processing i/o according to the client requests
CN107818012A (zh) 一种数据处理方法、装置及电子设备
JP5462529B2 (ja) タスク割当装置、および、タスク割当方法
WO2017167070A1 (zh) 集群数据复制方法、优先级确定方法及装置
US10289312B2 (en) Method of reordering a queue of write requests
CN115617497B (zh) 线程处理方法、调度组件、监测组件、服务器和存储介质
US20150220361A1 (en) Parallel computer system, control method of parallel computer system, and computer-readable storage medium
CN111343152B (zh) 数据处理方法、装置及电子设备、存储介质
US9710311B2 (en) Information processing system, method of controlling information processing system, and recording medium
CN104349201A (zh) 待录制预约计划处理方法及装置
CN114546279A (zh) Io请求预测方法、装置、存储节点及可读存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16823628

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16823628

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 02/11/2018)

122 Ep: pct application non-entry in european phase

Ref document number: 16823628

Country of ref document: EP

Kind code of ref document: A1