WO2024045780A1 - Video analysis method and apparatus, and storage medium - Google Patents

Video analysis method and apparatus, and storage medium Download PDF

Info

Publication number
WO2024045780A1
WO2024045780A1 PCT/CN2023/100986 CN2023100986W WO2024045780A1 WO 2024045780 A1 WO2024045780 A1 WO 2024045780A1 CN 2023100986 W CN2023100986 W CN 2023100986W WO 2024045780 A1 WO2024045780 A1 WO 2024045780A1
Authority
WO
WIPO (PCT)
Prior art keywords
plug
instance
data
execution engine
video
Prior art date
Application number
PCT/CN2023/100986
Other languages
French (fr)
Chinese (zh)
Inventor
彭席汉
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2024045780A1 publication Critical patent/WO2024045780A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • 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/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs

Abstract

The present application relates to a video analysis method and apparatus, and a storage medium. The method comprises: a processor acquiring video data; acquiring execution engine state information of one or more video analysis cards; the processor generating data flow information according to the video data and the execution engine state information, wherein the data flow information comprises a calling sequence of plug-in instances and the video data; the processor sending the data flow information to the video analysis card according to the calling sequence of the plug-in instances; and according to the calling sequence of the plug-in instances, the video analysis card calling, by means of a plug-in instance, a corresponding execution engine to process the video data, so as to obtain a video analysis result. According to the embodiments of the present application, the utilization rate of hardware resources on each video analysis card can be improved, and the hardware resources on different video analysis cards are flexibly and fully utilized, thereby improving the efficiency of video analysis.

Description

视频解析方法、装置和存储介质Video analysis method, device and storage medium
本申请要求于2022年08月29日提交中国专利局、申请号为202211042853.2、发明名称为“视频解析方法、装置和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application filed with the China Patent Office on August 29, 2022, with the application number 202211042853.2 and the invention name "Video Analysis Method, Device and Storage Medium", the entire content of which is incorporated into this application by reference. middle.
技术领域Technical field
本申请涉及人工智能技术领域,尤其涉及一种视频解析方法、装置和存储介质。This application relates to the field of artificial intelligence technology, and in particular to a video analysis method, device and storage medium.
背景技术Background technique
随着人工智能(artificial intelligence,AI)技术的不断发展,也推动了视频智能分析的飞速发展。由于现代智慧城市对数据所反应的内容要求越来越高,要求我们对这些视频数据做更加完善的规整和分析。当前通常是利用视频解析卡等来对视频数据进行处理。With the continuous development of artificial intelligence (AI) technology, it has also promoted the rapid development of video intelligent analysis. As modern smart cities have increasingly higher requirements for the content reflected by data, we are required to conduct more complete organization and analysis of these video data. Currently, video data is usually processed using video parsing cards.
然而,在大规模视频解析中可能会涉及混合业务流的场景,当前技术手段中通常是对视频解析卡的硬件资源进行虚拟化算力切分以适应该场景,这种方式无法充分地利用视频解析卡上的硬件资源。因此,亟需新型的视频解析方法以更加高效地利用底层硬件资源对视频数据进行解析,提高视频解析效率。However, large-scale video parsing may involve mixed service flow scenarios. Current technical methods usually virtualize the hardware resources of the video parsing card and divide the computing power to adapt to this scenario. This method cannot fully utilize the video. Parse the hardware resources on the card. Therefore, new video parsing methods are urgently needed to more efficiently utilize underlying hardware resources to parse video data and improve video parsing efficiency.
发明内容Contents of the invention
有鉴于此,提出了一种视频解析方法、装置和存储介质。In view of this, a video analysis method, device and storage medium are proposed.
第一方面,本申请的实施例提供了一种视频解析方法。该方法包括:In the first aspect, embodiments of the present application provide a video analysis method. The method includes:
获取视频数据;Get video data;
获取一个或多个视频解析卡的执行引擎状态信息;Obtain the execution engine status information of one or more video analysis cards;
根据视频数据和执行引擎状态信息,生成数据流信息,数据流信息包括插件实例的调用顺序和视频数据;Generate data flow information based on video data and execution engine status information. Data flow information includes the calling sequence of plug-in instances and video data;
根据插件实例的调用顺序,将数据流信息发送至视频解析卡,数据流信息用于视频解析卡根据插件实例的调用顺序,通过插件实例调用相应的执行引擎对视频数据进行处理,得到视频解析结果。According to the calling sequence of the plug-in instance, the data flow information is sent to the video analysis card. The data flow information is used by the video analysis card to call the corresponding execution engine through the plug-in instance to process the video data according to the calling sequence of the plug-in instance to obtain the video analysis result. .
根据本申请实施例,通过处理器在视频解析卡上部署插件实例,并通过插件实例调用底层的执行引擎,可以实现插件实例和底层执行引擎的分离,针对于不同视频数据解析的需求,可以灵活的调用不同视频解析卡上的插件实例以实现对视频的解析,以得到视频解析的结果。同时,通过获取各视频解析卡的执行引擎状态信息,以生成相应的数据流信息,确定解析视频时插件实例的调用顺序,可以提高各视频解析卡上的硬件资源的利用率,灵活、充分地利用不同视频解析卡上的硬件资源,提高了视频解析的效率。According to the embodiments of this application, the processor deploys a plug-in instance on the video parsing card, and calls the underlying execution engine through the plug-in instance. This can realize the separation of the plug-in instance and the underlying execution engine, and can flexibly meet the needs of different video data analysis. Call plug-in instances on different video parsing cards to parse the video and obtain the results of the video parsing. At the same time, by obtaining the execution engine status information of each video analysis card to generate corresponding data flow information and determine the calling order of plug-in instances when parsing videos, the utilization of hardware resources on each video analysis card can be improved, and the system can flexibly and fully Utilizing hardware resources on different video analysis cards improves the efficiency of video analysis.
根据第一方面,在视频解析方法的第一种可能的实现方式中,执行引擎状态信息包括一个或多个视频解析卡的一个或多个执行引擎的资源空闲状态,根据视频数据和执行引擎状态信息,生成数据流信息,包括:According to the first aspect, in a first possible implementation of the video parsing method, the execution engine status information includes the resource idle status of one or more execution engines of one or more video parsing cards. According to the video data and the execution engine status Information, generate data flow information, including:
根据视频数据的业务类型信息,确定业务类型对应的一个或多个插件,插件在视频解析卡上实例化为对应的一个或多个插件实例; According to the business type information of the video data, one or more plug-ins corresponding to the business type are determined, and the plug-ins are instantiated on the video analysis card into the corresponding one or more plug-in instances;
根据一个或多个插件对应的执行引擎的资源消耗信息和执行引擎的资源空闲状态,确定数据流信息中插件实例的调用顺序。The calling sequence of plug-in instances in the data flow information is determined based on the resource consumption information of the execution engine corresponding to one or more plug-ins and the resource idle status of the execution engine.
根据本申请实施例,通过根据满足业务需求的插件对应的执行引擎的资源消耗信息和执行引擎的资源空闲状态,来确定视频数据对应的插件实例的调用顺序,可以实现利用处理器对视频的解析流程进行动态的调度,以满足不同业务类型的需要,且在视频解析过程中可以充分利用底层硬件资源,实现硬件资源利用率的最大化,提高了视频解析效率。According to the embodiment of the present application, by determining the calling sequence of plug-in instances corresponding to video data based on the resource consumption information of the execution engine corresponding to the plug-in that meets the business requirements and the resource idle state of the execution engine, the video analysis by the processor can be realized The process is dynamically scheduled to meet the needs of different business types, and the underlying hardware resources can be fully utilized during the video analysis process to maximize the utilization of hardware resources and improve the efficiency of video analysis.
根据第一方面的第一种可能的实现方式,在视频解析方法的第二种可能的实现方式中,根据一个或多个插件对应的执行引擎的资源消耗信息和执行引擎的资源空闲状态,确定数据流信息中插件实例的调用顺序,包括:According to a first possible implementation manner of the first aspect, in a second possible implementation manner of the video parsing method, the resource consumption information of the execution engine corresponding to one or more plug-ins and the resource idle state of the execution engine are determined. The calling sequence of plug-in instances in the data flow information includes:
根据一个或多个插件对应的执行引擎的资源消耗信息和执行引擎的资源空闲状态,确定候选的调用顺序;Determine the candidate calling sequence based on the resource consumption information of the execution engine corresponding to one or more plug-ins and the resource idle status of the execution engine;
在候选的调用顺序的数量为多个的情况下,确定候选的调用顺序中插件实例跨视频解析卡进行交互的数据量最小的一个候选的调用顺序为插件实例的调用顺序。When the number of candidate calling sequences is multiple, the calling sequence of the candidate with the smallest amount of data for the plug-in instance to interact across the video parsing card among the candidate calling sequences is determined to be the calling sequence of the plug-in instance.
根据本申请实施例,通过处理器根据插件对应的执行引擎的资源消耗信息和当前的执行引擎的资源空闲状态,确定候选的调用顺序,并在存在多条候选的调用顺序中,以跨视频解析卡交互的数据量最小的候选的调用顺序作为最终确定的调用顺序,可以通过动态调度提高底层硬件资源的利用率,且可以减少视频解析过程中的数据传输代价,总体提高了数据解析的效率。According to the embodiment of the present application, the processor determines the candidate calling sequence according to the resource consumption information of the execution engine corresponding to the plug-in and the current resource idle state of the execution engine, and when there are multiple candidate calling sequences, performs cross-video analysis The calling order of the candidate with the smallest amount of card interaction data is used as the final calling order, which can improve the utilization of underlying hardware resources through dynamic scheduling, reduce the data transmission cost in the video parsing process, and overall improve the efficiency of data parsing.
根据第一方面的第一种或第二种可能的实现方式,在视频解析方法的第三种可能的实现方式中,根据一个或多个插件对应的执行引擎的资源消耗信息和执行引擎的资源空闲状态,确定数据流信息中插件实例的调用顺序,包括:According to the first or second possible implementation manner of the first aspect, in the third possible implementation manner of the video parsing method, according to the resource consumption information of the execution engine corresponding to one or more plug-ins and the resources of the execution engine The idle state determines the calling sequence of plug-in instances in the data flow information, including:
根据一个或多个插件对应的执行引擎的资源消耗信息和执行引擎的资源空闲状态,确定候选的调用顺序;Determine the candidate calling sequence based on the resource consumption information of the execution engine corresponding to one or more plug-ins and the resource idle status of the execution engine;
在候选的调用顺序的数量为零的情况下,根据执行引擎的资源空闲状态,在视频解析卡上部署新的插件实例;When the number of candidate calling sequences is zero, deploy a new plug-in instance on the video parsing card according to the resource idle status of the execution engine;
根据执行引擎的资源空闲状态和新的插件实例,确定插件实例的调用顺序。Determine the calling sequence of plug-in instances based on the resource idle status of the execution engine and the new plug-in instance.
根据本申请实施例,通过处理器根据插件对应的执行引擎的资源消耗信息和当前的执行引擎的资源空闲状态,确定候选的调用顺序,并在不存在可行的调用顺序时,通过部署新的插件实例以对调用路径进行动态扩容,从而可以满足动态解析的需求,提高视频解析的实时性。According to the embodiment of the present application, the processor determines the candidate calling sequence according to the resource consumption information of the execution engine corresponding to the plug-in and the resource idle status of the current execution engine, and when there is no feasible calling sequence, by deploying a new plug-in The instance can dynamically expand the calling path to meet the needs of dynamic analysis and improve the real-time performance of video analysis.
根据第一方面或第一方面的第一种或第二种或第三种可能的实现方式,在视频解析方法的第四种可能的实现方式中,视频解析卡根据插件实例的调用顺序,通过插件实例调用相应的执行引擎对视频数据进行处理,得到视频解析结果,包括:According to the first aspect or the first or second or third possible implementation manner of the first aspect, in a fourth possible implementation manner of the video parsing method, the video parsing card passes The plug-in instance calls the corresponding execution engine to process the video data and obtains the video analysis results, including:
视频解析卡根据数据流信息,确定第一插件实例对应的数据输入队列,第一插件实例为插件实例的调用顺序中的第一个插件实例;The video analysis card determines the data input queue corresponding to the first plug-in instance based on the data flow information, and the first plug-in instance is the first plug-in instance in the calling sequence of the plug-in instance;
视频解析卡通过第一插件实例,调用相应的执行引擎对数据输入队列进行处理,得到数据输出队列;The video analysis card calls the corresponding execution engine to process the data input queue through the first plug-in instance to obtain the data output queue;
视频解析卡以第一插件实例之后的第二插件实例作为新的第一插件实例,根据数据输出队列确定新的数据输入队列,重复执行视频解析卡通过第一插件实例调用相应的执行引擎, 对数据输入队列进行处理,得到数据输出队列及之后的步骤,直至第二插件实例为插件实例的调用顺序中的最后一个插件实例,得到视频解析结果。The video parsing card uses the second plug-in instance after the first plug-in instance as the new first plug-in instance, determines the new data input queue according to the data output queue, and repeatedly executes the video parsing card to call the corresponding execution engine through the first plug-in instance. Process the data input queue to obtain the data output queue and subsequent steps until the second plug-in instance is the last plug-in instance in the calling sequence of the plug-in instance, and obtain the video analysis result.
根据本申请实施例,通过确定插件实例对应的数据输入队列,并按照插件实例的调用顺序依次调用插件实例对数据输入队列中的各项数据进行处理,该处理过程通过插件实例调用相应的执行引擎实现,可以实现对各视频解析卡上各插件实例的统一管理,以充分地利用视频解析卡上的硬件资源,实现高效的视频解析过程。According to the embodiment of the present application, the data input queue corresponding to the plug-in instance is determined, and the plug-in instance is sequentially called according to the calling order of the plug-in instance to process each data in the data input queue. The processing process calls the corresponding execution engine through the plug-in instance. Implementation can achieve unified management of each plug-in instance on each video analysis card to fully utilize the hardware resources on the video analysis card and achieve an efficient video analysis process.
根据第一方面的第四种可能的实现方式,在视频解析方法的第五种可能的实现方式中,数据输入队列包括数据输入队列中一项或多项数据对应的优先级信息,视频解析卡通过第一插件实例,调用相应的执行引擎对数据输入队列进行处理,得到数据输出队列,包括:According to the fourth possible implementation manner of the first aspect, in the fifth possible implementation manner of the video analysis method, the data input queue includes priority information corresponding to one or more pieces of data in the data input queue, and the video analysis card Through the first plug-in instance, the corresponding execution engine is called to process the data input queue to obtain the data output queue, including:
视频解析卡根据优先级信息,通过第一插件实例,调用相应的执行引擎对数据输入队列中的一项或多项数据进行处理,得到数据输出队列。According to the priority information, the video analysis card calls the corresponding execution engine to process one or more data in the data input queue through the first plug-in instance to obtain the data output queue.
根据本申请实施例,通过在插件实例对应的数据输入队列中引入优先级信息,可以满足存在紧急业务的情况下视频解析的需要,在存在紧急业务的情况下可以使插件实例优先处理相应的视频数据,保证视频解析的实时性。According to the embodiments of the present application, by introducing priority information into the data input queue corresponding to the plug-in instance, the need for video analysis in the presence of emergency services can be met, and the plug-in instance can be prioritized to process the corresponding video in the presence of emergency services. data to ensure real-time video analysis.
根据第一方面的第四种或第五种可能的实现方式,在视频解析方法的第六种可能的实现方式中,视频解析卡通过第一插件实例,调用相应的执行引擎对数据输入队列进行处理,得到数据输出队列,包括:According to the fourth or fifth possible implementation manner of the first aspect, in the sixth possible implementation manner of the video analysis method, the video analysis card calls the corresponding execution engine to perform processing on the data input queue through the first plug-in instance. Process and obtain the data output queue, including:
视频解析卡通过第一插件实例,调用相应的执行引擎对应的线程池中的线程,对数据输入队列中的一项或多项数据进行处理,得到数据输出队列,线程池中并发的最大线程数量根据硬件资源的大小决定。The video analysis card calls the thread in the thread pool corresponding to the corresponding execution engine through the first plug-in instance to process one or more data in the data input queue to obtain the data output queue and the maximum number of concurrent threads in the thread pool. Depends on the size of the hardware resources.
根据本申请实施例,视频解析卡通过在调用执行引擎时,通过执行引擎中的线程池中的线程,对数据输入队列中的一项或多项数据进行处理,可以在执行引擎中实现多项数据解析任务的并发处理,提高处理效率,且通过线程池可以充分地利用底层硬件资源,提高硬件资源的利用率。According to the embodiment of the present application, the video analysis card can process one or more data items in the data input queue through threads in the thread pool in the execution engine when calling the execution engine, and can implement multiple items in the execution engine. Concurrent processing of data parsing tasks improves processing efficiency, and the underlying hardware resources can be fully utilized through the thread pool to improve the utilization of hardware resources.
第二方面,本申请的实施例提供了一种视频解析方法。该方法包括:In the second aspect, embodiments of the present application provide a video analysis method. The method includes:
获取处理器根据插件实例的调用顺序发送的数据流信息,数据流信息为处理器根据视频数据和执行引擎状态信息生成,数据流信息包括插件实例的调用顺序和视频数据;Obtain the data flow information sent by the processor according to the calling sequence of the plug-in instance. The data flow information is generated by the processor according to the video data and execution engine status information. The data flow information includes the calling sequence and video data of the plug-in instance;
根据插件实例的调用顺序,通过插件实例调用相应的执行引擎对视频数据进行处理,得到视频解析结果。According to the calling sequence of the plug-in instance, the corresponding execution engine is called through the plug-in instance to process the video data and the video analysis result is obtained.
根据本申请实施例,通过处理器在视频解析卡上部署插件实例,并通过插件实例调用底层的执行引擎,可以实现插件实例和底层执行引擎的分离,针对于不同视频数据解析的需求,可以灵活的调用不同视频解析卡上的插件实例以实现对视频的解析,以得到视频解析的结果。同时,通过获取各视频解析卡的执行引擎状态信息,以生成相应的数据流信息,确定解析视频时插件实例的调用顺序,可以提高各视频解析卡上的硬件资源的利用率,灵活、充分地利用不同视频解析卡上的硬件资源,提高了视频解析的效率。According to the embodiments of this application, the processor deploys a plug-in instance on the video parsing card, and calls the underlying execution engine through the plug-in instance. This can realize the separation of the plug-in instance and the underlying execution engine, and can flexibly meet the needs of different video data analysis. Call plug-in instances on different video parsing cards to parse the video and obtain the results of the video parsing. At the same time, by obtaining the execution engine status information of each video analysis card to generate corresponding data flow information and determine the calling sequence of plug-in instances when parsing the video, the utilization of the hardware resources on each video analysis card can be improved, and the system can flexibly and fully Utilizing hardware resources on different video analysis cards improves the efficiency of video analysis.
根据第二方面,在视频解析方法的第一种可能的实现方式中,根据插件实例的调用顺序,通过插件实例调用相应的执行引擎对视频数据进行处理,得到视频解析结果,包括:According to the second aspect, in the first possible implementation of the video parsing method, according to the calling sequence of the plug-in instance, the corresponding execution engine is called through the plug-in instance to process the video data, and the video parsing result is obtained, including:
根据数据流信息,确定第一插件实例对应的数据输入队列,第一插件实例为插件实例的调用顺序中的第一个插件实例; According to the data flow information, determine the data input queue corresponding to the first plug-in instance, where the first plug-in instance is the first plug-in instance in the calling sequence of the plug-in instance;
通过第一插件实例,调用相应的执行引擎对数据输入队列进行处理,得到数据输出队列;Through the first plug-in instance, the corresponding execution engine is called to process the data input queue to obtain the data output queue;
以第一插件实例的之后的第二插件实例作为新的第一插件实例,根据数据输出队列确定新的数据输入队列,重复执行通过第一插件实例调用相应的执行引擎,对数据输入队列进行处理,得到数据输出队列及之后的步骤,直至第二插件实例为插件实例的调用顺序中的最后一个插件实例,得到视频解析结果。Use the second plug-in instance after the first plug-in instance as the new first plug-in instance, determine the new data input queue according to the data output queue, and repeatedly call the corresponding execution engine through the first plug-in instance to process the data input queue. , obtain the data output queue and subsequent steps until the second plug-in instance is the last plug-in instance in the calling sequence of the plug-in instance, and obtain the video analysis result.
根据本申请实施例,通过确定插件实例对应的数据输入队列,并按照插件实例的调用顺序依次调用插件实例对数据输入队列中的各项数据进行处理,该处理过程通过插件实例调用相应的执行引擎实现,可以实现对各视频解析卡上各插件实例的统一管理,以充分地利用视频解析卡上的硬件资源,实现高效的视频解析过程。According to the embodiment of the present application, the data input queue corresponding to the plug-in instance is determined, and the plug-in instance is sequentially called according to the calling order of the plug-in instance to process each data in the data input queue. The processing process calls the corresponding execution engine through the plug-in instance. Implementation can achieve unified management of each plug-in instance on each video analysis card to fully utilize the hardware resources on the video analysis card and achieve an efficient video analysis process.
根据第二方面的第一种可能的实现方式,在视频解析方法的第二种可能的实现方式中,数据输入队列包括数据输入队列中一项或多项数据对应的优先级信息,通过第一插件实例,调用相应的执行引擎对数据输入队列进行处理,得到数据输出队列,包括:According to a first possible implementation manner of the second aspect, in a second possible implementation manner of the video parsing method, the data input queue includes priority information corresponding to one or more pieces of data in the data input queue, through the first The plug-in instance calls the corresponding execution engine to process the data input queue and obtains the data output queue, including:
根据优先级信息,通过第一插件实例,调用相应的执行引擎对数据输入队列中的一项或多项数据进行处理,得到数据输出队列。According to the priority information, through the first plug-in instance, the corresponding execution engine is called to process one or more data items in the data input queue to obtain the data output queue.
根据本申请实施例,通过在插件实例对应的数据输入队列中引入优先级信息,可以满足存在紧急业务的情况下视频解析的需要,在存在紧急业务的情况下可以使插件实例优先处理相应的视频数据,保证视频解析的实时性。According to the embodiments of the present application, by introducing priority information into the data input queue corresponding to the plug-in instance, the need for video analysis in the presence of emergency services can be met, and the plug-in instance can be prioritized to process the corresponding video in the presence of emergency services. data to ensure real-time video analysis.
根据第二方面的第一种或第二种可能的实现方式,在视频解析方法的第三种可能的实现方式中,通过第一插件实例,调用相应的执行引擎对数据输入队列进行处理,得到数据输出队列,包括:According to the first or second possible implementation manner of the second aspect, in the third possible implementation manner of the video parsing method, the corresponding execution engine is called through the first plug-in instance to process the data input queue, and we obtain Data output queue, including:
通过第一插件实例,调用相应的执行引擎对应的线程池中的线程,对数据输入队列中的一项或多项数据进行处理,得到数据输出队列,线程池中并发的最大线程数量根据硬件资源的大小决定。Through the first plug-in instance, call the thread in the thread pool corresponding to the corresponding execution engine to process one or more data in the data input queue to obtain the data output queue. The maximum number of concurrent threads in the thread pool is based on the hardware resources. Determined by size.
根据本申请实施例,视频解析卡通过在调用执行引擎时,通过执行引擎中的线程池中的线程,对数据输入队列中的一项或多项数据进行处理,可以在执行引擎中实现多项数据解析任务的并发处理,提高处理效率,且通过线程池可以充分地利用底层硬件资源,提高硬件资源的利用率。According to the embodiment of the present application, the video analysis card can process one or more data items in the data input queue through threads in the thread pool in the execution engine when calling the execution engine, and can implement multiple items in the execution engine. Concurrent processing of data parsing tasks improves processing efficiency, and the underlying hardware resources can be fully utilized through the thread pool to improve the utilization of hardware resources.
根据第二方面或第二方面的第一种或第二种或第三种可能的实现方式,在视频解析方法的第四种可能的实现方式中,执行引擎状态信息包括一个或多个视频解析卡的一个或多个执行引擎的资源空闲状态,数据流信息中插件实例的调用顺序根据一个或多个插件对应的执行引擎的资源消耗信息和执行引擎的资源空闲状态确定,插件在视频解析卡上实例化为对应的一个或多个插件实例,一个或多个插件根据视频数据的业务类型信息确定。According to the second aspect or the first or second or third possible implementation of the second aspect, in a fourth possible implementation of the video parsing method, the execution engine status information includes one or more video parsing The resource idle status of one or more execution engines of the card. The calling sequence of plug-in instances in the data flow information is determined based on the resource consumption information of the execution engine corresponding to one or more plug-ins and the resource idle status of the execution engine. The plug-in is in the video parsing card. is instantiated into one or more corresponding plug-in instances, and one or more plug-ins are determined based on the business type information of the video data.
根据本申请实施例,通过根据满足业务需求的插件对应的执行引擎的资源消耗信息和执行引擎的资源空闲状态,来确定视频数据对应的插件实例的调用顺序,可以实现利用处理器对视频的解析流程进行动态的调度,以满足不同业务类型的需要,且在视频解析过程中可以充分利用底层硬件资源,实现硬件资源利用率的最大化,提高了视频解析效率。According to the embodiment of the present application, by determining the calling sequence of plug-in instances corresponding to video data based on the resource consumption information of the execution engine corresponding to the plug-in that meets the business requirements and the resource idle state of the execution engine, the video analysis by the processor can be realized The process is dynamically scheduled to meet the needs of different business types, and the underlying hardware resources can be fully utilized during the video analysis process to maximize the utilization of hardware resources and improve the efficiency of video analysis.
根据第二方面的第四种可能的实现方式,在视频解析方法的第五种可能的实现方式中,在候选的调用顺序的数量为多个的情况下,确定插件实例的调用顺序为候选的调用顺序中插件实例跨视频解析卡进行交互的数据量最小的一个候选的调用顺序,候选的调用顺序根据一 个或多个插件对应的执行引擎的资源消耗信息和执行引擎的资源空闲状态确定。According to the fourth possible implementation manner of the second aspect, in the fifth possible implementation manner of the video parsing method, when the number of candidate calling sequences is multiple, it is determined that the calling sequence of the plug-in instance is the candidate In the calling sequence, the candidate calling sequence with the smallest amount of data for the plug-in instance to interact across the video parsing card is based on a The resource consumption information of the execution engine corresponding to one or more plug-ins and the resource idle status of the execution engine are determined.
根据本申请实施例,通过处理器根据插件对应的执行引擎的资源消耗信息和当前的执行引擎的资源空闲状态,确定候选的调用顺序,并在存在多条候选的调用顺序中,以跨视频解析卡交互的数据量最小的候选的调用顺序作为最终确定的调用顺序,可以通过动态调度提高底层硬件资源的利用率,且可以减少视频解析过程中的数据传输代价,总体提高了数据解析的效率。According to the embodiment of the present application, the processor determines the candidate calling sequence according to the resource consumption information of the execution engine corresponding to the plug-in and the current resource idle state of the execution engine, and when there are multiple candidate calling sequences, performs cross-video analysis The calling order of the candidate with the smallest amount of card interaction data is used as the final calling order, which can improve the utilization of underlying hardware resources through dynamic scheduling, and can reduce the data transmission cost in the video parsing process, and overall improve the efficiency of data parsing.
根据第二方面的第四种或第五种可能的实现方式,在视频解析方法的第六种可能的实现方式中,在候选的调用顺序的数量为零的情况下,插件实例的调用顺序根据执行引擎的资源空闲状态和新的插件实例确定,新的插件实例为根据执行引擎的资源空闲状态,在视频解析卡上部署的,候选的调用顺序根据一个或多个插件对应的执行引擎的资源消耗信息和执行引擎的资源空闲状态确定。According to the fourth or fifth possible implementation manner of the second aspect, in the sixth possible implementation manner of the video parsing method, when the number of candidate calling sequences is zero, the calling sequence of the plug-in instance is based on The resource idle status of the execution engine is determined by the new plug-in instance. The new plug-in instance is deployed on the video analysis card based on the resource idle status of the execution engine. The candidate calling sequence is based on the resources of the execution engine corresponding to one or more plug-ins. Consumption information and resource idle status determination of the execution engine.
根据本申请实施例,通过处理器根据插件对应的执行引擎的资源消耗信息和当前的执行引擎的资源空闲状态,确定候选的调用顺序,并在不存在可行的调用顺序时,通过部署新的插件实例以对调用路径进行动态扩容,从而可以满足动态解析的需求,提高视频解析的实时性。According to the embodiment of the present application, the processor determines the candidate calling sequence according to the resource consumption information of the execution engine corresponding to the plug-in and the resource idle status of the current execution engine, and when there is no feasible calling sequence, by deploying a new plug-in The instance can dynamically expand the calling path to meet the needs of dynamic analysis and improve the real-time performance of video analysis.
第三方面,本申请的实施例提供了一种视频解析装置。该装置包括:In a third aspect, embodiments of the present application provide a video analysis device. The device includes:
第一获取模块,用于获取视频数据;The first acquisition module is used to acquire video data;
第二获取模块,用于获取一个或多个视频解析卡的执行引擎状态信息;The second acquisition module is used to acquire execution engine status information of one or more video analysis cards;
生成模块,用于根据视频数据和执行引擎状态信息,生成数据流信息,数据流信息包括插件实例的调用顺序和视频数据;The generation module is used to generate data flow information based on the video data and execution engine status information. The data flow information includes the calling sequence of the plug-in instance and the video data;
发送模块,用于根据插件实例的调用顺序,将数据流信息发送至视频解析卡,数据流信息用于视频解析卡根据插件实例的调用顺序,通过插件实例调用相应的执行引擎对视频数据进行处理,得到视频解析结果。The sending module is used to send the data flow information to the video analysis card according to the calling sequence of the plug-in instance. The data flow information is used by the video parsing card to call the corresponding execution engine through the plug-in instance to process the video data according to the calling sequence of the plug-in instance. , get the video analysis results.
根据第三方面,在视频解析装置的第一种可能的实现方式中,执行引擎状态信息包括一个或多个视频解析卡的一个或多个执行引擎的资源空闲状态,生成模块,用于:According to the third aspect, in a first possible implementation manner of the video analysis device, the execution engine status information includes the resource idle status of one or more execution engines of one or more video analysis cards, and the generation module is used to:
根据视频数据的业务类型信息,确定业务类型对应的一个或多个插件,插件在视频解析卡上实例化为对应的一个或多个插件实例;According to the business type information of the video data, one or more plug-ins corresponding to the business type are determined, and the plug-ins are instantiated on the video analysis card into the corresponding one or more plug-in instances;
根据一个或多个插件对应的执行引擎的资源消耗信息和执行引擎的资源空闲状态,确定数据流信息中插件实例的调用顺序。The calling sequence of plug-in instances in the data flow information is determined based on the resource consumption information of the execution engine corresponding to one or more plug-ins and the resource idle status of the execution engine.
根据第三方面的第一种可能的实现方式,在视频解析装置的第二种可能的实现方式中,根据一个或多个插件对应的执行引擎的资源消耗信息和执行引擎的资源空闲状态,确定数据流信息中插件实例的调用顺序,包括:According to the first possible implementation manner of the third aspect, in the second possible implementation manner of the video analysis device, the resource consumption information of the execution engine corresponding to one or more plug-ins and the resource idle state of the execution engine are determined. The calling sequence of plug-in instances in the data flow information includes:
根据一个或多个插件对应的执行引擎的资源消耗信息和执行引擎的资源空闲状态,确定候选的调用顺序;Determine the candidate calling sequence based on the resource consumption information of the execution engine corresponding to one or more plug-ins and the resource idle status of the execution engine;
在候选的调用顺序的数量为多个的情况下,确定候选的调用顺序中插件实例跨视频解析卡进行交互的数据量最小的一个候选的调用顺序为插件实例的调用顺序。When the number of candidate calling sequences is multiple, the calling sequence of the candidate with the smallest amount of data for the plug-in instance to interact across the video parsing card among the candidate calling sequences is determined to be the calling sequence of the plug-in instance.
根据第三方面的第一种或第二种可能的实现方式,在视频解析装置的第三种可能的实现方式中,根据一个或多个插件对应的执行引擎的资源消耗信息和执行引擎的资源空闲状态,确定数据流信息中插件实例的调用顺序,包括: According to the first or second possible implementation manner of the third aspect, in the third possible implementation manner of the video analysis device, according to the resource consumption information of the execution engine corresponding to one or more plug-ins and the resources of the execution engine The idle state determines the calling sequence of plug-in instances in the data flow information, including:
根据一个或多个插件对应的执行引擎的资源消耗信息和执行引擎的资源空闲状态,确定候选的调用顺序;Determine the candidate calling sequence based on the resource consumption information of the execution engine corresponding to one or more plug-ins and the resource idle status of the execution engine;
在候选的调用顺序的数量为零的情况下,根据执行引擎的资源空闲状态,在视频解析卡上部署新的插件实例;When the number of candidate calling sequences is zero, deploy a new plug-in instance on the video parsing card according to the resource idle status of the execution engine;
根据执行引擎的资源空闲状态和新的插件实例,确定插件实例的调用顺序。Determine the calling sequence of plug-in instances based on the resource idle status of the execution engine and the new plug-in instance.
根据第三方面或第三方面的第一种或第二种或第三种可能的实现方式,在视频解析装置的第四种可能的实现方式中,视频解析卡根据插件实例的调用顺序,通过插件实例调用相应的执行引擎对视频数据进行处理,得到视频解析结果,包括:According to the third aspect or the first or second or third possible implementation manner of the third aspect, in a fourth possible implementation manner of the video analysis device, the video analysis card passes The plug-in instance calls the corresponding execution engine to process the video data and obtains the video analysis results, including:
视频解析卡根据数据流信息,确定第一插件实例对应的数据输入队列,第一插件实例为插件实例的调用顺序中的第一个插件实例;The video analysis card determines the data input queue corresponding to the first plug-in instance based on the data flow information, and the first plug-in instance is the first plug-in instance in the calling sequence of the plug-in instance;
视频解析卡通过第一插件实例,调用相应的执行引擎对数据输入队列进行处理,得到数据输出队列;The video analysis card calls the corresponding execution engine to process the data input queue through the first plug-in instance to obtain the data output queue;
视频解析卡以第一插件实例之后的第二插件实例作为新的第一插件实例,根据数据输出队列确定新的数据输入队列,重复执行视频解析卡通过第一插件实例调用相应的执行引擎,对数据输入队列进行处理,得到数据输出队列及之后的步骤,直至第二插件实例为插件实例的调用顺序中的最后一个插件实例,得到视频解析结果。The video parsing card uses the second plug-in instance after the first plug-in instance as the new first plug-in instance, determines the new data input queue according to the data output queue, and repeatedly executes the video parsing card to call the corresponding execution engine through the first plug-in instance. The data input queue is processed to obtain the data output queue and subsequent steps are performed until the second plug-in instance is the last plug-in instance in the calling sequence of the plug-in instance, and the video parsing result is obtained.
根据第三方面的第四种可能的实现方式,在视频解析装置的第五种可能的实现方式中,数据输入队列包括数据输入队列中一项或多项数据对应的优先级信息,视频解析卡通过第一插件实例,调用相应的执行引擎对数据输入队列进行处理,得到数据输出队列,包括:According to the fourth possible implementation manner of the third aspect, in the fifth possible implementation manner of the video analysis device, the data input queue includes priority information corresponding to one or more pieces of data in the data input queue, and the video analysis card Through the first plug-in instance, the corresponding execution engine is called to process the data input queue to obtain the data output queue, including:
视频解析卡根据优先级信息,通过第一插件实例,调用相应的执行引擎对数据输入队列中的一项或多项数据进行处理,得到数据输出队列。According to the priority information, the video analysis card calls the corresponding execution engine to process one or more data in the data input queue through the first plug-in instance to obtain the data output queue.
根据第三方面的第四种或第五种可能的实现方式,在视频解析装置的第六种可能的实现方式中,视频解析卡通过第一插件实例,调用相应的执行引擎对数据输入队列进行处理,得到数据输出队列,包括:According to the fourth or fifth possible implementation manner of the third aspect, in the sixth possible implementation manner of the video analysis device, the video analysis card calls the corresponding execution engine to perform processing on the data input queue through the first plug-in instance. Process and obtain the data output queue, including:
视频解析卡通过第一插件实例,调用相应的执行引擎对应的线程池中的线程,对数据输入队列中的一项或多项数据进行处理,得到数据输出队列,线程池中并发的最大线程数量根据硬件资源的大小决定。The video analysis card calls the thread in the thread pool corresponding to the corresponding execution engine through the first plug-in instance to process one or more data in the data input queue to obtain the data output queue and the maximum number of concurrent threads in the thread pool. Depends on the size of the hardware resources.
第四方面,本申请的实施例提供了一种视频解析装置。该装置包括:In a fourth aspect, embodiments of the present application provide a video analysis device. The device includes:
第三获取模块,用于获取处理器根据插件实例的调用顺序发送的数据流信息,数据流信息为处理器根据视频数据和执行引擎状态信息生成,数据流信息包括插件实例的调用顺序和视频数据;The third acquisition module is used to obtain the data flow information sent by the processor according to the calling sequence of the plug-in instance. The data flow information is generated by the processor according to the video data and execution engine status information. The data flow information includes the calling sequence and video data of the plug-in instance. ;
确定模块,用于根据插件实例的调用顺序,通过插件实例调用相应的执行引擎对视频数据进行处理,得到视频解析结果。The determination module is used to call the corresponding execution engine through the plug-in instance to process the video data according to the calling sequence of the plug-in instance, and obtain the video analysis result.
根据第四方面,在视频解析装置的第一种可能的实现方式中,确定模块,用于:According to the fourth aspect, in the first possible implementation manner of the video analysis device, the determining module is used for:
根据数据流信息,确定第一插件实例对应的数据输入队列,第一插件实例为插件实例的调用顺序中的第一个插件实例;According to the data flow information, determine the data input queue corresponding to the first plug-in instance, where the first plug-in instance is the first plug-in instance in the calling sequence of the plug-in instance;
通过第一插件实例,调用相应的执行引擎对数据输入队列进行处理,得到数据输出队列;Through the first plug-in instance, the corresponding execution engine is called to process the data input queue to obtain the data output queue;
以第一插件实例的之后的第二插件实例作为新的第一插件实例,根据数据输出队列确定新的数据输入队列,重复执行通过第一插件实例调用相应的执行引擎,对数据输入队列进行 处理,得到数据输出队列及之后的步骤,直至第二插件实例为插件实例的调用顺序中的最后一个插件实例,得到视频解析结果。Use the second plug-in instance after the first plug-in instance as the new first plug-in instance, determine the new data input queue according to the data output queue, and repeatedly call the corresponding execution engine through the first plug-in instance to perform the data input queue Process, obtain the data output queue and subsequent steps, until the second plug-in instance is the last plug-in instance in the calling sequence of the plug-in instance, and obtain the video analysis result.
根据第四方面的第一种可能的实现方式,在视频解析装置的第二种可能的实现方式中,数据输入队列包括数据输入队列中一项或多项数据对应的优先级信息,通过第一插件实例,调用相应的执行引擎对数据输入队列进行处理,得到数据输出队列,包括:According to a first possible implementation manner of the fourth aspect, in a second possible implementation manner of the video analysis device, the data input queue includes priority information corresponding to one or more pieces of data in the data input queue, through the first The plug-in instance calls the corresponding execution engine to process the data input queue and obtains the data output queue, including:
根据优先级信息,通过第一插件实例,调用相应的执行引擎对数据输入队列中的一项或多项数据进行处理,得到数据输出队列。According to the priority information, through the first plug-in instance, the corresponding execution engine is called to process one or more data items in the data input queue to obtain the data output queue.
根据第四方面的第一种或第二种可能的实现方式,在视频解析装置的第三种可能的实现方式中,通过第一插件实例,调用相应的执行引擎对数据输入队列进行处理,得到数据输出队列,包括:According to the first or second possible implementation manner of the fourth aspect, in the third possible implementation manner of the video analysis device, the corresponding execution engine is called through the first plug-in instance to process the data input queue, and we obtain Data output queue, including:
通过第一插件实例,调用相应的执行引擎对应的线程池中的线程,对数据输入队列中的一项或多项数据进行处理,得到数据输出队列,线程池中并发的最大线程数量根据硬件资源的大小决定。Through the first plug-in instance, call the thread in the thread pool corresponding to the corresponding execution engine to process one or more data in the data input queue to obtain the data output queue. The maximum number of concurrent threads in the thread pool is based on the hardware resources. Determined by size.
根据第四方面或第四方面的第一种或第二种或第三种可能的实现方式,在视频解析装置的第四种可能的实现方式中,执行引擎状态信息包括一个或多个视频解析卡的一个或多个执行引擎的资源空闲状态,数据流信息中插件实例的调用顺序根据一个或多个插件对应的执行引擎的资源消耗信息和执行引擎的资源空闲状态确定,插件在视频解析卡上实例化为对应的一个或多个插件实例,一个或多个插件根据视频数据的业务类型信息确定。According to the fourth aspect or the first, second or third possible implementation of the fourth aspect, in a fourth possible implementation of the video analysis device, the execution engine status information includes one or more video analysis The resource idle status of one or more execution engines of the card. The calling sequence of plug-in instances in the data flow information is determined based on the resource consumption information of the execution engine corresponding to one or more plug-ins and the resource idle status of the execution engine. The plug-in is in the video parsing card. is instantiated into one or more corresponding plug-in instances, and one or more plug-ins are determined based on the business type information of the video data.
根据第四方面的第四种可能的实现方式,在视频解析装置的第五种可能的实现方式中,在候选的调用顺序的数量为多个的情况下,确定插件实例的调用顺序为候选的调用顺序中插件实例跨视频解析卡进行交互的数据量最小的一个候选的调用顺序,候选的调用顺序根据一个或多个插件对应的执行引擎的资源消耗信息和执行引擎的资源空闲状态确定。According to the fourth possible implementation manner of the fourth aspect, in the fifth possible implementation manner of the video analysis device, when the number of candidate calling sequences is multiple, it is determined that the calling sequence of the plug-in instance is the candidate In the calling sequence, the candidate calling sequence with the smallest amount of data for the plug-in instance to interact across the video parsing card is determined based on the resource consumption information of the execution engine corresponding to one or more plug-ins and the resource idle status of the execution engine.
根据第四方面的第四种或第五种可能的实现方式,在视频解析装置的第六种可能的实现方式中,在候选的调用顺序的数量为零的情况下,插件实例的调用顺序根据执行引擎的资源空闲状态和新的插件实例确定,新的插件实例为根据执行引擎的资源空闲状态,在视频解析卡上部署的,候选的调用顺序根据一个或多个插件对应的执行引擎的资源消耗信息和执行引擎的资源空闲状态确定。According to the fourth or fifth possible implementation manner of the fourth aspect, in the sixth possible implementation manner of the video analysis device, when the number of candidate calling sequences is zero, the calling sequence of the plug-in instance is based on The resource idle status of the execution engine is determined by the new plug-in instance. The new plug-in instance is deployed on the video analysis card based on the resource idle status of the execution engine. The candidate calling sequence is based on the resources of the execution engine corresponding to one or more plug-ins. Consumption information and resource idle status determination of the execution engine.
第五方面,本申请的实施例提供了一种视频解析装置,该装置包括:处理器;用于存储处理器可执行指令的存储器;其中,处理器被配置为执行指令时实现上述第一方面或者第一方面的多种可能的实现方式中的一种或几种的视频解析方法,或者,实现上述第二方面或者第二方面的多种可能的实现方式中的一种或几种的视频解析方法。In a fifth aspect, embodiments of the present application provide a video analysis device, which includes: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to implement the first aspect when executing the instructions. Or a video parsing method that implements one or more of the multiple possible implementations of the first aspect, or implements the above second aspect or one or more of the multiple possible implementations of the second aspect. parsing method.
第六方面,本申请的实施例提供了一种非易失性计算机可读存储介质,其上存储有计算机程序指令,计算机程序指令被处理器执行时实现上述第一方面或者第一方面的多种可能的实现方式中的一种或几种的视频解析方法,或者,实现上述第二方面或者第二方面的多种可能的实现方式中的一种或几种的视频解析方法。In a sixth aspect, embodiments of the present application provide a non-volatile computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the above-mentioned first aspect or multiple aspects of the first aspect are implemented. One or more video parsing methods among possible implementations, or one or more video parsing methods that implement the above second aspect or multiple possible implementations of the second aspect.
第七方面,本申请的实施例提供了一种终端设备,该终端设备可以执行上述第一方面或者第一方面的多种可能的实现方式中的一种或几种的视频解析方法,或者,执行上述第二方面或者第二方面的多种可能的实现方式中的一种或几种的视频解析方法。In a seventh aspect, embodiments of the present application provide a terminal device that can execute one or more of the video parsing methods of the first aspect or multiple possible implementations of the first aspect, or, Execute one or more of the video parsing methods of the second aspect or multiple possible implementations of the second aspect.
第八方面,本申请的实施例提供了一种计算机程序产品,包括计算机可读代码,或者承 载有计算机可读代码的非易失性计算机可读存储介质,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行上述第一方面或者第一方面的多种可能的实现方式中的一种或几种的视频解析方法,或者,执行上述第二方面或者第二方面的多种可能的实现方式中的一种或几种的视频解析方法。In an eighth aspect, embodiments of the present application provide a computer program product, including computer readable code, or A non-volatile computer-readable storage medium carrying computer-readable code. When the computer-readable code is run in an electronic device, a processor in the electronic device executes the first aspect or multiple aspects of the first aspect. one or more of the video parsing methods among the possible implementations; or, perform the above second aspect or one or more of the video parsing methods of the multiple possible implementations of the second aspect.
本申请的这些和其他方面在以下(多个)实施例的描述中会更加简明易懂。These and other aspects of the application will be better understood in the description of the embodiment(s) below.
附图说明Description of drawings
包含在说明书中并且构成说明书的一部分的附图与说明书一起示出了本申请的示例性实施例、特征和方面,并且用于解释本申请的原理。The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the application and together with the description, serve to explain the principles of the application.
图1示出根据本申请一实施例的应用场景的示意图。Figure 1 shows a schematic diagram of an application scenario according to an embodiment of the present application.
图2示出根据本申请一实施例的视频解析方法的流程图。Figure 2 shows a flow chart of a video parsing method according to an embodiment of the present application.
图3示出根据本申请一实施例的视频解析卡对视频数据进行处理的示意图。Figure 3 shows a schematic diagram of video data processing by a video analysis card according to an embodiment of the present application.
图4示出根据本申请一实施例的视频解析方法的流程图。Figure 4 shows a flow chart of a video parsing method according to an embodiment of the present application.
图5示出根据本申请一实施例的执行引擎的资源消耗信息的示意图。Figure 5 shows a schematic diagram of resource consumption information of an execution engine according to an embodiment of the present application.
图6示出根据本申请一实施例的计算数据跨视频解析卡进行交互的代价的示意图。FIG. 6 shows a schematic diagram of calculating the cost of data interaction across video analysis cards according to an embodiment of the present application.
图7示出根据本申请一实施例的视频解析方法的流程图。Figure 7 shows a flow chart of a video parsing method according to an embodiment of the present application.
图8示出根据本申请一实施例的调用执行引擎对视频数据进行处理的示意图。Figure 8 shows a schematic diagram of calling an execution engine to process video data according to an embodiment of the present application.
图9示出根据本申请一实施例的插件实例实现的示意图。Figure 9 shows a schematic diagram of a plug-in instance implementation according to an embodiment of the present application.
图10示出根据本申请一实施例的视频解析装置的结构图。Figure 10 shows a structural diagram of a video analysis device according to an embodiment of the present application.
图11示出根据本申请一实施例的视频解析装置的结构图。Figure 11 shows a structural diagram of a video analysis device according to an embodiment of the present application.
图12示出根据本申请一实施例的电子设备1200的结构图。Figure 12 shows a structural diagram of an electronic device 1200 according to an embodiment of the present application.
具体实施方式Detailed ways
以下将参考附图详细说明本申请的各种示例性实施例、特征和方面。附图中相同的附图标记表示功能相同或相似的元件。尽管在附图中示出了实施例的各种方面,但是除非特别指出,不必按比例绘制附图。Various exemplary embodiments, features, and aspects of the present application will be described in detail below with reference to the accompanying drawings. The same reference numbers in the drawings identify functionally identical or similar elements. Although various aspects of the embodiments are illustrated in the drawings, the drawings are not necessarily drawn to scale unless otherwise indicated.
在这里专用的词“示例性”意为“用作例子、实施例或说明性”。这里作为“示例性”所说明的任何实施例不必解释为优于或好于其它实施例。The word "exemplary" as used herein means "serving as an example, example, or illustrative." Any embodiment described herein as "exemplary" is not necessarily to be construed as superior or superior to other embodiments.
另外,为了更好的说明本申请,在下文的具体实施方式中给出了众多的具体细节。本领域技术人员应当理解,没有某些具体细节,本申请同样可以实施。在一些实例中,对于本领域技术人员熟知的方法、手段、元件和电路未作详细描述,以便于凸显本申请的主旨。In addition, in order to better explain the present application, numerous specific details are given in the following detailed description. It will be understood by those skilled in the art that the present application may be practiced without certain specific details. In some instances, methods, means, components and circuits that are well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present application.
随着AI技术的不断发展,也推动了视频智能分析的飞速发展。由于现代智慧城市对数据所反应的内容要求越来越高,要求我们对这些视频数据做更加完善的规整和分析。当前通常是利用视频解析卡等来对视频数据进行处理。而当前利用视频解析卡解析视频数据的方案中,在涉及大规模视频解析以及混合业务流场景时,通常是对视频解析卡的硬件资源进行算力切分并利用虚拟化方式将资源进行组合,这种方式使得硬件资源利用率依赖于底层算力切分的粒度,加入的虚拟化层也会带来额外的性能消耗,且在视频码流路数动态调整时,还需要重新分配虚拟视频解析卡的资源,这些都会导致视频解析卡上的硬件资源无法被充分的利用。 因此,亟需新型的视频解析方法以更加高效地利用底层硬件资源对视频数据进行解析。With the continuous development of AI technology, it has also promoted the rapid development of video intelligent analysis. As modern smart cities have increasingly higher requirements for the content reflected by data, we are required to conduct more complete organization and analysis of these video data. Currently, video data is usually processed using video parsing cards. In the current solution of using video analysis cards to parse video data, when large-scale video analysis and mixed service flow scenarios are involved, the hardware resources of the video analysis cards are usually divided into computing power and virtualization is used to combine the resources. This method makes the utilization of hardware resources depend on the granularity of the underlying computing power segmentation. The added virtualization layer will also bring additional performance consumption, and when the number of video streams is dynamically adjusted, virtual video parsing also needs to be reallocated. Card resources, these will cause the hardware resources on the video analysis card to not be fully utilized. Therefore, new video parsing methods are urgently needed to more efficiently utilize underlying hardware resources to parse video data.
鉴于此,本申请提供了一种视频解析方法,该方法能够在视频解析卡上部署插件实例,通过插件实例调用底层的执行引擎,可以实现插件实例和底层执行引擎的分离,针对于不同视频数据解析的需求,可以灵活的调用不同视频解析卡上的插件实例以实现对视频的解析,以得到视频解析的结果。同时,通过获取各视频解析卡的执行引擎状态信息,以生成相应的数据流信息,确定解析视频时插件实例的调用顺序,可以提高各视频解析卡上的硬件资源的利用率,充分利用不同视频解析卡上的硬件资源,提高了视频解析的效率。In view of this, this application provides a video parsing method that can deploy plug-in instances on the video parsing card and call the underlying execution engine through the plug-in instance, thereby realizing the separation of the plug-in instance and the underlying execution engine, and targeting different video data For parsing needs, plug-in instances on different video parsing cards can be flexibly called to parse the video and obtain the results of the video parsing. At the same time, by obtaining the execution engine status information of each video analysis card to generate corresponding data flow information and determine the calling order of plug-in instances when parsing videos, the utilization of hardware resources on each video analysis card can be improved and different videos can be fully utilized. The hardware resources on the parsing card improve the efficiency of video parsing.
图1示出根据本申请一实施例的应用场景的示意图。如图1所示,本申请实施例的视频解析系统100可部署于终端设备或服务器上,可以包括处理器110和视频解析卡121-123,视频解析系统100可以与摄像头201-203相连接。该摄像头可以是彩色摄像头、红外摄像头等,本申请对摄像头的类型不作限制。Figure 1 shows a schematic diagram of an application scenario according to an embodiment of the present application. As shown in Figure 1, the video analysis system 100 of the embodiment of the present application can be deployed on a terminal device or a server, and can include a processor 110 and video analysis cards 121-123. The video analysis system 100 can be connected to cameras 201-203. The camera can be a color camera, an infrared camera, etc. This application does not limit the type of camera.
例如,在多业务场景(如智慧城市等)下,摄像头201-203可用于不同的业务,例如,摄像头201-202可用于人体信息结构化的业务(如用于人脸识别、行人重识别等),摄像头203可用于车辆信息结构化的业务(如车辆目标检测等);视频解析卡121-123也可用于不同的业务,例如,视频解析卡121-122可用于人体信息结构化的业务、视频解析卡123可用于车辆信息结构化的业务。For example, in multi-service scenarios (such as smart cities, etc.), the cameras 201-203 can be used for different services. For example, the cameras 201-202 can be used for services with structured human body information (such as face recognition, pedestrian re-identification, etc.) ), the camera 203 can be used for structured vehicle information services (such as vehicle target detection, etc.); the video analysis cards 121-123 can also be used for different services, for example, the video analysis cards 121-122 can be used for structured human body information services, The video analysis card 123 can be used for vehicle information structured services.
其中,处理器110可用于获取摄像头201-203发送的视频数据(即图中视频码流),以及视频解析卡121-123发送的执行引擎状态信息,处理器110可以根据视频数据和执行引擎状态信息,可以生成相应的数据流,确定插件实例的调用顺序,处理器110可以根据插件实例的调用顺序将数据流发送给相应的视频解析卡,例如在数据流对应于人体信息结构化的业务时,可由视频解析卡121-122来处理该数据流,在数据流对应于车辆信息结构化的业务时,可由视频解析卡123来处理该数据流;视频解析卡121-123可根据插件实例的调用顺序,通过视频解析卡上的插件实例调用相应的执行引擎对视频数据进行处理,得到视频解析结果。Among them, the processor 110 can be used to obtain the video data sent by the cameras 201-203 (ie, the video code stream in the figure), and the execution engine status information sent by the video analysis card 121-123. The processor 110 can obtain the video data and the execution engine status according to the video data and execution engine status. information, the corresponding data stream can be generated, and the calling sequence of the plug-in instance can be determined. The processor 110 can send the data stream to the corresponding video parsing card according to the calling sequence of the plug-in instance, for example, when the data stream corresponds to a structured business of human body information. , the data stream can be processed by the video parsing card 121-122. When the data stream corresponds to the vehicle information structured service, the data stream can be processed by the video parsing card 123; the video parsing card 121-123 can be processed according to the call of the plug-in instance. In sequence, the plug-in instance on the video parsing card calls the corresponding execution engine to process the video data and obtains the video parsing results.
需要说明的是,图中的摄像头201-203仅作为一个示例,也可包括更多数量的摄像头,如100路摄像头用于人体信息结构化的业务、50路摄像头用于车辆信息结构化的业务等;图中的视频解析卡121-123也仅作为一个示例,也可包括更多数量的视频解析卡。图中处理器的数量也可以是多个。It should be noted that the cameras 201-203 in the figure are only used as an example, and may also include a larger number of cameras, such as 100 cameras for the business of structuring human body information, and 50 cameras for the business of structuring vehicle information. etc.; the video analysis cards 121-123 in the figure are only used as an example, and a larger number of video analysis cards may also be included. The number of processors in the figure can also be multiple.
需要说明的是,本申请实施例也可用于除智慧城市之外的其他需要对视频进行解析的场景中,如自动驾驶、视频内容审核等场景,本申请对此不作限制。It should be noted that the embodiments of this application can also be used in other scenarios other than smart cities that require video analysis, such as autonomous driving, video content review and other scenarios, and this application does not limit this.
本申请涉及的终端设备可以是指具有无线连接功能的设备,无线连接的功能是指可以通过Wi-Fi、蓝牙等无线连接方式与其他终端设备或服务器进行连接,本申请的终端设备也可以具有有线连接进行通信的功能。本申请的终端设备可以是触屏的、也可以是非触屏的、也可以是没有屏幕的,触屏的可以通过手指、触控笔等在显示屏幕上点击、滑动等方式对终端设备进行控制,非触屏的设备可以连接鼠标、键盘、触控面板等输入设备,通过输入设备对终端设备进行控制,没有屏幕的设备比如说可以是没有屏幕的蓝牙音箱等。举例来说,本申请的终端设备可以是智能手机、上网本、平板电脑、笔记本电脑、可穿戴电子设备(如智能手环、智能手表等)、TV、虚拟现实设备、音响、电子墨水,等等。The terminal device involved in this application may refer to a device with a wireless connection function. The wireless connection function refers to the ability to connect to other terminal devices or servers through wireless connection methods such as Wi-Fi and Bluetooth. The terminal device in this application may also have The ability to communicate via a wired connection. The terminal device of this application can be a touch screen, a non-touch screen, or without a screen. If the touch screen is used, the terminal device can be controlled by clicking or sliding on the display screen with fingers, stylus, etc. , non-touch screen devices can be connected to input devices such as mice, keyboards, and touch panels, and the terminal devices can be controlled through the input devices. Devices without screens can be, for example, Bluetooth speakers without screens. For example, the terminal device of this application can be a smartphone, a netbook, a tablet, a laptop, a wearable electronic device (such as a smart bracelet, a smart watch, etc.), a TV, a virtual reality device, a stereo, an electronic ink, etc. .
本申请涉及的服务器可以位于云端或本地,可以是实体设备,也可以是虚拟设备,如虚拟机、容器等,具有无线通信功能,其中,无线通信功能可设置于该服务器的芯片(系统)或 其他部件或组件。可以是指具有无线连接功能的设备,无线连接的功能是指可以通过Wi-Fi、蓝牙等无线连接方式与其他服务器或终端设备进行连接,本申请的服务器也可以具有有线连接进行通信的功能。本申请实施例的处理器和视频解析卡也可分别部署于不同的设备,可以通过设备间的有限或无线功能进行通信。The server involved in this application can be located in the cloud or locally. It can be a physical device or a virtual device, such as a virtual machine, a container, etc., and has a wireless communication function. The wireless communication function can be set on the chip (system) of the server or Other parts or components. It can refer to a device with a wireless connection function. The wireless connection function means that it can connect to other servers or terminal devices through wireless connection methods such as Wi-Fi and Bluetooth. The server of this application can also have the function of wired connection for communication. The processor and video analysis card in the embodiment of the present application can also be deployed on different devices, and can communicate through limited or wireless functions between devices.
在一种可能的实现方式中,本申请实施例的视频解析方法也可通过软件开发工具(software development kit,SDK)实现。In a possible implementation manner, the video analysis method in the embodiment of the present application can also be implemented through a software development kit (SDK).
以下通过图2-图9,对本申请实施例的视频解析方法进行详细的介绍。The following is a detailed introduction to the video analysis method according to the embodiment of the present application through Figures 2 to 9.
图2示出根据本申请一实施例的视频解析方法的流程图。该方法可用于上述视频解析系统100中,如图2所示,该方法包括:Figure 2 shows a flow chart of a video parsing method according to an embodiment of the present application. This method can be used in the above-mentioned video analysis system 100. As shown in Figure 2, the method includes:
步骤S201,处理器获取视频数据。Step S201: The processor obtains video data.
其中,处理器例如是图1中的处理器110,视频数据(即视频码流)可以是由摄像头(如图1中摄像头201-202)拍摄的,处理器可以通过视频传输协议获取摄像头的视频数据,该视频传输协议可以是实时串流协议(real time streaming protocol,RTSP)等。The processor is, for example, the processor 110 in Figure 1. The video data (i.e., the video stream) can be captured by a camera (such as the cameras 201-202 in Figure 1), and the processor can obtain the video of the camera through a video transmission protocol. Data, the video transmission protocol can be a real-time streaming protocol (real time streaming protocol, RTSP), etc.
对于某一视频解析业务,可以将其分解为一个或多个部分,每个部分可封装为相应的业务插件(plugin),每个业务插件可以表示在业务层面的抽象,每个业务插件还可实例化为一个或多个对象,由处理器部署在不同的视频解析卡上,视频解析卡例如是图1中的视频解析卡121-123。以信息结构化的业务场景为例,其业务流程可包含数据解码、数据预处理、模型推理,则可以将数据解码的过程抽象化为一个业务插件,将数据预处理、模型推理的过程抽象为另一个业务插件。For a certain video analysis business, it can be decomposed into one or more parts. Each part can be encapsulated into a corresponding business plug-in. Each business plug-in can represent an abstraction at the business level. Each business plug-in can also Instantiated into one or more objects, deployed by the processor on different video parsing cards, the video parsing cards are, for example, the video parsing cards 121-123 in Figure 1. Taking the information structured business scenario as an example, the business process can include data decoding, data preprocessing, and model reasoning. The process of data decoding can be abstracted into a business plug-in, and the process of data preprocessing and model reasoning can be abstracted into Another business plugin.
参见图3,示出根据本申请一实施例的视频解析卡对视频数据进行处理的示意图。如图3所示,视频解析卡121和视频解析卡123可部署有若干业务插件实例,如图中业务插件实例1、业务插件实例2和业务插件实例3,这些业务插件实例可以由不同的业务插件实例化形成,对应于不同的业务抽象,视频解析卡121上的业务插件实例1和视频解析卡123上的业务插件实例1例如可表示同一业务插件在不同视频解析卡上的实例化后的对象。Referring to Figure 3, a schematic diagram showing video data processing by a video analysis card according to an embodiment of the present application is shown. As shown in Figure 3, the video analysis card 121 and the video analysis card 123 can be deployed with several service plug-in instances, such as service plug-in instance 1, service plug-in instance 2 and service plug-in instance 3 in the figure. These service plug-in instances can be composed of different services. Plug-in instantiation is formed, corresponding to different business abstractions. The business plug-in instance 1 on the video analysis card 121 and the business plug-in instance 1 on the video analysis card 123 can, for example, represent the same business plug-in after instantiation on different video analysis cards. object.
而视频解析卡上不同的硬件功能单元可以实现为不同的执行引擎,举例来说,这些执行引擎可以包括解码引擎、直接记忆体存取(direct memory access,DMA)引擎、缩放引擎、推理引擎。其中解码引擎可用于对视频数据进行解码、DMA引擎可用于访问存储设备、缩放引擎可用于对视频数据进行数据预处理,例如对数据的尺寸进行调整、推理引擎可用于通过模型对数据进行推理分析,以得到视频解析结果。Different hardware functional units on the video analysis card can be implemented as different execution engines. For example, these execution engines can include decoding engines, direct memory access (DMA) engines, scaling engines, and inference engines. The decoding engine can be used to decode video data, the DMA engine can be used to access storage devices, the scaling engine can be used to perform data preprocessing on video data, such as adjusting the size of the data, and the inference engine can be used to perform inference analysis on the data through models. , to obtain the video analysis results.
通过视频解析卡上部署的业务插件实例,可以根据功能需求调用相应的一个或多个执行引擎对视频数据进行处理,如图3所示,对于视频解析卡121和视频解析卡123而言,业务插件实例1可用于调用解码引擎,业务插件实例2可用于调用缩放引擎和推理引擎,业务插件实例3可用于调用解码引擎。由此可以实现业务插件实例与底层执行引擎的分离。在视频解析的过程中,通过按序执行相应的业务插件实例,由业务插件实例调用相应的执行引擎,执行引擎即可利用硬件资源实现对视频数据的解析。Through the business plug-in instance deployed on the video analysis card, the corresponding one or more execution engines can be called to process the video data according to the functional requirements. As shown in Figure 3, for the video analysis card 121 and the video analysis card 123, the business Plug-in instance 1 can be used to call the decoding engine, business plug-in instance 2 can be used to call the scaling engine and inference engine, and business plug-in instance 3 can be used to call the decoding engine. This enables the separation of business plug-in instances and underlying execution engines. During the video parsing process, the corresponding business plug-in instances are executed in sequence, and the business plug-in instances call the corresponding execution engines. The execution engines can use hardware resources to parse the video data.
在此过程中,为了充分利用硬件资源,提高视频数据的处理效率,在存在视频解析的需求时,处理器可以为相应的视频数据生成最优的插件实例调用顺序。以下对该过程进行详细介绍。In this process, in order to make full use of hardware resources and improve the processing efficiency of video data, when there is a need for video analysis, the processor can generate the optimal plug-in instance calling sequence for the corresponding video data. This process is described in detail below.
步骤S202,处理器获取一个或多个视频解析卡的执行引擎状态信息。 Step S202: The processor obtains execution engine status information of one or more video analysis cards.
其中,处理器可以每隔预定时间(如每隔1秒)或者在接收到视频数据时,获取各个视频解析卡的执行引擎状态信息。Wherein, the processor can obtain the execution engine status information of each video analysis card every predetermined time (such as every 1 second) or when receiving video data.
可选地,该执行引擎状态信息可包括一个或多个视频解析卡的一个或多个执行引擎的资源空闲状态。执行引擎的资源空闲状态例如可包括视频解析卡上每个执行引擎对应的资源使用率,例如为50%可以表示该执行引擎还有一半的硬件资源可供使用。Optionally, the execution engine status information may include resource idle status of one or more execution engines of one or more video analysis cards. The resource idle status of the execution engine may include, for example, the resource usage corresponding to each execution engine on the video analysis card. For example, 50% may indicate that half of the hardware resources of the execution engine are available for use.
步骤S203,处理器根据视频数据和执行引擎状态信息,生成数据流信息。Step S203: The processor generates data flow information based on the video data and execution engine status information.
其中,数据流信息可包括插件实例的调用顺序和视频数据。The data flow information may include the calling sequence and video data of the plug-in instance.
插件实例的调用顺序可以是指对应数据流经过的业务插件实例的顺序。如图3所示,数据流1和数据流2可以分别对应不同的视频数据,数据流1和数据流2可以分别流经不同的业务插件实例,以完成对数据的解析。The calling order of plug-in instances may refer to the order of business plug-in instances that the corresponding data flow passes through. As shown in Figure 3, data flow 1 and data flow 2 can respectively correspond to different video data, and data flow 1 and data flow 2 can flow through different business plug-in instances respectively to complete the analysis of the data.
如图,在一个示例中,经过处理器搜索最优编排策略后得到的数据流1对应的插件实例的调用顺序为:视频解析卡121中的业务插件实例1、视频解析卡121中的业务插件实例2;得到的数据流2对应的插件实例的调用顺序为:视频解析卡121中的业务插件实例3、视频解析卡123中的业务插件实例2。则对于数据流1,视频解析卡121中的业务插件实例1可在调用解码引擎对其进行处理后,再由视频解析卡121中的业务插件实例2分别调用缩放引擎和推理引擎对其进行处理;对于数据流2,视频解析卡121中的业务插件实例3可在调用解码引擎对其进行处理后,再由视频解析卡123中的业务插件实例2分别调用缩放引擎和推理引擎对其进行处理。最终可分别得到数据流1和数据流2对应的视频解析结果。As shown in the figure, in one example, the calling sequence of the plug-in instances corresponding to data stream 1 obtained after the processor searches for the optimal orchestration strategy is: business plug-in instance 1 in the video analysis card 121, business plug-in in the video analysis card 121 Example 2: The calling sequence of the plug-in instances corresponding to the obtained data stream 2 is: business plug-in instance 3 in the video analysis card 121, and business plug-in instance 2 in the video analysis card 123. Then for data flow 1, the business plug-in instance 1 in the video analysis card 121 can call the decoding engine to process it, and then the business plug-in instance 2 in the video analysis card 121 calls the scaling engine and the inference engine to process it respectively. ; For data flow 2, the business plug-in instance 3 in the video analysis card 121 can call the decoding engine to process it, and then the business plug-in instance 2 in the video analysis card 123 calls the scaling engine and the inference engine to process it respectively. . Finally, the video analysis results corresponding to data stream 1 and data stream 2 can be obtained respectively.
以下对处理器搜索最优编排策略,以得到数据流信息中的插件实例的调用顺序的过程进行详细介绍。The following is a detailed introduction to the process of the processor searching for the optimal orchestration strategy to obtain the calling sequence of plug-in instances in the data flow information.
图4示出根据本申请一实施例的视频解析方法的流程图。如图4所示,可选地,该步骤S203,可包括:Figure 4 shows a flow chart of a video parsing method according to an embodiment of the present application. As shown in Figure 4, optionally, step S203 may include:
步骤S401,处理器根据视频数据的业务类型信息,确定业务类型对应的一个或多个插件。Step S401: The processor determines one or more plug-ins corresponding to the service type based on the service type information of the video data.
其中,该插件可在视频解析卡上实例化为对应的一个或多个插件实例。将各插件(即图3中业务插件)实例化为插件实例(如图3中业务插件实例)的过程可参见上述步骤S201中的相关叙述。The plug-in can be instantiated on the video parsing card as one or more corresponding plug-in instances. The process of instantiating each plug-in (ie, the business plug-in in Figure 3) into a plug-in instance (the business plug-in instance in Figure 3) can be referred to the relevant description in step S201 above.
其中,可以根据视频数据的业务类型,确定该业务流程下要利用的插件。例如,对于信息结构化的业务场景,在将数据解码的过程抽象化为一个业务插件,将数据预处理、模型推理的过程抽象为另一个业务插件的情况下,该视频数据涉及的插件可包括该数据解码的过程抽象化的业务插件(可称为插件1),以及该数据预处理、模型推理的过程抽象为的业务插件(可称为插件2)。Among them, the plug-in to be used in the business process can be determined according to the business type of the video data. For example, for information-structured business scenarios, when the process of data decoding is abstracted into a business plug-in, and the process of data preprocessing and model reasoning is abstracted into another business plug-in, the plug-ins involved in the video data may include The process of data decoding is abstracted into a business plug-in (which can be called plug-in 1), and the process of data preprocessing and model reasoning is abstracted into a business plug-in (which can be called plug-in 2).
步骤S402,处理器根据一个或多个插件对应的执行引擎的资源消耗信息和执行引擎的资源空闲状态,确定数据流信息中插件实例的调用顺序。Step S402: The processor determines the calling sequence of plug-in instances in the data flow information based on the resource consumption information of the execution engine corresponding to one or more plug-ins and the resource idle status of the execution engine.
其中,可以根据上述确定的插件,以确定相应插件在不同视频解析卡上实例化为的插件实例。例如,对于信息结构化的业务场景,在图3中,插件1对应的插件实例可以包括视频解析卡121上的业务插件实例1和视频解析卡123上的业务插件实例1;插件2对应的插件实例可以包括视频解析卡121上的业务插件实例2和视频解析卡123上的业务插件实例2。可以根据各插件对应的执行引擎的资源消耗信息和各插件实例对应的执行引擎的资源空闲状态,确定数据流可行的插件实例调用顺序,在可行的插件实例调用顺序中,选择最优的顺序 作为最终确定的插件实例的调用顺序,该过程可参见下述。Among them, the plug-in instances that the corresponding plug-in is instantiated on different video parsing cards can be determined based on the plug-ins determined above. For example, for a business scenario with structured information, in Figure 3, the plug-in instance corresponding to plug-in 1 may include the business plug-in instance 1 on the video analysis card 121 and the business plug-in instance 1 on the video analysis card 123; the plug-in corresponding to plug-in 2 Instances may include the service plug-in instance 2 on the video analysis card 121 and the service plug-in instance 2 on the video analysis card 123 . Based on the resource consumption information of the execution engine corresponding to each plug-in and the resource idle status of the execution engine corresponding to each plug-in instance, the feasible plug-in instance calling sequence for the data flow can be determined, and the optimal sequence can be selected among the feasible plug-in instance calling sequences. As the final calling sequence of plug-in instances, the process can be seen as follows.
根据本申请实施例,通过根据满足业务需求的插件对应的执行引擎的资源消耗信息和执行引擎的资源空闲状态,来确定视频数据对应的插件实例的调用顺序,可以实现利用处理器对视频的解析流程进行动态的调度,以满足不同业务类型的需要,且在视频解析过程中可以充分利用底层硬件资源,实现硬件资源利用率的最大化,提高了视频解析效率。According to the embodiment of the present application, by determining the calling sequence of plug-in instances corresponding to video data based on the resource consumption information of the execution engine corresponding to the plug-in that meets the business requirements and the resource idle state of the execution engine, the video analysis by the processor can be realized The process is dynamically scheduled to meet the needs of different business types, and the underlying hardware resources can be fully utilized during the video analysis process to maximize the utilization of hardware resources and improve the efficiency of video analysis.
可选地,该步骤S402可包括:Optionally, this step S402 may include:
步骤S4021,处理器根据一个或多个插件对应的执行引擎的资源消耗信息和执行引擎的资源空闲状态,确定候选的调用顺序。Step S4021: The processor determines the candidate calling sequence based on the resource consumption information of the execution engine corresponding to one or more plug-ins and the resource idle status of the execution engine.
其中,插件对应的执行引擎的资源消耗信息可以表示执行引擎需要消耗多少资源,可以预先通过测试得到。Among them, the resource consumption information of the execution engine corresponding to the plug-in can indicate how much resources the execution engine needs to consume, which can be obtained through testing in advance.
参见图5,示出根据本申请一实施例的执行引擎的资源消耗信息的示意图。以人脸识别的业务为例,如图5所示,对于视频显示格式为1080p(即分辨率为1920*1080)的视频数据,例如需要经过1次插件实例1(对应于插件1)调用解码引擎、1次插件实例2(对应于插件2)调用缩放引擎、1次插件实例2(对应于插件2)调用推理引擎,则经过预先测试得到的插件资源信息可参见图5右侧的引擎资源消耗表所示。业务流类型中“人脸识别@1080p”可以表示业务类型为对1080p格式的视频数据进行人脸识别,“人脸识别@720p”可以表示业务类型为对720p格式的视频数据进行人脸识别。I/O(input/output)数据量为“x1”可以表示视频数据输入/输出的次数为1,即对应的数据量为1倍;数据量为“x2”可以表示视频数据输入/输出的次数为2,即对应的数据量为2倍。占用比为“x1%”可以表示插件调用引擎对视频数据处理时占用的资源为该引擎对应的硬件总资源的1%;占用比为“x2%”可以表示插件调用引擎对视频数据处理时占用的资源为该引擎对应的硬件总资源的2%;占用比为“x3%”可以表示插件调用引擎对视频数据处理时占用的资源为该引擎对应的硬件总资源的3%。Referring to FIG. 5 , a schematic diagram showing resource consumption information of an execution engine according to an embodiment of the present application is shown. Taking the face recognition business as an example, as shown in Figure 5, for video data with a video display format of 1080p (that is, a resolution of 1920*1080), for example, it needs to be decoded once by plug-in instance 1 (corresponding to plug-in 1). engine, once plug-in instance 2 (corresponding to plug-in 2) calls the scaling engine, and once plug-in instance 2 (corresponds to plug-in 2) calls the inference engine, the plug-in resource information obtained after pre-testing can be seen in the engine resources on the right side of Figure 5 Consumption table shown. In the business flow type, "face recognition@1080p" can indicate that the business type is face recognition of video data in 1080p format, and "face recognition@720p" can indicate that the business type is face recognition of video data in 720p format. The I/O (input/output) data amount is "x1", which means that the number of video data input/output times is 1, that is, the corresponding data amount is 1 times; the data amount is "x2", which means the number of video data input/output times. is 2, that is, the corresponding data amount is 2 times. An occupancy ratio of "x1%" can mean that the resources occupied by the plug-in calling engine for processing video data are 1% of the total hardware resources corresponding to the engine; an occupancy ratio of "x2%" can mean that the resources occupied by the plug-in calling engine for processing video data The resources are 2% of the total hardware resources corresponding to the engine; the occupation ratio is "x3%" which means that when the plug-in calls the engine to process video data, the resources occupied by the engine are 3% of the total hardware resources corresponding to the engine.
可以根据表中各插件实例对应的引擎的资源占用比、以及各插件实例对应的执行引擎的资源空闲状态,来确定候选的调用顺序。例如,对应引擎1,若处理器得到在视频解析卡121中插件实例1对应的引擎1当前的资源使用率为95%,而根据表中引擎的资源占用比确定若使用插件实例调用该引擎,将占用1%的资源,可知,若利用插件实例调用引擎1对视频数据进行处理,处理过程中资源使用率可以变为96%,若此时的资源使用率不超过预定最大阈值(例如是98%),则可以使用视频解析卡121上的插件实例1。参见上述方法,可以得到所有可用的插件实例,通过对各个视频解析卡上可用的插件实例进行排列组合,可以得到插件实例的候选的调用顺序。The candidate calling sequence can be determined based on the resource occupancy ratio of the engine corresponding to each plug-in instance in the table and the resource idle status of the execution engine corresponding to each plug-in instance. For example, corresponding to engine 1, if the processor obtains the current resource usage rate of engine 1 corresponding to plug-in instance 1 in the video analysis card 121, which is 95%, and determines according to the resource usage ratio of the engine in the table, if the plug-in instance is used to call the engine, It will occupy 1% of the resources. It can be seen that if the plug-in instance is used to call engine 1 to process the video data, the resource usage during the processing can become 96%. If the resource usage at this time does not exceed the predetermined maximum threshold (for example, 98 %), you can use the plug-in instance 1 on the video parsing card 121. Referring to the above method, all available plug-in instances can be obtained. By arranging and combining the plug-in instances available on each video analysis card, the candidate calling sequence of the plug-in instances can be obtained.
步骤S4022,处理器在候选的调用顺序的数量为多个的情况下,确定候选的调用顺序中插件实例跨视频解析卡进行交互的数据量最小的一个候选的调用顺序为插件实例的调用顺序。Step S4022: When the number of candidate calling sequences is multiple, the processor determines that the candidate calling sequence with the smallest amount of data for the plug-in instance to interact across the video analysis card among the candidate calling sequences is the calling sequence of the plug-in instance.
也就是说,在步骤S4021中,若处理器确定的候选的调用顺序为多条的情况下,可以在多条候选的调用顺序中,选择其中一条最优的调用顺序作为最终的调用顺序。最优的调用顺序可以根据上下游插件实例之间跨视频解析卡进行交互的数据量确定,可以以跨视频解析卡进行交互的数据量最小对应的调用顺序作为最优的调用顺序。上下游插件实例之间跨视频解析卡进行交互的数据量,可以通过计算数据跨视频解析卡进行交互的总代价来确定。That is to say, in step S4021, if there are multiple candidate calling sequences determined by the processor, one of the optimal calling sequences may be selected as the final calling sequence among the multiple candidate calling sequences. The optimal calling order can be determined based on the amount of data interacted across video parsing cards between upstream and downstream plug-in instances. The optimal calling order can be the calling order corresponding to the smallest amount of data interacted across video parsing cards. The amount of data exchanged across video parsing cards between upstream and downstream plug-in instances can be determined by calculating the total cost of data interaction across video parsing cards.
图6示出根据本申请一实施例的计算数据跨视频解析卡进行交互的代价的示意图。如图6所示,以视频解析卡121-123为例,3张视频解析卡中分别都包括插件实例1、插件实例2 和插件实例3,其中插件实例1可以表示插件1实例化后的对象,插件实例2可以表示插件2实例化后的对象,插件实例3可以表示插件3实例化后的对象。视频解析卡内部交互一次数据的代价可记为0,在视频解析卡121与视频解析卡122交互一次数据的代价(cost)记为15,视频解析卡121与视频解析卡123交互一次数据的代价记为10,视频解析卡122与视频解析卡123交互一次数据的代价记为7.5的情况下,由此可以计算得到解析数据流的过程中的总代价。例如对于图中的4条候选的调用顺序,第1条候选的调用顺序(如图中候选项1)对应的总代价为0,第2条候选的调用顺序(如图中候选项2)对应的总代价为10,第3条候选的调用顺序(如图中候选项3)对应的总代价为15,第4条候选的调用顺序(如图中候选项4)对应的总代价为15。因此,可以选择总代价最小的一项,即候选项1对应的调用顺序作为最终确定最优的调用顺序。FIG. 6 shows a schematic diagram of calculating the cost of data interaction across video analysis cards according to an embodiment of the present application. As shown in Figure 6, taking video analysis cards 121-123 as an example, the three video analysis cards include plug-in instance 1 and plug-in instance 2 respectively. and plug-in instance 3, where plug-in instance 1 can represent the object instantiated by plug-in 1, plug-in instance 2 can represent the object instantiated by plug-in 2, and plug-in instance 3 can represent the object instantiated by plug-in 3. The cost of one data exchange within the video analysis card can be recorded as 0, the cost of one data exchange between the video analysis card 121 and the video analysis card 122 is recorded as 15, and the cost of one data exchange between the video analysis card 121 and the video analysis card 123 It is recorded as 10, and the cost of one data interaction between the video analysis card 122 and the video analysis card 123 is recorded as 7.5. From this, the total cost in the process of analyzing the data stream can be calculated. For example, for the four candidate calling sequences in the figure, the total cost corresponding to the calling sequence of the first candidate (candidate 1 in the figure) is 0, and the calling sequence of the second candidate (candidate 2 in the figure) corresponds to The total cost is 10, the total cost corresponding to the third candidate's calling sequence (candidate 3 in the figure) is 15, and the total cost corresponding to the fourth candidate's calling sequence (candidate 4 in the figure) is 15. Therefore, the item with the smallest total cost, that is, the calling sequence corresponding to candidate 1, can be selected as the final optimal calling sequence.
可选地,若存在多条总代价最小且值一致的候选的调用顺序,可以随机选择其中一条作为最终确定的调用顺序。图6中所示的计算方式仅作为一个示例。Optionally, if there are multiple candidate calling sequences with the smallest total cost and consistent values, one of them can be randomly selected as the final calling sequence. The calculation shown in Figure 6 is only an example.
根据本申请实施例,通过处理器根据插件对应的执行引擎的资源消耗信息和当前的执行引擎的资源空闲状态,确定候选的调用顺序,并在存在多条候选的调用顺序中,以跨视频解析卡交互的数据量最小的候选的调用顺序作为最终确定的调用顺序,可以通过动态调度提高底层硬件资源的利用率,且可以减少视频解析过程中的数据传输代价,总体提高了数据解析的效率。According to the embodiment of the present application, the processor determines the candidate calling sequence according to the resource consumption information of the execution engine corresponding to the plug-in and the current resource idle state of the execution engine, and when there are multiple candidate calling sequences, performs cross-video analysis The calling order of the candidate with the smallest amount of card interaction data is used as the final calling order, which can improve the utilization of underlying hardware resources through dynamic scheduling, reduce the data transmission cost in the video parsing process, and overall improve the efficiency of data parsing.
可选地,如果存在突发的视频解析需求时,按当前部署的插件实例调用执行引擎可能无法满足视频解析的需求,因此,可以通过部署新的插件实例以对解析路径进行动态扩容,满足动态解析的需求。在此情况下,该步骤S402还可包括:Optionally, if there is a sudden demand for video parsing, calling the execution engine according to the currently deployed plug-in instance may not be able to meet the demand for video parsing. Therefore, you can deploy a new plug-in instance to dynamically expand the parsing path to meet the dynamic needs. Analytical requirements. In this case, step S402 may also include:
步骤S4023,处理器在候选的调用顺序的数量为零的情况下,根据执行引擎的资源空闲状态,在视频解析卡上部署新的插件实例。Step S4023: When the number of candidate calling sequences is zero, the processor deploys a new plug-in instance on the video analysis card according to the resource idle state of the execution engine.
也就是说,在步骤S4021中,若处理器确定的候选的调用顺序为零的情况下,可以表示当前不存在可行的调用顺序,则可以根据处理器获得的执行引擎的资源空闲状态,确定可用的执行引擎,例如,可以寻找当前的资源利用率符合要求(例如资源利用率与对应插件实例的占用比之和小于100%)的执行引擎,并在该执行引擎对应的视频解析卡中部署相应的新的插件实例。从而可以使得该新的插件实例能够调用该执行引擎实现相应的功能。That is to say, in step S4021, if the candidate calling sequence determined by the processor is zero, it can mean that there is currently no feasible calling sequence, and the available calling sequence can be determined based on the resource idle status of the execution engine obtained by the processor. For example, you can find an execution engine whose current resource utilization meets the requirements (for example, the sum of resource utilization and the occupancy ratio of the corresponding plug-in instance is less than 100%), and deploy the corresponding execution engine in the video parsing card corresponding to the execution engine. new plugin instance. This enables the new plug-in instance to call the execution engine to implement corresponding functions.
步骤S4024,处理器根据执行引擎的资源空闲状态和新的插件实例,确定插件实例的调用顺序。Step S4024: The processor determines the calling sequence of plug-in instances based on the resource idle status of the execution engine and the new plug-in instance.
在部署了新的插件实例之后,可以在插件实例的调用顺序中,加入该新部署的插件实例,使得存在可行的调用顺序,从而视频解析卡可以据此进行视频解析。After a new plug-in instance is deployed, the newly deployed plug-in instance can be added to the calling sequence of the plug-in instance so that there is a feasible calling sequence, so that the video analysis card can perform video analysis accordingly.
根据本申请实施例,通过处理器根据插件对应的执行引擎的资源消耗信息和当前的执行引擎的资源空闲状态,确定候选的调用顺序,并在不存在可行的调用顺序时,通过部署新的插件实例以对调用路径进行动态扩容,从而可以满足动态解析的需求,提高视频解析的实时性。According to the embodiment of the present application, the processor determines the candidate calling sequence according to the resource consumption information of the execution engine corresponding to the plug-in and the resource idle status of the current execution engine, and when there is no feasible calling sequence, by deploying a new plug-in The instance can dynamically expand the calling path to meet the needs of dynamic analysis and improve the real-time performance of video analysis.
步骤S204,处理器根据插件实例的调用顺序,将数据流信息发送至视频解析卡。Step S204: The processor sends the data flow information to the video analysis card according to the calling sequence of the plug-in instance.
其中,处理器可以通过硬件总线将数据流信息发送至视频解析卡,该硬件总线例如可以是外部设备互连总线接口(peripheral component interconnect express,PCIe)等。Among them, the processor can send the data stream information to the video analysis card through a hardware bus. The hardware bus can be, for example, a peripheral component interconnect express (PCIe) or the like.
以图3为例,对于数据流1,其对应的插件实例的调用顺序为:视频解析卡121中的业 务插件实例1、视频解析卡121中的业务插件实例2。因此,可以首先将数据流信息发送至视频解析卡121中的业务插件实例1进行处理。Taking Figure 3 as an example, for data flow 1, the calling sequence of the corresponding plug-in instance is: the business in the video analysis card 121 Service plug-in instance 1, service plug-in instance 2 in the video analysis card 121. Therefore, the data flow information can be first sent to the service plug-in instance 1 in the video analysis card 121 for processing.
步骤S205,视频解析卡获取处理器根据插件实例的调用顺序发送的数据流信息。Step S205: The video analysis card obtains the data flow information sent by the processor according to the calling sequence of the plug-in instance.
其中,视频解析卡可以通过硬件总线(如PCIe总线)获取处理器发送的数据流信息。Among them, the video analysis card can obtain the data flow information sent by the processor through the hardware bus (such as PCIe bus).
步骤S206,视频解析卡根据插件实例的调用顺序,通过插件实例调用相应的执行引擎对视频数据进行处理,得到视频解析结果。Step S206: The video analysis card calls the corresponding execution engine through the plug-in instance to process the video data according to the calling sequence of the plug-in instance, and obtains the video analysis result.
以图3为例,对于数据流2,其对应的插件实例的调用顺序为:视频解析卡121中的业务插件实例3、视频解析卡123中的业务插件实例2。根据该调用顺序,可以由视频解析卡121中的业务插件实例3可调用解码引擎对视频数据进行处理,再将处理后的数据发送至视频解析卡123,由视频解析卡123中的业务插件实例2分别调用缩放引擎和推理引擎对其进行处理。最终得到数据流2对应的视频解析结果。详细过程可参见下述。Taking Figure 3 as an example, for data flow 2, the calling sequence of the corresponding plug-in instances is: business plug-in instance 3 in the video analysis card 121, and service plug-in instance 2 in the video analysis card 123. According to the calling sequence, the decoding engine can be called by the business plug-in instance 3 in the video analysis card 121 to process the video data, and then the processed data is sent to the video analysis card 123. The business plug-in instance in the video analysis card 123 2 Call the scaling engine and inference engine respectively to process it. Finally, the video analysis result corresponding to data stream 2 is obtained. The detailed process can be found below.
根据本申请实施例,通过处理器在视频解析卡上部署插件实例,并通过插件实例调用底层的执行引擎,可以实现插件实例和底层执行引擎的分离,针对于不同视频数据解析的需求,可以灵活的调用不同视频解析卡上的插件实例以实现对视频的解析,以得到视频解析的结果。同时,通过获取各视频解析卡的执行引擎状态信息,以生成相应的数据流信息,确定解析视频时插件实例的调用顺序,可以提高各视频解析卡上的硬件资源的利用率,灵活、充分地利用不同视频解析卡上的硬件资源,提高了视频解析的效率。According to the embodiments of this application, the processor deploys a plug-in instance on the video parsing card, and calls the underlying execution engine through the plug-in instance. This can realize the separation of the plug-in instance and the underlying execution engine, and can flexibly meet the needs of different video data analysis. Call plug-in instances on different video parsing cards to parse the video and obtain the results of the video parsing. At the same time, by obtaining the execution engine status information of each video analysis card to generate corresponding data flow information and determine the calling order of plug-in instances when parsing videos, the utilization of hardware resources on each video analysis card can be improved, and the system can flexibly and fully Utilizing hardware resources on different video analysis cards improves the efficiency of video analysis.
图7示出根据本申请一实施例的视频解析方法的流程图。如图7所示,该步骤S206,可包括:Figure 7 shows a flow chart of a video parsing method according to an embodiment of the present application. As shown in Figure 7, this step S206 may include:
步骤S2061,视频解析卡根据数据流信息,确定第一插件实例对应的数据输入队列。Step S2061: The video analysis card determines the data input queue corresponding to the first plug-in instance based on the data flow information.
其中,第一插件实例为插件实例的调用顺序中的第一个插件实例。数据输入队列(input queue)中的每一项数据可以对应于一条数据流。Wherein, the first plug-in instance is the first plug-in instance in the calling sequence of the plug-in instances. Each item of data in the data input queue can correspond to a data stream.
步骤S2062,视频解析卡通过第一插件实例,调用相应的执行引擎对数据输入队列进行处理,得到数据输出队列。Step S2062: The video analysis card calls the corresponding execution engine to process the data input queue through the first plug-in instance to obtain the data output queue.
该队列可以采用先入先出(first in first out,FIFO)的方式工作,即第一插件实例可以优先处理先入队列的数据流。The queue can work in a first-in-first-out (FIFO) manner, that is, the first plug-in instance can prioritize the data stream that enters the queue first.
可选地,数据输入队列中的每一项数据可以包括队列标识、时间戳、优先级信息、实际有效数据(即视频数据)。该步骤S2062,可包括:Optionally, each item of data in the data input queue may include queue identification, timestamp, priority information, and actual valid data (ie, video data). This step S2062 may include:
视频解析卡根据优先级信息,通过第一插件实例,调用相应的执行引擎对所述数据输入队列中的一项或多项数据进行处理,得到数据输出队列。According to the priority information, the video analysis card calls the corresponding execution engine to process one or more data in the data input queue through the first plug-in instance to obtain the data output queue.
其中,优先级信息可以表示对应项数据的紧急程度,例如,优先级信息中优先级的值越大,可以指示对应项数据的紧急程度越高。从而,第一插件实例在对每项数据进行处理的过程中,可以在FIFO的基础上,优先处理对应优先级程度更高的数据流。The priority information may indicate the urgency of the corresponding data. For example, the larger the priority value in the priority information, the higher the urgency of the corresponding data. Therefore, when processing each piece of data, the first plug-in instance can prioritize the data stream corresponding to a higher priority on the basis of FIFO.
根据本申请实施例,通过在插件实例对应的数据输入队列中引入优先级信息,可以满足存在紧急业务的情况下视频解析的需要,在存在紧急业务的情况下可以使插件实例优先处理相应的视频数据,保证视频解析的实时性。According to the embodiments of the present application, by introducing priority information into the data input queue corresponding to the plug-in instance, the need for video analysis in the presence of emergency services can be met, and the plug-in instance can be prioritized to process the corresponding video in the presence of emergency services. data to ensure real-time video analysis.
在第一插件实例对数据输入队列进行处理的过程中,可以调用相应的执行引擎实现对数据的处理,可选地,该步骤S2062,可包括:When the first plug-in instance processes the data input queue, the corresponding execution engine can be called to process the data. Optionally, step S2062 can include:
视频解析卡通过所述第一插件实例,调用相应的执行引擎对应的线程池中的线程,对数 据输入队列中的一项或多项数据进行处理,得到数据输出队列。The video analysis card calls the thread in the thread pool corresponding to the corresponding execution engine through the first plug-in instance, logarithmically Process one or more data items in the input queue to obtain a data output queue.
图8示出根据本申请一实施例的调用执行引擎对视频数据进行处理的示意图。如图8所示,在调用执行引擎时,可以根据数据输入队列生成优先队列(priority queue),优先队列中的每一项数据可以包含要处理的数据(即视频数据)以及处理视频数据的方式(如处理函数),例如,对于推理引擎,处理视频数据的方式可以是所用到的推理模型。Figure 8 shows a schematic diagram of calling an execution engine to process video data according to an embodiment of the present application. As shown in Figure 8, when calling the execution engine, a priority queue can be generated based on the data input queue. Each item of data in the priority queue can include the data to be processed (i.e., video data) and the method of processing the video data. (such as processing function), for example, for an inference engine, the way to process video data can be the inference model used.
如图8所示,可以执行引擎对优先队列中的每一项数据进行处理时,可以采用线程池的方式,线程池中的各个线程可以是对底层硬件资源划分后得到的。其中,线程池中并发的最大线程数量可根据硬件资源的大小决定,硬件资源越大,线程池中可并发执行的线程数量可以越大。线程池中的线程可以通过底层驱动接口,调用底层硬件功能模块中的硬件资源进行计算。As shown in Figure 8, when the execution engine processes each item of data in the priority queue, it can use a thread pool. Each thread in the thread pool can be obtained by dividing the underlying hardware resources. Among them, the maximum number of concurrent threads in the thread pool can be determined according to the size of the hardware resources. The larger the hardware resources, the larger the number of threads that can be executed concurrently in the thread pool. Threads in the thread pool can call hardware resources in the underlying hardware function modules for calculation through the underlying driver interface.
根据本申请实施例,视频解析卡通过在调用执行引擎时,通过执行引擎中的线程池中的线程,对数据输入队列中的一项或多项数据进行处理,可以在执行引擎中实现多项数据解析任务的并发处理,提高处理效率,且通过线程池可以充分地利用底层硬件资源,提高硬件资源的利用率。According to the embodiment of the present application, the video analysis card can process one or more data items in the data input queue through threads in the thread pool in the execution engine when calling the execution engine, and can implement multiple items in the execution engine. Concurrent processing of data parsing tasks improves processing efficiency, and the underlying hardware resources can be fully utilized through the thread pool to improve the utilization of hardware resources.
步骤S2063,视频解析卡以第一插件实例之后的第二插件实例作为新的第一插件实例,根据数据输出队列确定新的数据输入队列,重复执行视频解析卡通过第一插件实例调用相应的执行引擎,对数据输入队列进行处理,得到数据输出队列及之后的步骤,直至第二插件实例为插件实例的调用顺序中的最后一个插件实例,得到视频解析结果。Step S2063: The video parsing card uses the second plug-in instance after the first plug-in instance as the new first plug-in instance, determines a new data input queue according to the data output queue, and repeatedly executes the video parsing card to call the corresponding execution through the first plug-in instance. The engine processes the data input queue to obtain the data output queue and subsequent steps until the second plug-in instance is the last plug-in instance in the calling sequence of the plug-in instance and obtains the video parsing result.
在调用执行引擎对数据进行处理后,第一插件实例可以得到输出数据队列,该输出数据队列可以包括输入数据队列对应的各处理后的数据流。根据数据输出队列确定新的数据输入队列,可以是,按照各数据流对应的插件实例的调用顺序,将输出数据队列中各处理后的数据流分别发送给相应的第二插件实例(即对应的插件实例的调用顺序中,第一插件实例的下一个插件实例),以形成第二插件实例的数据输入队列,在将第二插件实例作为新的第一插件实例后,第二插件实例的数据输入队列也即新的第一插件实例的数据输入队列。After calling the execution engine to process the data, the first plug-in instance can obtain the output data queue, and the output data queue can include each processed data stream corresponding to the input data queue. Determining the new data input queue according to the data output queue may be to send each processed data stream in the output data queue to the corresponding second plug-in instance (that is, the corresponding In the calling sequence of the plug-in instance, the next plug-in instance of the first plug-in instance) to form the data input queue of the second plug-in instance. After the second plug-in instance is used as the new first plug-in instance, the data of the second plug-in instance The input queue is also the data input queue of the new first plug-in instance.
参见图9,示出根据本申请一实施例的插件实例实现的示意图。如图9所示,上游插件实例可以表示第一插件实例,下游插件实例可以表示第二插件实例。若数据流对应的插件实例的调用顺序包括第一插件实例、第二插件实例的情况下,可以首先将根据数据流信息输入上游插件实例的数据输入队列中。在上游插件实例调用执行引擎对其进行处理后,可以将其发送给下游插件实例,可以将其输入对应的下游插件实例的数据输入队列中,得到下游插件实例的数据输入队列。在下游插件实例调用执行引擎对其进行处理后,由于该下游插件实例为数据流对应的插件实例的调用顺序中最后一个插件实例,可以得到该数据流对应的视频解析结果。Referring to Figure 9, a schematic diagram of a plug-in instance implementation according to an embodiment of the present application is shown. As shown in Figure 9, the upstream plug-in instance may represent the first plug-in instance, and the downstream plug-in instance may represent the second plug-in instance. If the calling sequence of the plug-in instances corresponding to the data flow includes the first plug-in instance and the second plug-in instance, the information according to the data flow may first be input into the data input queue of the upstream plug-in instance. After the upstream plug-in instance calls the execution engine to process it, it can be sent to the downstream plug-in instance, and it can be input into the data input queue of the corresponding downstream plug-in instance to obtain the data input queue of the downstream plug-in instance. After the downstream plug-in instance calls the execution engine to process it, since the downstream plug-in instance is the last plug-in instance in the calling sequence of the plug-in instance corresponding to the data flow, the video parsing result corresponding to the data flow can be obtained.
根据本申请实施例,通过确定插件实例对应的数据输入队列,并按照插件实例的调用顺序依次调用插件实例对数据输入队列中的各项数据进行处理,该处理过程通过插件实例调用相应的执行引擎实现,可以实现对各视频解析卡上各插件实例的统一管理,以充分地利用视频解析卡上的硬件资源,实现高效的视频解析过程。According to the embodiment of the present application, the data input queue corresponding to the plug-in instance is determined, and the plug-in instance is sequentially called according to the calling order of the plug-in instance to process each data in the data input queue. The processing process calls the corresponding execution engine through the plug-in instance. Implementation can achieve unified management of each plug-in instance on each video analysis card to fully utilize the hardware resources on the video analysis card and achieve an efficient video analysis process.
图10示出根据本申请一实施例的视频解析装置的结构图。该装置可用于上述处理器,如图10所示,该装置包括:Figure 10 shows a structural diagram of a video analysis device according to an embodiment of the present application. The device can be used for the above processor, as shown in Figure 10, the device includes:
第一获取模块1001,用于获取视频数据; The first acquisition module 1001 is used to acquire video data;
第二获取模块1002,用于获取一个或多个视频解析卡的执行引擎状态信息;The second acquisition module 1002 is used to acquire execution engine status information of one or more video analysis cards;
生成模块1003,用于根据视频数据和执行引擎状态信息,生成数据流信息,数据流信息包括插件实例的调用顺序和视频数据;The generation module 1003 is used to generate data flow information based on the video data and execution engine status information. The data flow information includes the calling sequence of the plug-in instance and the video data;
发送模块1004,用于根据插件实例的调用顺序,将数据流信息发送至视频解析卡,数据流信息用于视频解析卡根据插件实例的调用顺序,通过插件实例调用相应的执行引擎对视频数据进行处理,得到视频解析结果。The sending module 1004 is used to send the data flow information to the video analysis card according to the calling sequence of the plug-in instance. The data flow information is used by the video parsing card to call the corresponding execution engine through the plug-in instance to process the video data according to the calling sequence of the plug-in instance. Process and obtain the video analysis results.
根据本申请实施例,通过处理器在视频解析卡上部署插件实例,并通过插件实例调用底层的执行引擎,可以实现插件实例和底层执行引擎的分离,针对于不同视频数据解析的需求,可以灵活的调用不同视频解析卡上的插件实例以实现对视频的解析,以得到视频解析的结果。同时,通过获取各视频解析卡的执行引擎状态信息,以生成相应的数据流信息,确定解析视频时插件实例的调用顺序,可以提高各视频解析卡上的硬件资源的利用率,灵活、充分地利用不同视频解析卡上的硬件资源,提高了视频解析的效率。According to the embodiments of this application, the processor deploys a plug-in instance on the video parsing card, and calls the underlying execution engine through the plug-in instance. This can realize the separation of the plug-in instance and the underlying execution engine, and can flexibly meet the needs of different video data analysis. Call plug-in instances on different video parsing cards to parse the video and obtain the results of the video parsing. At the same time, by obtaining the execution engine status information of each video analysis card to generate corresponding data flow information and determine the calling order of plug-in instances when parsing videos, the utilization of hardware resources on each video analysis card can be improved, and the system can flexibly and fully Utilizing hardware resources on different video analysis cards improves the efficiency of video analysis.
可选地,执行引擎状态信息包括一个或多个视频解析卡的一个或多个执行引擎的资源空闲状态,生成模块1003,用于:Optionally, the execution engine status information includes the resource idle status of one or more execution engines of one or more video analysis cards, and the generation module 1003 is used to:
根据视频数据的业务类型信息,确定业务类型对应的一个或多个插件,插件在视频解析卡上实例化为对应的一个或多个插件实例;According to the business type information of the video data, one or more plug-ins corresponding to the business type are determined, and the plug-ins are instantiated on the video analysis card into the corresponding one or more plug-in instances;
根据一个或多个插件对应的执行引擎的资源消耗信息和执行引擎的资源空闲状态,确定数据流信息中插件实例的调用顺序。The calling sequence of plug-in instances in the data flow information is determined based on the resource consumption information of the execution engine corresponding to one or more plug-ins and the resource idle status of the execution engine.
根据本申请实施例,通过根据满足业务需求的插件对应的执行引擎的资源消耗信息和执行引擎的资源空闲状态,来确定视频数据对应的插件实例的调用顺序,可以实现利用处理器对视频的解析流程进行动态的调度,以满足不同业务类型的需要,且在视频解析过程中可以充分利用底层硬件资源,实现硬件资源利用率的最大化,提高了视频解析效率。According to the embodiment of the present application, by determining the calling sequence of plug-in instances corresponding to video data based on the resource consumption information of the execution engine corresponding to the plug-in that meets the business requirements and the resource idle state of the execution engine, the video analysis by the processor can be realized The process is dynamically scheduled to meet the needs of different business types, and the underlying hardware resources can be fully utilized during the video analysis process to maximize the utilization of hardware resources and improve the efficiency of video analysis.
可选地,根据一个或多个插件对应的执行引擎的资源消耗信息和执行引擎的资源空闲状态,确定数据流信息中插件实例的调用顺序,包括:Optionally, determine the calling sequence of plug-in instances in the data flow information based on the resource consumption information of the execution engine corresponding to one or more plug-ins and the resource idle status of the execution engine, including:
根据一个或多个插件对应的执行引擎的资源消耗信息和执行引擎的资源空闲状态,确定候选的调用顺序;Determine the candidate calling sequence based on the resource consumption information of the execution engine corresponding to one or more plug-ins and the resource idle status of the execution engine;
在候选的调用顺序的数量为多个的情况下,确定候选的调用顺序中插件实例跨视频解析卡进行交互的数据量最小的一个候选的调用顺序为插件实例的调用顺序。When the number of candidate calling sequences is multiple, the calling sequence of the candidate with the smallest amount of data that the plug-in instance interacts with across the video parsing card among the candidate calling sequences is determined to be the calling sequence of the plug-in instance.
根据本申请实施例,通过处理器根据插件对应的执行引擎的资源消耗信息和当前的执行引擎的资源空闲状态,确定候选的调用顺序,并在存在多条候选的调用顺序中,以跨视频解析卡交互的数据量最小的候选的调用顺序作为最终确定的调用顺序,可以通过动态调度提高底层硬件资源的利用率,且可以减少视频解析过程中的数据传输代价,总体提高了数据解析的效率。According to the embodiment of the present application, the processor determines the candidate calling sequence according to the resource consumption information of the execution engine corresponding to the plug-in and the current resource idle state of the execution engine, and when there are multiple candidate calling sequences, performs cross-video analysis The calling order of the candidate with the smallest amount of card interaction data is used as the final calling order, which can improve the utilization of underlying hardware resources through dynamic scheduling, reduce the data transmission cost in the video parsing process, and overall improve the efficiency of data parsing.
可选地,根据一个或多个插件对应的执行引擎的资源消耗信息和执行引擎的资源空闲状态,确定数据流信息中插件实例的调用顺序,包括:Optionally, determine the calling sequence of plug-in instances in the data flow information based on the resource consumption information of the execution engine corresponding to one or more plug-ins and the resource idle status of the execution engine, including:
根据一个或多个插件对应的执行引擎的资源消耗信息和执行引擎的资源空闲状态,确定候选的调用顺序;Determine the candidate calling sequence based on the resource consumption information of the execution engine corresponding to one or more plug-ins and the resource idle status of the execution engine;
在候选的调用顺序的数量为零的情况下,根据执行引擎的资源空闲状态,在视频解析卡上部署新的插件实例; When the number of candidate calling sequences is zero, deploy a new plug-in instance on the video parsing card according to the resource idle status of the execution engine;
根据执行引擎的资源空闲状态和新的插件实例,确定插件实例的调用顺序。Determine the calling sequence of plug-in instances based on the resource idle status of the execution engine and the new plug-in instance.
根据本申请实施例,通过处理器根据插件对应的执行引擎的资源消耗信息和当前的执行引擎的资源空闲状态,确定候选的调用顺序,并在不存在可行的调用顺序时,通过部署新的插件实例以对调用路径进行动态扩容,从而可以满足动态解析的需求,提高视频解析的实时性。According to the embodiment of the present application, the processor determines the candidate calling sequence according to the resource consumption information of the execution engine corresponding to the plug-in and the resource idle status of the current execution engine, and when there is no feasible calling sequence, by deploying a new plug-in The instance can dynamically expand the calling path to meet the needs of dynamic analysis and improve the real-time performance of video analysis.
可选地,视频解析卡根据插件实例的调用顺序,通过插件实例调用相应的执行引擎对视频数据进行处理,得到视频解析结果,包括:Optionally, the video analysis card calls the corresponding execution engine through the plug-in instance to process the video data according to the calling sequence of the plug-in instance, and obtains the video analysis results, including:
视频解析卡根据数据流信息,确定第一插件实例对应的数据输入队列,第一插件实例为插件实例的调用顺序中的第一个插件实例;The video analysis card determines the data input queue corresponding to the first plug-in instance based on the data flow information, and the first plug-in instance is the first plug-in instance in the calling sequence of the plug-in instance;
视频解析卡通过第一插件实例,调用相应的执行引擎对数据输入队列进行处理,得到数据输出队列;The video analysis card calls the corresponding execution engine to process the data input queue through the first plug-in instance to obtain the data output queue;
视频解析卡以第一插件实例之后的第二插件实例作为新的第一插件实例,根据数据输出队列确定新的数据输入队列,重复执行视频解析卡通过第一插件实例调用相应的执行引擎,对数据输入队列进行处理,得到数据输出队列及之后的步骤,直至第二插件实例为插件实例的调用顺序中的最后一个插件实例,得到视频解析结果。The video parsing card uses the second plug-in instance after the first plug-in instance as the new first plug-in instance, determines the new data input queue according to the data output queue, and repeatedly executes the video parsing card to call the corresponding execution engine through the first plug-in instance. The data input queue is processed to obtain the data output queue and subsequent steps are performed until the second plug-in instance is the last plug-in instance in the calling sequence of the plug-in instance, and the video parsing result is obtained.
根据本申请实施例,通过确定插件实例对应的数据输入队列,并按照插件实例的调用顺序依次调用插件实例对数据输入队列中的各项数据进行处理,该处理过程通过插件实例调用相应的执行引擎实现,可以实现对各视频解析卡上各插件实例的统一管理,以充分地利用视频解析卡上的硬件资源,实现高效的视频解析过程。According to the embodiment of the present application, the data input queue corresponding to the plug-in instance is determined, and the plug-in instance is sequentially called according to the calling order of the plug-in instance to process each data in the data input queue. The processing process calls the corresponding execution engine through the plug-in instance. Implementation can achieve unified management of each plug-in instance on each video analysis card to fully utilize the hardware resources on the video analysis card and achieve an efficient video analysis process.
可选地,数据输入队列包括数据输入队列中一项或多项数据对应的优先级信息,视频解析卡通过第一插件实例,调用相应的执行引擎对数据输入队列进行处理,得到数据输出队列,包括:Optionally, the data input queue includes priority information corresponding to one or more pieces of data in the data input queue. The video analysis card calls the corresponding execution engine to process the data input queue through the first plug-in instance to obtain the data output queue. include:
视频解析卡根据优先级信息,通过第一插件实例,调用相应的执行引擎对数据输入队列中的一项或多项数据进行处理,得到数据输出队列。According to the priority information, the video analysis card calls the corresponding execution engine to process one or more data in the data input queue through the first plug-in instance to obtain the data output queue.
根据本申请实施例,通过在插件实例对应的数据输入队列中引入优先级信息,可以满足存在紧急业务的情况下视频解析的需要,在存在紧急业务的情况下可以使插件实例优先处理相应的视频数据,保证视频解析的实时性。According to the embodiments of the present application, by introducing priority information into the data input queue corresponding to the plug-in instance, the need for video analysis in the presence of emergency services can be met, and the plug-in instance can be prioritized to process the corresponding video in the presence of emergency services. data to ensure real-time video analysis.
可选地,视频解析卡通过第一插件实例,调用相应的执行引擎对数据输入队列进行处理,得到数据输出队列,包括:Optionally, the video analysis card calls the corresponding execution engine to process the data input queue through the first plug-in instance, and obtains the data output queue, including:
视频解析卡通过第一插件实例,调用相应的执行引擎对应的线程池中的线程,对数据输入队列中的一项或多项数据进行处理,得到数据输出队列,线程池中并发的最大线程数量根据硬件资源的大小决定。The video analysis card calls the thread in the thread pool corresponding to the corresponding execution engine through the first plug-in instance to process one or more data in the data input queue to obtain the data output queue and the maximum number of concurrent threads in the thread pool. Depends on the size of the hardware resources.
根据本申请实施例,视频解析卡通过在调用执行引擎时,通过执行引擎中的线程池中的线程,对数据输入队列中的一项或多项数据进行处理,可以在执行引擎中实现多项数据解析任务的并发处理,提高处理效率,且通过线程池可以充分地利用底层硬件资源,提高硬件资源的利用率。According to the embodiment of the present application, the video analysis card can process one or more data items in the data input queue through threads in the thread pool in the execution engine when calling the execution engine, and can implement multiple items in the execution engine. Concurrent processing of data parsing tasks improves processing efficiency, and the underlying hardware resources can be fully utilized through the thread pool to improve the utilization of hardware resources.
图11示出根据本申请一实施例的视频解析装置的结构图。该装置可用于上述视频解析卡,如图11所示,该装置包括:Figure 11 shows a structural diagram of a video analysis device according to an embodiment of the present application. This device can be used for the above video analysis card, as shown in Figure 11, the device includes:
第三获取模块1101,用于获取处理器根据插件实例的调用顺序发送的数据流信息,数据 流信息为处理器根据视频数据和执行引擎状态信息生成,数据流信息包括插件实例的调用顺序和视频数据;The third acquisition module 1101 is used to acquire the data flow information sent by the processor according to the calling sequence of the plug-in instance. The stream information is generated by the processor based on the video data and execution engine status information. The data stream information includes the calling sequence of the plug-in instance and the video data;
确定模块1102,用于根据插件实例的调用顺序,通过插件实例调用相应的执行引擎对视频数据进行处理,得到视频解析结果。The determination module 1102 is used to call the corresponding execution engine through the plug-in instance to process the video data according to the calling sequence of the plug-in instance, and obtain the video analysis result.
根据本申请实施例,通过处理器在视频解析卡上部署插件实例,并通过插件实例调用底层的执行引擎,可以实现插件实例和底层执行引擎的分离,针对于不同视频数据解析的需求,可以灵活的调用不同视频解析卡上的插件实例以实现对视频的解析,以得到视频解析的结果。同时,通过获取各视频解析卡的执行引擎状态信息,以生成相应的数据流信息,确定解析视频时插件实例的调用顺序,可以提高各视频解析卡上的硬件资源的利用率,灵活、充分地利用不同视频解析卡上的硬件资源,提高了视频解析的效率。According to the embodiments of this application, the processor deploys a plug-in instance on the video parsing card, and calls the underlying execution engine through the plug-in instance. This can realize the separation of the plug-in instance and the underlying execution engine, and can flexibly meet the needs of different video data analysis. Call plug-in instances on different video parsing cards to parse the video and obtain the results of the video parsing. At the same time, by obtaining the execution engine status information of each video analysis card to generate corresponding data flow information and determine the calling order of plug-in instances when parsing videos, the utilization of hardware resources on each video analysis card can be improved, and the system can flexibly and fully Utilizing hardware resources on different video analysis cards improves the efficiency of video analysis.
可选地,确定模块1102,用于:Optionally, the determination module 1102 is used for:
根据数据流信息,确定第一插件实例对应的数据输入队列,第一插件实例为插件实例的调用顺序中的第一个插件实例;According to the data flow information, determine the data input queue corresponding to the first plug-in instance, where the first plug-in instance is the first plug-in instance in the calling sequence of the plug-in instance;
通过第一插件实例,调用相应的执行引擎对数据输入队列进行处理,得到数据输出队列;Through the first plug-in instance, the corresponding execution engine is called to process the data input queue to obtain the data output queue;
以第一插件实例的之后的第二插件实例作为新的第一插件实例,根据数据输出队列确定新的数据输入队列,重复执行通过第一插件实例调用相应的执行引擎,对数据输入队列进行处理,得到数据输出队列及之后的步骤,直至第二插件实例为插件实例的调用顺序中的最后一个插件实例,得到视频解析结果。Use the second plug-in instance after the first plug-in instance as the new first plug-in instance, determine the new data input queue according to the data output queue, and repeatedly call the corresponding execution engine through the first plug-in instance to process the data input queue. , obtain the data output queue and subsequent steps until the second plug-in instance is the last plug-in instance in the calling sequence of the plug-in instance, and obtain the video analysis result.
根据本申请实施例,通过确定插件实例对应的数据输入队列,并按照插件实例的调用顺序依次调用插件实例对数据输入队列中的各项数据进行处理,该处理过程通过插件实例调用相应的执行引擎实现,可以实现对各视频解析卡上各插件实例的统一管理,以充分地利用视频解析卡上的硬件资源,实现高效的视频解析过程。According to the embodiment of the present application, the data input queue corresponding to the plug-in instance is determined, and the plug-in instance is sequentially called according to the calling order of the plug-in instance to process each data in the data input queue. The processing process calls the corresponding execution engine through the plug-in instance. Implementation can achieve unified management of each plug-in instance on each video analysis card to fully utilize the hardware resources on the video analysis card and achieve an efficient video analysis process.
可选地,数据输入队列包括数据输入队列中一项或多项数据对应的优先级信息,通过第一插件实例,调用相应的执行引擎对数据输入队列进行处理,得到数据输出队列,包括:Optionally, the data input queue includes priority information corresponding to one or more pieces of data in the data input queue. Through the first plug-in instance, the corresponding execution engine is called to process the data input queue to obtain the data output queue, including:
根据优先级信息,通过第一插件实例,调用相应的执行引擎对数据输入队列中的一项或多项数据进行处理,得到数据输出队列。According to the priority information, through the first plug-in instance, the corresponding execution engine is called to process one or more data items in the data input queue to obtain the data output queue.
根据本申请实施例,通过在插件实例对应的数据输入队列中引入优先级信息,可以满足存在紧急业务的情况下视频解析的需要,在存在紧急业务的情况下可以使插件实例优先处理相应的视频数据,保证视频解析的实时性。According to the embodiments of the present application, by introducing priority information into the data input queue corresponding to the plug-in instance, the need for video analysis in the presence of emergency services can be met, and the plug-in instance can be prioritized to process the corresponding video in the presence of emergency services. data to ensure real-time video analysis.
可选地,通过第一插件实例,调用相应的执行引擎对数据输入队列进行处理,得到数据输出队列,包括:Optionally, through the first plug-in instance, call the corresponding execution engine to process the data input queue to obtain the data output queue, including:
通过第一插件实例,调用相应的执行引擎对应的线程池中的线程,对数据输入队列中的一项或多项数据进行处理,得到数据输出队列,线程池中并发的最大线程数量根据硬件资源的大小决定。Through the first plug-in instance, call the thread in the thread pool corresponding to the corresponding execution engine to process one or more data in the data input queue to obtain the data output queue. The maximum number of concurrent threads in the thread pool is based on the hardware resources. Determined by size.
根据本申请实施例,视频解析卡通过在调用执行引擎时,通过执行引擎中的线程池中的线程,对数据输入队列中的一项或多项数据进行处理,可以在执行引擎中实现多项数据解析任务的并发处理,提高处理效率,且通过线程池可以充分地利用底层硬件资源,提高硬件资源的利用率。According to the embodiment of the present application, the video analysis card can process one or more data items in the data input queue through threads in the thread pool in the execution engine when calling the execution engine, and can implement multiple items in the execution engine. Concurrent processing of data parsing tasks improves processing efficiency, and the underlying hardware resources can be fully utilized through the thread pool to improve the utilization of hardware resources.
可选地,执行引擎状态信息包括一个或多个视频解析卡的一个或多个执行引擎的资源空 闲状态,数据流信息中插件实例的调用顺序根据一个或多个插件对应的执行引擎的资源消耗信息和执行引擎的资源空闲状态确定,插件在视频解析卡上实例化为对应的一个或多个插件实例,一个或多个插件根据视频数据的业务类型信息确定。Optionally, the execution engine status information includes resource availability of one or more execution engines of one or more video analysis cards. In the idle state, the calling sequence of plug-in instances in the data flow information is determined based on the resource consumption information of the execution engine corresponding to one or more plug-ins and the resource idle status of the execution engine. The plug-in is instantiated on the video analysis card as the corresponding one or more Plug-in instance, one or more plug-ins are determined based on the business type information of the video data.
根据本申请实施例,通过根据满足业务需求的插件对应的执行引擎的资源消耗信息和执行引擎的资源空闲状态,来确定视频数据对应的插件实例的调用顺序,可以实现利用处理器对视频的解析流程进行动态的调度,以满足不同业务类型的需要,且在视频解析过程中可以充分利用底层硬件资源,实现硬件资源利用率的最大化,提高了视频解析效率。According to the embodiment of the present application, by determining the calling sequence of plug-in instances corresponding to video data based on the resource consumption information of the execution engine corresponding to the plug-in that meets the business requirements and the resource idle state of the execution engine, the video analysis by the processor can be realized The process is dynamically scheduled to meet the needs of different business types, and the underlying hardware resources can be fully utilized during the video analysis process to maximize the utilization of hardware resources and improve the efficiency of video analysis.
可选地,在候选的调用顺序的数量为多个的情况下,确定插件实例的调用顺序为候选的调用顺序中插件实例跨视频解析卡进行交互的数据量最小的一个候选的调用顺序,候选的调用顺序根据一个或多个插件对应的执行引擎的资源消耗信息和执行引擎的资源空闲状态确定。Optionally, when the number of candidate calling sequences is multiple, the calling sequence of the plug-in instance is determined to be a candidate calling sequence with the smallest amount of data for the plug-in instance to interact across the video parsing card among the candidate calling sequences. The candidate The calling sequence is determined based on the resource consumption information of the execution engine corresponding to one or more plug-ins and the resource idle status of the execution engine.
根据本申请实施例,通过处理器根据插件对应的执行引擎的资源消耗信息和当前的执行引擎的资源空闲状态,确定候选的调用顺序,并在存在多条候选的调用顺序中,以跨视频解析卡交互的数据量最小的候选的调用顺序作为最终确定的调用顺序,可以通过动态调度提高底层硬件资源的利用率,且可以减少视频解析过程中的数据传输代价,总体提高了数据解析的效率。According to the embodiment of the present application, the processor determines the candidate calling sequence according to the resource consumption information of the execution engine corresponding to the plug-in and the current resource idle state of the execution engine, and when there are multiple candidate calling sequences, performs cross-video analysis The calling order of the candidate with the smallest amount of card interaction data is used as the final calling order, which can improve the utilization of underlying hardware resources through dynamic scheduling, reduce the data transmission cost in the video parsing process, and overall improve the efficiency of data parsing.
可选地,在候选的调用顺序的数量为零的情况下,插件实例的调用顺序根据执行引擎的资源空闲状态和新的插件实例确定,新的插件实例为根据执行引擎的资源空闲状态,在视频解析卡上部署的,候选的调用顺序根据一个或多个插件对应的执行引擎的资源消耗信息和执行引擎的资源空闲状态确定。Optionally, when the number of candidate calling sequences is zero, the calling sequence of the plug-in instance is determined based on the resource idle state of the execution engine and the new plug-in instance. The new plug-in instance is based on the resource idle status of the execution engine. Deployed on the video analysis card, the candidate calling sequence is determined based on the resource consumption information of the execution engine corresponding to one or more plug-ins and the resource idle status of the execution engine.
根据本申请实施例,通过处理器根据插件对应的执行引擎的资源消耗信息和当前的执行引擎的资源空闲状态,确定候选的调用顺序,并在不存在可行的调用顺序时,通过部署新的插件实例以对调用路径进行动态扩容,从而可以满足动态解析的需求,提高视频解析的实时性。According to the embodiment of the present application, the processor determines the candidate calling sequence according to the resource consumption information of the execution engine corresponding to the plug-in and the resource idle status of the current execution engine, and when there is no feasible calling sequence, by deploying a new plug-in The instance can dynamically expand the calling path to meet the needs of dynamic analysis and improve the real-time performance of video analysis.
本申请的实施例提供了一种视频解析装置,包括:处理器以及用于存储处理器可执行指令的存储器;其中,所述处理器被配置为执行所述指令时实现上述视频解析方法。Embodiments of the present application provide a video analysis device, including: a processor and a memory for storing instructions executable by the processor; wherein the processor is configured to implement the above video analysis method when executing the instructions.
本申请的实施例提供了一种终端设备,该终端设备可以执行上述视频解析方法。Embodiments of the present application provide a terminal device that can execute the above video parsing method.
本申请的实施例提供了一种非易失性计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述视频解析方法。Embodiments of the present application provide a non-volatile computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the above video analysis method is implemented.
本申请的实施例提供了一种计算机程序产品,包括计算机可读代码,或者承载有计算机可读代码的非易失性计算机可读存储介质,当所述计算机可读代码在电子设备的处理器中运行时,所述电子设备中的处理器执行上述视频解析方法。Embodiments of the present application provide a computer program product, including computer readable code, or a non-volatile computer readable storage medium carrying the computer readable code, when the computer readable code is stored in a processor of an electronic device When running, the processor in the electronic device executes the above video parsing method.
图12示出根据本申请一实施例的电子设备1200的结构图。如图12所示,该电子设备1200可以是上述视频解析系统100。该电子设备1200包括至少一个处理器1801,至少一个存储器1802、至少一个通信接口1803。此外,该电子设备还可以包括天线等通用部件,在此不再详述。Figure 12 shows a structural diagram of an electronic device 1200 according to an embodiment of the present application. As shown in Figure 12, the electronic device 1200 may be the above-mentioned video analysis system 100. The electronic device 1200 includes at least one processor 1801, at least one memory 1802, and at least one communication interface 1803. In addition, the electronic device may also include common components such as antennas, which will not be described in detail here.
下面结合图12对电子设备1200的各个构成部件进行具体的介绍。Next, each component of the electronic device 1200 will be introduced in detail with reference to FIG. 12 .
处理器1801可以是通用中央处理器(CPU),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制以上方案程序执行的集成电路。处理器1801可以包括一个或多个处理单元,例如:处理器110可以包括应 用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。处理器也可以是上述处理器110。The processor 1801 may be a general central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control program execution of the above scheme. The processor 1801 may include one or more processing units. For example, the processor 110 may include Application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, video codec, digital signal processing (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU), etc. Among them, different processing units can be independent devices or integrated in one or more processors. The processor may also be the above-mentioned processor 110.
通信接口1803,用于与其他电子设备或通信网络通信,如以太网,无线接入网(RAN),核心网,无线局域网(Wireless Local Area Networks,WLAN)等。Communication interface 1803 is used to communicate with other electronic devices or communication networks, such as Ethernet, Radio Access Network (RAN), core network, Wireless Local Area Networks (Wireless Local Area Networks, WLAN), etc.
存储器1802可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(ElectricallyErasable Programmable Read-Only Memory,EEPROM)、只读光盘(Compact Disc Read-Only Memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器可以是独立存在,通过总线与处理器相连接。存储器也可以和处理器集成在一起。Memory 1802 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (random access memory (RAM)) or other type that can store information and instructions. The dynamic storage device can also be Electrically Erasable Programmable Read-Only Memory (EEPROM), Compact Disc Read-Only Memory (CD-ROM) or other optical disk storage, optical disc storage ( Including compressed optical discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or can be used to carry or store desired program code in the form of instructions or data structures and can be stored by a computer. any other medium, but not limited to this. The memory can exist independently and be connected to the processor through a bus. Memory can also be integrated with the processor.
其中,所述存储器1802用于存储执行以上方案的应用程序代码,并由处理器1801来控制执行。所述处理器1801用于执行所述存储器1802中存储的应用程序代码。The memory 1802 is used to store the application code for executing the above solution, and the processor 1801 controls the execution. The processor 1801 is used to execute application codes stored in the memory 1802 .
可选地,该电子设备1200还可包括上述视频解析卡121-123,视频解析卡通过硬件总线可以与处理器进行连接,以实现上述视频解析方法。Optionally, the electronic device 1200 may also include the above-mentioned video analysis cards 121-123. The video analysis cards may be connected to the processor through a hardware bus to implement the above-mentioned video analysis method.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above embodiments, each embodiment is described with its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是――但不限于――电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(Random Access Memory,RAM)、只读存储器(Read Only Memory,ROM)、可擦式可编程只读存储器(Electrically Programmable Read-Only-Memory,EPROM或闪存)、静态随机存取存储器(Static Random-Access Memory,SRAM)、便携式压缩盘只读存储器(Compact Disc Read-Only Memory,CD-ROM)、数字多功能盘(Digital Video Disc,DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。Computer-readable storage media may be tangible devices that can retain and store instructions for use by an instruction execution device. The computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: portable computer disks, hard drives, random access memory (RAM), read only memory (ROM), erasable memory Electrically Programmable Read-Only-Memory (EPROM or Flash Memory), Static Random-Access Memory (SRAM), Portable Compact Disc Read-Only Memory (Compact Disc Read-Only Memory, CD -ROM), Digital Versatile Disc (Digital Video Disc, DVD), memory stick, floppy disk, mechanical encoding device, such as a punched card or a raised structure in a groove with instructions stored thereon, and any suitable combination of the above .
这里所描述的计算机可读程序指令或代码可以从计算机可读存储介质下载到各个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或外部存储设备。网络可以包括铜传输电缆、光纤传输、无线传输、路由器、防火墙、交换机、网关计算机和/或边缘服务器。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。Computer-readable program instructions or code described herein may be downloaded from a computer-readable storage medium to various computing/processing devices, or to an external computer or external storage device over a network, such as the Internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers. A network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage on a computer-readable storage medium in the respective computing/processing device .
用于执行本申请操作的计算机程序指令可以是汇编指令、指令集架构(Instruction Set Architecture,ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码,所述编程语言包括面向对 象的编程语言—诸如Smalltalk、C++等,以及常规的过程式编程语言—诸如“C”语言或类似的编程语言。计算机可读程序指令可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络—包括局域网(Local Area Network,LAN)或广域网(Wide Area Network,WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。在一些实施例中,通过利用计算机可读程序指令的状态信息来个性化定制电子电路,例如可编程逻辑电路、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或可编程逻辑阵列(Programmable Logic Array,PLA),该电子电路可以执行计算机可读程序指令,从而实现本申请的各个方面。The computer program instructions used to perform the operations of this application may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, status setting data, or one or more Source code or object code written in any combination of programming languages, including object-oriented Object programming languages - such as Smalltalk, C++, etc., as well as conventional procedural programming languages - such as the "C" language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server implement. In situations involving remote computers, the remote computer can be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or it can be connected to an external computer (e.g. Use an Internet service provider to connect via the Internet). In some embodiments, electronic circuits are customized by utilizing state information of computer-readable program instructions, such as programmable logic circuits, field-programmable gate arrays (Field-Programmable Gate Arrays, FPGAs), or programmable logic arrays (Programmable logic circuits). Logic Array (PLA), this electronic circuit can execute computer-readable program instructions to implement various aspects of the present application.
这里参照根据本申请实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本申请的各个方面。应当理解,流程图和/或框图的每个方框以及流程图和/或框图中各方框的组合,都可以由计算机可读程序指令实现。Various aspects of the present application are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
这些计算机可读程序指令可以提供给通用计算机、专用计算机或其它可编程数据处理装置的处理器,从而生产出一种机器,使得这些指令在通过计算机或其它可编程数据处理装置的处理器执行时,产生了实现流程图和/或框图中的一个或多个方框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、可编程数据处理装置和/或其他设备以特定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,其包括实现流程图和/或框图中的一个或多个方框中规定的功能/动作的各个方面的指令。These computer-readable program instructions may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus, thereby producing a machine that, when executed by the processor of the computer or other programmable data processing apparatus, , resulting in an apparatus that implements the functions/actions specified in one or more blocks in the flowchart and/or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium. These instructions cause the computer, programmable data processing device and/or other equipment to work in a specific manner. Therefore, the computer-readable medium storing the instructions includes An article of manufacture that includes instructions that implement aspects of the functions/acts specified in one or more blocks of the flowcharts and/or block diagrams.
也可以把计算机可读程序指令加载到计算机、其它可编程数据处理装置、或其它设备上,使得在计算机、其它可编程数据处理装置或其它设备上执行一系列操作步骤,以产生计算机实现的过程,从而使得在计算机、其它可编程数据处理装置、或其它设备上执行的指令实现流程图和/或框图中的一个或多个方框中规定的功能/动作。Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other equipment, causing a series of operating steps to be performed on the computer, other programmable data processing apparatus, or other equipment to produce a computer-implemented process , thereby causing instructions executed on a computer, other programmable data processing apparatus, or other equipment to implement the functions/actions specified in one or more blocks in the flowcharts and/or block diagrams.
附图中的流程图和框图显示了根据本申请的多个实施例的装置、系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,所述模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。The flowcharts and block diagrams in the figures illustrate the architecture, functionality and operations of possible implementations of apparatuses, systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions that embody one or more elements for implementing the specified logical function(s). Executable instructions. In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two consecutive blocks may actually execute substantially in parallel, or they may sometimes execute in the reverse order, depending on the functionality involved.
也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行相应的功能或动作的硬件(例如电路或ASIC(Application Specific Integrated Circuit,专用集成电路))来实现,或者可以用硬件和软件的组合,如固件等来实现。It will also be noted that each block of the block diagram and/or flowchart illustration, and combinations of blocks in the block diagram and/or flowchart illustration, can be implemented by hardware (such as circuits or ASICs) that perform the corresponding function or action. Specific Integrated Circuit), or can be implemented with a combination of hardware and software, such as firmware.
尽管在此结合各实施例对本发明进行了描述,然而,在实施所要求保护的本发明过程中,本领域技术人员通过查看所述附图、公开内容、以及所附权利要求书,可理解并实现所述公开实施例的其它变化。在权利要求中,“包括”(comprising)一词不排除其他组成部分或步骤,“一”或“一个”不排除多个的情况。单个处理器或其它单元可以实现权利要求中列举的若干项功能。相互不同的从属权利要求中记载了某些措施,但这并不表示这些措施不能组合起来产生良好的效果。 Although the present invention has been described herein in conjunction with various embodiments, those skilled in the art, in practicing the claimed invention, will understand and understand by reviewing the drawings, the disclosure, and the appended claims. Other variations of the disclosed embodiments are implemented. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude a plurality. A single processor or other unit may perform several of the functions recited in the claims. The mere fact that certain measures are recited in mutually different dependent claims does not mean that a combination of these measures cannot be combined to advantageous effects.
以上已经描述了本申请的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术的改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。 The embodiments of the present application have been described above. The above description is illustrative, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope of the illustrated embodiments. The terminology used herein is chosen to best explain the principles, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (19)

  1. 一种视频解析方法,其特征在于,所述方法包括:A video analysis method, characterized in that the method includes:
    获取视频数据;Get video data;
    获取一个或多个视频解析卡的执行引擎状态信息;Obtain the execution engine status information of one or more video analysis cards;
    根据所述视频数据和所述执行引擎状态信息,生成数据流信息,所述数据流信息包括插件实例的调用顺序和所述视频数据;Generate data flow information according to the video data and the execution engine status information, where the data flow information includes the calling sequence of the plug-in instance and the video data;
    根据所述插件实例的调用顺序,将所述数据流信息发送至视频解析卡,所述数据流信息用于视频解析卡根据所述插件实例的调用顺序,通过插件实例调用相应的执行引擎对所述视频数据进行处理,得到视频解析结果。According to the calling sequence of the plug-in instance, the data flow information is sent to the video analysis card. The data flow information is used by the video parsing card to call the corresponding execution engine through the plug-in instance according to the calling sequence of the plug-in instance. The video data is processed to obtain video analysis results.
  2. 根据权利要求1所述的方法,其特征在于,所述执行引擎状态信息包括一个或多个视频解析卡的一个或多个执行引擎的资源空闲状态,所述根据所述视频数据和所述执行引擎状态信息,生成数据流信息,包括:The method according to claim 1, wherein the execution engine status information includes the resource idle status of one or more execution engines of one or more video analysis cards, and the execution engine status information is determined according to the video data and the execution engine status information. Engine status information generates data flow information, including:
    根据所述视频数据的业务类型信息,确定所述业务类型对应的一个或多个插件,所述插件在视频解析卡上实例化为对应的一个或多个插件实例;According to the service type information of the video data, one or more plug-ins corresponding to the service type are determined, and the plug-ins are instantiated on the video parsing card as corresponding one or more plug-in instances;
    根据所述一个或多个插件对应的执行引擎的资源消耗信息和所述执行引擎的资源空闲状态,确定所述数据流信息中所述插件实例的调用顺序。The calling sequence of the plug-in instances in the data flow information is determined according to the resource consumption information of the execution engine corresponding to the one or more plug-ins and the resource idle status of the execution engine.
  3. 根据权利要求2所述的方法,其特征在于,所述根据所述一个或多个插件对应的执行引擎的资源消耗信息和所述执行引擎的资源空闲状态,确定所述数据流信息中所述插件实例的调用顺序,包括:The method according to claim 2, characterized in that, based on the resource consumption information of the execution engine corresponding to the one or more plug-ins and the resource idle state of the execution engine, determining the said data flow information The calling sequence of plug-in instances, including:
    根据所述一个或多个插件对应的执行引擎的资源消耗信息和所述执行引擎的资源空闲状态,确定候选的调用顺序;Determine the candidate calling sequence according to the resource consumption information of the execution engine corresponding to the one or more plug-ins and the resource idle status of the execution engine;
    在候选的调用顺序的数量为多个的情况下,确定候选的调用顺序中插件实例跨视频解析卡进行交互的数据量最小的一个候选的调用顺序为所述插件实例的调用顺序。When the number of candidate calling sequences is multiple, the calling sequence of the candidate with the smallest amount of data for the plug-in instance to interact across the video analysis card among the candidate calling sequences is determined to be the calling sequence of the plug-in instance.
  4. 根据权利要求2或3所述的方法,其特征在于,所述根据所述一个或多个插件对应的执行引擎的资源消耗信息和所述执行引擎的资源空闲状态,确定所述数据流信息中所述插件实例的调用顺序,包括:The method according to claim 2 or 3, characterized in that, based on the resource consumption information of the execution engine corresponding to the one or more plug-ins and the resource idle status of the execution engine, it is determined that the data flow information The calling sequence of the plug-in instance includes:
    根据所述一个或多个插件对应的执行引擎的资源消耗信息和所述执行引擎的资源空闲状态,确定候选的调用顺序;Determine the candidate calling sequence according to the resource consumption information of the execution engine corresponding to the one or more plug-ins and the resource idle status of the execution engine;
    在候选的调用顺序的数量为零的情况下,根据所述执行引擎的资源空闲状态,在视频解析卡上部署新的插件实例; When the number of candidate calling sequences is zero, deploy a new plug-in instance on the video parsing card according to the resource idle state of the execution engine;
    根据所述执行引擎的资源空闲状态和所述新的插件实例,确定所述插件实例的调用顺序。The calling sequence of the plug-in instances is determined according to the resource idle state of the execution engine and the new plug-in instance.
  5. 根据权利要求1-4任一项所述的方法,其特征在于,所述视频解析卡根据所述插件实例的调用顺序,通过插件实例调用相应的执行引擎对所述视频数据进行处理,得到视频解析结果,包括:The method according to any one of claims 1 to 4, characterized in that the video parsing card calls the corresponding execution engine through the plug-in instance to process the video data according to the calling sequence of the plug-in instance to obtain the video Analysis results include:
    所述视频解析卡根据所述数据流信息,确定第一插件实例对应的数据输入队列,所述第一插件实例为所述插件实例的调用顺序中的第一个插件实例;The video analysis card determines the data input queue corresponding to the first plug-in instance according to the data flow information, and the first plug-in instance is the first plug-in instance in the calling sequence of the plug-in instance;
    所述视频解析卡通过所述第一插件实例,调用相应的执行引擎对所述数据输入队列进行处理,得到数据输出队列;The video analysis card calls the corresponding execution engine to process the data input queue through the first plug-in instance to obtain the data output queue;
    所述视频解析卡以所述第一插件实例之后的第二插件实例作为新的第一插件实例,根据所述数据输出队列确定新的数据输入队列,重复执行所述视频解析卡通过所述第一插件实例调用相应的执行引擎,对所述数据输入队列进行处理,得到数据输出队列及之后的步骤,直至第二插件实例为所述插件实例的调用顺序中的最后一个插件实例,得到所述视频解析结果。The video analysis card uses the second plug-in instance after the first plug-in instance as a new first plug-in instance, determines a new data input queue according to the data output queue, and repeatedly executes the video analysis card to pass the first plug-in instance. A plug-in instance calls the corresponding execution engine to process the data input queue to obtain the data output queue and subsequent steps until the second plug-in instance is the last plug-in instance in the calling sequence of the plug-in instance, and obtain the Video analysis results.
  6. 根据权利要求5所述的方法,其特征在于,所述数据输入队列包括所述数据输入队列中一项或多项数据对应的优先级信息,所述视频解析卡通过所述第一插件实例,调用相应的执行引擎对所述数据输入队列进行处理,得到数据输出队列,包括:The method according to claim 5, characterized in that the data input queue includes priority information corresponding to one or more data in the data input queue, and the video analysis card passes the first plug-in instance, Call the corresponding execution engine to process the data input queue to obtain the data output queue, including:
    所述视频解析卡根据所述优先级信息,通过所述第一插件实例,调用相应的执行引擎对所述数据输入队列中的一项或多项数据进行处理,得到数据输出队列。According to the priority information, the video analysis card calls the corresponding execution engine to process one or more data in the data input queue through the first plug-in instance to obtain a data output queue.
  7. 根据权利要求5或6所述的方法,所述视频解析卡通过所述第一插件实例,调用相应的执行引擎对所述数据输入队列进行处理,得到数据输出队列,包括:According to the method of claim 5 or 6, the video analysis card calls the corresponding execution engine to process the data input queue through the first plug-in instance to obtain a data output queue, including:
    所述视频解析卡通过所述第一插件实例,调用相应的执行引擎对应的线程池中的线程,对所述数据输入队列中的一项或多项数据进行处理,得到数据输出队列,所述线程池中并发的最大线程数量根据硬件资源的大小决定。The video analysis card calls the thread in the thread pool corresponding to the corresponding execution engine through the first plug-in instance to process one or more data in the data input queue to obtain a data output queue. The maximum number of concurrent threads in the thread pool is determined by the size of the hardware resources.
  8. 一种视频解析方法,其特征在于,所述方法包括:A video analysis method, characterized in that the method includes:
    获取处理器根据插件实例的调用顺序发送的数据流信息,所述数据流信息为所述处理器根据视频数据和执行引擎状态信息生成,所述数据流信息包括所述插件实例的调用顺序和所述视频数据;Obtain the data flow information sent by the processor according to the calling sequence of the plug-in instance. The data flow information is generated by the processor according to the video data and execution engine status information. The data flow information includes the calling sequence of the plug-in instance and all the data flow information. Describe video data;
    根据所述插件实例的调用顺序,通过插件实例调用相应的执行引擎对所述视频数据进行处理,得到视频解析结果。According to the calling sequence of the plug-in instance, the corresponding execution engine is called through the plug-in instance to process the video data to obtain a video analysis result.
  9. 根据权利要求8所述的方法,其特征在于,所述根据所述插件实例的调用顺序,通过插件实例调用相应的执行引擎对所述视频数据进行处理,得到视频解析结果,包括:The method according to claim 8, characterized in that, according to the calling sequence of the plug-in instance, the corresponding execution engine is called through the plug-in instance to process the video data to obtain the video analysis result, including:
    根据所述数据流信息,确定第一插件实例对应的数据输入队列,所述第一插件实例为所 述插件实例的调用顺序中的第一个插件实例;According to the data flow information, the data input queue corresponding to the first plug-in instance is determined, and the first plug-in instance is the The first plug-in instance in the calling sequence of the described plug-in instances;
    通过所述第一插件实例,调用相应的执行引擎对所述数据输入队列进行处理,得到数据输出队列;Through the first plug-in instance, call the corresponding execution engine to process the data input queue to obtain the data output queue;
    以所述第一插件实例的之后的第二插件实例作为新的第一插件实例,根据所述数据输出队列确定新的数据输入队列,重复执行所述通过所述第一插件实例调用相应的执行引擎,对所述数据输入队列进行处理,得到数据输出队列及之后的步骤,直至第二插件实例为所述插件实例的调用顺序中的最后一个插件实例,得到所述视频解析结果。Using the second plug-in instance after the first plug-in instance as the new first plug-in instance, determine a new data input queue according to the data output queue, and repeatedly execute the corresponding execution called through the first plug-in instance The engine processes the data input queue to obtain the data output queue and subsequent steps until the second plug-in instance is the last plug-in instance in the calling sequence of the plug-in instance to obtain the video analysis result.
  10. 根据权利要求9所述的方法,其特征在于,所述数据输入队列包括所述数据输入队列中一项或多项数据对应的优先级信息,所述通过所述第一插件实例,调用相应的执行引擎对所述数据输入队列进行处理,得到数据输出队列,包括:The method according to claim 9, characterized in that the data input queue includes priority information corresponding to one or more data in the data input queue, and the corresponding call is made through the first plug-in instance. The execution engine processes the data input queue to obtain a data output queue, including:
    根据所述优先级信息,通过所述第一插件实例,调用相应的执行引擎对所述数据输入队列中的一项或多项数据进行处理,得到数据输出队列。According to the priority information, through the first plug-in instance, the corresponding execution engine is called to process one or more data items in the data input queue to obtain a data output queue.
  11. 根据权利要求9或10所述的方法,所述通过所述第一插件实例,调用相应的执行引擎对所述数据输入队列进行处理,得到数据输出队列,包括:According to the method of claim 9 or 10, calling the corresponding execution engine to process the data input queue through the first plug-in instance to obtain the data output queue includes:
    通过所述第一插件实例,调用相应的执行引擎对应的线程池中的线程,对所述数据输入队列中的一项或多项数据进行处理,得到数据输出队列,所述线程池中并发的最大线程数量根据硬件资源的大小决定。Through the first plug-in instance, the thread in the thread pool corresponding to the corresponding execution engine is called to process one or more data in the data input queue to obtain a data output queue. The concurrent data in the thread pool is The maximum number of threads is determined by the size of the hardware resources.
  12. 根据权利要求8-11任一项所述的方法,其特征在于,所述执行引擎状态信息包括一个或多个视频解析卡的一个或多个执行引擎的资源空闲状态,所述数据流信息中所述插件实例的调用顺序根据一个或多个插件对应的执行引擎的资源消耗信息和所述执行引擎的资源空闲状态确定,所述插件在视频解析卡上实例化为对应的一个或多个插件实例,所述一个或多个插件根据所述视频数据的业务类型信息确定。The method according to any one of claims 8-11, characterized in that the execution engine status information includes the resource idle status of one or more execution engines of one or more video analysis cards, and the data flow information The calling sequence of the plug-in instances is determined based on the resource consumption information of the execution engine corresponding to one or more plug-ins and the resource idle status of the execution engine. The plug-in is instantiated as the corresponding one or more plug-ins on the video analysis card. For example, the one or more plug-ins are determined based on the service type information of the video data.
  13. 根据权利要求12所述的方法,其特征在于,在候选的调用顺序的数量为多个的情况下,确定所述插件实例的调用顺序为候选的调用顺序中插件实例跨视频解析卡进行交互的数据量最小的一个候选的调用顺序,所述候选的调用顺序根据所述一个或多个插件对应的执行引擎的资源消耗信息和所述执行引擎的资源空闲状态确定。The method according to claim 12, characterized in that, when the number of candidate calling sequences is multiple, determining the calling sequence of the plug-in instance is the plug-in instance interacting across the video parsing card in the candidate calling sequence. The calling order of a candidate with the smallest amount of data, which is determined based on the resource consumption information of the execution engine corresponding to the one or more plug-ins and the resource idle status of the execution engine.
  14. 根据权利要求12或13所述的方法,其特征在于,在候选的调用顺序的数量为零的情况下,所述插件实例的调用顺序根据所述执行引擎的资源空闲状态和新的插件实例确定,所述新的插件实例为根据所述执行引擎的资源空闲状态,在视频解析卡上部署的,所述候选的调用顺序根据所述一个或多个插件对应的执行引擎的资源消耗信息和所述执行引擎的资源空闲状态确定。The method according to claim 12 or 13, characterized in that, when the number of candidate calling sequences is zero, the calling sequence of the plug-in instance is determined according to the resource idle state of the execution engine and the new plug-in instance. , the new plug-in instance is deployed on the video analysis card according to the resource idle state of the execution engine, and the candidate calling sequence is based on the resource consumption information of the execution engine corresponding to the one or more plug-ins and the The resource idle status of the execution engine is determined.
  15. 一种视频解析装置,其特征在于,所述装置包括: A video analysis device, characterized in that the device includes:
    第一获取模块,用于获取视频数据;The first acquisition module is used to acquire video data;
    第二获取模块,用于获取一个或多个视频解析卡的执行引擎状态信息;The second acquisition module is used to acquire execution engine status information of one or more video analysis cards;
    生成模块,用于根据所述视频数据和所述执行引擎状态信息,生成数据流信息,所述数据流信息包括插件实例的调用顺序和所述视频数据;A generation module configured to generate data flow information based on the video data and the execution engine status information, where the data flow information includes the calling sequence of the plug-in instance and the video data;
    发送模块,用于根据所述插件实例的调用顺序,将所述数据流信息发送至视频解析卡,所述数据流信息用于视频解析卡根据所述插件实例的调用顺序,通过插件实例调用相应的执行引擎对所述视频数据进行处理,得到视频解析结果。A sending module, configured to send the data flow information to the video analysis card according to the calling sequence of the plug-in instance. The data flow information is used by the video parsing card to call the corresponding plug-in instance according to the calling sequence of the plug-in instance. The execution engine processes the video data to obtain video analysis results.
  16. 一种视频解析装置,其特征在于,所述装置包括:A video analysis device, characterized in that the device includes:
    第三获取模块,用于获取处理器根据插件实例的调用顺序发送的数据流信息,所述数据流信息为所述处理器根据视频数据和执行引擎状态信息生成,所述数据流信息包括所述插件实例的调用顺序和所述视频数据;The third acquisition module is used to acquire the data flow information sent by the processor according to the calling sequence of the plug-in instance. The data flow information is generated by the processor according to the video data and execution engine status information. The data flow information includes the The calling sequence of plug-in instances and the video data;
    确定模块,用于根据所述插件实例的调用顺序,通过插件实例调用相应的执行引擎对所述视频数据进行处理,得到视频解析结果。The determination module is configured to call the corresponding execution engine through the plug-in instance to process the video data according to the calling sequence of the plug-in instance, and obtain the video analysis result.
  17. 一种视频解析装置,其特征在于,包括:A video analysis device, characterized by including:
    处理器;processor;
    用于存储处理器可执行指令的存储器;Memory used to store instructions executable by the processor;
    其中,所述处理器被配置为执行所述指令时实现权利要求1-7中任意一项所述的方法,或者实现权利要求8-14中任意一项所述的方法。Wherein, the processor is configured to implement the method described in any one of claims 1-7 or to implement the method described in any one of claims 8-14 when executing the instructions.
  18. 一种非易失性计算机可读存储介质,其上存储有计算机程序指令,其特征在于,所述计算机程序指令被处理器执行时实现权利要求1-7中任意一项所述的方法,或者,实现权利要求8-14中任意一项所述的方法。A non-volatile computer-readable storage medium with computer program instructions stored thereon, characterized in that when the computer program instructions are executed by a processor, the method described in any one of claims 1-7 is implemented, or , implement the method described in any one of claims 8-14.
  19. 一种计算机程序产品,包括计算机可读代码,或者承载有计算机可读代码的非易失性计算机可读存储介质,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行权利要求1-7中任意一项所述的方法,或者,执行权利要求8-14中任意一项所述的方法。 A computer program product includes computer readable code, or a non-volatile computer readable storage medium carrying computer readable code. When the computer readable code is run in an electronic device, The processor performs the method described in any one of claims 1-7, or performs the method described in any one of claims 8-14.
PCT/CN2023/100986 2022-08-29 2023-06-19 Video analysis method and apparatus, and storage medium WO2024045780A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211042853.2A CN117667245A (en) 2022-08-29 2022-08-29 Video parsing method, device and storage medium
CN202211042853.2 2022-08-29

Publications (1)

Publication Number Publication Date
WO2024045780A1 true WO2024045780A1 (en) 2024-03-07

Family

ID=90077515

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/100986 WO2024045780A1 (en) 2022-08-29 2023-06-19 Video analysis method and apparatus, and storage medium

Country Status (2)

Country Link
CN (1) CN117667245A (en)
WO (1) WO2024045780A1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080109810A1 (en) * 2006-11-07 2008-05-08 Microsoft Corporation Parallel engine support in display driver model
CN112132120A (en) * 2020-11-24 2020-12-25 北京沃东天骏信息技术有限公司 Method and device for video structuring
CN112650578A (en) * 2019-10-12 2021-04-13 阿里巴巴集团控股有限公司 Data processing method, scheduling platform, video storage platform and video processing engine

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080109810A1 (en) * 2006-11-07 2008-05-08 Microsoft Corporation Parallel engine support in display driver model
CN112650578A (en) * 2019-10-12 2021-04-13 阿里巴巴集团控股有限公司 Data processing method, scheduling platform, video storage platform and video processing engine
CN112132120A (en) * 2020-11-24 2020-12-25 北京沃东天骏信息技术有限公司 Method and device for video structuring

Also Published As

Publication number Publication date
CN117667245A (en) 2024-03-08

Similar Documents

Publication Publication Date Title
Ali et al. RES: Real-time video stream analytics using edge enhanced clouds
CN108012156B (en) Video processing method and control platform
CN109409513B (en) Task processing method based on neural network and related equipment
CN108206937B (en) Method and device for improving intelligent analysis performance
CN111506434B (en) Task processing method and device and computer readable storage medium
CN110650347A (en) Multimedia data processing method and device
CN110781180B (en) Data screening method and data screening device
US20220374219A1 (en) Deployment of service
CN113157418A (en) Server resource allocation method and device, storage medium and electronic equipment
KR20210125559A (en) Methods and devices for step-assisted workflows
Salehe et al. Videopipe: Building video stream processing pipelines at the edge
EP4034988A1 (en) Method and apparatus for a step-enabled workflow
WO2024045780A1 (en) Video analysis method and apparatus, and storage medium
CN114466227A (en) Video analysis method and device, electronic equipment and storage medium
WO2023124361A1 (en) Chip, acceleration card, electronic device and data processing method
WO2023124428A1 (en) Chip, accelerator card, electronic device and data processing method
CN113051051B (en) Scheduling method, device, equipment and storage medium of video equipment
US11269625B1 (en) Method and system to identify and prioritize re-factoring to improve micro-service identification
Antil et al. MF2ShrT: Multi-Modal Feature Fusion using Shared Layered Transformer for Face Anti-Spoofing
Hsu et al. Multimedia fog computing: Minions in the cloud and crowd
US11126854B1 (en) Efficient identification of objects in videos using motion information
CN113992493A (en) Video processing method, system, device and storage medium
CN111901561A (en) Video data processing method, device and system in monitoring system and storage medium
WO2022261928A1 (en) Operation acceleration method and operation accelerator
CN116680086B (en) Scheduling management system based on offline rendering engine

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: 23858819

Country of ref document: EP

Kind code of ref document: A1