[go: up one dir, main page]

CN118118677A - Data and video processing method and device - Google Patents

Data and video processing method and device Download PDF

Info

Publication number
CN118118677A
CN118118677A CN202211528132.2A CN202211528132A CN118118677A CN 118118677 A CN118118677 A CN 118118677A CN 202211528132 A CN202211528132 A CN 202211528132A CN 118118677 A CN118118677 A CN 118118677A
Authority
CN
China
Prior art keywords
component
data
target
processing
target processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211528132.2A
Other languages
Chinese (zh)
Inventor
高艳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
BOE Technology Group Co Ltd
Original Assignee
BOE Technology Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by BOE Technology Group Co Ltd filed Critical BOE Technology Group Co Ltd
Priority to CN202211528132.2A priority Critical patent/CN118118677A/en
Priority to PCT/CN2023/134051 priority patent/WO2024114534A1/en
Publication of CN118118677A publication Critical patent/CN118118677A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/172Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a picture, frame or field
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/20Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using video object coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/44Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
    • 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 or manipulating encoded video stream scene graphs

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

A data and video processing method and device. The data processing method is applied to a data processing system, the data processing system comprises a management component and a processing component, and the method comprises the following steps: determining a plurality of target processing components according to a task to be processed, wherein the task to be processed is used for processing target data; the management component loads the plurality of target processing components; and the loaded multiple target processing components process the data fragments of the target data in sequence, wherein each target processing component processes different data fragments at the same time, and at least one data fragment is processed by each target processing component in sequence. The method can simplify the management logic of the processing assembly and the processing process of the target video, is beneficial to improving the processing efficiency of the target data, and better meets the diversified processing requirements of the target data.

Description

数据、视频处理方法及装置Data and video processing method and device

技术领域Technical Field

本发明涉及电子信息技术领域,具体而言,涉及一种数据、视频处理方法及装置。The present invention relates to the field of electronic information technology, and in particular to a data and video processing method and device.

背景技术Background Art

在需要采用多种处理方式对数据进行处理的情况下,现阶段通常采用各种处理方式分别对应的功能模块进行处理,或者采用通用形式的处理软件进行处理。When multiple processing methods are required to process data, at present, functional modules corresponding to various processing methods are usually used for processing, or general processing software is used for processing.

以待处理的视频为例,在对视频进行解码、插帧等处理时,通常需要针对待处理的视频开发各个处理方式对应的、分立式的功能模块,然后分别使用各个功能模块依次处理视频。在功能模块的种类或数量较多的情况下,该方式往往需要手动调整功能模块的参数或被处理视频的中间数据,整体处理逻辑和处理过程较为复杂,导致处理效率较低。而通用形式的视频处理软件通常只提供简单的标准化功能,往往难以满足多样化的处理需求。Taking the video to be processed as an example, when decoding, inserting frames, etc., it is usually necessary to develop discrete functional modules corresponding to each processing method for the video to be processed, and then use each functional module to process the video in turn. When there are many types or numbers of functional modules, this method often requires manual adjustment of the parameters of the functional modules or the intermediate data of the processed video. The overall processing logic and processing process are relatively complex, resulting in low processing efficiency. General video processing software usually only provides simple standardized functions, which often cannot meet diverse processing needs.

发明内容Summary of the invention

有鉴于此,本发明的实施例提出了一种数据、视频处理方法及装置,以解决相关技术中存在的不足。In view of this, an embodiment of the present invention proposes a data and video processing method and device to solve the deficiencies existing in the related art.

根据本发明实施例的第一方面,提出一种数据处理方法,应用于数据处理系统,所述数据处理系统包括管理组件和处理组件,所述方法包括:According to a first aspect of an embodiment of the present invention, a data processing method is provided, which is applied to a data processing system, wherein the data processing system includes a management component and a processing component, and the method includes:

根据待处理任务确定多个目标处理组件,所述待处理任务用于处理目标数据;Determine a plurality of target processing components according to the tasks to be processed, wherein the tasks to be processed are used to process target data;

所述管理组件加载所述多个目标处理组件;The management component loads the multiple target processing components;

加载完成的所述多个目标处理组件按序处理所述目标数据的数据片段,其中,各个目标处理组件在同一时刻分别处理不同的数据片段,至少一个数据片段被各个目标处理组件依次处理。The multiple target processing components that have completed loading process the data segments of the target data in sequence, wherein each target processing component processes different data segments at the same time, and at least one data segment is processed in sequence by each target processing component.

根据本发明实施例的第二方面,提出一种视频处理方法,应用于视频处理系统,所述视频处理系统包括管理组件和处理组件,所述方法包括:According to a second aspect of an embodiment of the present invention, a video processing method is provided, which is applied to a video processing system. The video processing system includes a management component and a processing component. The method includes:

根据待处理任务确定目标处理组件,所述待处理任务用于处理目标视频,所述目标处理组件包括解码组件、编码组件和至少一个智能算法组件;Determine a target processing component according to a task to be processed, wherein the task to be processed is used to process a target video, and the target processing component includes a decoding component, an encoding component, and at least one intelligent algorithm component;

所述管理组件加载所述目标处理组件;The management component loads the target processing component;

加载完成的所述智能算法组件按序处理所述目标视频的视频帧,其中,各个目标处理组件在同一时刻分别处理不同的视频帧,至少一个视频帧被各个目标处理组件依次处理。The loaded intelligent algorithm component processes the video frames of the target video in sequence, wherein each target processing component processes different video frames at the same time, and at least one video frame is processed in sequence by each target processing component.

根据本发明实施例的第三方面,提出一种数据处理装置,所述装置应用于数据处理系统,所述数据处理系统包括管理组件和处理组件,所述装置包括一个或多个处理器,所述处理器被配置为:According to a third aspect of an embodiment of the present invention, a data processing device is provided. The device is applied to a data processing system. The data processing system includes a management component and a processing component. The device includes one or more processors. The processors are configured to:

根据待处理任务确定多个目标处理组件,所述待处理任务用于处理目标数据;Determine a plurality of target processing components according to the tasks to be processed, wherein the tasks to be processed are used to process target data;

所述管理组件加载所述多个目标处理组件;The management component loads the multiple target processing components;

加载完成的所述多个目标处理组件按序处理所述目标数据的数据片段,其中,各个目标处理组件在同一时刻分别处理不同的数据片段,至少一个数据片段被各个目标处理组件依次处理。The multiple target processing components that have completed loading process the data segments of the target data in sequence, wherein each target processing component processes different data segments at the same time, and at least one data segment is processed in sequence by each target processing component.

根据本发明实施例的第四方面,提出一种视频处理装置,所述装置应用于视频处理系统,所述视频处理系统包括管理组件和处理组件,所述装置包括一个或多个处理器,所述处理器被配置为:According to a fourth aspect of an embodiment of the present invention, a video processing device is provided. The device is applied to a video processing system. The video processing system includes a management component and a processing component. The device includes one or more processors. The processors are configured to:

根据待处理任务确定目标处理组件,所述待处理任务用于处理目标视频,所述目标处理组件包括解码组件、编码组件和至少一个智能算法组件;Determine a target processing component according to a task to be processed, wherein the task to be processed is used to process a target video, and the target processing component includes a decoding component, an encoding component, and at least one intelligent algorithm component;

所述管理组件加载所述目标处理组件;The management component loads the target processing component;

加载完成的所述智能算法组件按序处理所述目标视频的视频帧,其中,各个目标处理组件在同一时刻分别处理不同的视频帧,至少一个视频帧被各个目标处理组件依次处理。The loaded intelligent algorithm component processes the video frames of the target video in sequence, wherein each target processing component processes different video frames at the same time, and at least one video frame is processed in sequence by each target processing component.

根据本发明实施例的第五方面,提出一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为实现上述第一方面或第二方面中任一项所述的数据处理方法。According to a fifth aspect of an embodiment of the present invention, an electronic device is proposed, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to implement the data processing method described in any one of the first aspect or the second aspect.

根据本发明实施例的第六方面,提出一种非瞬态计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现上述第一方面或第二方面中任一项所述的数据处理方法中的步骤。According to a sixth aspect of an embodiment of the present invention, a non-volatile computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the steps in the data processing method described in any one of the first aspect or the second aspect are implemented.

根据本发明的实施例,提出一种包括管理组件和处理组件的数据处理系统,针对用于处理目标数据的待处理任务,该系统先确定多个目标处理组件,然后由所述管理组件加载各个目标处理组件;进而,加载完成的所述多个目标处理组件可以按序处理所述目标数据的数据片段,其中,各个目标处理组件在同一时刻分别处理不同的数据片段,至少一个数据片段被各个目标处理组件依次处理。According to an embodiment of the present invention, a data processing system including a management component and a processing component is proposed. For tasks to be processed for processing target data, the system first determines multiple target processing components, and then the management component loads each target processing component; then, the multiple target processing components that have been loaded can process data fragments of the target data in sequence, wherein each target processing component processes different data fragments at the same time, and at least one data fragment is processed in sequence by each target processing component.

在所述多个处理组件被管理组件加载后,各个处理组件可以按序处理所述目标数据的数据片段,从而完成所述待处理任务。一方面,该方案可以由所述管理组件统一管理和调度目标处理组件,以由各个目标处理组件相互配合有序完成针对目标数据的处理过程。即便目标处理组件的数量较多,各个目标处理组件也可以有序处理数据片段,从而大大简化了针对系统中各个处理组件的管理逻辑和对所述目标数据的处理过程,有助于提升待处理任务的执行效率。另一方面,可以根据待处理任务确定各个目标处理组件并进行加载,从而使得各个目标处理组件可以按照自身的处理逻辑对所述目标数据的数据片段进行处理,由于各个目标处理组件的处理逻辑可以根据实际需要预先定义,所以该方式可以实现较为复杂的任务处理逻辑,以便提供更多的处理功能,从而便于实现多样化的数据处理需求。After the multiple processing components are loaded by the management component, each processing component can process the data fragments of the target data in order, thereby completing the task to be processed. On the one hand, the solution can be managed and scheduled by the management component in a unified manner, so that each target processing component can cooperate with each other to complete the processing process for the target data in an orderly manner. Even if the number of target processing components is large, each target processing component can process the data fragments in an orderly manner, thereby greatly simplifying the management logic for each processing component in the system and the processing process of the target data, which helps to improve the execution efficiency of the task to be processed. On the other hand, each target processing component can be determined and loaded according to the task to be processed, so that each target processing component can process the data fragments of the target data according to its own processing logic. Since the processing logic of each target processing component can be pre-defined according to actual needs, this method can implement a more complex task processing logic, so as to provide more processing functions, thereby facilitating the realization of diversified data processing needs.

另外,管理组件可以根据待处理任务对应的目标数据确定相应的处理组件,进而将确定出的各个处理组件加载至数据处理系统。可以理解的是,在上述数据处理系统启动之前,用户可以针对所述目标数据向所述管理组件指定相应的处理组件,从而实现对处理组件的按需加载。In addition, the management component can determine the corresponding processing component according to the target data corresponding to the task to be processed, and then load each determined processing component into the data processing system. It is understandable that before the above-mentioned data processing system is started, the user can specify the corresponding processing component to the management component according to the target data, so as to realize the on-demand loading of the processing component.

根据本发明的实施例,还提出一种包括管理组件和处理组件的视频处理系统,针对待处理任务,该系统根据待处理任务确定目标处理组件,所述待处理任务用于处理目标视频,所述目标处理组件包括解码组件、编码组件和至少一个智能算法组件;然后所述管理组件加载所述目标处理组件;加载完成的所述智能算法组件按序处理所述目标视频的视频帧,其中,各个目标处理组件在同一时刻分别处理不同的视频帧,至少一个视频帧被各个目标处理组件依次处理。According to an embodiment of the present invention, a video processing system including a management component and a processing component is also proposed. For a task to be processed, the system determines a target processing component according to the task to be processed, wherein the task to be processed is used to process a target video, and the target processing component includes a decoding component, an encoding component and at least one intelligent algorithm component; then the management component loads the target processing component; the loaded intelligent algorithm component processes video frames of the target video in sequence, wherein each target processing component processes different video frames at the same time, and at least one video frame is processed in sequence by each target processing component.

与前述用于数据处理的数据处理系统类似的,一方面,该方案可以由所述管理组件统一管理和调度目标处理组件,以由各个目标处理组件(包括解码组件、编码组件和至少一个智能算法组件)相互配合有序完成针对目标视频的处理过程。即便智能算法组件的数量较多,各个智能算法组件也可以有序处理视频帧,从而大大简化了针对系统中各个智能算法组件的管理逻辑和对所述目标数据的处理过程,有助于提升待处理任务的执行效率。另一方面,可以根据待处理任务确定至少一个智能算法组件并进行加载,从而使得各个智能算法组件可以按照自身的处理逻辑对所述目标视频的视频帧进行处理,由于各个智能算法组件的处理逻辑可以根据实际需要预先定义,所以该方式可以实现较为复杂的视频处理逻辑,以便提供更多的处理功能,从而便于实现多样化的视频处理需求。另外,可以实现对智能算法组件的按需加载。Similar to the aforementioned data processing system for data processing, on the one hand, the solution can be managed and scheduled by the management component in a unified manner, so that each target processing component (including a decoding component, an encoding component and at least one intelligent algorithm component) cooperates with each other to orderly complete the processing process for the target video. Even if the number of intelligent algorithm components is large, each intelligent algorithm component can process video frames in an orderly manner, thereby greatly simplifying the management logic for each intelligent algorithm component in the system and the processing process of the target data, which helps to improve the execution efficiency of the tasks to be processed. On the other hand, at least one intelligent algorithm component can be determined and loaded according to the tasks to be processed, so that each intelligent algorithm component can process the video frames of the target video according to its own processing logic. Since the processing logic of each intelligent algorithm component can be pre-defined according to actual needs, this method can realize a more complex video processing logic, so as to provide more processing functions, thereby facilitating the realization of diversified video processing needs. In addition, on-demand loading of intelligent algorithm components can be achieved.

应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本发明。It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单的介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

图1是根据本发明实施例示出的一种数据处理方法的流程图。FIG. 1 is a flow chart showing a data processing method according to an embodiment of the present invention.

图2是根据本发明实施例示出的一种数据处理系统的架构示意图。FIG. 2 is a schematic diagram showing the architecture of a data processing system according to an embodiment of the present invention.

图3是根据本发明实施例示出的一种管理组件的工作流程示意图。FIG. 3 is a schematic diagram of a workflow of a management component according to an embodiment of the present invention.

图4是根据本发明实施例示出的一种处理组件的工作流程示意图。FIG. 4 is a schematic diagram of a workflow of a processing component according to an embodiment of the present invention.

图5是根据本发明实施例示出的一种处理组件之间数据传递过程的示意图。FIG. 5 is a schematic diagram showing a data transmission process between processing components according to an embodiment of the present invention.

图6是根据本发明实施例示出的一种算法服务接口的示意图。FIG. 6 is a schematic diagram showing an algorithm service interface according to an embodiment of the present invention.

图7是根据本发明实施例示出的一种视频处理方法的流程图。FIG. 7 is a flow chart showing a video processing method according to an embodiment of the present invention.

图8是根据本发明实施例示出的一种视频处理系统的架构示意图。FIG. 8 is a schematic diagram showing the architecture of a video processing system according to an embodiment of the present invention.

图9是根据本发明实施例示出的一种视频处理过程的示意图。FIG. 9 is a schematic diagram showing a video processing process according to an embodiment of the present invention.

图10是根据本发明实施例示出的一种视频处理系统的示意图。FIG. 10 is a schematic diagram of a video processing system according to an embodiment of the present invention.

图11是根据本发明实施例示出的一种数据处理装置或者视频处理装置的示意框图。FIG. 11 is a schematic block diagram of a data processing device or a video processing device according to an embodiment of the present invention.

具体实施方式DETAILED DESCRIPTION

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

针对前述相关技术中存在的技术问题,本发明实施例提出一种数据处理方法,下面结合附图及相应实施例对上述方案进行详细描述。In view of the technical problems existing in the aforementioned related technologies, an embodiment of the present invention proposes a data processing method, which is described in detail below in conjunction with the accompanying drawings and corresponding embodiments.

本发明实施例所述数据处理方法的执行主体可以为数据处理设备,如应用程序的服务器或者客户端所处的终端设备等。其中,所述服务器可以为包含一独立主机的物理服务器,或者该服务器也可以为主机集群承载的虚拟服务器、云服务器等;所述终端设备可以为手机、平板设备、笔记本电脑、掌上电脑(PDAs,Personal Digital Assistants)、可穿戴设备(如智能眼镜、智能手表等)、VR(Virtual Reality,虚拟现实)设备、AR(AugmentedReality,增强现实)设备等,本发明一个或多个实施例并不对此进行限制。The execution subject of the data processing method described in the embodiment of the present invention may be a data processing device, such as a server of an application or a terminal device where a client is located. The server may be a physical server including an independent host, or the server may be a virtual server carried by a host cluster, a cloud server, etc.; the terminal device may be a mobile phone, a tablet device, a laptop computer, a PDA (Personal Digital Assistants), a wearable device (such as smart glasses, smart watches, etc.), a VR (Virtual Reality) device, an AR (Augmented Reality) device, etc., and one or more embodiments of the present invention are not limited to this.

图1是根据本发明实施例示出的一种数据处理方法的流程图。如图1所示,所述方法应用于数据处理系统,所述数据处理系统包括管理组件和处理组件,该方法可以包括以下步骤102-106。Fig. 1 is a flow chart of a data processing method according to an embodiment of the present invention. As shown in Fig. 1, the method is applied to a data processing system, the data processing system includes a management component and a processing component, and the method may include the following steps 102-106.

步骤102,根据待处理任务确定多个目标处理组件,所述待处理任务用于处理目标数据。Step 102, determining a plurality of target processing components according to the tasks to be processed, wherein the tasks to be processed are used to process target data.

步骤S104,所述管理组件加载所述多个目标处理组件。Step S104: the management component loads the multiple target processing components.

本发明实施例所述的管理组件可以用于管理数据处理系统中的各个处理组件,所述处理组件中预定义有相应的处理逻辑。对于所述管理组件和处理组件,从软件层面而言,任一组件可以利用任意形式的程序设计语言编程实现,例如可以采用C++等面向对象的程序设计语言实现。而从硬件层面而言,上述管理组件和处理组件均可以运行于数据处理设备的CPU(Central Processing Unit,中央处理器)中;或者,上述管理组件可以运行于数据处理设备的CPU,而处理组件可以运行于该数据处理设备的GPU(Graphics ProcessingUnit,图形处理器)中,不再赘述。The management component described in the embodiment of the present invention can be used to manage various processing components in the data processing system, and the corresponding processing logic is predefined in the processing component. For the management component and the processing component, from the software level, any component can be implemented using any form of programming language, for example, it can be implemented using object-oriented programming languages such as C++. From the hardware level, the above-mentioned management component and processing component can both run in the CPU (Central Processing Unit) of the data processing device; or, the above-mentioned management component can run in the CPU of the data processing device, and the processing component can run in the GPU (Graphics Processing Unit) of the data processing device, which will not be repeated.

所述数据处理系统接收到的所述待处理任务用于处理目标数据,即所述待处理任务可以用于向数据处理系统指示哪些数据是待处理的目标数据;相应的,所述数据处理系统执行所述待处理任务的过程,即为对所述目标数据的数据片段进行处理的过程。其中,待处理任务可以通过多种方式实现上述指示,例如,所述待处理任务可以包含所述目标数据,使得首个目标处理组件在获取到所述待处理任务的情况下,即可得到待处理的目标数据;再例如,所述待处理任务也可以包含所述目标数据的存储地址,使得首个目标处理组件可以在获取到所述待处理任务后,从所述存储地址处读取所述目标数据。又例如,所述待处理任务还可以包含其他服务的服务信息,使得首个目标处理组件可以将所述其他服务的处理结果作为所述目标数据,从而在其他任务与所述数据处理系统之间实现任务传递,具体过程不再赘述。The pending tasks received by the data processing system are used to process target data, that is, the pending tasks can be used to indicate to the data processing system which data are the target data to be processed; accordingly, the process of the data processing system executing the pending tasks is the process of processing the data segments of the target data. Among them, the pending tasks can implement the above instructions in a variety of ways. For example, the pending tasks can include the target data, so that the first target processing component can obtain the target data to be processed when the pending tasks are obtained; for another example, the pending tasks can also include the storage address of the target data, so that the first target processing component can read the target data from the storage address after obtaining the pending tasks. For another example, the pending tasks can also include service information of other services, so that the first target processing component can use the processing results of the other services as the target data, thereby realizing task transfer between other tasks and the data processing system. The specific process will not be repeated.

本方案所述待处理任务对应的目标数据可以为任意形式,根据所述目标数据的形式不同,相应的数据片段也有所不同。例如,在目标数据为视频的情况下,数据片段可以为视频帧图像或者该视频剪辑得到的视频片段;在目标数据为音频的情况下,数据片段也可以为基于该音频提取出的某一音频分量或者分割得到的音频片段;在目标数据为图像的情况下,数据片段也可以为该图像在色彩空间中的某一颜色值或者针对该图像裁剪得到的部分区域等,不再赘述。The target data corresponding to the task to be processed in this solution can be in any form, and the corresponding data segments are different according to the different forms of the target data. For example, when the target data is a video, the data segment can be a video frame image or a video segment obtained by clipping the video; when the target data is audio, the data segment can also be an audio component extracted from the audio or an audio segment obtained by segmentation; when the target data is an image, the data segment can also be a color value of the image in the color space or a partial area cropped from the image, etc., which will not be repeated here.

另外,需要说明的是,所述算法任务和所述待处理任务虽然都称为“任务”,但二者含义并不相同,所述算法任务是所述数据处理系统用于实现预设处理逻辑的功能组件(即所述处理组件),而所述待处理任务是数据处理系统可以执行的任务,具体的,所述管理组件可以先确定并加载相应的目标处理组件,并由被加载的各个目标处理组件分别按照自身的处理逻辑对目标数据的数据片段进行处理,以执行所述处理组件。In addition, it should be noted that although the algorithm task and the task to be processed are both called "tasks", their meanings are not the same. The algorithm task is a functional component (i.e., the processing component) used by the data processing system to implement a preset processing logic, while the task to be processed is a task that can be executed by the data processing system. Specifically, the management component can first determine and load the corresponding target processing component, and each loaded target processing component can process the data fragments of the target data according to its own processing logic to execute the processing component.

在接收到所述待处理任务的情况下,管理组件可以先根据该任务确定多个目标处理组件。其中,管理组件可以根据待处理任务的需求信息确定多个目标处理组件,其中,所述需求信息用于指示目标数据的处理需求,该信息可以包含下述至少之一:所述目标数据的元信息、所述待处理任务的发起方配置信息、所述数据处理系统提供的默认功能信息。例如,管理组件可以预先获取数据的元信息与处理组件之前的映射关系。所述处理组件可以包括下述至少之一:编码组件、解码组件、插帧组件、降噪组件、超分辨率(Super-Resolution)组件、高动态范围组件、细节修复组件、灰度化组件等。上述映射关系可以预先设置或由数据处理系统预先获取,进而在确定所述目标数据的元信息后,管理组件可以根据所述映射关系确定该元信息对应的多个处理组件,并将其作为所述待处理任务对应的多个目标处理组件。In the case of receiving the task to be processed, the management component may first determine multiple target processing components according to the task. Among them, the management component may determine multiple target processing components according to the demand information of the task to be processed, wherein the demand information is used to indicate the processing requirements of the target data, and the information may include at least one of the following: the meta information of the target data, the configuration information of the initiator of the task to be processed, and the default function information provided by the data processing system. For example, the management component may pre-acquire the mapping relationship between the meta information of the data and the processing component. The processing component may include at least one of the following: an encoding component, a decoding component, an interpolation component, a noise reduction component, a super-resolution component, a high dynamic range component, a detail repair component, a grayscale component, etc. The above mapping relationship can be pre-set or pre-acquired by the data processing system, and then after determining the meta information of the target data, the management component can determine the multiple processing components corresponding to the meta information according to the mapping relationship, and use it as the multiple target processing components corresponding to the task to be processed.

其中,所述元信息可以采用枚举形式,示例性的,其枚举成员可以参见下表1。The meta information may be in enumerated form. For example, the enumerated members may refer to the following Table 1.

表1Table 1

再例如,所述待处理任务的发起方(如所述数据处理设备的用户)可以为该任务设置配置信息(即所述发起方配置信息),从而,管理组件可以基于所述配置信息确定所述多个目标处理组件。如所述发起方可以通过所述配置信息指定目标处理组件,以便用户准确向管理组件准确地指定执行待处理任务所需的目标处理组件。或者,发起方也可以通过所述配置信息指定所述目标数据的处理效果,使管理组件可以将该处理效果对应的多个处理组件确定为所述目标数据对应的多个目标处理组件。此时,用户无需知晓数据处理系统执行待处理任务需要何种处理组件,而只需要指在待处理任务执行完毕后目标数据实现的功能效果即可,从而实现了对各个处理组件的功能化封装,使得数据处理系统对其用户黑箱化,有助于提升简化用户使用流程,提升待处理任务的执行效率。For another example, the initiator of the task to be processed (such as the user of the data processing device) can set configuration information for the task (i.e., the initiator configuration information), so that the management component can determine the multiple target processing components based on the configuration information. For example, the initiator can specify the target processing component through the configuration information, so that the user can accurately specify the target processing component required to execute the task to be processed to the management component. Alternatively, the initiator can also specify the processing effect of the target data through the configuration information, so that the management component can determine the multiple processing components corresponding to the processing effect as the multiple target processing components corresponding to the target data. At this time, the user does not need to know what kind of processing component the data processing system needs to execute the task to be processed, but only needs to refer to the functional effect achieved by the target data after the task to be processed is completed, thereby realizing the functional encapsulation of each processing component, making the data processing system black-box for its users, which helps to simplify the user usage process and improve the execution efficiency of the task to be processed.

以所述数据处理设备的用户为例,数据处理设备可以为用户提供针对所述数据处理系统的图形操作界面或编程界面,从而用户可以在所述图形操作界面中实施操作或者在所述编程界面中编辑指令代码实现与所述数据处理系统的交互。以图形操作界面为例,用户可以在该界面中指定目标数据并生成相应的待处理任务,从而数据处理系统可以获知所述待处理任务和目标数据。进一步的,用户可以针对所述待处理任务发起加载指令,该指令中包含的组件标识即用于向数据处理系统指示多个目标处理组件。如用户可以在前述图形界面中展示出的、数据处理系统包含的处理组件中选取多个处理组件,所述加载指令中即包含被选取的各个处理组件的组件标识。相应的,管理组件可以响应于所述加载指令,将该指令中包含的各个组件标识分别表征的处理组件(即前述被选取的处理组件)确定为所述多个目标处理组件。另外,上述触发指令中还可以包含所述多个目标处理组件的加载顺序,以便管理组件获取该加载顺序并按照该顺序依次加载各个目标处理组件。如用户可以在前述图形操作界面中编辑所述加载顺序或者按照所述组件标识的选取顺序确定所述加载顺序等,不再赘述。或者,用户也可以在前述编程界面中编辑用于加载所述多个目标处理组件的程序代码,该程序代码中即可用于指定多个目标处理组件。当然,上述代码也可以用于指定所述多个目标处理组件的加载/执行顺序(如各个目标处理组件的任务添加函数的先后顺序即可作为所述加载顺序),从而管理组件在执行上述程序代码的过程中,即可按照所述加载顺序依次加载所述多个目标处理组件至所述数据处理系统,实现各个处理组件的有序加载/执行。通过该方式,用户可以向数据处理系统指定用于处理目标数据的多个目标处理组件。Taking the user of the data processing device as an example, the data processing device can provide the user with a graphical operation interface or programming interface for the data processing system, so that the user can implement operations in the graphical operation interface or edit instruction codes in the programming interface to interact with the data processing system. Taking the graphical operation interface as an example, the user can specify the target data in the interface and generate the corresponding tasks to be processed, so that the data processing system can know the tasks to be processed and the target data. Further, the user can initiate a loading instruction for the tasks to be processed, and the component identification contained in the instruction is used to indicate multiple target processing components to the data processing system. If the user can select multiple processing components from the processing components contained in the data processing system displayed in the aforementioned graphical interface, the loading instruction includes the component identification of each selected processing component. Accordingly, the management component can respond to the loading instruction and determine the processing components represented by each component identification contained in the instruction (i.e., the aforementioned selected processing components) as the multiple target processing components. In addition, the above trigger instruction can also include the loading order of the multiple target processing components, so that the management component obtains the loading order and loads each target processing component in sequence according to the order. For example, the user can edit the loading order in the aforementioned graphical operation interface or determine the loading order according to the selection order of the component identifiers, etc., which will not be repeated here. Alternatively, the user can also edit the program code for loading the multiple target processing components in the aforementioned programming interface, and the program code can be used to specify multiple target processing components. Of course, the above code can also be used to specify the loading/execution order of the multiple target processing components (such as the order in which the tasks of each target processing component are added can be used as the loading order), so that the management component can load the multiple target processing components to the data processing system in sequence according to the loading order during the execution of the above program code, so as to realize the orderly loading/execution of each processing component. In this way, the user can specify multiple target processing components for processing target data to the data processing system.

又例如,所述数据处理系统也可以预先设置有默认功能信息,其中任一默认功能信息可以对应于至少一个处理组件,基于此,管理组件可以在所述待处理任务的发起方并未指定目标处理组件的情况下,按照所述默认功能信息直接确定相应的处理组件作为所述目标处理组件。其中,所述默认功能信息可以由数据处理系统的开发人员预先生成,或者也可以由所述数据处理设备的用户在发起所述待处理任务之前预先设置,本发明实施例并不对此进行限定。For another example, the data processing system may also be pre-set with default function information, wherein any default function information may correspond to at least one processing component, based on which, when the initiator of the task to be processed does not specify the target processing component, the management component may directly determine the corresponding processing component as the target processing component according to the default function information. The default function information may be pre-generated by the developer of the data processing system, or may be pre-set by the user of the data processing device before initiating the task to be processed, and the embodiment of the present invention is not limited to this.

另外,可以预先创建数据信息与候选处理组件之间的映射关系,以一个数据信息与一个候选处理组件之间的单映射关系为例:视频可以对应于解码组件和编码组件、1280*720分辨率可以对应于插帧组件、4K分辨率可以对应于抽帧组件等。当然,上述数据信息与候选处理组件之间也可以建立一对多、多对一或者多对多地映射关系,不再赘述。基于此,管理组件即可在确定目标数据的视频信息后查询所述映射关系以确定所述至少一个处理组件。通过该方式,管理组件可以准确、快速地查询到匹配于目标数据的数据信息的至少一个处理组件。或者,管理组件也可以根据对历史数据的处理记录统计不同数据信息与各个候选处理组件匹配概率,从而可以将与所述目标数据的数据信息的匹配概率最大的候选处理组件确定为所述至少一个处理组件。通过该方式,管理组件可以使得确定出的至少一个处理组件尽可能符合用户的使用习惯。当然,上述过程中也可以同时确定所述至少一个处理组件的加载顺序,不再赘述。In addition, a mapping relationship between data information and candidate processing components can be created in advance. Take a single mapping relationship between a data information and a candidate processing component as an example: video can correspond to a decoding component and an encoding component, 1280*720 resolution can correspond to an interpolation component, 4K resolution can correspond to a frame extraction component, etc. Of course, a one-to-many, many-to-one or many-to-many mapping relationship can also be established between the above data information and the candidate processing components, which will not be repeated. Based on this, the management component can query the mapping relationship after determining the video information of the target data to determine the at least one processing component. In this way, the management component can accurately and quickly query at least one processing component that matches the data information of the target data. Alternatively, the management component can also count the matching probabilities of different data information and each candidate processing component based on the processing records of historical data, so that the candidate processing component with the highest matching probability with the data information of the target data can be determined as the at least one processing component. In this way, the management component can make the determined at least one processing component as consistent with the user's usage habits as much as possible. Of course, the loading order of the at least one processing component can also be determined at the same time in the above process, which will not be repeated.

在一实施例中,所述数据处理系统可以包括算法服务和算法任务。其中,所述算法服务是对算法任务的流程化管理,用于对全部算法任务进行高并发调度,实现资源最大化利用,以达到最高效的处理效率。所述算法任务是对待处理任务对应的目标数据进行算法处理的所有任务的集合。所述算法服务可以包括所述管理组件、源组件和同步组件,所述源组件用于生成所述处理组件。所述算法任务可以包括所述处理组件,即所述各个处理组件可以视为所述数据处理系统中用于实现预设处理逻辑的算法任务。所述算法服务和算法任务的具体生成及运行情况可见下文实施例的记载,此处暂不赘述。In one embodiment, the data processing system may include an algorithm service and an algorithm task. The algorithm service is a process management of the algorithm task, which is used to perform high-concurrency scheduling of all algorithm tasks to maximize resource utilization and achieve the most efficient processing efficiency. The algorithm task is a collection of all tasks that perform algorithmic processing on the target data corresponding to the task to be processed. The algorithm service may include the management component, the source component and the synchronization component, and the source component is used to generate the processing component. The algorithm task may include the processing component, that is, each processing component can be regarded as an algorithm task for implementing a preset processing logic in the data processing system. The specific generation and operation of the algorithm service and algorithm task can be seen in the description of the following embodiments, which will not be repeated here.

在一实施例中,所述数据处理系统可以采用面向对象(Object Oriented)的程序设计语言编程实现,如C++、C#、java、python等。利用这类程序设计语言,可以通过类(Class)实现前述算法服务和算法任务,如所述算法服务包括三部分:流程管理类(对应于管理组件)、任务创建类(对应于源组件)、数据同步类(对应于同步组件)。其中,所述任务创建类用于创建算法任务,如创建包含多个算法功能的任务集合;所述数据同步类包含配置算法任务的输入、输出节点,用于在目标处理组件之间同步数据片段,以保障不同算法任务之间数据片段的传递和同步;所述流程管理类用于对算法任务进行任务调度(如添加算法任务和/或删除算法任务)、资源管理(如针对算法任务的资源分配和释放)、状态In one embodiment, the data processing system can be implemented by programming in an object-oriented programming language, such as C++, C#, java, python, etc. Using this type of programming language, the aforementioned algorithm services and algorithm tasks can be implemented through classes. For example, the algorithm service includes three parts: a process management class (corresponding to the management component), a task creation class (corresponding to the source component), and a data synchronization class (corresponding to the synchronization component). Among them, the task creation class is used to create algorithm tasks, such as creating a task set containing multiple algorithm functions; the data synchronization class includes configuring the input and output nodes of the algorithm task, which is used to synchronize data fragments between target processing components to ensure the transmission and synchronization of data fragments between different algorithm tasks; the process management class is used to perform task scheduling (such as adding algorithm tasks and/or deleting algorithm tasks), resource management (such as resource allocation and release for algorithm tasks), and status synchronization for algorithm tasks.

监控(监管算法任务的运行状态)与管理等。通过算法服务对算法任务的管理,能够使目5标数据的各个数据片段依次经过各个算法任务进行数据处理,每个算法任务只专注于自身的处理逻辑所对应的处理步骤,判断自身的资源占用情况,只要当前资源空闲,就可以接受相邻的前一计算任务的数据,并激活该任务进行数据处理,也就是说各个算法任务可以并行处理。通过以上三类可以实现对算法任务的流程化管理,从而可以将所述数据处理系统实现为按照一定顺序处理目标数据中至少部分数据片段的“流水线(pipeline)”。Monitoring (supervising the running status of algorithm tasks) and management, etc. Through the management of algorithm tasks by algorithm services, each data fragment of the target data can be processed by each algorithm task in turn. Each algorithm task only focuses on the processing steps corresponding to its own processing logic and judges its own resource occupancy. As long as the current resources are idle, it can accept the data of the adjacent previous computing task and activate the task for data processing. In other words, each algorithm task can be processed in parallel. Through the above three categories, the process management of algorithm tasks can be realized, so that the data processing system can be realized as a "pipeline" that processes at least part of the data fragments in the target data in a certain order.

0在一实施例中,所述数据处理系统还可以包含源组件,所述源组件可以包含预定义规In one embodiment, the data processing system may further include a source component, wherein the source component may include a predefined rule.

则,所述源组件可以基于所述预定义规则生成所述目标处理组件。其中,所述预定义规则可以包括预定义的函数和/或规则。通过该方式,可以确保所生成的目标处理组件符合前述预定义规则。在一实施例中,目标处理组件由源组件生成,因此包含了源组件中的预定义规则,进一步执行预定义规则生成最终进行数据处理的目标处理组件。Then, the source component can generate the target processing component based on the predefined rules. The predefined rules may include predefined functions and/or rules. In this way, it can be ensured that the generated target processing component complies with the aforementioned predefined rules. In one embodiment, the target processing component is generated by the source component, and thus includes the predefined rules in the source component, and further executes the predefined rules to generate the target processing component that finally performs data processing.

5其中,所述任务创建类可以是基类(或称基础类),此时,所述目标处理组件可以由5 Wherein, the task creation class may be a base class (or basic class), in which case the target processing component may be

所述基类派生生成,即该目标处理组件为对应于所述基类的派生类。在该方式下,作为派生类的目标处理组件通常符合基类中预定义的数据格式、函数、成员变量等。例如,所述任务创建类的成员变量中可以包含目标处理组件的基类信息,如目标处理单元的配置信The base class is derived, that is, the target processing component is a derived class corresponding to the base class. In this way, the target processing component as a derived class usually conforms to the data format, function, member variables, etc. predefined in the base class. For example, the member variables of the task creation class can contain the base class information of the target processing component, such as the configuration information of the target processing unit.

息、前向节点、后向节点、数据传递机制和数据处理的具体方式等。通过该派生类执行预0定义的规则(如成员函数)生成最终进行数据处理的目标处理组件。Information, forward nodes, backward nodes, data transfer mechanism and specific methods of data processing, etc. The derived class executes the pre-defined rules (such as member functions) to generate the target processing component that finally processes the data.

需要说明的是,前述目标处理组件的生成过程可以适用于数据处理系统中的各个处理组件,即所述处理组件中的任一处理组件均可以采用前述方式生成。当然,任一处理组件也可以由其他设备生成后提供至所述数据处理系统。另外,数据处理系统包含的各个处理It should be noted that the generation process of the target processing component described above can be applied to each processing component in the data processing system, that is, any processing component in the processing component can be generated in the above manner. Of course, any processing component can also be generated by other devices and then provided to the data processing system. In addition, each processing component included in the data processing system

组件可以基于该系统开发完成,如所述处理组件的数据格式、数据传输方式等组件参数能5够满足所述数据处理系统的运行要求,从而确保各个处理组件能够被管理组件顺利加载。Components can be developed based on the system. For example, component parameters such as data format and data transmission mode of the processing component can meet the operation requirements of the data processing system, thereby ensuring that each processing component can be successfully loaded by the management component.

所述管理组件在根据所述待处理任务确定出多个目标处理组件后,可以加载这些处理组件。承接于前述实施例,所述管理组件可以将所述多个目标处理组件添加至组件列表中,并启动所述组件列表中的各个目标处理组件。其中,所述管理组件可以维护一组件列表,After determining multiple target processing components according to the tasks to be processed, the management component can load these processing components. Continuing from the above embodiment, the management component can add the multiple target processing components to a component list and start each target processing component in the component list. The management component can maintain a component list.

该列表可以用于记录所述待处理任务对应的各个目标处理组件的组件。考虑到所述数据处0理系统可能同时处理多个待处理任务,所述管理组件可以同时维护各个待处理任务分别对应的组件列表,其中任一待处理任务对应的组件列表可以用于记录该根据该任务确定出的各个目标处理组件。或者,所述管理组件也可以仅维护一个组件列表,该列表用于记录各个待处理任务分别对应的各个目标处理组件,此时,前述被启动的“所述组件列表中的各个目标处理组件”,应当被理解为根据所述待处理任务确定出的多个待处理任务,而可能并非当前时刻全部待处理任务对应的全部目标处理组件。The list can be used to record the components of each target processing component corresponding to the pending task. Considering that the data processing system may process multiple pending tasks at the same time, the management component can simultaneously maintain component lists corresponding to each pending task, wherein the component list corresponding to any pending task can be used to record the target processing components determined according to the task. Alternatively, the management component can also maintain only one component list, which is used to record the target processing components corresponding to each pending task. In this case, the aforementioned "target processing components in the component list" that are activated should be understood as multiple pending tasks determined according to the pending tasks, and may not be all target processing components corresponding to all pending tasks at the current moment.

其中,所述管理组件将所述多个目标处理组件中的至少一个目标处理组件添加至组件列表中,可以包括:所述管理组件识别所述至少一个目标处理组件是否由所述源组件生成,若是,则可以将所述至少一个目标处理组件添加至组件列表中;若否,则可以拒绝将所述至少一个目标处理组件添加至组件列表中。若所述至少一个目标处理组件由源组件生成,则这些目标处理组件将遵循所述源组件的前述预设规则,所以加载完成后的该组件将能够符合所述预设规则,所以在前述判断通过时添加该目标处理组件并,能够确保被添加至组件列表的各个目标处理组件均符合所述预设规则,从而确保被加载的各个目标处理组件均能够正常启动。Wherein, the management component adds at least one of the multiple target processing components to the component list, which may include: the management component identifies whether the at least one target processing component is generated by the source component, and if so, the at least one target processing component may be added to the component list; if not, the at least one target processing component may be refused to be added to the component list. If the at least one target processing component is generated by the source component, these target processing components will follow the aforementioned preset rules of the source component, so the component after loading will be able to comply with the preset rules, so when the aforementioned judgment is passed, the target processing component is added and it can be ensured that each target processing component added to the component list complies with the preset rules, thereby ensuring that each loaded target processing component can be started normally.

另外,将任一目标处理组件记录在所述组件列表中,具体可以将该组件的组件信息记录在该列表中;基于此,所述管理组件可以获取所述组件列表中的各个目标处理组件的组件信息,并基于所述组件信息,启动所述各个目标处理组件。其中,所述组件信息用于表明所述目标处理组件的身份(即用于表明是哪个处理组件)。对于被记录的任一目标处理组件,该组件的组件信息可以包括该组件对应的成员变量,如该组件的组件名称、组件标识、前向节点、后向节点等。In addition, any target processing component is recorded in the component list, and specifically, the component information of the component can be recorded in the list; based on this, the management component can obtain the component information of each target processing component in the component list, and start each target processing component based on the component information. The component information is used to indicate the identity of the target processing component (i.e., to indicate which processing component it is). For any recorded target processing component, the component information of the component can include member variables corresponding to the component, such as the component name, component identifier, forward node, backward node, etc. of the component.

所述管理组件可以通过多种方式获取任一目标处理组件的成员变量。例如,管理组件可以将任一目标处理组件加载至相应的线程中,可利用算法任务线程函数,为算法任务线程创建提供函数指针,使每个算法任务都在单独的线程中处理,启动任务函数会调用该指针进行线程创建。在基于所述算法任务线程函数创建所述线程的过程中,管理组件先需要访问所述任一目标处理组件的成员函数以获取所述成员变量。为了确保管理组件能够顺利访问任一目标处理组件的成员函数,可以预先将所述算法任务线程函数定义为友元函数。此时,管理组件可以访问所述友元函数以获取所述任一目标处理组件的成员变量。或者,在所述管理组件为基类、所述任一目标处理组件为所述基类对应的派生类(即基于所述基类派生得到)的情况下,也可以将所述任一目标处理组件定义为所述管理组件的成员变量,此时所述管理组件可以直接访问所述处理组件的成员变量。The management component can obtain the member variables of any target processing component in a variety of ways. For example, the management component can load any target processing component into the corresponding thread, and can use the algorithm task thread function to provide a function pointer for the algorithm task thread creation, so that each algorithm task is processed in a separate thread, and the startup task function will call the pointer to create a thread. In the process of creating the thread based on the algorithm task thread function, the management component first needs to access the member function of any target processing component to obtain the member variables. In order to ensure that the management component can smoothly access the member function of any target processing component, the algorithm task thread function can be defined as a friend function in advance. At this time, the management component can access the friend function to obtain the member variables of any target processing component. Alternatively, in the case where the management component is a base class and any target processing component is a derived class corresponding to the base class (i.e., derived based on the base class), any target processing component can also be defined as a member variable of the management component, and the management component can directly access the member variables of the processing component.

其中,为了避免不同目标处理组件之间可能产生的资源竞争等不利影响,各个目标处理组件可以分别运行在不同线程(Thread)中。可以理解的是,各个线程可以属于同一进程(Process),此时,各个线程分别用于执行待处理任务中对应于各个目标处理组件的子任务,所述进程可以被视为前述待处理任务的执行方。或者,为了便于实现对各个线程的统一管理和调度,前述多个目标处理组件也可以运行在同一线程中,本发明实施例并不对此进行限定。Among them, in order to avoid adverse effects such as resource competition that may arise between different target processing components, each target processing component can be run in a different thread. It can be understood that each thread can belong to the same process. At this time, each thread is used to execute the subtask corresponding to each target processing component in the task to be processed, and the process can be regarded as the executor of the aforementioned task to be processed. Alternatively, in order to facilitate the unified management and scheduling of each thread, the aforementioned multiple target processing components can also run in the same thread, and the embodiment of the present invention does not limit this.

数据处理设备可以通过调用并执行可执行文件的方式加载目标处理组件并执行待处理任务。以所述目标数据为.mp4格式的视频为例,数据处理设备可以执行下述代码:The data processing device can load the target processing component and execute the task to be processed by calling and executing the executable file. Taking the target data as a video in .mp4 format as an example, the data processing device can execute the following code:

./sr_sdk-i test_video/1080_25.mp4-m frc_1080:denoise_1080:sr1x_1080-c0-p 0-oout.mp4./sr_sdk-i test_video/1080_25.mp4-m frc_1080:denoise_1080:sr1x_1080-c0-p 0-out.mp4

其中,sr_sdk为待执行的可执行文件。-i之后的字符串(test_video/1080_25.mp4)为待处理的目标视频的文件名。-m之后的字符串(frc_1080:denoise_1080:sr1x_1080)表示用于对所述目标视频进行处理的目标处理组件,其中frc_1080为插帧组件、denoise_1080为小模型降噪组件、sr1x_1080为单帧超分辨率组件。当然,在需要对所述目标视频进行其他处理的情况下,可以将相应的目标处理组件添加在该处。示例性的,可选的目标处理组件可以参见下表2所示。Among them, sr_sdk is the executable file to be executed. The string after -i (test_video/1080_25.mp4) is the file name of the target video to be processed. The string after -m (frc_1080:denoise_1080:sr1x_1080) represents the target processing component used to process the target video, where frc_1080 is the interpolation component, denoise_1080 is the small model noise reduction component, and sr1x_1080 is the single-frame super-resolution component. Of course, if other processing is required for the target video, the corresponding target processing component can be added here. Exemplarily, the optional target processing components can be shown in Table 2 below.

表2Table 2

-c之后的数字用于表示所述目标视频的视频编码方式,其中0可以用于表示h264编码。示例性的,编码方式与数字标识之间的映射关系可以参见下表3。The number after -c is used to indicate the video encoding mode of the target video, where 0 can be used to indicate h264 encoding. For example, the mapping relationship between the encoding mode and the digital identifier can be seen in Table 3 below.

表3Table 3

数字标识Digital ID 视频编码方式Video encoding method 00 h264h264 11 h265h265 22 mpeg-1mpeg-1 33 mpeg-2mpeg-2 44 mpeg-4mpeg-4 55 wmv7wmv7 66 wmv8wmv8

-P之后的数字用于表示对所述目标视频进行编码时的像素格式,如0表示yuv420格式、1表示yuv422格式等,不再赘述。-o之后的字符串用于表示目标视频的文件存储路径和文件名等信息,如前述out.mp4表示目标视频的文件名为“out.mp4”。当然,所述目标视频的文件格式除.mp4之外,也可以为.avi、.wmv等,可参见前述记载,此处不再赘述。The number after -P is used to indicate the pixel format when encoding the target video, such as 0 for yuv420 format, 1 for yuv422 format, etc., which will not be repeated here. The string after -o is used to indicate the file storage path and file name of the target video, such as the aforementioned out.mp4 indicates that the file name of the target video is "out.mp4". Of course, in addition to .mp4, the file format of the target video can also be .avi, .wmv, etc., which can be referred to the aforementioned records, which will not be repeated here.

另外,所述HDR标准信息可以采用枚举形式,相应的枚举成员可见表4。In addition, the HDR standard information may be in enumeration form, and corresponding enumeration members may be seen in Table 4.

表4Table 4

如前所述,管理组件可以进行任务调度,如添加算法任务和/或删除算法任务等。具体的,在加载所述多个目标处理组件完成后,所述管理组件可以响应于针对任一其他处理组件的加载指令,继续加载所述任一其他处理组件。可以理解的是,所述其他处理组件是区别于被加载的多个目标处理组件之外的处理组件。和/或管理组件也可以响应于针对已加载的任一目标处理组件的卸载指令,卸载所述任一目标处理组件,即将完成加载的任一目标处理组件由已加载状态恢复为未加载状态(如在前述组件列表中杉树所述任一目标处理组件的组件信息等)。需要说明的是,加载任一其他处理组件或者卸载(已经加载完成的)任一目标处理组件,可以在执行待处理任务之前、执行待处理任务的过程中或者执行待处理任务完成后进行,本方案对于加载或卸载的实际并不进行限制。通过该方式,待处理任务的发起方(如数据处理设备的用户)可以根据待处理任务的实际情况灵活控制管理组件加载所需的目标处理组件,便于采用灵活多样的处理方式处理所述目标数据。As mentioned above, the management component can perform task scheduling, such as adding algorithm tasks and/or deleting algorithm tasks. Specifically, after loading the multiple target processing components, the management component can respond to the loading instruction for any other processing component and continue to load any other processing component. It can be understood that the other processing component is a processing component other than the multiple target processing components that are loaded. And/or the management component can also respond to the unloading instruction for any loaded target processing component to unload the any target processing component, that is, to restore any target processing component that has been loaded from a loaded state to an unloaded state (such as the component information of any target processing component described in the aforementioned component list, etc.). It should be noted that loading any other processing component or unloading any target processing component (already loaded) can be performed before executing the task to be processed, during the execution of the task to be processed, or after the execution of the task to be processed. This solution does not restrict the actual loading or unloading. In this way, the initiator of the task to be processed (such as the user of the data processing device) can flexibly control the management component to load the required target processing component according to the actual situation of the task to be processed, so as to facilitate the use of flexible and diverse processing methods to process the target data.

步骤106,加载完成的所述多个目标处理组件按序处理所述目标数据的数据片段,其中,各个目标处理组件在同一时刻分别处理不同的数据片段,至少一个数据片段被各个目标处理组件依次处理。Step 106 , the multiple target processing components that have completed loading process the data segments of the target data in sequence, wherein each target processing component processes different data segments at the same time, and at least one data segment is processed in sequence by each target processing component.

可以理解的是,通过前述实施例的加载过程,被加载的各个目标处理组件可以构成至少一条处理链路(下称流水线),其中任一处理链路中的各个目标处理组件在同一时刻可以分别处理不同的数据片段,任一目标数据对应的至少一个数据片段可以被该数据所对应处理链路中的各个目标处理组件依次处理。例如,在待处理任务包含音视频文件的情况下,所述目标数据可以包括该文件解码得到的视频文件和音频文件,此时所述视频文件和所述音频文件可以分别由不同的处理链路来处理,其中任一处理链路可以视为一条用于处理相应目标数据的流水线。在下文实施例中,如无特别说明,所述多个目标处理组件属于任一流水线。It can be understood that, through the loading process of the aforementioned embodiment, each loaded target processing component can constitute at least one processing link (hereinafter referred to as a pipeline), wherein each target processing component in any processing link can respectively process different data fragments at the same time, and at least one data fragment corresponding to any target data can be processed in sequence by each target processing component in the processing link corresponding to the data. For example, in the case where the task to be processed includes an audio and video file, the target data may include a video file and an audio file obtained by decoding the file. At this time, the video file and the audio file can be processed by different processing links respectively, wherein any processing link can be regarded as a pipeline for processing the corresponding target data. In the embodiments below, unless otherwise specified, the multiple target processing components belong to any pipeline.

如前所述,管理组件可以进行资源管理(如针对算法任务的资源分配和释放)。具体的,所述管理组件可以为各个目标处理组件分配相应的处理资源,对于任一目标处理组件而言,其可以使用管理组件为自身分配的处理资源对目标数据的数据片段进行处理。其中,所述处理资源可以包括网络资源、存储资源和计算资源等任意形式,本发明实施例并不对此进行限定。以及,在任一目标处理组件处理所述目标数据的最后一个数据片段完成后,管理组件可以释放为所述任一目标处理组件分配的处理资源,以便数据处理系统在所述任一目标处理组件处理待处理任务完成后及时回收为该组件分配的处理资源。其中,由于存在多个目标处理组件处理所述目标数据的数据片段,所以管理组件可以在任一目标处理组件处理数据片段完成后立即回收为给组件分配的处理资源;或者,也可以在全部目标处理组件分别处理数据片段完成(即数据处理系统执行待处理任务完成)后再统一回收为全部目标处理组件分配的处理资源,不再赘述。As mentioned above, the management component can perform resource management (such as resource allocation and release for algorithm tasks). Specifically, the management component can allocate corresponding processing resources to each target processing component. For any target processing component, it can use the processing resources allocated by the management component to itself to process the data fragments of the target data. Among them, the processing resources can include any form such as network resources, storage resources and computing resources, and the embodiment of the present invention does not limit this. And, after any target processing component completes processing the last data fragment of the target data, the management component can release the processing resources allocated to any target processing component, so that the data processing system can timely recycle the processing resources allocated to the component after any target processing component completes processing the pending task. Among them, since there are multiple target processing components processing the data fragments of the target data, the management component can immediately recycle the processing resources allocated to the component after any target processing component completes processing the data fragment; or, it can also be unified after all target processing components complete processing the data fragments (that is, the data processing system completes executing the pending task) and then recycle the processing resources allocated to all target processing components, which will not be repeated.

另外如前所述,各个目标处理组件可以分别运行在相应的线程中。可以理解的是,进程是操作系统分配资源的最小单位,线程是任务调动和执行的最小单位。基于此,前述管理组件针对任一目标处理组件分配资源和释放资源的过程,可以以该组件所处的线程为单位进行,即所述管理组件可以为任一目标处理组件所处的线程分配资源,并在(所述任一目标处理组件处理目标数据的数据片段完成)该线程关闭的情况下释放该线程的资源。In addition, as mentioned above, each target processing component can run in a corresponding thread respectively. It can be understood that a process is the smallest unit of resource allocation by the operating system, and a thread is the smallest unit of task mobilization and execution. Based on this, the process of resource allocation and resource release by the aforementioned management component for any target processing component can be performed in units of threads where the component is located, that is, the management component can allocate resources for the thread where any target processing component is located, and release the resources of the thread when the thread is closed (when any target processing component completes processing the data fragment of the target data).

如前所述,管理组件还可以进行状态监控(监管算法任务的运行状态)与管理等。在所述多个目标处理组件按序处理所述目标数据的数据片段的过程中,可能由于某些原因导致处理过程出现异常,如数据处理超时、数据传递失败等。对此,管理组件可以在出现异常时输出异常提醒消息,以便数据处理设备的用户通过该消息及时知晓上述异常情况。或者,管理组件也可以在出现异常时记录所述异常的相关信息,以便所述用户通过该信息分析异常原因,从而排除异常。再或者,为了避免某一异常可能对所述数据处理系统的运行造成更大范围的不利影响,同时减少异常出现之后的无效处理,管理组件还可以在出现异常时触发停止针对所述目标数据的处理过程,从而临时暂停或终止待处理任务的执行过程。As mentioned above, the management component can also perform status monitoring (supervising the running status of algorithm tasks) and management, etc. In the process of the multiple target processing components sequentially processing the data fragments of the target data, the processing process may be abnormal due to certain reasons, such as data processing timeout, data transmission failure, etc. In this regard, the management component can output an abnormal reminder message when an abnormality occurs, so that the user of the data processing device can promptly know the above abnormal situation through the message. Alternatively, the management component can also record the relevant information of the abnormality when an abnormality occurs, so that the user can analyze the cause of the abnormality through the information and eliminate the abnormality. Alternatively, in order to avoid a certain abnormality that may have a wider range of adverse effects on the operation of the data processing system and reduce invalid processing after the abnormality occurs, the management component can also trigger the stop of the processing process for the target data when an abnormality occurs, thereby temporarily pausing or terminating the execution process of the task to be processed.

在一实施例中,所述数据处理系统还可以包括前向节点和后向节点,所述目标处理组件对应一个或多个前向节点,以及所述目标处理组件对应一个或多个后向节点;其中,所述前向节点用于获取前向数据片段以供所述目标处理组件读取,所述后向节点用于获取目标处理组件处理后的后向数据片段。其中,所述前向节点和后向节点可以通过实例化前述数据同步类得到。另外,任一目标处理组件对应的前向节点和后向节点可以通过多种方式进行配置,例如,在生成各个节点后,可以在由所述任务创建类派生得到所述任一目标处理组件时,基于所述任务创建类的成员变量为该目标处理组件配置其对应的前向节点和后向节点。再例如,在生成任一目标处理组件和各个节点后,可以由所述管理组件为该目标处理组件配置相应的前向节点和后向节点。在上述设置完成后,所述任一目标处理组件的组件信息中即包含其前向节点和后向节点的节点身份信息,该信息可以被记录在所述管理组件维护的组件列表中,以便在处理目标数据的数据片段过程中查询。In one embodiment, the data processing system may further include a forward node and a backward node, the target processing component corresponds to one or more forward nodes, and the target processing component corresponds to one or more backward nodes; wherein the forward node is used to obtain a forward data segment for the target processing component to read, and the backward node is used to obtain a backward data segment processed by the target processing component. Wherein, the forward node and the backward node can be obtained by instantiating the aforementioned data synchronization class. In addition, the forward node and the backward node corresponding to any target processing component can be configured in a variety of ways. For example, after generating each node, when any target processing component is derived from the task creation class, the corresponding forward node and backward node can be configured for the target processing component based on the member variables of the task creation class. For another example, after generating any target processing component and each node, the management component can configure the corresponding forward node and backward node for the target processing component. After the above settings are completed, the component information of any target processing component includes the node identity information of its forward node and backward node. This information can be recorded in the component list maintained by the management component for query during the process of processing the data fragment of the target data.

如前所述,所述多个目标处理组件用于按序处理目标数据的数据片段,因此所述多个目标处理组件存在相应的处理顺序。该处理顺序中的首个目标处理组件可以不存在前向节点,或者,也可以将该目标处理组件的前向节点设置为空节点;类似的,所述数据顺序中的最后一个目标处理组件可以不存在后向节点,或者,也可以将该目标处理组件的后向节点设置为空节点。另外,对于该处理顺序中的任意两个相邻的目标处理组件,前一目标处理组件的后向节点与后一目标处理组件的前向节点可以为同一节点。As mentioned above, the multiple target processing components are used to process the data segments of the target data in sequence, so the multiple target processing components have a corresponding processing sequence. The first target processing component in the processing sequence may not have a forward node, or the forward node of the target processing component may be set to an empty node; similarly, the last target processing component in the data sequence may not have a backward node, or the backward node of the target processing component may be set to an empty node. In addition, for any two adjacent target processing components in the processing sequence, the backward node of the previous target processing component and the forward node of the next target processing component may be the same node.

基于为目标处理组件配置的所述前向节点和后向节点,相邻的目标处理组件之间可以传递数据片段。例如,任一目标处理组件在所述前向节点处于可读状态时,可以获取前向数据片段。其中,所述前向数据片段可以是由所述任一目标处理组件的前一目标处理组件处理得到数据片段本身,也可以是该数据片段的存储地址,在此不作限定。该前向数据片段可以由所述前一目标处理组件传递至所述前向节点(如写入所述前向节点),从而所述任一目标处理组件可以从其前向节点处读取所述前向数据片段进行数据处理操作。当前向数据片段为数据片段本身是,目标处理组件可以直接进行数据处理,当前向数据片段为存储地址时,目标处理组件可以根据存储地址获取其指向的数据片段,进行数据处理。在所述任一目标处理组件从所述前向节点处获取到所述前向数据片段后,所述前向节点可以由可读状态更新为可写状态。此后,所述任一目标处理组件可以执行数据处理操作以得到相应的后向数据片段,具体的,可以按照自身的预设处理逻辑对数据片段进行处理。进而,在所述后向节点处于可写状态时,所述后向节点可以获取所述任一目标处理组件处理得到的所述后向数据片;以及,在获取所述后向数据片段后,所述后向节点可以从可写状态更新为可读状态。其中,后向数据片段可以是当前目标处理组件进行数据处理后得到的数据片段本身,也可以是处理后的数据存储地址,在此不作限定。可以理解的是,在所述后向节点更新为可读状态后,若所述任一目标处理组件的后向节点与所述后一目标处理组件的前向节点为同一节点,则所述后一目标处理组件可以在该节点处于可读状态的情况下从该节点处获取所述后向数据片段;或者,在所述任一目标处理组件的后向节点与所述后一目标处理组件的前向节点并非同一节点的情况下,所述任一目标处理组件的后向节点与所述后一目标处理组件的前向节点可以依次连接。对此,在所述任一目标处理组件的后向节点处于可读状态的情况下,后一目标处理组件的前向节点可以从该后向节点处获取所述后向处理数据并记录在本地,以便所述后一目标处理组件从该前向节点处获取所述后向处理数据。可以理解的是,该后向数据片段对于所述后一目标处理组件而言是其前向数据片段。Based on the forward node and backward node configured for the target processing component, data segments can be transferred between adjacent target processing components. For example, any target processing component can obtain the forward data segment when the forward node is in a readable state. Wherein, the forward data segment can be the data segment itself obtained by the previous target processing component of any target processing component, or it can be the storage address of the data segment, which is not limited here. The forward data segment can be transferred to the forward node by the previous target processing component (such as writing to the forward node), so that any target processing component can read the forward data segment from its forward node for data processing operations. When the forward data segment is the data segment itself, the target processing component can directly perform data processing. When the forward data segment is a storage address, the target processing component can obtain the data segment pointed to by the storage address and perform data processing. After any target processing component obtains the forward data segment from the forward node, the forward node can be updated from a readable state to a writable state. After that, any target processing component can perform data processing operations to obtain corresponding backward data segments, and specifically, can process the data segments according to its own preset processing logic. Furthermore, when the backward node is in a writable state, the backward node can obtain the backward data segment obtained by processing any target processing component; and, after obtaining the backward data segment, the backward node can be updated from a writable state to a readable state. Among them, the backward data segment can be the data segment itself obtained after the current target processing component performs data processing, or it can be the data storage address after processing, which is not limited here. It can be understood that after the backward node is updated to a readable state, if the backward node of any target processing component and the forward node of the latter target processing component are the same node, then the latter target processing component can obtain the backward data segment from the node when the node is in a readable state; or, if the backward node of any target processing component and the forward node of the latter target processing component are not the same node, the backward node of any target processing component and the forward node of the latter target processing component can be connected in sequence. In this regard, when the backward node of any target processing component is in a readable state, the forward node of the latter target processing component can obtain the backward processing data from the backward node and record it locally, so that the latter target processing component obtains the backward processing data from the forward node. It can be understood that the backward data segment is the forward data segment of the latter target processing component.

另外,所述前向数据片段或者所述后向数据片段可以按照整型、浮点型(单精度浮点型float或双精度浮点型double)、字符型(char)等格式存储。所述存储地址可以为所述数据片段在所述预设存储空间的存储地址,如在所述内存中的存储地址等。具体的,可以通过调用数据类型转换函数实现精度转换。该函数的参数列表可参见下表5。In addition, the forward data segment or the backward data segment can be stored in the format of integer, floating point (single precision floating point type float or double precision floating point type double), character (char), etc. The storage address can be the storage address of the data segment in the preset storage space, such as the storage address in the memory, etc. Specifically, the precision conversion can be achieved by calling a data type conversion function. The parameter list of the function can be seen in Table 5 below.

表5Table 5

参数parameter 输入/输出类型Input/Output Type 参数说明Parameter Description 整形内存数据Integer memory data 输入/输出参数Input/Output Parameters 8位整型数据8-bit integer data 浮点型显存数据Floating point memory data 输入/输出参数Input/Output Parameters 32位浮点型数据32-bit floating point data

图2是根据本发明实施例示出的一种数据处理系统的架构示意图。如图2所示,管理组件中定义有n个基类,即所述基类1~n,其中,n为大于1的整数。需要说明的是,图2所示基类与目标处理组件之间的对应关系是为了表明目标处理组件是基于相应基类创建的派生类,在方案实施过程中,所述基类1~n也可以完全相同,即管理组件中可以预定一个基类,而且根据待处理任务确定的多个目标处理组件均可以通过该基类生成并完成加载。在加载完成后,所述目标处理组件1~n即构成一条用于执行待处理任务(即用于处理目标数据的数据片段)的流水线。图2所示相邻目标处理组件之间仅示出了一个同步组件,如同步组件1可以作为目标处理组件1的后向同步节点和目标处理组件2的前向同步节点,同步组件2可以作为目标处理组件2的后向同步节点和目标处理组件3的前向同步节点等,不再赘述。当然,对于任意两个相邻的目标处理组件,其中前一目标处理组件的后向节点和后一目标处理组件的前向节点也可以互不相同,如目标处理组件1和2之间可以配置同步组件12和同步组件21(图中并未示出),琼中同步组件12可以作为目标处理组件1的后向节点,同步组件21可以作为目标处理组件2的前向节点,不再赘述。FIG. 2 is a schematic diagram of the architecture of a data processing system according to an embodiment of the present invention. As shown in FIG. 2 , n base classes are defined in the management component, namely, the base classes 1 to n, where n is an integer greater than 1. It should be noted that the correspondence between the base class and the target processing component shown in FIG. 2 is to indicate that the target processing component is a derived class created based on the corresponding base class. During the implementation of the solution, the base classes 1 to n can also be completely the same, that is, a base class can be predetermined in the management component, and multiple target processing components determined according to the task to be processed can be generated and loaded through the base class. After loading is completed, the target processing components 1 to n constitute a pipeline for executing the task to be processed (i.e., for processing the data fragment of the target data). Only one synchronization component is shown between adjacent target processing components shown in FIG. 2, such as synchronization component 1 can be used as a backward synchronization node of target processing component 1 and a forward synchronization node of target processing component 2, and synchronization component 2 can be used as a backward synchronization node of target processing component 2 and a forward synchronization node of target processing component 3, etc., which will not be repeated. Of course, for any two adjacent target processing components, the backward node of the previous target processing component and the forward node of the next target processing component may also be different from each other. For example, a synchronization component 12 and a synchronization component 21 (not shown in the figure) can be configured between target processing components 1 and 2. The synchronization component 12 can serve as the backward node of target processing component 1, and the synchronization component 21 can serve as the forward node of target processing component 2. No further details will be given.

在一实施例中,所述目标处理组件可以包括数据等待模块,该模块具体可以为所述目标处理组件中预定义的数据等待函数。前述实施例所述任一目标处理组件从其前向节点处读取所述前向数据片段的过程,具体可以由所述数据等待模块实现。例如,该模块可以响应所述目标处理组件在所述前向节点处于可读状态时读取所述前向数据片段。在前向数据片段为存储地址时,所述数据等待模块可以读取该存储地址,此后再利用所述目标数据组件中预定义的数据获取函数获取(如读取)所述存储地址处记录的前一目标数据组件处理得到的数据片段。在一实施例中,所述目标处理组件可以包括数据传递模块,该模块具体可以为所述目标处理组件中预定义的数据等待函数。前述实施例所述任一目标处理组件将自身处理得到的后向数据片段传递至后向节点的过程,具体可以由所述数据传递模块实现。例如,所述数据传递模块可以在目标处理组件完成数据处理操作后,在所述后向节点处于可写状态时将所述后向数据片段传递至所述后向节点。其中所述数据传递模块可以从所述任一目标处理组件处获取后向数据片段(数据片段本身或存储地址),然后将所述后向数据片段写入所述后向节点。在一实施例中,所述目标数据可以包括音频和/或视频,所述多个目标处理组件可以包括编码组件、智能算法组件和解码组件。其中,所述智能算法组件的数量可以为一个或多个。在所述目标数据包括视频的情况下,所述智能算法组件包括下述至少之一的子算法组件:插帧组件、降噪组件、超分辨率组件、高动态范围组件、细节修复组件,当然,在方案实施过程中,所述子算法组件可以根据实际情况进行扩展,如包括灰度化组件等,不再赘述。以视频为例,所述解码组件用于将所述视频解码处理为各个视频帧,所述智能算法组件用于基于预定义的AI算法逻辑对所述视频帧进行处理(如插帧处理、降噪处理等),所述编码用于将所述智能算法组件处理后输出的处理后视频帧进行编码处理,从而生成所述视频对应的处理后视频。可以理解的是,由于所述处理后视频基于被所述智能算法组件依次处理得到的处理后视频帧生成,所以处理后视频在播放过程中即可呈现出所述智能算法组件对应的处理后显示效果。In one embodiment, the target processing component may include a data waiting module, which may specifically be a data waiting function predefined in the target processing component. The process of any target processing component reading the forward data fragment from its forward node described in the aforementioned embodiment may be specifically implemented by the data waiting module. For example, the module may respond to the target processing component reading the forward data fragment when the forward node is in a readable state. When the forward data fragment is a storage address, the data waiting module may read the storage address, and then use the data acquisition function predefined in the target data component to obtain (such as read) the data fragment processed by the previous target data component recorded at the storage address. In one embodiment, the target processing component may include a data transfer module, which may specifically be a data waiting function predefined in the target processing component. The process of any target processing component in the aforementioned embodiment transferring the backward data fragment processed by itself to the backward node may be specifically implemented by the data transfer module. For example, the data transfer module may transfer the backward data fragment to the backward node when the backward node is in a writable state after the target processing component completes the data processing operation. The data transfer module can obtain a backward data segment (the data segment itself or the storage address) from any of the target processing components, and then write the backward data segment to the backward node. In one embodiment, the target data may include audio and/or video, and the multiple target processing components may include an encoding component, an intelligent algorithm component, and a decoding component. Among them, the number of the intelligent algorithm components may be one or more. In the case where the target data includes a video, the intelligent algorithm component includes at least one of the following sub-algorithm components: a frame insertion component, a noise reduction component, a super-resolution component, a high dynamic range component, and a detail repair component. Of course, during the implementation of the solution, the sub-algorithm component can be expanded according to actual conditions, such as including a grayscale component, etc., which will not be repeated. Taking video as an example, the decoding component is used to decode the video into individual video frames, the intelligent algorithm component is used to process the video frames based on a predefined AI algorithm logic (such as frame insertion processing, noise reduction processing, etc.), and the encoding is used to encode the processed video frames output after processing by the intelligent algorithm component, thereby generating a processed video corresponding to the video. It can be understood that since the processed video is generated based on the processed video frames processed in sequence by the intelligent algorithm component, the processed video can present the processed display effect corresponding to the intelligent algorithm component during the playback process.

在一实施例中,所述数据处理设备的CPU中可以具有多个处理器核心(Core),即In one embodiment, the CPU of the data processing device may have multiple processor cores, that is,

该CPU为多核CPU。在上述多核(MultiCore)场景下,若所述目标处理组件的数量为多5个且所述数据处理系统运行于所述多核CPU中,则所述多个目标处理组件可以采用下述The CPU is a multi-core CPU. In the above multi-core scenario, if the number of the target processing components is greater than 5 and the data processing system runs in the multi-core CPU, the multiple target processing components can be configured as follows:

之一的方式运行。例如,所述多个目标处理组件可以运行在同一处理器核心中,以便于实现对各个线程的统一管理和调度,并提升CPU核心的资源利用率。再例如,在所述CPU核心的数量不小于目标处理组件的数量的情况下,各个目标处理组件也可以分别运行在不For example, the multiple target processing components may be run in the same processor core to facilitate unified management and scheduling of each thread and improve the resource utilization of the CPU core. For another example, when the number of the CPU cores is not less than the number of the target processing components, each target processing component may also be run in different CPU cores.

同的CPU核心中,以尽量避免不同目标处理组件之间的干扰,提升各个目标处理组件的0运行效率。又例如,管理组件也可以根据多个CPU核心的负载情况灵活调整各个目标处In the same CPU core, the interference between different target processing components can be avoided as much as possible, and the operation efficiency of each target processing component can be improved. For another example, the management component can also flexibly adjust the load of each target processing component according to the load of multiple CPU cores.

理组件所处的CPU核心,以便实现负载均衡,从而尽量避免对CPU核心的正常运行造成干扰。又例如,任一目标处理组件也可以由多个处理器核心分别运行,此时,所述多个处理器核心可能存在数据交互,从而通过多个处理器内核之间的相互配合,共同实现所述任一目标处理组件的预期功能。The CPU core where the target processing component is located is used to achieve load balancing, thereby avoiding interference with the normal operation of the CPU core as much as possible. For another example, any target processing component can also be run by multiple processor cores respectively. At this time, the multiple processor cores may have data interaction, so that the expected function of any target processing component is jointly achieved through the mutual cooperation between the multiple processor cores.

5在又一实施例中,所述数据处理设备中可以装配多个GPU,其中,可以将根据所述In another embodiment, the data processing device may be equipped with a plurality of GPUs, wherein the GPUs according to the

待处理任务确定的多个目标处理组件部署在多个GPU中。如在数据处理系统包括多个前述流水线的情况下,将各个流水线分别部署在不同的GPU中;和/或,也可以将其中任一流水线分别部署在多个GPU中(此时所述多个GPU中分别部署有所述任一流水线)。所The multiple target processing components determined by the task to be processed are deployed in multiple GPUs. If the data processing system includes multiple pipelines, each pipeline is deployed in a different GPU; and/or, any pipeline can be deployed in multiple GPUs (in this case, any pipeline is deployed in each of the multiple GPUs).

述目标处理组件还可以包括分发组件和集合组件。所述目标数据中的各个数据片段可以分0别具有相应的序列号,任意两个数据片段的序列号互不相同,所述序列号用于表征所述各The target processing component may also include a distribution component and a collection component. Each data fragment in the target data may have a corresponding serial number, and the serial numbers of any two data fragments are different. The serial number is used to characterize the

个数据片段在所述目标数据中的先后顺序。例如,各个视频帧可以分别具有自身的帧序号,任一视频帧的帧序号即可用于确定该视频帧在所述视频中所处的位置(即该视频帧位于所述视频的时间轴中的哪一时刻)。For example, each video frame may have its own frame number, and the frame number of any video frame can be used to determine the position of the video frame in the video (i.e., at which moment the video frame is located in the timeline of the video).

基于所述序列号,所述分发组件和集合组件可以用于处理数据片段。例如,所述分发5组件可以将所述解码组件输出的各个数据片段分别分发至相应的智能算法组件。具体的,Based on the sequence number, the distribution component and the collection component can be used to process the data fragments. For example, the distribution component can distribute each data fragment output by the decoding component to the corresponding intelligent algorithm component. Specifically,

可以将不同流水线对应的数据片段分别分发至属于不同流水线的目标处理组件,也可以将同一流水线对应的不同数据片段分别分发至该不同GPU中部署的属于该流水线的目标处理组件。各个智能算法组件可以分别处理自身接收到的数据片段,并将处理得到的处理后The data fragments corresponding to different pipelines can be distributed to the target processing components belonging to different pipelines, and the different data fragments corresponding to the same pipeline can also be distributed to the target processing components belonging to the pipeline deployed in different GPUs. Each intelligent algorithm component can process the data fragments it receives and send the processed data to the target processing components.

数据片段分别传递至所述集合组件。该集合组件可以接收各个智能算法组件分别传递的处0理后数据片段,并按照所述序列号将接收到的各个处理后数据片段依次发送至所述编码组件。通过该方式,可以将目标数据的各个数据片段准确分发至相应的智能算法组件进行处理,而且各个智能算法组件可以在处理完成后立即将处理后数据片段传递至集合组件,并由后者按照所述先后顺序将各个处理后数据片段依次发送至编码组件。不仅实现了对各个目标数据片段的乱序重组,从而确保待处理任务的执行结果的准确性,还能够避免智能算法组件的等待,有助于提升其数据处理效率。The data fragments are passed to the collection component respectively. The collection component can receive the processed data fragments respectively passed by each intelligent algorithm component, and send the received processed data fragments to the encoding component in sequence according to the sequence number. In this way, each data fragment of the target data can be accurately distributed to the corresponding intelligent algorithm component for processing, and each intelligent algorithm component can pass the processed data fragment to the collection component immediately after the processing is completed, and the latter will send each processed data fragment to the encoding component in sequence according to the sequence. Not only does it achieve the disordered reorganization of each target data fragment, thereby ensuring the accuracy of the execution result of the task to be processed, but it can also avoid the waiting of the intelligent algorithm component, which helps to improve its data processing efficiency.

在一个实施例中,不同智能算法组件可以位于不同的GPU中,分发组件将解码组件输出的各个数据片段分别分发至相应的智能算法组件,即发送至不同GPU对应的智能算法组件中。分发规则可以预先按照一定顺序(如序列号、接收解码组件的顺序)分发至不同的GPU/智能算法组件,可以根据GPU不同的可用资源/空间进行动态分发,在此不作限定。集合单元接收到数据片段后,按照序列号一次发送至编码组件,发送过程可以是接收到数据片段后,识别是否符合序列号顺序,若符合序列号顺序则立即发送至编码组件,也可以集合多个数据片段后再按照序列号顺序进行发送。所述序列号可以由所述分发组件分发时进行标记。In one embodiment, different intelligent algorithm components can be located in different GPUs, and the distribution component distributes each data fragment output by the decoding component to the corresponding intelligent algorithm component, that is, sends it to the intelligent algorithm components corresponding to different GPUs. The distribution rules can be distributed to different GPUs/intelligent algorithm components in advance in a certain order (such as serial number, order of receiving decoding components), and can be dynamically distributed according to different available resources/spaces of the GPU, which is not limited here. After the collection unit receives the data fragment, it sends it to the encoding component once according to the serial number. The sending process can be to identify whether it meets the sequence number order after receiving the data fragment. If it meets the sequence number order, it is immediately sent to the encoding component, or it can collect multiple data fragments and then send them in the sequence number order. The sequence number can be marked by the distribution component when distributing it.

下面对数据处理系统中目标处理组件的加载过程以及各个组件相互配合执行待处理任务的过程进行说明。如前所述,数据处理系统中的组件可以分为算法服务和算法任务两类,针对所述算法服务,数据处理系统可以提供算法服务接口,以用于算法服务与算法任务之间的任务管理和服务调用;针对所述算法任务,数据处理系统可以提供算法任务接口,以用于调用具体的算法任务,例如解码组件,智能算法组件,编码组件等。所述算法服务接口和算法任务接口可以通过接口函数和相应的成员变量实现。示例性的,所述算法服务接口的接口函数和成员变量可以参见下表6。The following is an explanation of the loading process of the target processing component in the data processing system and the process of each component cooperating with each other to execute the task to be processed. As mentioned above, the components in the data processing system can be divided into two categories: algorithm services and algorithm tasks. For the algorithm service, the data processing system can provide an algorithm service interface for task management and service calls between the algorithm service and the algorithm task; for the algorithm task, the data processing system can provide an algorithm task interface for calling specific algorithm tasks, such as decoding components, intelligent algorithm components, encoding components, etc. The algorithm service interface and the algorithm task interface can be implemented through interface functions and corresponding member variables. Exemplarily, the interface functions and member variables of the algorithm service interface can be seen in Table 6 below.

表6Table 6

CZ2214464-PX2231246JZCNCZ2214464-PX2231246JZCN

其中,所述数据同步类可以通过对数据节点的管理,保障算法任务之间的数据传递和数据同步。所述数据节点类为数据同步类的成员变量,其定义了算法任务数据传递所需要的具体操作,其所包含的成员列表可以参见下表7。The data synchronization class can ensure data transfer and data synchronization between algorithm tasks by managing data nodes. The data node class is a member variable of the data synchronization class, which defines the specific operations required for algorithm task data transfer. The member list it contains can be found in Table 7 below.

表7Table 7

所述数据同步类通过是由所述任务创建类基于相应的创建规范创建的算法任务,算法任务基于此规范创建后,可添加至算法服务中进行流程化管理。其中,基于此规范创建的所述算法任务中可以包含所述规范。The data synchronization class is an algorithm task created by the task creation class based on the corresponding creation specification. After the algorithm task is created based on this specification, it can be added to the algorithm service for process management. The algorithm task created based on this specification can include the specification.

通过前向节点配置函数和后向节点配置函数可以为任一目标处理组件配置相应的数据同步类(如该类实例化得到的所述前向节点和后向节点),以用于确定所述任一目标处理组件在处理流程中的位置,并且保证算法任务间数据传递的同步。启动全部算法任务之前,要配置好算法任务的前后节点,其参数列表见表8。The forward node configuration function and the backward node configuration function can be used to configure the corresponding data synchronization class (such as the forward node and backward node instantiated by the class) for any target processing component to determine the position of any target processing component in the processing flow and ensure the synchronization of data transmission between algorithm tasks. Before starting all algorithm tasks, the forward and backward nodes of the algorithm tasks must be configured. The parameter list is shown in Table 8.

表8Table 8

函数名称Function name 输入/输出类型Input/Output Type 参数说明Parameter Description 算法任务前向/后向节点配置函数Algorithm task forward/backward node configuration function 输入参数Input Parameters 参数类型为数据同步类Parameter type is data synchronization class

所述数据等待函数和数据传递函数用于使算法任务可以在数据节点中获取以及数据传递,其参数列表可以参见表9。The data waiting function and data transfer function are used to enable the algorithm task to obtain and transfer data in the data node. The parameter list can be found in Table 9.

表9Table 9

函数名称Function name 输入/输出类型Input/Output Type 参数说明Parameter Description 数据等待/传递函数参数列表Data waiting/transfer function parameter list 输入参数Input Parameters 参数类型为数据节点类The parameter type is data node class

图3是根据本发明实施例示出的一种管理组件的工作流程示意图。如图3所示,针对待处理任务的一次完整处理过程可以包括下述步骤302-308:Fig. 3 is a schematic diagram of a workflow of a management component according to an embodiment of the present invention. As shown in Fig. 3, a complete processing process for a task to be processed may include the following steps 302-308:

步骤302,通过执行初始化函数init()初始化数据处理系统。Step 302: Initialize the data processing system by executing the initialization function init().

管理组件中可以包含预定义的成员变量,如前述目标处理组件的基类FrameProcessCla目标数据、处理组件的算法任务线程函数Process_thread()、处理组件出错信息获取函数get_thread_e待处理任务or()等。当然,所述管理组件中还可以包含其他预定义内容,本发明实施例并不对此进行限定。在加载目标处理组件之前,管理组件可以先执行初始化函数init()以对上述成员变量、功能函数等预定义内容进行初始化,从而完成对所述数据处理系统的初始化过程。The management component may include predefined member variables, such as the base class FrameProcessCla target data of the target processing component, the algorithm task thread function Process_thread() of the processing component, the error information acquisition function get_thread_e to-be-processed task or() of the processing component, etc. Of course, the management component may also include other predefined contents, which are not limited in the embodiment of the present invention. Before loading the target processing component, the management component may first execute the initialization function init() to initialize the predefined contents such as the above-mentioned member variables, function functions, etc., thereby completing the initialization process of the data processing system.

步骤304,通过执行任务添加函数add_task()将所述多个目标处理组件添加至管理组件维护的组件列表中。Step 304: Add the multiple target processing components to the component list maintained by the management component by executing the task adding function add_task().

在初始化完成后,针对根据所述待处理任务确定出的多个目标处理组件,管理组件可以执行任务添加函数add_task(),其中,该函数的入参可以为所述多个目标处理组件中各个组件的组件信息。当然,在上述添加完成后,管理组件还可以响应于卸载指令,卸载组件列表中已记录的一个或多个目标处理组件(如从该列表中删除所述目标处理组件的组件信息),不再赘述。After the initialization is completed, for the multiple target processing components determined according to the to-be-processed tasks, the management component can execute the task adding function add_task(), wherein the input parameter of the function can be the component information of each component in the multiple target processing components. Of course, after the above addition is completed, the management component can also respond to the uninstallation instruction to uninstall one or more target processing components recorded in the component list (such as deleting the component information of the target processing component from the list), which will not be repeated.

步骤306,通过执行任务启动函数start_task()启动被添加至所述任务列表的各个目标处理组件。Step 306: Start each target processing component added to the task list by executing the task start function start_task().

在上述添加完成后,管理组件可以执行任务启动函数start_task()以启动各个目标处理组件。相应的,在目标处理组件启动完成后,即可视为所述数据处理系统中对应于岁哦书待处理任务的流水线启动完成。此后,各个目标处理组件即可按序处理所述目标数据的数据片段,从而完成对所述待处理任务的执行过程。After the above addition is completed, the management component can execute the task start function start_task() to start each target processing component. Correspondingly, after the target processing component is started, it can be regarded that the pipeline startup corresponding to the task to be processed in the data processing system is completed. Thereafter, each target processing component can process the data fragments of the target data in sequence, thereby completing the execution process of the task to be processed.

可以理解的是,所述步骤304~306即为加载所述多个目标处理组件的过程,换言之,加载过程包括添加和启动两个子过程。It can be understood that steps 304 to 306 are the process of loading the multiple target processing components. In other words, the loading process includes two sub-processes: adding and starting.

步骤308,通过执行任务关闭函数start_task()关闭数据处理系统。Step 308: Shut down the data processing system by executing the task shutdown function start_task().

在上述待处理任务执行完毕后,管理组件可以执行任务关闭函数start_task()以关闭所述流水线。此处需要说明的是,本发明实施例对于待处理任务所对应目标数据的数量并不进行限定,如所述待处理任务可以仅对应于一个视频,或者也可以同时对应于多个视频或者多段音频等。而管理组件可以在处理所述待处理任务中的最后一个目标数据完毕后,执行上述任务关闭函数start_task()以关闭所述流水线。当然,所述管理组件也可以在执行所述待处理任务后继续执行其他任务,并在执行完毕所述其他任务的情况下,再执行上述任务关闭函数start_task()以关闭所述流水线,不再赘述。After the above-mentioned pending tasks are completed, the management component can execute the task closing function start_task() to close the pipeline. It should be noted here that the embodiment of the present invention does not limit the number of target data corresponding to the pending tasks. For example, the pending tasks may correspond to only one video, or may correspond to multiple videos or multiple audios at the same time. The management component can execute the above-mentioned task closing function start_task() to close the pipeline after processing the last target data in the pending tasks. Of course, the management component can also continue to execute other tasks after executing the pending tasks, and execute the above-mentioned task closing function start_task() to close the pipeline after completing the execution of the other tasks, which will not be repeated.

可以理解的是,所述步骤106应当在步骤306和步骤308之间执行,下面对所述步骤306的执行情况进行说明。其中,数据处理系统中的各个目标处理组件可以按序处理目标数据的数据片段,所述按序处理可以有多种实现方式,下面分别进行说明:It is understandable that step 106 should be performed between step 306 and step 308. The following describes the execution of step 306. Each target processing component in the data processing system can process the data segments of the target data in sequence. There are many ways to implement the sequential processing, which are described below:

在一实施例中,所述数据处理系统中运行的任一目标处理组件可以依次处理所述目标数据的各个数据片段,其中:在所述任一目标处理组件不为所述数据处理系统中的最后一个目标处理组件的情况下,所述任一目标处理组件在处理任一数据片段后,可以将相应的处理结果传递至后一目标处理组件进行处理;以及,在所述任一目标处理组件为所述数据处理系统中的最后一个目标处理组件的情况下,所述任一目标处理组件可以在处理最后一个数据片段后输出相应的处理结果,以作为数据处理系统针对所述目标数据的处理结果,即所述待处理任务的执行结果。具体的,所述任一目标处理组件可以按照自身预定义的处理逻辑处理自身接收到的各个数据片段。根据目标处理组件所实现的功能不同,该目标处理组件的处理逻辑也有所不同,如在所述任一目标处理组件为解码组件(用于对视频进行解码)的情况下,其处理逻辑可以为预设的解码算法;如在所述任一目标处理组件为超分辨率组件(用于提升视频帧图像的分辨率)的情况下,其处理逻辑可以为预设的上采样算法,不再赘述。In one embodiment, any target processing component running in the data processing system can process each data segment of the target data in sequence, wherein: when any target processing component is not the last target processing component in the data processing system, after processing any data segment, any target processing component can pass the corresponding processing result to the next target processing component for processing; and, when any target processing component is the last target processing component in the data processing system, any target processing component can output the corresponding processing result after processing the last data segment as the processing result of the data processing system for the target data, that is, the execution result of the task to be processed. Specifically, any target processing component can process each data segment received by itself according to its own predefined processing logic. Depending on the different functions implemented by the target processing component, the processing logic of the target processing component is also different. For example, when any target processing component is a decoding component (used to decode the video), its processing logic can be a preset decoding algorithm; when any target processing component is a super-resolution component (used to improve the resolution of the video frame image), its processing logic can be a preset upsampling algorithm, which will not be repeated.

如前所述,数据处理系统中加载有多个目标处理组件,其中,任意两个相邻的目标处理组件之间存在单向的数据传递,即按照各个目标处理组件对应的处理顺序,前一目标处理组件会将自身处理数据片段后得到的处理结果(即前述处理后数据片段或后向数据片段)传递至后一目标处理组件。As mentioned above, multiple target processing components are loaded in the data processing system, among which there is a one-way data transmission between any two adjacent target processing components, that is, according to the processing order corresponding to each target processing component, the previous target processing component will transmit the processing result obtained after processing the data segment itself (that is, the aforementioned processed data segment or backward data segment) to the next target processing component.

如图2所示,不妨假设n=4,此时目标处理组件4为数据处理系统中的最后一个目标处理组件,目标处理组件1在处理任一数据片段完成后,可以将相应的处理结果(下称一级数据片段,下同)传递至目标处理组件2;相应的,目标处理组件2可以将自身对一级数据片段进行处理得到的二级数据片段传递至目标处理组件3、目标处理组件3可以将自身对二级数据片段进行处理得到的三级数据片段传递至目标处理组件4。而作为数据处理系统中最后一个目标处理组件,目标处理组件4可以将自身对三级数据片段进行处理得到的四级数据片段直接输出,以作为对所述目标数据的处理结果的一部分;或者,也可以在完成对目标数据的最后一个数据片段的处理后,根据多个数据片段的四级数据片段生成针对目标数据的最终处理结果,并输出该最终处理结果。由此可见,从目标数据的任一数据片段的角度而言,数据处理系统中的各个目标处理组件串行处理该数据片段。换言之,各个目标处理组件按序处理目标数据的数据片段,可以包括各个目标处理组件依次串行处理所述目标数据的各个数据片段。As shown in FIG2 , let us assume that n=4. In this case, the target processing component 4 is the last target processing component in the data processing system. After the target processing component 1 completes processing any data segment, it can pass the corresponding processing result (hereinafter referred to as the first-level data segment, the same below) to the target processing component 2; accordingly, the target processing component 2 can pass the second-level data segment obtained by processing the first-level data segment to the target processing component 3, and the target processing component 3 can pass the third-level data segment obtained by processing the second-level data segment to the target processing component 4. As the last target processing component in the data processing system, the target processing component 4 can directly output the fourth-level data segment obtained by processing the third-level data segment as part of the processing result of the target data; or, after completing the processing of the last data segment of the target data, it can generate the final processing result for the target data according to the fourth-level data segments of multiple data segments, and output the final processing result. It can be seen from this that from the perspective of any data segment of the target data, each target processing component in the data processing system processes the data segment in series. In other words, each target processing component processes the data segments of the target data in sequence, which can include each target processing component sequentially processing each data segment of the target data.

在另一实施例中,在任一目标处理组件处理任一数据片段的过程中,其他目标处理组件可以同时处理目标数据的其他数据片段,且各个目标处理组件的处理过程相互独立。例如,目标处理组件1在将任一一级数据片段传递至目标处理组件2的情况下,目标处理组件2可以按照自身的处理逻辑开始处理该一级数据片段,而目标处理组件1可以开始获取并处理下一个数据片段。类似的,目标处理组件2在将任一二级数据片段传递至目标处理组件3的情况下,目标处理组件3可以按照自身的处理逻辑开始处理该二级数据片段,而目标处理组件2可以开始获取并处理下一个一级数据片段;目标处理组件3在将任一三级数据片段传递至目标处理组件4的情况下,目标处理组件4可以按照自身的处理逻辑开始处理该三级数据片段,而目标处理组件3可以开始获取并处理下一个二级数据片段。再例如,在图2中的目标处理组件4在处理目标数据的第i个数据片段的同时,目标处理组件1、2和3可以分别处理数据片段的第i-3、第i-2和第i-1个数据片段。由此可见,从各个目标处理组件的角度而言,各个数据处理系统并行处理不同的数据片段。也就是说,各个目标处理组件按序处理目标数据的数据片段,还可以包括各个目标处理组件依次串行处理所述目标数据的同一数据片段,且各个目标处理组件并行处理不同的数据片段。In another embodiment, in the process of any target processing component processing any data fragment, other target processing components can simultaneously process other data fragments of the target data, and the processing processes of each target processing component are independent of each other. For example, when target processing component 1 passes any primary data fragment to target processing component 2, target processing component 2 can start processing the primary data fragment according to its own processing logic, and target processing component 1 can start acquiring and processing the next data fragment. Similarly, when target processing component 2 passes any secondary data fragment to target processing component 3, target processing component 3 can start processing the secondary data fragment according to its own processing logic, and target processing component 2 can start acquiring and processing the next primary data fragment; when target processing component 3 passes any tertiary data fragment to target processing component 4, target processing component 4 can start processing the tertiary data fragment according to its own processing logic, and target processing component 3 can start acquiring and processing the next secondary data fragment. For another example, when target processing component 4 in FIG. 2 processes the i-th data fragment of the target data, target processing components 1, 2, and 3 can respectively process the i-3, i-2, and i-1 data fragments of the data fragment. It can be seen that from the perspective of each target processing component, each data processing system processes different data fragments in parallel. That is, each target processing component processes the data fragments of the target data in sequence, and each target processing component can also process the same data fragment of the target data in series in sequence, and each target processing component processes different data fragments in parallel.

图4是根据本发明实施例示出的一种目标处理组件的工作流程示意图。如图4所示,该过程包括步骤402-410:Fig. 4 is a schematic diagram of a work flow of a target processing component according to an embodiment of the present invention. As shown in Fig. 4, the process includes steps 402-410:

步骤402,配置前向节点和后向节点。Step 402, configure the forward node and the backward node.

在加载任一目标处理组件之前,管理组件可以先配置该目标处理组件的前向节点和后向节点。所述任一目标处理组件与其前一目标处理组件之间的同步组件可以视为所述任一目标处理组件的前向节点,所述任一目标处理组件与其后一目标处理组件之间的同步组件可以视为所述任一目标处理组件的后向节点。如图2所示,在n=4的情况下,目标处理组件1不存在前向节点或者其前向节点为空、其后向节点为同步组件1;目标处理组件2的前向节点和后向节点分别为同步组件1和2,目标处理组件3的前向节点和后向节点分别为同步组件2和3;目标处理组件4的前向节点为同步组件3、不存在后向节点或者其后向节点为空。Before loading any target processing component, the management component can first configure the forward node and backward node of the target processing component. The synchronization component between any target processing component and its previous target processing component can be regarded as the forward node of any target processing component, and the synchronization component between any target processing component and its subsequent target processing component can be regarded as the backward node of any target processing component. As shown in Figure 2, in the case of n=4, target processing component 1 does not have a forward node or its forward node is empty, and its backward node is synchronization component 1; the forward node and backward node of target processing component 2 are synchronization components 1 and 2 respectively, and the forward node and backward node of target processing component 3 are synchronization components 2 and 3 respectively; the forward node of target processing component 4 is synchronization component 3, and there is no backward node or its backward node is empty.

具体的,管理组件可以根据所述处理顺序确定任一目标处理组件的前向节点和后向节点,进而在执行前述任务添加函数add_task()之前,依次针对该目标处理组件执行前向节点配置函数pre_node()和后向节点配置函数next_node()。其中,所述前向节点配置函数pre_node()的入参可以包括所述任一目标处理组件及其前向节点的节点标识,所述后向节点配置函数next_node()的入参可以包括所述任一目标处理组件及其后向节点的节点标识。通过该方式,管理组件可以完成对任一目标处理组件的前向组件和后向组件的配置,此后可以通过执行前述任务添加函数add_task()将所述任一目标处理组件加载所述组件列表。其中,管理组件可以执行针对所述各个目标处理组件的任务添加函数add_task(),而在确定出各个目标处理组件的处理顺序的情况下,管理组件可以按照该处理顺序依次执行针对各个目标处理组件的任务添加函数。可见,各个目标处理组件的任务添加函数add_task()的执行顺序,可以作为所述各个目标处理组件的加载顺序,从而实现了对各个目标处理组件的有序加载以及启动之后的各个目标处理组件的有序运行。另外,本方案所述各个目标处理组件的处理顺序,即为各个目标处理组件针对同一数据片段的处理顺序,即所述多个目标处理组件可以按照其对应的处理顺序依次处理同一数据片段。Specifically, the management component can determine the forward node and backward node of any target processing component according to the processing order, and then before executing the aforementioned task adding function add_task(), execute the forward node configuration function pre_node() and the backward node configuration function next_node() for the target processing component in sequence. Among them, the input parameter of the forward node configuration function pre_node() can include the node identification of any target processing component and its forward node, and the input parameter of the backward node configuration function next_node() can include the node identification of any target processing component and its backward node. In this way, the management component can complete the configuration of the forward component and the backward component of any target processing component, and then the aforementioned task adding function add_task() can be executed to load the component list of any target processing component. Among them, the management component can execute the task adding function add_task() for each target processing component, and when the processing order of each target processing component is determined, the management component can execute the task adding function for each target processing component in sequence according to the processing order. It can be seen that the execution order of the task adding function add_task() of each target processing component can be used as the loading order of each target processing component, thereby realizing the orderly loading of each target processing component and the orderly operation of each target processing component after startup. In addition, the processing order of each target processing component in this solution is the processing order of each target processing component for the same data fragment, that is, the multiple target processing components can process the same data fragment in sequence according to their corresponding processing order.

步骤404,等待前向节点处于可读状态时,从所述前向节点处获取前向数据片段。Step 404: When waiting for the forward node to be in a readable state, obtain the forward data segment from the forward node.

在加载完成各个目标处理组件完成后,数据处理系统中被加载的各个目标处理组件即可参与处理目标数据的数据片段。其中,任一目标处理组件的前一目标处理组件可以将自身处理得到的数据片段(该数据片段相对于所述前一目标处理组件是后向数据片段,相对于所述任一目标处理组件时前向数据片段)传递至自身的后向节点。在该后向节点为所述任一目标处理组件的前向节点的情况下,所述任一目标处理组件可以等待该前向节点处于可读状态;而在该后向节点并非所述任一目标处理组件的前向节点的情况下,所述任一目标处理组件的前向节点可以在该后向节点处于可读状态时,从该节点处获取所述前向数据片段。在该前向节点写入所述前向数据片段后,该节点可以更新为可读状态。After the loading of each target processing component is completed, each target processing component loaded in the data processing system can participate in processing the data segment of the target data. Among them, the previous target processing component of any target processing component can pass the data segment processed by itself (the data segment is a backward data segment relative to the previous target processing component, and a forward data segment relative to any target processing component) to its own backward node. In the case where the backward node is the forward node of any target processing component, the any target processing component can wait for the forward node to be in a readable state; and in the case where the backward node is not the forward node of any target processing component, the forward node of any target processing component can obtain the forward data segment from the node when the backward node is in a readable state. After the forward node writes the forward data segment, the node can be updated to a readable state.

从而,所述任一目标处理组件可以在所述前向节点处于可读状态,从所述前向节点处获取前向数据片段。具体的,可以从所述前向节点处直接读取所述前向数据片段,也可以读取该片段的存储地址,进而从该存储地址处获取所述前向数据片段。具体可以参见前述实施例的记载,此处不再赘述。当然,对于数据处理系统中的第一个目标处理组件,由于其并不存在前向节点,所以其可以接收其他设备发送来的所述前向数据片段或者从预设存储空间中读取所述前向数据片段。Thus, any of the target processing components can obtain the forward data segment from the forward node when the forward node is in a readable state. Specifically, the forward data segment can be directly read from the forward node, or the storage address of the segment can be read, and then the forward data segment can be obtained from the storage address. For details, please refer to the description of the aforementioned embodiment, which will not be repeated here. Of course, for the first target processing component in the data processing system, since it does not have a forward node, it can receive the forward data segment sent by other devices or read the forward data segment from a preset storage space.

其中,从前向节点处获取前向数据片段的过程,可以通过执行数据等待函数wait()实现,而该函数的执行结果可以为所述前向数据片段。The process of obtaining the forward data fragment from the forward node can be implemented by executing the data waiting function wait(), and the execution result of the function can be the forward data fragment.

步骤406,按照自身的处理逻辑处理获取到的前向数据片段。Step 406: Process the acquired forward data segment according to its own processing logic.

在接收到所述前向数据片段之后,所述任一目标处理组件即可开始按照自身的处理逻5辑处理该数据片段,具体处理方式不再赘述。其中,处理所述前向数据片段的过程可以通After receiving the forward data segment, any target processing component may start to process the data segment according to its own processing logic, and the specific processing method will not be described in detail.

过执行数据处理函数Process()实现,该函数的函数体中可以记录前述处理逻辑的逻辑代码,从而该函数的执行结果即为对所述前向数据片段的处理结果。This is achieved by executing a data processing function Process(), in the function body of which the logic code of the aforementioned processing logic can be recorded, so that the execution result of the function is the processing result of the forward data segment.

步骤408,向后向节点输出处理完成的数据片段。Step 408: Output the processed data segments to the backward node.

在处理所述前向数据片段完成后,所述任一目标处理组件可以将处理得到的后向数据0片段传递至其后向节点。其中,传递该后向数据片段的过程可以通过调用数据传递函数pose()实现,该函数的入参即为所述后向数据片段或其存储地址。在所述传递完成后,所述后向节点可以将自身状态更新为可读状态,以便下一目标处理组件(或其前向节点)从该节点处读取所述前向数据片段或其存储地址。After processing the forward data segment, any target processing component can pass the processed backward data 0 segment to its backward node. The process of passing the backward data segment can be implemented by calling the data transfer function pose(), and the input parameter of the function is the backward data segment or its storage address. After the transfer is completed, the backward node can update its own state to a readable state so that the next target processing component (or its forward node) can read the forward data segment or its storage address from the node.

步骤410,关闭目标处理组件。Step 410, shut down the target processing component.

5在所述任一目标处理组件处理所述目标数据的最后一个数据片段完成的情况下,可以5. When any target processing component completes processing the last data segment of the target data,

确定该目标处理组件完成了针对所述目标数据的前述子任务。此时,管理组件可以触发关闭该目标处理组件;或者也可以等待最后一个目标处理组件对目标数据的最后一个数据片段处理完成后关闭该目标处理组件。其中,所述任一目标处理组件可以触发自身关闭,或Determine that the target processing component has completed the aforementioned subtask for the target data. At this point, the management component can trigger the closing of the target processing component; or it can wait for the last target processing component to complete processing the last data segment of the target data and then close the target processing component. Among them, any of the target processing components can trigger its own closing, or

者也可以由所述管理组件控制关闭该目标处理组件。具体的,可以通过执行针对所述任一0目标处理组件的组件关闭函数close()的方式该组件。Alternatively, the target processing component may be closed by the management component. Specifically, the component may be closed by executing a component closing function close() for any of the target processing components.

在一实施例中,可以为任一同步组件设置共享变量,该共享变量用于存储被传递的数据片段,所述共享变量的取值即为被传递的数据片段或其存储地址、哈希值等。如对于任一目标处理组件的前向节点和后向节点而言,所述前向节点的共享变量用于存储前一目标In one embodiment, a shared variable can be set for any synchronization component. The shared variable is used to store the transmitted data fragment. The value of the shared variable is the transmitted data fragment or its storage address, hash value, etc. For example, for the forward node and the backward node of any target processing component, the shared variable of the forward node is used to store the previous target node.

处理组件向所述任一目标处理组件传递的前向数据片段,所述后向节点的共享变量用于存5储所述任一目标处理组件向后一目标处理组件传递的后向数据片段。其中,在任一同步组The forward data segment transmitted by the processing component to any target processing component, and the shared variable of the backward node is used to store the backward data segment transmitted by any target processing component to the next target processing component.

件处于可写状态下,其共享变量可写,即可以通过对该共享变量赋值将待传递的数据片段写入该共享变量;相应的,在任一同步组件处于可读状态下,其共享变量可读,即可以通过读取该共享变量的取值获取被写入的数据片段。When a component is in a writable state, its shared variables are writable, that is, the data fragment to be transmitted can be written into the shared variable by assigning a value to the shared variable; correspondingly, when any synchronization component is in a readable state, its shared variables are readable, that is, the written data fragment can be obtained by reading the value of the shared variable.

为便于区分,不妨将任一目标处理组件的前向节点的共享变量记为共享变量1、后向0节点的共享变量记为共享变量2。图5是根据本发明实施例示出的一种目标处理组件之间数据传递过程的示意图。下面以传递某一数据片段的完整数据为例,结合图5对数据处理系统中相邻的目标处理组件通过前述共享变量传递中间数据片段(即所述前向数据片段或者后向数据片段)的过程进行详细说明。如图5所示,该过程包括步骤502-514。For the sake of distinction, the shared variable of the forward node of any target processing component may be recorded as shared variable 1, and the shared variable of the backward node 0 may be recorded as shared variable 2. FIG5 is a schematic diagram of a data transmission process between target processing components according to an embodiment of the present invention. Taking the transmission of complete data of a certain data segment as an example, the process of transmitting intermediate data segments (i.e., the forward data segment or the backward data segment) by adjacent target processing components in the data processing system through the aforementioned shared variables is described in detail in conjunction with FIG5. As shown in FIG5, the process includes steps 502-514.

步骤502,等待共享变量1可读。Step 502, waiting for shared variable 1 to be readable.

当前目标处理组件的前一目标处理组件在处理目标数据的任一数据片段完成后,可以通过当前目标处理组件与所述前一目标处理组件之间的前向节点传递相应的处理结果(下称目标处理结果)。具体的,可以将所述目标处理结果写入共享变量1,并在写入完成后触发将所述前向节点设置为可读状态,从而使所述共享变量1可读,此时共享变量1的标志位var1_readable_sem=1。对此,所述当前目标处理组件可以通过执行状态等待函数Sem_wait()等待所述共享变量1可读,并在var1_readable_sem的值为1的情况下确定所述共享变量1可读。After the previous target processing component of the current target processing component completes processing any data segment of the target data, the corresponding processing result (hereinafter referred to as the target processing result) can be transmitted through the forward node between the current target processing component and the previous target processing component. Specifically, the target processing result can be written into shared variable 1, and after the writing is completed, the forward node is triggered to be set to a readable state, so that the shared variable 1 is readable, and the flag bit var1_readable_sem of shared variable 1 is 1. In this regard, the current target processing component can wait for the shared variable 1 to be readable by executing the state waiting function Sem_wait(), and determine that the shared variable 1 is readable when the value of var1_readable_sem is 1.

步骤504,读取共享变量1。Step 504, read shared variable 1.

步骤506,释放共享变量1可写。Step 506, releasing the shared variable 1 to be writable.

此时,所述当前目标处理组件可以读取共享变量1以获取被写入的前向数据片段,在读取完成后,所述前向节点可以更新为可写状态,即释放所述共享变量1可写。其中,可以由所述当前目标处理组件在读取完成后触发上述更新,也可以由所述前向同步组件自身在监听到读取完成后开始上述更新。具体的,可以执行状态更新函数Sem_post(),从而将var1_writeable_sem的值设置为1,以用于表征共享变量1可写。At this time, the current target processing component can read shared variable 1 to obtain the forward data segment to be written. After the reading is completed, the forward node can be updated to a writable state, that is, the shared variable 1 is released to be writable. Among them, the above update can be triggered by the current target processing component after the reading is completed, or the forward synchronization component itself can start the above update after listening to the completion of the reading. Specifically, the state update function Sem_post() can be executed to set the value of var1_writeable_sem to 1 to indicate that shared variable 1 is writable.

当然,在步骤502-506中,所述前向节点也可以将所述前向数据片段保存在所述数据处理设备的内存中,并将相应的存储地址或者索引等结果检索信息写入所述共享变量1,并在写入完成后触发所述共享变量1可读;相应的,所述当前目标处理组件可以在确定共享变量1可读的情况下从所述共享变量1中的读取所述结果检索信息,并进一步根据该信息从所述内存的相应存储空间中读取所述前向数据片段。通过该方式,可以为所述共享变量1设置较小的存储空间,并且避免将前向数据片段写入该存储空间或从中读取该结果,从而有助于在节省存储空间的同时提升组件之间的数据传递效率。Of course, in steps 502-506, the forward node can also save the forward data segment in the memory of the data processing device, and write the corresponding storage address or index and other result retrieval information into the shared variable 1, and trigger the shared variable 1 to be readable after the writing is completed; accordingly, the current target processing component can read the result retrieval information from the shared variable 1 when it is determined that the shared variable 1 is readable, and further read the forward data segment from the corresponding storage space of the memory according to the information. In this way, a smaller storage space can be set for the shared variable 1, and it is avoided to write the forward data segment into the storage space or read the result therefrom, which helps to save storage space while improving the data transmission efficiency between components.

步骤508,处理目标处理结果。Step 508, process the target processing result.

在获取到所述目标处理结果后,所述当前目标处理组件可以按照自身的处理逻辑处理所述目标处理结果,并进一步得到后向数据片段。After acquiring the target processing result, the current target processing component may process the target processing result according to its own processing logic, and further obtain a backward data segment.

步骤510,等待共享变量2可写。Step 510, waiting for shared variable 2 to be writable.

在当前目标处理组件的后向节点从后向节点的共享变量2中读取数据(即所述当前目标处理组件在处理所述目标处理结果的前一处理结果得到的数据)完成后,可以触发将后向节点设置为可写状态,从而使共享变量2可写,此时共享变量2的标志位var1_writeable_sem=1。所述当前目标处理组件可以继续执行状态等待函数Sem_wait()等待所述共享变量2可写,并在var2_writeable_sem的值为1的情况下确定所述共享变量2可写。After the backward node of the current target processing component completes reading data from the shared variable 2 of the backward node (i.e., the data obtained by the current target processing component after processing the previous processing result of the target processing result), it can trigger the backward node to be set to a writable state, thereby making the shared variable 2 writable, and at this time, the flag bit var1_writeable_sem of the shared variable 2 = 1. The current target processing component can continue to execute the state waiting function Sem_wait() to wait for the shared variable 2 to be writable, and determine that the shared variable 2 is writable when the value of var2_writeable_sem is 1.

步骤512,为共享变量2赋值。Step 512, assign a value to shared variable 2.

步骤514,释放共享变量2可读。Step 514, release the shared variable 2 to be readable.

在确定共享变量2可写的情况下,所述当前目标处理组件可以为该变量赋值。具体的,即将所述后向数据片段(或者该结果的结果检索信息)写入所述共享变量2,并在写入完成后触发将所述后向节点更新为可读状态,即释放所述共享变量2可读。具体的,可以继续执行状态更新函数Sem_post(),从而将var2_readable_sem的值设置为1,以用于表征共享变量2可读。在上述更新完成后,所述后向节点可以通过读取所述共享变量2获取所述后向数据片段,具体过程与所述当前目标处理组件通过所述共享变量1获取所述目标处理结果的过程类似,不再赘述。When it is determined that shared variable 2 is writable, the current target processing component can assign a value to the variable. Specifically, the backward data segment (or the result retrieval information of the result) is written to the shared variable 2, and after the writing is completed, the backward node is triggered to be updated to a readable state, that is, the shared variable 2 is released to be readable. Specifically, the state update function Sem_post() can continue to be executed, so that the value of var2_readable_sem is set to 1 to characterize that shared variable 2 is readable. After the above update is completed, the backward node can obtain the backward data segment by reading the shared variable 2. The specific process is similar to the process in which the current target processing component obtains the target processing result through the shared variable 1, and will not be repeated.

通过上述方式,通过当前目标处理组件与所述前向节点之间的前向节点,所述当前目标处理组件可以获取所述前向节点处理中间数据片段得到的目标处理结果,即实现了所述目标处理结果在所述前向节点和所述当前目标处理组件之间的传递;通过当前目标处理组件与所述后向节点之间的后向节点,所述后向节点可以获取所述当前目标处理组件处理所述目标处理结果得到的后向数据片段,即实现了所述后向数据片段在所述当前目标处理组件和所述后向节点之间的传递。可见,所述数据处理系统中任意两相邻目标处理组件均可以通过前述方式实现数据的有效传递。Through the above-mentioned method, through the forward node between the current target processing component and the forward node, the current target processing component can obtain the target processing result obtained by the forward node processing the intermediate data fragment, that is, the transfer of the target processing result between the forward node and the current target processing component is realized; through the backward node between the current target processing component and the backward node, the backward node can obtain the backward data fragment obtained by the current target processing component processing the target processing result, that is, the transfer of the backward data fragment between the current target processing component and the backward node is realized. It can be seen that any two adjacent target processing components in the data processing system can realize the effective transfer of data through the above-mentioned method.

可以理解的是,因为图5实施例所述的当前目标处理组件具有前向节点和后向节点,所以该目标处理组件可以是流水线中除第一个和最后一个目标处理组件之外的任一目标处理组件。对于流水线中的第一个目标处理组件,由于没有前向节点,所以其可以应用于图5的步骤508-514;而对于流水线中的最后一个目标处理组件,由于没有后向节点,所以其可以应用于图5的步骤502-508,特此说明。It is understandable that, because the current target processing component described in the embodiment of FIG. 5 has a forward node and a backward node, the target processing component can be any target processing component in the pipeline except the first and last target processing components. For the first target processing component in the pipeline, since there is no forward node, it can be applied to steps 508-514 of FIG. 5; and for the last target processing component in the pipeline, since there is no backward node, it can be applied to steps 502-508 of FIG. 5, which is hereby explained.

在一实施例中,为了进一步提升同步组件的时间同步效果,可以为同步组件设置尽量大的存储空间(即增大同步组件的数据容量),以使同步组件可以同时存储多个中间数据片段。In one embodiment, in order to further improve the time synchronization effect of the synchronization component, a storage space as large as possible can be set for the synchronization component (ie, the data capacity of the synchronization component is increased) so that the synchronization component can store multiple intermediate data fragments at the same time.

在另一实施例中,考虑到同步组件的状态更新仍然需要消耗一定的时间,可以采用消息队列作为上述同步组件,即将待传输的中间数据片段(或其存储地址、哈希值)作为消息、同步组件连接的流水线中除最后一个目标处理组件之外的目标处理组件可以作为消息的生产者、除第一个目标处理组件之外的目标处理组件可以作为消息的消费者。从而在消息队列的容量满足的情况下,所述生产者可以在其处理任一数据片段后,立即将处理结果传递至其后向节点而不必等待其处于可读状态,从而在相邻目标处理组件之间实现更充分的异步处理。In another embodiment, considering that the state update of the synchronization component still takes a certain amount of time, a message queue can be used as the above synchronization component, that is, the intermediate data fragment to be transmitted (or its storage address, hash value) is used as a message, and the target processing components other than the last target processing component in the pipeline connected by the synchronization component can be used as message producers, and the target processing components other than the first target processing component can be used as message consumers. Therefore, when the capacity of the message queue is met, the producer can immediately pass the processing result to its backward node after processing any data fragment without waiting for it to be in a readable state, thereby achieving more adequate asynchronous processing between adjacent target processing components.

在一实施例中,在流水线中包含多个目标处理组件的情况下,任一目标处理组件在处理所述目标数据的任一数据片段的过程中,还可以从其他目标处理组件处获取所述任一数据片段的关联信息,并根据所述关联信息处理所述任一数据片段,所述关联信息由所述其他目标处理组件在处理所述任一数据片段的关联数据片段时产生。其中,上述关联数据片段可以是所述任一目标处理组件正在处理的当前数据片段的相邻数据片段或者连续预设数量的数据片段(如当前帧的相邻帧或者连续多帧等);上述关联信息可以为相邻数据片段之间的同步信息、延迟时长、参数(如灰度值等)差值等信息。利用上述信息,所述任一目标处理组件可以充分确定当前数据片段与其关联数据片段之间的相互关系,从而有助于提升所述任一目标处理组件对当前数据片段的处理准确度。In one embodiment, when a pipeline includes multiple target processing components, any target processing component can also obtain the associated information of any data segment from other target processing components during the process of processing any data segment of the target data, and process the any data segment according to the associated information, wherein the associated information is generated by the other target processing components when processing the associated data segments of any data segment. The associated data segments can be adjacent data segments of the current data segment being processed by any target processing component or a preset number of consecutive data segments (such as adjacent frames of the current frame or multiple consecutive frames, etc.); the associated information can be synchronization information, delay duration, parameter (such as grayscale value, etc.) difference between adjacent data segments, and other information. Using the above information, any target processing component can fully determine the relationship between the current data segment and its associated data segment, thereby helping to improve the processing accuracy of the current data segment by any target processing component.

通过前述实施例,在所述多个处理组件被管理组件加载后,各个处理组件可以按序处理所述目标数据的数据片段,从而完成所述待处理任务。一方面,该方案可以由所述管理组件统一管理和调度目标处理组件,以由各个目标处理组件相互配合有序完成针对目标数据的处理过程。即便目标处理组件的数量较多,各个目标处理组件也可以有序处理数据片段,从而大大简化了针对系统中各个处理组件的管理逻辑和对所述目标数据的处理过程,有助于提升待处理任务的执行效率。另一方面,可以根据待处理任务确定各个目标处理组件并进行加载,从而使得各个目标处理组件可以按照自身的处理逻辑对所述目标数据的数据片段进行处理,由于各个目标处理组件的处理逻辑可以根据实际需要预先定义,所以该方式可以实现较为复杂的任务处理逻辑,以便提供更多的处理功能,从而便于实现多样化的处理需求。Through the above-mentioned embodiments, after the multiple processing components are loaded by the management component, each processing component can process the data fragments of the target data in order, thereby completing the task to be processed. On the one hand, the solution can be managed and scheduled by the management component in a unified manner, so that each target processing component can cooperate with each other to complete the processing process for the target data in an orderly manner. Even if the number of target processing components is large, each target processing component can process the data fragments in an orderly manner, thereby greatly simplifying the management logic for each processing component in the system and the processing process of the target data, which helps to improve the execution efficiency of the task to be processed. On the other hand, each target processing component can be determined and loaded according to the task to be processed, so that each target processing component can process the data fragments of the target data according to its own processing logic. Since the processing logic of each target processing component can be pre-defined according to actual needs, this method can implement a more complex task processing logic, so as to provide more processing functions, thereby facilitating the realization of diversified processing needs.

另外,管理组件可以根据待处理任务对应的目标数据确定相应的处理组件,进而将确定出的各个处理组件加载至数据处理系统。可以理解的是,在上述数据处理系统启动之前,用户可以针对所述目标数据向所述管理组件指定相应的处理组件,从而实现对处理组件的按需加载。In addition, the management component can determine the corresponding processing component according to the target data corresponding to the task to be processed, and then load each determined processing component into the data processing system. It is understandable that before the above-mentioned data processing system is started, the user can specify the corresponding processing component to the management component according to the target data, so as to realize the on-demand loading of the processing component.

图6为本方案所述算法服务接口的示意图。如图6所示,通过对任务创建类进行派生的形式,可以创建具体的算法任务,即图中算法任务1、算法任务2、算法任务3和算法任务等。算法任务创建完成后,可添加至流程管理类中(具体可以添加至所述组件列表)进行管理,流程管理类可以为每一个算法任务创建相应的线程并分配处理资源。通过对数据同步类实例化的方式,还可以创建算法任务间传递的对象,并通过调用前向节点配置函数、后向节点配置函数的方式对各个算法任务分别对应的前向节点和后向节点进行配置。数据同步类可保障算法任务在高并发情况下能够有序传输数据片段。Figure 6 is a schematic diagram of the algorithm service interface described in this solution. As shown in Figure 6, by deriving the task creation class, specific algorithm tasks can be created, namely, algorithm task 1, algorithm task 2, algorithm task 3 and algorithm task, etc. in the figure. After the algorithm task is created, it can be added to the process management class (specifically, it can be added to the component list) for management. The process management class can create corresponding threads for each algorithm task and allocate processing resources. By instantiating the data synchronization class, objects passed between algorithm tasks can also be created, and the forward nodes and backward nodes corresponding to each algorithm task can be configured by calling the forward node configuration function and the backward node configuration function. The data synchronization class can ensure that the algorithm task can transmit data fragments in an orderly manner under high concurrency.

全部算法任务添加完成并配置好前向节点和后向节点后,流程管理类可以调用任务启动函数来启动全部任务,启动后的各个计算任务即构成用于执行所述待处理任务的流水线。在该任务的执行过程中,流程管理类可以监测流水线中的各个算法任务,并在确定所述流水线的输出节点输出的数据为空的情况下,关闭流水线中的各个算法任务(即管理该流水线)并释放相应的处理资源。After all algorithm tasks are added and forward nodes and backward nodes are configured, the process management class can call the task start function to start all tasks. After the start, each computing task constitutes a pipeline for executing the task to be processed. During the execution of the task, the process management class can monitor each algorithm task in the pipeline, and when it is determined that the data output by the output node of the pipeline is empty, it closes each algorithm task in the pipeline (i.e., manages the pipeline) and releases the corresponding processing resources.

对应于前述数据处理方法,本发明还提出一种视频处理方法,该方法应用于视频处理系统,所述视频处理系统包括管理组件和处理组件。图7是根据本发明实施例示出的一种视频处理方法的流程图。如图7所示,该方法包括步骤702-706。Corresponding to the aforementioned data processing method, the present invention also proposes a video processing method, which is applied to a video processing system, wherein the video processing system includes a management component and a processing component. FIG7 is a flow chart of a video processing method according to an embodiment of the present invention. As shown in FIG7 , the method includes steps 702-706.

步骤702,根据待处理任务确定目标处理组件,所述待处理任务用于处理目标视频,所述目标处理组件包括解码组件、编码组件和至少一个智能算法组件;Step 702, determining a target processing component according to a task to be processed, wherein the task to be processed is used to process a target video, and the target processing component includes a decoding component, an encoding component, and at least one intelligent algorithm component;

步骤704,所述管理组件加载所述目标处理组件。Step 704: the management component loads the target processing component.

步骤706,加载完成的所述智能算法组件按序处理所述目标视频的视频帧,其中,各个目标处理组件在同一时刻分别处理不同的视频帧,至少一个视频帧被各个目标处理组件依次处理。Step 706, the loaded intelligent algorithm component processes the video frames of the target video in sequence, wherein each target processing component processes different video frames at the same time, and at least one video frame is processed in sequence by each target processing component.

在本发明所述实施例中,所述解码组件用于对所述目标视频进行解码处理得到多张视频帧,并将各张视频帧依次发送至所述智能算法组件。所述智能算法组件可以按序处理所述目标视频的视频帧,其中最后一个智能算法组件可以将各个视频帧对应的处理后视频帧发送至所述编码组件,以由后者各个处理后视频帧进行编码处理以得到处理后视频。In the embodiment of the present invention, the decoding component is used to decode the target video to obtain multiple video frames, and send each video frame to the intelligent algorithm component in sequence. The intelligent algorithm component can process the video frames of the target video in sequence, wherein the last intelligent algorithm component can send the processed video frames corresponding to each video frame to the encoding component, so that the latter can encode each processed video frame to obtain a processed video.

在一实施例中,所述智能算法组件可以包括下述至少之一的子算法组件:插帧组件、降噪组件、超分辨率组件、高动态范围组件、细节修复组件。当然,在方案实施过程中,所述子算法组件可以根据实际情况进行扩展,如包括灰度化组件等,不再赘述。In one embodiment, the intelligent algorithm component may include at least one of the following sub-algorithm components: a frame insertion component, a noise reduction component, a super-resolution component, a high dynamic range component, and a detail restoration component. Of course, during the implementation of the solution, the sub-algorithm component may be expanded according to actual conditions, such as including a grayscale component, etc., which will not be described in detail.

在一实施例中,所述视频处理系统还可以包括前向节点和后向节点,所述目标处理组件对应一个或多个前向节点,以及所述目标处理组件对应一个或多个后向节点;其中,所述前向节点用于获取前向视频帧信息以供所述目标处理组件读取,所述后向节点用于获取目标处理组件处理后的后向视频帧信息。其中,所述前向节点和后向节点可以视为前述实施例所述的前向同步组件和后向同步组件,所述前向节点和后向节点的配置启动方式可以参见前述相关实施例的记载,此处不再赘述。In one embodiment, the video processing system may further include a forward node and a backward node, the target processing component corresponds to one or more forward nodes, and the target processing component corresponds to one or more backward nodes; wherein the forward node is used to obtain forward video frame information for the target processing component to read, and the backward node is used to obtain backward video frame information processed by the target processing component. The forward node and the backward node may be regarded as the forward synchronization component and the backward synchronization component described in the aforementioned embodiment, and the configuration and startup methods of the forward node and the backward node may refer to the records of the aforementioned related embodiments, which will not be repeated here.

在一实施例中,任一目标处理组件在所述前向节点处于可读状态时,可以获取前向视频帧信息。其中,所述前向视频帧信息由所述任一目标处理组件的前一目标处理组件处理得到,该前向视频帧信息(视频帧数据或存储地址)可以由所述前一目标处理组件传递时所述前向节点(如写入所述前向节点),从而所述任一目标处理组件可以从其前向节点处直接读取所述视频帧数据,或者在从所述前向节点处读取所述存储地址后,进一步从所述存储地址处读取视频帧数据。在所述任一目标处理组件从所述前向节点处获取到所述前向视频帧信息后,所述前向节点可以由可读状态更新为可写状态。此后,所述任一目标处理组件可以执行数据处理操作以得到相应的后向视频帧信息,具体的,可以按照自身的预设处理逻辑对所述前向视频帧信息进行处理。进而,在所述后向节点处于可写状态时,所述后向节点可以获取所述任一目标处理组件处理得到的所述后向视频帧信息(视频帧数据或存储地址);以及,在获取所述后向视频帧信息后,所述后向节点可以从可写状态更新为可读状态。如所述任一目标处理组件可以在自身处理得到所述后向视频帧信息的情况下,将后向视频帧信息写入所述后向节点。In one embodiment, any target processing component can obtain forward video frame information when the forward node is in a readable state. Wherein, the forward video frame information is obtained by processing the previous target processing component of any target processing component, and the forward video frame information (video frame data or storage address) can be transmitted by the previous target processing component to the forward node (such as writing to the forward node), so that any target processing component can directly read the video frame data from its forward node, or after reading the storage address from the forward node, further read the video frame data from the storage address. After any target processing component obtains the forward video frame information from the forward node, the forward node can be updated from a readable state to a writable state. Thereafter, any target processing component can perform data processing operations to obtain corresponding backward video frame information, and specifically, the forward video frame information can be processed according to its own preset processing logic. Furthermore, when the backward node is in a writable state, the backward node can obtain the backward video frame information (video frame data or storage address) processed by any target processing component; and after obtaining the backward video frame information, the backward node can be updated from a writable state to a readable state. For example, when any target processing component obtains the backward video frame information through processing, the backward video frame information can be written into the backward node.

可以理解的是,在所述后向节点更新为可读状态后,若所述任一目标处理组件的后向节点与所述后一目标处理组件的前向节点为同一节点,则所述后一目标处理组件可以在该节点处于可读状态的情况下从该节点处获取所述后向视频帧信息;或者,在所述任一目标处理组件的后向节点与所述后一目标处理组件的前向节点并非同一节点的情况下,所述任一目标处理组件的后向节点与所述后一目标处理组件的前向节点可以依次连接。对此,在所述任一目标处理组件的后向节点处于可读状态的情况下,后一目标处理组件的前向节点可以从该后向节点处读取所述后向处理数据并记录在本地,以便所述后一目标处理组件从该前向节点处读取所述后向处理数据。可以理解的是,该后向视频帧信息对于所述后一目标处理组件而言是其前向视频帧信息。It is understandable that after the backward node is updated to a readable state, if the backward node of any target processing component is the same node as the forward node of the latter target processing component, the latter target processing component can obtain the backward video frame information from the node when the node is in a readable state; or, in the case where the backward node of any target processing component is not the same node as the forward node of the latter target processing component, the backward node of any target processing component and the forward node of the latter target processing component can be connected in sequence. In this regard, when the backward node of any target processing component is in a readable state, the forward node of the latter target processing component can read the backward processing data from the backward node and record it locally, so that the latter target processing component reads the backward processing data from the forward node. It is understandable that the backward video frame information is its forward video frame information for the latter target processing component.

在一实施例中,所述视频处理设备中可以装配多个GPU,其中,可以将根据所述待处理任务确定的各个智能算法组件分别部署在多个GPU中。如在视频处理系统包括多个流水线的情况下,将各个流水线分别部署在不同的GPU中;和/或,也可以将其中任一流水线分别部署在多个GPU中(此时所述多个GPU中分别部署有所述任一流水线)。所述目标处理组件还可以包括分发组件和集合组件。所述目标视频中的各个视频帧可以分别具有相应的序列号,任意两个视频帧的序列号互不相同,所述序列号用于表征所述各个视频帧在所述目标视频的时间轴中所处的位置。例如,任一视频帧的帧序号即可用于确定该视频帧位于所述视频的时间轴中的哪一时刻。In one embodiment, the video processing device may be equipped with multiple GPUs, wherein each intelligent algorithm component determined according to the task to be processed may be deployed in multiple GPUs respectively. For example, in the case where the video processing system includes multiple pipelines, each pipeline is deployed in a different GPU respectively; and/or, any one of the pipelines may be deployed in multiple GPUs respectively (in this case, any one of the pipelines is deployed in the multiple GPUs respectively). The target processing component may also include a distribution component and a collection component. Each video frame in the target video may have a corresponding serial number, and the serial numbers of any two video frames are different from each other. The serial number is used to characterize the position of each video frame in the timeline of the target video. For example, the frame number of any video frame can be used to determine at which moment the video frame is located in the timeline of the video.

基于所述序列号,所述分发组件和集合组件可以用于处理视频帧。例如,所述分发组件可以将所述解码组件输出的各个视频帧分别分发至相应的智能算法组件。具体的,可以将不同流水线对应的视频帧分别分发至属于不同流水线的智能算法组件,也可以将同一流水线对应的不同视频帧分别分发至该不同GPU中部署的属于该流水线的智能算法组件。各个智能算法组件可以分别处理自身接收到的视频帧,并将处理得到的处理后视频帧分别传递至所述集合组件。该集合组件可以接收各个智能算法组件分别传递的处理后视频帧,并将接收到的各个处理后视频帧按照所述序列号依次发送至所述编码组件。通过该方式,可以将目标视频的各个视频帧准确分发至相应的智能算法组件进行处理,而且各个智能算法组件可以在处理完成后立即将处理后视频帧传递至集合组件,并由后者按照所述先后顺序将各个处理后视频帧依次发送至编码组件。不仅实现了对各个目标视频片段的乱序重组,从而确保待处理任务的执行结果的准确性,还能够避免智能算法组件的等待,有助于提升其数据处理效率。Based on the sequence number, the distribution component and the collection component can be used to process video frames. For example, the distribution component can distribute each video frame output by the decoding component to the corresponding intelligent algorithm component. Specifically, the video frames corresponding to different pipelines can be distributed to the intelligent algorithm components belonging to different pipelines, or the different video frames corresponding to the same pipeline can be distributed to the intelligent algorithm components belonging to the pipeline deployed in the different GPUs. Each intelligent algorithm component can process the video frames received by itself, and pass the processed video frames obtained by processing to the collection component. The collection component can receive the processed video frames respectively passed by each intelligent algorithm component, and send the received processed video frames to the encoding component in sequence according to the sequence number. In this way, each video frame of the target video can be accurately distributed to the corresponding intelligent algorithm component for processing, and each intelligent algorithm component can pass the processed video frame to the collection component immediately after the processing is completed, and the latter sends each processed video frame to the encoding component in sequence according to the sequence. It not only achieves the random reorganization of each target video clip, thereby ensuring the accuracy of the execution results of the tasks to be processed, but also avoids the waiting of intelligent algorithm components, which helps to improve its data processing efficiency.

可以理解的是,所述处理后视频在播放过程中即可呈现出所述智能算法组件对应的处理后显示效果。例如,在所述智能算法组件包括插帧组件的情况下,所述处理后视频的相对于处理前的目标视频将具有更高的帧数,相应的,可以使用相对于目标视频更高的帧率播放所述处理后视频。再例如,在所述智能算法组件包括细节修复组件的情况下,所述处理后视频的细节显示效果相对于处理前的目标视频,如细节部分的清晰度更高等。It is understandable that the processed video can present the processed display effect corresponding to the intelligent algorithm component during the playback process. For example, when the intelligent algorithm component includes an interpolation component, the processed video will have a higher frame rate relative to the target video before processing, and accordingly, the processed video can be played at a higher frame rate relative to the target video. For another example, when the intelligent algorithm component includes a detail restoration component, the detail display effect of the processed video is relative to the target video before processing, such as higher clarity of the details.

根据前述实施例,一方面,可以由所述管理组件统一管理和调度目标处理组件,以由各个目标处理组件(包括解码组件、编码组件和至少一个智能算法组件)相互配合有序完成针对目标视频的处理过程。即便智能算法组件的数量较多,各个智能算法组件也可以有序处理视频帧,从而大大简化了针对系统中各个智能算法组件的管理逻辑和对所述目标数据的处理过程,有助于提升待处理任务的执行效率。另一方面,可以根据待处理任务确定至少一个智能算法组件并进行加载,从而使得各个智能算法组件可以按照自身的处理逻辑对所述目标视频的视频帧进行处理,由于各个智能算法组件的处理逻辑可以根据实际需要预先定义,所以该方式可以实现较为复杂的视频处理逻辑,以便提供更多的处理功能,从而便于实现多样化的视频处理需求。另外,可以实现对智能算法组件的按需加载。According to the aforementioned embodiment, on the one hand, the management component can uniformly manage and schedule the target processing components, so that each target processing component (including a decoding component, an encoding component and at least one intelligent algorithm component) cooperates with each other to orderly complete the processing process for the target video. Even if the number of intelligent algorithm components is large, each intelligent algorithm component can process the video frames in an orderly manner, thereby greatly simplifying the management logic for each intelligent algorithm component in the system and the processing process of the target data, which helps to improve the execution efficiency of the tasks to be processed. On the other hand, at least one intelligent algorithm component can be determined and loaded according to the tasks to be processed, so that each intelligent algorithm component can process the video frames of the target video according to its own processing logic. Since the processing logic of each intelligent algorithm component can be pre-defined according to actual needs, this method can realize a more complex video processing logic, so as to provide more processing functions, thereby facilitating the realization of diversified video processing needs. In addition, on-demand loading of intelligent algorithm components can be achieved.

图8是根据本发明实施例示出的一种视频处理系统的架构示意图。如图8所示,在采用面向对象的程序设计语言实现上述数据处理系统的情况下,所述管理组件(即VideoProcessFrameWork)中可以预定义有视频流水处理的基本实现类(简称基类),数据处理系统中加载的各个目标处理组件可以基于该基类派生得到,即各个目标处理组件可以是该基类对应的派生类。Fig. 8 is a schematic diagram of the architecture of a video processing system according to an embodiment of the present invention. As shown in Fig. 8, when the above data processing system is implemented using an object-oriented programming language, the management component (i.e., VideoProcessFrameWork) may pre-define a basic implementation class (referred to as the base class) for video pipeline processing, and each target processing component loaded in the data processing system may be derived based on the base class, i.e., each target processing component may be a derived class corresponding to the base class.

图8所示流水线中各个目标处理组件的处理顺序依次为:解码组件(即VideoReaderUnit)、分发组件(即OneToManyUnit)、智能算法组件(TensorrtProcessUnit[])、集合组件(即ManyToOneUnit)和编码组件(VideoWriterImgUnit)。另外,任意两个相邻目标处理组件之间可以设置有同步组件(即UnitSynArg1~4),如所述解码组件和分发组件之间设置有UnitSynArg1、智能算法组件与集合组件之间设置有UnitSynArg3等,不再赘述。其中,任一目标处理组件可以被设置有前向节点和后向节点,以所述分发组件为例,“pre_node(synArg_videoReaderunit_out)”表明该组件的前向节点为解码组件,分发组件接收解码组件通过同步组件UnitSynArg1传递来的处理结果(即一级视频帧);“next_node(synArg_OneToManyUnit_out[])”表明该组件的后向节点为智能算法组件,该组件处理任一视频帧后的处理结果(即二级视频帧)通过同步组件UnitSynArg2传递至其后的集合组件。需要说明的是,作为第一个目标处理组件的解码组件,其前向节点为空(Pre_node(NULL));作为最后一个目标处理组件的编码组件,其后向节点也为空(next_node(NULL))。The processing order of each target processing component in the pipeline shown in Figure 8 is: decoding component (i.e., VideoReaderUnit), distribution component (i.e., OneToManyUnit), intelligent algorithm component (TensorrtProcessUnit[]), collection component (i.e., ManyToOneUnit) and encoding component (VideoWriterImgUnit). In addition, a synchronization component (i.e., UnitSynArg1-4) can be set between any two adjacent target processing components, such as UnitSynArg1 between the decoding component and the distribution component, UnitSynArg3 between the intelligent algorithm component and the collection component, etc., which will not be repeated here. Among them, any target processing component can be set with a forward node and a backward node. Taking the distribution component as an example, "pre_node(synArg_videoReaderunit_out)" indicates that the forward node of the component is a decoding component, and the distribution component receives the processing result (i.e., the primary video frame) transmitted by the decoding component through the synchronization component UnitSynArg1; "next_node(synArg_OneToManyUnit_out[])" indicates that the backward node of the component is an intelligent algorithm component, and the processing result (i.e., the secondary video frame) after the component processes any video frame is transmitted to the subsequent collection component through the synchronization component UnitSynArg2. It should be noted that, as the first target processing component, the decoding component has an empty forward node (Pre_node(NULL)); as the last target processing component, the encoding component has an empty backward node (next_node(NULL)).

在加载所述解码组件、智能算法组件以及编码组件完成之后,被加载的所述各个目标处理组件共同构成针对待处理任务的流水线,此时管理组件可以启动该流水线以用于执行该任务,即用于处理所述目标视频。具体的,管理组件可以通过执行前述任务启动函数start_task()启动所述流水线中的各个目标处理组件。After the decoding component, the intelligent algorithm component and the encoding component are loaded, the loaded target processing components together constitute a pipeline for the task to be processed, and the management component can start the pipeline to execute the task, that is, to process the target video. Specifically, the management component can start each target processing component in the pipeline by executing the aforementioned task start function start_task().

进一步的,在各个目标处理组件被启动完成后,所述解码组件可以获取待处理任务指定的目标视频。具体的,可以直接从所述待处理任务中提取所述目标视频,或者也可以根据所述待处理任务中包含的存储地址、索引等视频检索信息,在该信息指定的存储空间中读取所述目标视频。Furthermore, after each target processing component is started, the decoding component can obtain the target video specified by the task to be processed. Specifically, the target video can be directly extracted from the task to be processed, or the target video can be read from the storage space specified by the storage address, index and other video retrieval information contained in the task to be processed.

进一步的,该组件可以对获取到的所述目标视频进行解码处理以得到多张视频帧。然后,解码组件可以将解码处理得到的所述多张视频帧传递至智能算法组件,进而,流水线中加载的至少一个智能算法组件可以按序处理所述多张视频帧,以得到相应的处理后视频帧。Furthermore, the component can decode the acquired target video to obtain multiple video frames. Then, the decoding component can pass the multiple video frames obtained by decoding to the intelligent algorithm component, and then, at least one intelligent algorithm component loaded in the pipeline can process the multiple video frames in sequence to obtain corresponding processed video frames.

图8所示的智能算法组件仅以一个TensorrtProcessUnit[]作为示意,实际上,被加载的子算法组件的数量可以为一个或多个。例如,本方案所述智能算法组件可以包括下述之一的子算法组件:插帧组件、降噪组件、超分辨率组件、高动态范围组件、细节修复组件,也可以包括前述表1所示的其他组件,不再赘述。上述智能算法组件可以是经过预训练的AI(Artificial Intelligence,人工智能)算法模型,在方案实践中,上述任一AI算法模型可以采用Tensorrt作为AI加速框架,采用CUDA(Compute Unified DeviceArchitecture,图形处理器开发环境)作为算法加速框架,采用ffmpeg作为编解码框架。The intelligent algorithm component shown in Figure 8 is only illustrated by one TensorrtProcessUnit[]. In fact, the number of loaded sub-algorithm components can be one or more. For example, the intelligent algorithm component described in this solution may include one of the following sub-algorithm components: interpolation component, noise reduction component, super-resolution component, high dynamic range component, detail restoration component, and may also include other components shown in Table 1 above, which will not be repeated here. The above-mentioned intelligent algorithm component can be a pre-trained AI (Artificial Intelligence) algorithm model. In the practice of the solution, any of the above-mentioned AI algorithm models can use Tensorrt as the AI acceleration framework, CUDA (Compute Unified Device Architecture, graphics processor development environment) as the algorithm acceleration framework, and ffmpeg as the encoding and decoding framework.

另外,本方案所述目标视频的编码格式、编码像素格式和视频文件封装格式等参数可以根据实际情况选取,本发明实施例并不对此进行限定。示例性的,所述编码格式可以为h264,编码像素格式可以为yuv420,视频文件封装格式可以为.mp4。其中,所述视频的视频流编码格式信息和视频流像素格式信息均可采用枚举形式,相应枚举成员可见表10。In addition, the encoding format, encoding pixel format and video file encapsulation format of the target video in this solution can be selected according to actual conditions, and the embodiment of the present invention does not limit this. For example, the encoding format can be h264, the encoding pixel format can be yuv420, and the video file encapsulation format can be .mp4. Among them, the video stream encoding format information and video stream pixel format information of the video can both be in enumeration form, and the corresponding enumeration members can be seen in Table 10.

表10Table 10

其中,与前述数据处理方法类似的,所述至少一个子算法组件按序处理所述多张视频帧的过程中,各个子算法组件同样可以遵循前述流水线的工作方式。例如,任一子算法组件在处理任一视频帧后,可以将相应的处理结果传递至后一目标处理组件进行处理。其中,根据所述任一子算法组件的不同,相应的后一目标处理组件可以为其他子算法组件,或者也可以为所述编码组件。Wherein, similar to the aforementioned data processing method, in the process of the at least one sub-algorithm component sequentially processing the multiple video frames, each sub-algorithm component can also follow the aforementioned pipeline working method. For example, after processing any video frame, any sub-algorithm component can pass the corresponding processing result to the next target processing component for processing. Wherein, depending on the difference of any of the sub-algorithm components, the corresponding next target processing component can be other sub-algorithm components, or can also be the encoding component.

再例如,在所述流水线还包括同步组件的情况下,任一第一类目标处理组件之前可以连接有前向节点,所述第一类目标处理组件为所述多个目标处理组件的处理顺序中除所述解码组件之外的任一目标处理组件;和/或,任一第二类目标处理组件之后可以连接有后向节点,所述第二类目标处理组件为所述处理顺序中除所述编码组件之外的任一目标处理组件。其中,任一第一类目标处理组件的前向节点与其前一第二类目标处理组件的后向节点可以是同一节点,或者也可以是不同的节点。For another example, when the pipeline further includes a synchronization component, a forward node may be connected before any first-category target processing component, and the first-category target processing component is any target processing component other than the decoding component in the processing sequence of the multiple target processing components; and/or, a backward node may be connected after any second-category target processing component, and the second-category target processing component is any target processing component other than the encoding component in the processing sequence. The forward node of any first-category target processing component and the backward node of the previous second-category target processing component may be the same node, or may be different nodes.

其中,任一第一类目标处理组件在所述前向节点处于可读状态的情况下,可以从所述前向节点指示的第一存储地址处获取(如读取)目标视频帧,在获取完成后,所述前向节点更新为可写状态;其中,所述目标视频帧由所述任一第一类目标处理组件的前一目标处理组件处理得到并在所述前向节点处于可写状态时写入所述第一存储地址。Among them, when any first-category target processing component is in a readable state, it can obtain (such as read) the target video frame from the first storage address indicated by the forward node, and after the acquisition is completed, the forward node is updated to a writable state; wherein, the target video frame is processed by the previous target processing component of any first-category target processing component and written to the first storage address when the forward node is in a writable state.

另外,任一第二类目标处理组件在所述后向节点处于可写状态的情况下,可以将自身处理得到的处理后视频帧写入所述后向节点指示的第二存储地址,并在写入完成后触发所述后向节点更新为可读状态。上述第一类目标处理组件和第二类目标处理组件通过所述同步组件实现视频帧交换的过程,与数据处理方案中通过同步组件实现视频帧交换的过程并不存在本质区别,具体实现方式可以参见前文相应实施例的记载,此处不再赘述。In addition, when the backward node is in a writable state, any second-category target processing component can write the processed video frame obtained by itself into the second storage address indicated by the backward node, and trigger the backward node to be updated to a readable state after writing is completed. The process of realizing video frame exchange by the first-category target processing component and the second-category target processing component through the synchronization component is essentially the same as the process of realizing video frame exchange by the synchronization component in the data processing scheme. The specific implementation method can be found in the records of the corresponding embodiments above, which will not be repeated here.

在一实施例中,图像处理设备中可以装配有多个独立的GPU板卡;或者,任一GPU板卡可以在逻辑上划分为多个GPU模块,本发明实施例将所述独立的GPU板卡或者GPU模块称为GPU。在上述情况下,为了提升待处理任务的处理效率,可以利用所述多个GPU实现不同视频帧的并行处理。例如,一方面,可以在多个GPU中分别部署所述智能算法组件,另一方面,可以由所述管理组件加载分发组件和集合组件。In one embodiment, the image processing device may be equipped with multiple independent GPU boards; or, any GPU board may be logically divided into multiple GPU modules, and the independent GPU board or GPU module is referred to as a GPU in the embodiment of the present invention. In the above case, in order to improve the processing efficiency of the task to be processed, the multiple GPUs may be used to implement parallel processing of different video frames. For example, on the one hand, the intelligent algorithm component may be deployed in multiple GPUs respectively, and on the other hand, the distribution component and the collection component may be loaded by the management component.

其中,在食品处理系统中可以存在多个流水线,此时可以将各个流水线中的子算法组件分别部署在不同的GPU中,如在目标视频为音视频文件的情况下,所述视频处理系统可以包括音频流水线和视频流水线。此时,所述音频流水线中的各个子算法组件可以被部署在任一GPU中,而所述视频流水线中的各个子算法组件可以被部署在另一GPU中。基于此,所述流水线中的解码组件在对音视频文件进行解码处理得到音频片段和视频帧后,所述分发组件可以将全部音频片段依次分发至音频流水线中的首个子算法组件处理,并将全部视频帧依次发送至视频流水线中的首个子算法组件处理。其中,所示音频的音频流编码格式信息可以采用枚举形式,相应的枚举成员可以见表11。Among them, there may be multiple pipelines in the food processing system. At this time, the sub-algorithm components in each pipeline can be deployed in different GPUs respectively. For example, when the target video is an audio and video file, the video processing system may include an audio pipeline and a video pipeline. At this time, each sub-algorithm component in the audio pipeline can be deployed in any GPU, and each sub-algorithm component in the video pipeline can be deployed in another GPU. Based on this, after the decoding component in the pipeline decodes the audio and video file to obtain audio clips and video frames, the distribution component can distribute all audio clips to the first sub-algorithm component in the audio pipeline for processing in sequence, and send all video frames to the first sub-algorithm component in the video pipeline for processing in sequence. Among them, the audio stream encoding format information of the audio shown can be in enumerated form, and the corresponding enumeration members can be seen in Table 11.

表11Table 11

或者,针对任一流水线,也可以按照相同的部署方式在多个GPU中分别部署该流水线中的全部子算法组件,如分别在各个GPU中按照相同的加载顺序依次部署全部的子算法组件,以使各个GPU可以实现完全相同的处理逻辑。或者,在所述智能算法组件包括多个子算法组件的情况下,也可以将多个子算法组件分散部署在多个GPU中,如可以将某一子算法组件部署在某一GPU中,并将另一子算法组件部署在另一GPU中;特殊的,在GPU的数量不小于子算法组件的数量的情况下,可以将各个子算法组件分别部署在不同的GPU中。基于该部署方式,所述分发组件可以按照预设规则将所述解码组件输出的所述多张视频帧分别分发至相应的GPU。任一GPU在接收到任一视频帧之后,该GPU中部署的子算法组件可以分别处理该视频帧。Alternatively, for any pipeline, all sub-algorithm components in the pipeline can be deployed in multiple GPUs in the same deployment mode, such as deploying all sub-algorithm components in each GPU in the same loading order, so that each GPU can implement exactly the same processing logic. Alternatively, in the case where the intelligent algorithm component includes multiple sub-algorithm components, the multiple sub-algorithm components can also be deployed in multiple GPUs in a dispersed manner, such as deploying a certain sub-algorithm component in a certain GPU, and deploying another sub-algorithm component in another GPU; in particular, when the number of GPUs is not less than the number of sub-algorithm components, each sub-algorithm component can be deployed in a different GPU. Based on this deployment method, the distribution component can distribute the multiple video frames output by the decoding component to the corresponding GPUs according to preset rules. After any GPU receives any video frame, the sub-algorithm components deployed in the GPU can process the video frame respectively.

示例性的,在按照相同的部署方式在多个GPU中分别部署任一流水线中的全部的子算法组件的情况下,为了简化分发组件的分发逻辑,所述预设规则可以采用轮询规则,即所述GPU组件可以将所述多张视频帧依次按序发送至各个GPU;或者,考虑到不同GPU之间可能存在性能差异,所以为了尽量提升视频帧的整体处理效率,所述预设规则也可以采用负载均衡规则,以将各张视频帧尽量分发至当前时刻性能最优的GPU。此时,不同GPU可以分别接收到不同的视频帧,任一GPU中的部署的全部子算法组件可以处理该GPU接收到的各张视频帧。而在多个子算法组件被分散部署在多个GPU中的情况下,为保证各张视频帧均能够被全部子算法组件进行处理,所述分发组件可以将任意一张视频帧分别发送至各个GPU。此时,各个GPU可以分别获取到所述目标视频的全部视频帧,任一GPU中部署的各个子算法组件可以按照相应的处理逻辑处理该GPU接收到的视频帧。Exemplarily, in the case where all sub-algorithm components in any pipeline are deployed in multiple GPUs in the same deployment mode, in order to simplify the distribution logic of the distribution component, the preset rule can adopt a polling rule, that is, the GPU component can send the multiple video frames to each GPU in sequence; or, considering that there may be performance differences between different GPUs, in order to maximize the overall processing efficiency of video frames, the preset rule can also adopt a load balancing rule to distribute each video frame to the GPU with the best performance at the current moment. At this time, different GPUs can receive different video frames respectively, and all sub-algorithm components deployed in any GPU can process each video frame received by the GPU. In the case where multiple sub-algorithm components are dispersedly deployed in multiple GPUs, in order to ensure that each video frame can be processed by all sub-algorithm components, the distribution component can send any video frame to each GPU respectively. At this time, each GPU can obtain all video frames of the target video respectively, and each sub-algorithm component deployed in any GPU can process the video frame received by the GPU according to the corresponding processing logic.

其中,GPU分发单元可以维护可用GPU资源信息容器,该容器用于存储所述视频处理设备所提供GPU的资源信息。例如,所述容器可以包括数组,该数组可以用于记录各个GPU的GPU标识,任一GPU标识可以为8位或16位的整型数字。再例如,所述容器也可以包括结构体,该结构体可以用于记录各个GPU的GPU标识、型号信息、性能参数、数据格式、可用资源类型、可处理任务类型等多种GPU相关信息,不再赘述。分发组件在按照前述预设规则分发视频帧的过程中,可以基于上述容器中存储的GPU标识或GPU相关信息,准确地确定应当将任一视频帧发送至哪个GPU,从而实现视频帧的精准分发。Among them, the GPU distribution unit can maintain an available GPU resource information container, which is used to store the resource information of the GPU provided by the video processing device. For example, the container may include an array, which can be used to record the GPU identification of each GPU, and any GPU identification can be an 8-bit or 16-bit integer. For another example, the container may also include a structure, which can be used to record the GPU identification, model information, performance parameters, data format, available resource type, processable task type and other GPU-related information of each GPU, which will not be repeated. In the process of distributing video frames according to the aforementioned preset rules, the distribution component can accurately determine to which GPU any video frame should be sent based on the GPU identification or GPU-related information stored in the above container, thereby achieving accurate distribution of video frames.

需要说明的是,所述数据处理系统中除智能算法组件之外的管理组件、分发组件和集合组件,可以运行于视频处理设备的CPU中。而所述解码组件和编码组件根据编解码方式的不同运行于不同位置。例如,若对目标视频采用硬件解码方式,所述解码组件可以运行于GPU中;若采用软件解码方式,所述解码组件可以运行于CPU中。类似的,若对各张处理后视频帧采用硬件编码方式,所述编码组件可以运行于GPU中;若采用软件编码方式,所述编码组件可以运行于CPU中。It should be noted that the management component, distribution component and collection component of the data processing system, except for the intelligent algorithm component, can run in the CPU of the video processing device. The decoding component and the encoding component run in different locations according to different encoding and decoding methods. For example, if the target video is decoded by hardware, the decoding component can run in the GPU; if the software decoding method is used, the decoding component can run in the CPU. Similarly, if the hardware encoding method is used for each processed video frame, the encoding component can run in the GPU; if the software encoding method is used, the encoding component can run in the CPU.

其中,管理组件可以通过调用函数的方式配置和运行所述分发组件和所述集合组件。所述分发组件对应的函数有:The management component can configure and run the distribution component and the collection component by calling functions. The functions corresponding to the distribution component are:

初始化函数,用于初始化GPU资源分发信息。函数返回值:调用成功,返回0;调用失败,返回非0。Initialization function, used to initialize GPU resource distribution information. Function return value: if the call is successful, it returns 0; if the call fails, it returns non-zero.

数据处理函数,用于给每个GPU分发数据。函数返回值:调用成功,返回0;调用失败,返回非0。Data processing function, used to distribute data to each GPU. Function return value: 0 if the call is successful; non-zero if the call fails.

资源释放函数,用于释放为GPU分配的资源。函数返回值:调用成功,返回0;调用失败,返回非0。Resource release function, used to release the resources allocated to the GPU. Function return value: 0 if the call is successful; non-zero if the call fails.

相应的,所述集合组件对应的函数有:Correspondingly, the functions corresponding to the collection component are:

初始化函数,用于初始化GPU资源集合信息。函数返回值:调用成功,返回0;调用失败,返回非0。Initialization function, used to initialize GPU resource collection information. Function return value: if the call is successful, it returns 0; if the call fails, it returns non-zero.

数据处理函数,用于有序集合GPU数据。函数返回值:调用成功,返回0;调用失败,返回非0。Data processing function, used to collect GPU data in an ordered manner. Function return value: 0 if the call is successful; non-zero if the call fails.

资源释放函数,用于释放为GPU分配的资源。函数返回值:调用成功,返回0;调用失败,返回非0。Resource release function, used to release the resources allocated to the GPU. Function return value: 0 if the call is successful; non-zero if the call fails.

另外,上述分发组件和集合组件分别对应的初始化函数的参数列表,可参加下表12。In addition, the parameter lists of the initialization functions corresponding to the above distribution components and collection components can be found in Table 12 below.

表12Table 12

对于任一GPU而言,其中部署的各个子算法组件在处理任一视频帧后可以得到相应的处理结果。在按照相同的部署方式在各个GPU中分别部署全部的子算法组件的情况下,所述处理结果即为所述任一视频帧对应的处理后视频帧。而在多个子算法组件被分散部署在多个GPU中的情况下,任一GPU输出的处理结果仅是该GPU内的部分子算法组件处理后的结果,因此集合组件还需要将各个GPU分别输出的、对应于同一序列号的各个处理结果进行组合处理,从而得到该序列号对应的处理后视频帧。此后,集合组件可以将各个处理后视频帧按照所述多张视频帧的序列号顺序依次发送至所述编码组件。通过上述方式,可以在多个目标处理组件按序处理视频帧的基础上,利用GPU所具有的并行处理能力并发运行多条流水线,从而进一步提升数据处理系统对待处理任务的执行效率。For any GPU, each sub-algorithm component deployed therein can obtain a corresponding processing result after processing any video frame. In the case where all sub-algorithm components are deployed in each GPU in the same deployment mode, the processing result is the processed video frame corresponding to any video frame. In the case where multiple sub-algorithm components are dispersedly deployed in multiple GPUs, the processing result output by any GPU is only the result after processing by some sub-algorithm components in the GPU. Therefore, the collection component also needs to combine and process the processing results corresponding to the same serial number output by each GPU, so as to obtain the processed video frame corresponding to the serial number. Thereafter, the collection component can send each processed video frame to the encoding component in sequence according to the serial number order of the multiple video frames. In the above manner, on the basis of multiple target processing components processing video frames in sequence, the parallel processing capability of the GPU can be used to run multiple pipelines concurrently, thereby further improving the execution efficiency of the data processing system for the tasks to be processed.

另外,任一GPU在接收到视频帧之后,可以先对其进行数据前处理,然后由智能算法组件按照自身的算法逻辑对经过前处理的视频帧进行处理。相应的,对于智能算法组件通过处理视频帧得到的处理后视频帧或者处理后数据,该GPU也可以对其进行后处理。本发明实施例对于前述前处理和后处理的具体方式并不进行限定,示例性的,可以包括数据类型转换和归一化等,不再赘述。In addition, after receiving a video frame, any GPU may pre-process the data, and then the intelligent algorithm component may process the pre-processed video frame according to its own algorithm logic. Accordingly, the GPU may also post-process the processed video frame or processed data obtained by the intelligent algorithm component by processing the video frame. The embodiment of the present invention does not limit the specific methods of the aforementioned pre-processing and post-processing, and may include data type conversion and normalization, etc., which will not be described in detail.

其中,由于不同GPU的性能差异,可能导致不同视频帧的处理过程耗时不同,因此集合组件接收到各张处理后视频帧的顺序可能与GPU发送各张视频帧的顺序不同,即各张处理后视频帧可能存在乱序。此时,为了确保编码组件可以顺利完成视频编码工作,集合组件可以对接收到的各张处理后视频帧进行乱序重组,如将乱序的处理后视频帧暂存在本地,并在接收到预期序列号的处理后视频帧的情况下,在按照前述顺序向编码组件依次发送所述处理后视频帧。当然,本发明实施例对于具体的乱序重组逻辑和实现过程并不进行限定。或者,上述乱序重组也可以由编码组件完成,例如,集合组件可以将接收到的各张处理后视频帧按照接收顺序依次输出至编码组件,此时编码组件接收到的是各张处理后视频帧可能存在乱序,即各张处理后视频帧的接收顺序与相应序列号的大小顺序并不一致,所以码组件在对各张处理后视频帧进行编码处理时,可以按照相应序列号的大小顺序图像依次对所述各张处理后视频帧进行编码处理,从而实现针对各张处理后视频帧的乱序重组。Among them, due to the performance differences of different GPUs, the processing time of different video frames may be different. Therefore, the order in which the collection component receives each processed video frame may be different from the order in which the GPU sends each video frame, that is, each processed video frame may be out of order. At this time, in order to ensure that the encoding component can successfully complete the video encoding work, the collection component can reorganize the received processed video frames in a disordered order, such as temporarily storing the disordered processed video frames locally, and when receiving the processed video frames with the expected sequence number, send the processed video frames to the encoding component in sequence according to the aforementioned order. Of course, the embodiment of the present invention does not limit the specific disordered reorganization logic and implementation process. Alternatively, the above-mentioned out-of-order reorganization can also be completed by the encoding component. For example, the collection component can output the received processed video frames to the encoding component in sequence according to the receiving order. At this time, the processed video frames received by the encoding component may be out of order, that is, the receiving order of the processed video frames is inconsistent with the size order of the corresponding serial numbers. Therefore, when the code component encodes each processed video frame, it can encode each processed video frame in sequence according to the size order of the corresponding serial numbers, thereby realizing out-of-order reorganization of each processed video frame.

图9是根据本发明实施例示出的一种视频处理过程的示意图。下面结合图8,以视频超高清处理场景为例,对按照相同的部署方式在各个GPU中分别部署全部的子算法组件的情况下的视频处理过程进行说明。如图9所示,m(m大于2)个GPU中分别部署有相同的智能算法组件,且GPU中各个子算法组件的连接方式(对应于各个子算法组件的处理顺序)保持一致;换言之,m个GPU中以相同方式部署了至少一个子算法组件。其中,所述智能算法组件包含的子算法组件可以为前述表3所示的任一组件,下述实施例以三个子算法组件:降噪组件、超分辨率组件和HDR组件为例进行说明。Figure 9 is a schematic diagram of a video processing process according to an embodiment of the present invention. In conjunction with Figure 8, taking the video ultra-high-definition processing scenario as an example, the video processing process in which all sub-algorithm components are deployed in each GPU in the same deployment manner is described. As shown in Figure 9, the same intelligent algorithm components are deployed in m (m is greater than 2) GPUs, and the connection method of each sub-algorithm component in the GPU (corresponding to the processing order of each sub-algorithm component) remains consistent; in other words, at least one sub-algorithm component is deployed in the same manner in m GPUs. Among them, the sub-algorithm component included in the intelligent algorithm component can be any of the components shown in Table 3 above. The following embodiment is described by taking three sub-algorithm components: noise reduction component, super-resolution component and HDR component as examples.

如图9所示,待处理的目标视频是分辨率为1080P的视频文件,不妨假设目标视频名称为1080p.mp4,帧率为25,分辨率为1080*1920,封装格式为mp4,编码格式为libx264,码率为25fps。As shown in FIG9 , the target video to be processed is a video file with a resolution of 1080P. It is assumed that the target video name is 1080p.mp4, the frame rate is 25, the resolution is 1080*1920, the encapsulation format is mp4, the encoding format is libx264, and the bit rate is 25fps.

另外,假设解码组件采用的解码器为目标视频所对应的libx264,解码像素格式为RGB24,解码后的数据类型为8位整型数据,数据范围为0-255,数据大小为1080*1920*3。解码组件获取到该视频文件后对其进行解码处理得到多张视频帧图像,具体可以调用ffmpegAPI(Application Programming Interface,应用程序编程接口)实现解码,进而,分发组件依次将解码组件解码得到的各张视频帧图像分发至相应的GPU。例如在按照轮询规则分发的情况下,可以将视频帧图像1~m依次分发至GPU1~m,接下来,视频帧图像m+1~2m张视频帧图像可以继续被依次分发至GPU1~m,不再赘述。对于任一GPU,其中部署的各个智能算法组件依次处理该核心接收到的多张视频帧图像。通过该方式,各个GPU可以分别并行处理自身接收到的视频帧图像,而任一GPU中部署的各个智能算法组件则按序处理该GPU接收到的各张视频帧图像。可见,该方式可以在多个目标处理组件按序处理视频帧图像的基础上,利用GPU所具有的并行处理能力并发运行多条流水线,从而进一步提升数据处理系统对待处理任务的执行效率。In addition, it is assumed that the decoder used by the decoding component is libx264 corresponding to the target video, the decoding pixel format is RGB24, the decoded data type is 8-bit integer data, the data range is 0-255, and the data size is 1080*1920*3. After the decoding component obtains the video file, it decodes it to obtain multiple video frame images. Specifically, the ffmpegAPI (Application Programming Interface) can be called to implement decoding, and then the distribution component distributes each video frame image decoded by the decoding component to the corresponding GPU in sequence. For example, in the case of distribution according to the polling rule, video frame images 1~m can be distributed to GPU1~m in sequence, and then video frame images m+1~2m video frame images can continue to be distributed to GPU1~m in sequence, which will not be repeated. For any GPU, each intelligent algorithm component deployed therein processes multiple video frame images received by the core in sequence. In this way, each GPU can process the video frame images received by itself in parallel, and each intelligent algorithm component deployed in any GPU processes each video frame image received by the GPU in sequence. It can be seen that this method can use the parallel processing capability of the GPU to run multiple pipelines concurrently on the basis of multiple target processing components processing video frame images in sequence, thereby further improving the execution efficiency of the data processing system for the tasks to be processed.

其中,所述智能算法组件可以基于所述CUDA框架和Tensorrt推理引擎(一种深度学习推理SDK)实现,以便充分利用所述智能算法组件所处GPU的计算资源。在所述智能算法组件包括多个子算法组件的情况下,各个子算法组件可以通过共享GPU显存的方式分别处理视频帧图像,从而各个子算法组件所处的Tensorrt推理引擎之间无需进行数据传输,从而减少了数据传输带来的冗余和性能开销。在任一GPU中的智能算法组件处理任一视频帧图像的过程中,该视频帧图像(即该图像的数据)从GPU的host端传给device端,且可以传递一次,而各个子算法组件的算法逻辑可以在device端实现,最终处理完的数据(如所述处理后图像或所述处理后数据)可以从device端传给host端,以供编码单元使用。Among them, the intelligent algorithm component can be implemented based on the CUDA framework and the TensorRT reasoning engine (a deep learning reasoning SDK) to make full use of the computing resources of the GPU where the intelligent algorithm component is located. In the case where the intelligent algorithm component includes multiple sub-algorithm components, each sub-algorithm component can process the video frame image separately by sharing the GPU video memory, so that there is no need to transmit data between the TensorRT reasoning engines where each sub-algorithm component is located, thereby reducing the redundancy and performance overhead caused by data transmission. In the process of processing any video frame image by the intelligent algorithm component in any GPU, the video frame image (that is, the data of the image) is transmitted from the host end of the GPU to the device end, and can be transmitted once, and the algorithm logic of each sub-algorithm component can be implemented on the device end, and the final processed data (such as the processed image or the processed data) can be transmitted from the device end to the host end for use by the encoding unit.

具体处理过程可以包括:host端将所述任一视频帧图像的原始数据拷贝至device端,CUDA框架对所述原始数据进行归一化处理和数据类型转换等前处理。其中,上述类型转换可以包括将0-255范围的uint8数据转换为0-1范围的float32数据。然后调用降噪组件的Tensorrt推理引擎进行模型推理,即对前处理后的原始数据进行降噪处理,并将降噪后数据的存储地址传递至超分辨率组件的Tensorrt推理引擎进行模型推理,即对降噪后数据进行超分辨率处理,并将得到的超分辨率数据的存储地址传递至HDR组件进行模型推理,即对超分辨率数据进行HDR处理,最终的处理后数据即构成处理后图像。其中,上述存储地址可以为相应数据在所述GPU的显存(Video Memory,显卡内存)中的存储地址。The specific processing process may include: the host side copies the original data of any video frame image to the device side, and the CUDA framework performs pre-processing such as normalization and data type conversion on the original data. Among them, the above type conversion may include converting uint8 data in the range of 0-255 to float32 data in the range of 0-1. Then call the TensorRT inference engine of the denoising component to perform model inference, that is, perform denoising on the original data after pre-processing, and pass the storage address of the denoised data to the TensorRT inference engine of the super-resolution component for model inference, that is, perform super-resolution processing on the denoised data, and pass the storage address of the obtained super-resolution data to the HDR component for model inference, that is, perform HDR processing on the super-resolution data, and the final processed data constitutes the processed image. Among them, the above storage address can be the storage address of the corresponding data in the video memory (Video Memory, graphics card memory) of the GPU.

此后,所述CUDA框架还可以对所述处理后图像进行后处理,如可以进行数据修剪(clip)、数据映射和/或数据类型转换等。其中,数据修剪可以包括;将超出0-1范围的数据截断,小于0的置换为0,大于1的置换为1。数据映射可以包括:将0-1范围的数据映射到0-255(或者0-65535),映射范围取决于是否HDR输出,若否则映射至0-255,若是则映射至0-65535。数据类型转换可以与所述前处理中的数据类型转换过程相反,如在前处理时将0-255范围的uint8数据转换为0-1范围的float32数据的情况下,后处理时可以再将float32的数据转换为uint8的数据,以确保GPU的输入数据和输出数据的数据格式及精度保持一致。Thereafter, the CUDA framework may also perform post-processing on the processed image, such as data clipping, data mapping and/or data type conversion. Data clipping may include: truncating data beyond the range of 0-1, replacing data less than 0 with 0, and replacing data greater than 1 with 1. Data mapping may include: mapping data in the range of 0-1 to 0-255 (or 0-65535), the mapping range depends on whether HDR output is performed, if not, it is mapped to 0-255, and if so, it is mapped to 0-65535. The data type conversion may be the opposite of the data type conversion process in the pre-processing. For example, when converting uint8 data in the range of 0-255 to float32 data in the range of 0-1 during pre-processing, the float32 data may be converted to uint8 data during post-processing to ensure that the data format and precision of the GPU input data and output data remain consistent.

在上述过程中,对于被处理的视频帧图像的而言,解码得到的视频帧图像的原始数据可以为8位整型的RGB24数据,该数据可以被存储在图像处理设备的内存中,并被传输到任一GPU显存的。此后,可以调用CUDA框架将上述8位整型数据转换并归一化为32位浮点型数据,数据范围可以为0-1。在该GPU中经过降噪组件的处理,输出的降噪后数据可以保持为32位浮点型数据(范围0-1),存储位置为GPU显存,数据大小为1080*1920*3。所述降噪后数据可以被进一步传递给超分辨率组件,经过该组件处理后的超分辨率数据可以保持为32位浮点型数据(范围0-1),相应的数据大小可以为1080*2*1920*2*3。所述超分辨率数据可以被进一步传递给HDR组件,经过该组件处理后的HDR数据可以为继续保持为32位浮点型数据(范围0-1),输出大小为1080*2*1920*2*3。此后,可以调用CUDA框架对所述HDR数据进行后处理,如进行数据范围映射和数据类型转换,从而将该数据转换为16位整型,范围为0-65535,该数据即可以视为所述处理后图像的数据。In the above process, for the processed video frame image, the original data of the decoded video frame image can be 8-bit integer RGB24 data, which can be stored in the memory of the image processing device and transmitted to any GPU video memory. Thereafter, the CUDA framework can be called to convert and normalize the above 8-bit integer data into 32-bit floating point data, and the data range can be 0-1. After being processed by the denoising component in the GPU, the output denoised data can be maintained as 32-bit floating point data (range 0-1), the storage location is the GPU video memory, and the data size is 1080*1920*3. The denoised data can be further passed to the super-resolution component, and the super-resolution data processed by the component can be maintained as 32-bit floating point data (range 0-1), and the corresponding data size can be 1080*2*1920*2*3. The super-resolution data can be further passed to the HDR component, and the HDR data processed by the component can continue to be 32-bit floating point data (range 0-1), and the output size is 1080*2*1920*2*3. Thereafter, the CUDA framework can be called to post-process the HDR data, such as performing data range mapping and data type conversion, so as to convert the data into a 16-bit integer with a range of 0-65535, and the data can be regarded as the data of the processed image.

所述处理后图像可以被该GPU传递至CPU,并由GPU结合组件和编码组件分别进行集合和编码。其中,编码组件可以根据用户配置的编码器格式(如libx264、libx265、mpeg等)和编码像素类型(yuv420p、yuv444p等),以及文件封装格式(.mov、.mp4等)等信息创建编码器并封装编码后的文件。例如可以采用ffmpeg硬编码的方式(h264_nvenc、hevc_nvenc等)实现上述编码,以提高编码速度。另外,在所述GPU硬件不支持编码的情况下,所述编码组件可以采用软编实现上述编码处理,具体过程可以参见相关技术中的记载,此处不再赘述。The processed image can be passed to the CPU by the GPU, and the GPU combined component and the encoding component are respectively assembled and encoded. Among them, the encoding component can create an encoder and encapsulate the encoded file according to the encoder format (such as libx264, libx265, mpeg, etc.) and encoded pixel type (yuv420p, yuv444p, etc.) configured by the user, as well as the file encapsulation format (.mov, .mp4, etc.) and other information. For example, the above encoding can be implemented in a ffmpeg hard-coded manner (h264_nvenc, hevc_nvenc, etc.) to increase the encoding speed. In addition, when the GPU hardware does not support encoding, the encoding component can use soft editing to implement the above encoding processing. The specific process can be referred to the records in the relevant technology, which will not be repeated here.

进一步的,各个GPU中部署的HDR组件(即最后一个智能算法组件)可以将处理完成的各张处理后图像依次传递至集合组件。而集合组件可以将各个GPU中的HDR组件分别传递来的处理后图像(可以经过乱序重组)发送至编码组件。可以理解的是,因为使用了插帧组件,所以任一GPU中的HDR组件传递至集合组件的处理后图像的数量,可能大于分发组件向该GPU分发的视频帧图像的数量;相应的,集合组件接收到的处理后图像的数量,也可能大于GPU分发单元所分发的视频帧图像的数量。当然,编码组件用于进行编码处理的处理后图像的数量也大于解码组件解码得到的视频帧图像的数量。相应的,编码组件可以对接收到的多张处理后图像进行编码处理,从而得到处理后图像。如在目标视频是分辨率为1080P的视频文件的情况下,最终输出的处理后图像可以为4K的HDR视频文件。Furthermore, the HDR component deployed in each GPU (i.e., the last intelligent algorithm component) can pass the processed images to the collection component in sequence. The collection component can send the processed images (which can be reorganized in a disordered order) respectively passed by the HDR components in each GPU to the encoding component. It can be understood that because the interpolation component is used, the number of processed images passed by the HDR component in any GPU to the collection component may be greater than the number of video frame images distributed to the GPU by the distribution component; accordingly, the number of processed images received by the collection component may also be greater than the number of video frame images distributed by the GPU distribution unit. Of course, the number of processed images used by the encoding component for encoding processing is also greater than the number of video frame images decoded by the decoding component. Accordingly, the encoding component can encode the multiple processed images received to obtain the processed images. For example, when the target video is a video file with a resolution of 1080P, the processed image finally output can be a 4K HDR video file.

如图10所示,数据处理系统中的管理组件即算法服务,目标处理组件即相应的解码任务、智能算法任务和编码任务。针对所述数据处理系统,可以向用户提供视频处理算法接口,该接口可以基于C++的多态规范生成,并可以采用多线程技术以便用户充分调度视频处理设备的硬件资源,从而使算法任务高并发的对视频进行高效处理。其中解码任务是对输入的音视频文件进行解码,得到音视频文件的媒体数据(包含视频帧和音频)。AI模型处理任务包括但不限于视频降噪、超分辨率,帧率提升、HDR等超高清视频处理算法功能。其中,所述AI模型处理任务对应的AI模型信息可以采用枚举形式,相应的枚举成员可以见表13。As shown in Figure 10, the management component in the data processing system is the algorithm service, and the target processing component is the corresponding decoding task, intelligent algorithm task and encoding task. For the data processing system, a video processing algorithm interface can be provided to the user. The interface can be generated based on the polymorphic specification of C++, and multi-threading technology can be used to allow users to fully schedule the hardware resources of the video processing device, so that the algorithm task can process the video efficiently with high concurrency. Among them, the decoding task is to decode the input audio and video files to obtain the media data (including video frames and audio) of the audio and video files. AI model processing tasks include but are not limited to video noise reduction, super resolution, frame rate improvement, HDR and other ultra-high-definition video processing algorithm functions. Among them, the AI model information corresponding to the AI model processing task can be in enumeration form, and the corresponding enumeration members can be seen in Table 13.

表13Table 13

另外,编码任务是对经过算法任务处理完成的媒体数据进行编码,输出视频文件或者视频数据流。所述视频文件的封装类型信息可以采用枚举形式,相应的枚举成员可见表14。In addition, the encoding task is to encode the media data processed by the algorithm task and output a video file or a video data stream. The encapsulation type information of the video file can be in enumeration form, and the corresponding enumeration members can be seen in Table 14.

表14Table 14

其中,所述视频处理算法接口可以包括算法服务接口和算法任务接口。其中,所述算法服务接口用于视频处理系统与算法任务之间的任务管理和服务调用,该接口对应于图10所示的算法服务,用户可以通过该接口向算法服务发起针对所述数据处理系统的配置指令,以便搭建数据处理系统、指定各个目标处理组件的处理顺序或指定任一处理组件的具体参数等。所述算法任务接口可以用于调用具体的算法任务,例如解码组件,智能算法组件,编码组件等。该接口对应于图10所示的智能算法任务,用户可以通过该接口向管理组件指定具体的智能算法任务,以便将其加载至相应的流水线。Wherein, the video processing algorithm interface may include an algorithm service interface and an algorithm task interface. Wherein, the algorithm service interface is used for task management and service calls between the video processing system and the algorithm task. The interface corresponds to the algorithm service shown in FIG10. The user can initiate configuration instructions for the data processing system to the algorithm service through the interface, so as to build a data processing system, specify the processing order of each target processing component, or specify the specific parameters of any processing component. The algorithm task interface can be used to call specific algorithm tasks, such as decoding components, intelligent algorithm components, encoding components, etc. The interface corresponds to the intelligent algorithm task shown in FIG10. The user can specify a specific intelligent algorithm task to the management component through the interface so as to load it into the corresponding pipeline.

其中,所述算法任务的配置信息可以采用字符串形式,相应的算法任务配置信息可见表15。Among them, the configuration information of the algorithm task can be in the form of a string, and the corresponding algorithm task configuration information can be seen in Table 15.

表15Table 15

另外,所述算法任务接口的函数列表可以参见表16。In addition, the function list of the algorithm task interface can be found in Table 16.

表16Table 16

CZ2214464-PX2231246JZCNCZ2214464-PX2231246JZCN

在上述数据处理系统的搭建阶段,用户可以通过算法服务接口指定需要加载的各个AI视频处理任务。此后,可以通过调用AI模型处理任务的接口函数运行所述AI视频处理任务。示例性的,其接口函数如下:During the construction phase of the above data processing system, the user can specify the various AI video processing tasks that need to be loaded through the algorithm service interface. Thereafter, the AI video processing task can be run by calling the interface function of the AI model processing task. For example, its interface function is as follows:

模型初始化函数,用于初始化AI推理引擎。参数见表28,函数返回值:调用成功,返回0;调用失败,返回非0。Model initialization function, used to initialize the AI inference engine. Parameters are shown in Table 28. Function return value: If the call is successful, it returns 0; if the call fails, it returns non-zero.

数据前处理函数,用于将整形数据转换为模型需要的浮点型数据,并传递给GPU。函数返回值:调用成功,返回0;调用失败,返回非0。Data pre-processing function, used to convert the integer data into floating-point data required by the model and pass it to the GPU. Function return value: 0 if the call is successful; non-zero if the call fails.

数据处理函数,用于处理数据。函数返回值:调用成功,返回0;调用失败,返回非0。Data processing function, used to process data. Function return value: 0 if the call is successful; non-zero if the call fails.

数据后处理函数,用于将浮点数据转换为整型数据,并将GPU数据传递给主机内存。函数返回值:调用成功,返回0;调用失败,返回非0。Data post-processing function, used to convert floating-point data into integer data and pass GPU data to host memory. Function return value: 0 if the call is successful; non-zero if the call fails.

模型资源释放函数,用于释放AI推理引擎,以及其他资源。函数返回值:调用成功,返回0;调用失败,返回非0。Model resource release function, used to release the AI inference engine and other resources. Function return value: 0 if the call is successful; non-zero if the call fails.

AI模型处理任务初始化函数,用于初始化AI模型处理任务。函数返回值:调用成功,返回0;调用失败,返回非0。AI model processing task initialization function, used to initialize AI model processing tasks. Function return value: 0 if the call is successful; non-zero if the call fails.

AI模型处理任务数据处理函数,用于启动AI模型处理任务进行数据处理,并和其他算法任务进行数据传递。函数返回值:调用成功,返回0;调用失败,返回非0。The AI model processing task data processing function is used to start the AI model processing task for data processing and transfer data with other algorithm tasks. Function return value: If the call is successful, it returns 0; if the call fails, it returns non-zero.

AI模型处理任务资源释放函数,目的是通知算法服务该任务已完成,并释放资源。函数返回值:调用成功,返回0;调用失败,返回非0。AI model processing task resource release function, the purpose is to notify the algorithm service that the task has been completed and release resources. Function return value: if the call is successful, it returns 0; if the call fails, it returns non-zero.

在所述数据处理系统启动完成后,用户可以通过前述算法任务接口向数据处理系统指定待处理视频。After the data processing system is started, the user can specify the video to be processed to the data processing system through the aforementioned algorithm task interface.

其中,通过视频解码任务接口可以调用视频解码任务的预定义的下述函数,以实现相应的功能。在通过路径指示输入的目标视频的情况下,所述解码组件可以调用:The following predefined functions of the video decoding task can be called through the video decoding task interface to implement the corresponding functions. In the case of inputting the target video through the path indication, the decoding component can call:

视频文件函数,用于根据视频文件路径打开视频并获取解码环境信息。视频帧获取函数,用于解码得到目标视频的视频帧序列。视频帧率获取函数,用于获取目标视频的帧率。视频编码信息获取函数,用于获取目标视频编码环境信息。视频宽获取函数,用于获取目标视频的宽度。视频高获取函数,用于获取输入视频高度。解码任务初始化函数,用于初始化解码任务。解码任务数据处理函数,用于了解码每一帧数据,并把数据传递给其他算法任务。解码任务资源释放函数,用于释放为算法任务分配的处理资源。上述各个函数的参数列表可以参见表17。The video file function is used to open the video according to the video file path and obtain the decoding environment information. The video frame acquisition function is used to decode and obtain the video frame sequence of the target video. The video frame rate acquisition function is used to obtain the frame rate of the target video. The video encoding information acquisition function is used to obtain the encoding environment information of the target video. The video width acquisition function is used to obtain the width of the target video. The video height acquisition function is used to obtain the input video height. The decoding task initialization function is used to initialize the decoding task. The decoding task data processing function is used to understand the decoding of each frame of data and pass the data to other algorithm tasks. The decoding task resource release function is used to release the processing resources allocated to the algorithm task. The parameter list of the above functions can be found in Table 17.

表17Table 17

假设所述待处理视频为2K视频,则所述视频处理系统可以对该视频进行2倍上采样,以将其处理为4K HDR视频。具体的,通过执行解码任务,可以将待处理视频解码为多个视频帧图像。进一步的,通过执行AI模型处理任务,可以对上述视频帧图像依次进行降噪、超分辨率、插针、HDR上变换等处理。最后,通过执行编码任务可以对处理后的视频帧图像进行编码和文件封装等处理,以得到并输出处理后视频。Assuming that the video to be processed is a 2K video, the video processing system can upsample the video by 2 times to process it into a 4K HDR video. Specifically, by executing the decoding task, the video to be processed can be decoded into multiple video frame images. Furthermore, by executing the AI model processing task, the above-mentioned video frame images can be processed in sequence such as noise reduction, super-resolution, interpolation, HDR up-conversion, etc. Finally, by executing the encoding task, the processed video frame images can be encoded and packaged into files to obtain and output the processed video.

其中,所述编码组件可以调用视频文件创建函数,以初始化音视频编码器,并基于各个算法任务对的处理结果创建视频文件。该函数的返回值:调用成功,返回0;调用失败,返回非0。该函数的参数列表可以参见表18。The encoding component may call a video file creation function to initialize the audio and video encoder and create a video file based on the processing results of each algorithm task pair. The return value of the function: if the call is successful, it returns 0; if the call fails, it returns non-zero. The parameter list of the function can be found in Table 18.

表18Table 18

参数parameter 输入/输出类型Input/Output Type 参数说明Parameter Description 视频流编码格式类型Video stream encoding format type 输入参数Input Parameters // 视频流像素格式Video stream pixel format 输入参数Input Parameters // HDR标准类型HDR Standard Type 输入参数Input Parameters // 音频流编码格式类型Audio stream encoding format type 输入参数Input Parameters // 视频文件封装类型Video file packaging type 输入参数Input Parameters // 视频文件路径Video file path 输出参数Output Parameters 输出视频文件路径及文件名Output video file path and file name

另外,编码组件还可以调用视频编码函数以编码处理后的每一张图像帧,该函数的返回值:调用成功,返回0;调用失败,返回非0。以及,调用音频编码函数以编码处理后的每一张图像帧分别对应的音频帧。所述视频编码函数和音频编码函数的参数列表可参见表19。In addition, the encoding component can also call the video encoding function to encode each processed image frame, and the return value of the function is: if the call is successful, it returns 0; if the call fails, it returns non-zero. And, call the audio encoding function to encode the audio frame corresponding to each processed image frame. The parameter list of the video encoding function and the audio encoding function can be found in Table 19.

表19Table 19

参数parameter 输入/输出类型Input/Output Type 参数说明Parameter Description 内存数据Memory Data 输入参数Input Parameters 视频流的内存数据Memory data of video stream 内存数据Memory Data 输入参数Input Parameters 音频流的内存数据Memory data of audio stream

另外,编码组件还可以调用下述各函数,以实现相应功能:In addition, the encoding component can also call the following functions to implement corresponding functions:

设置HDR参数函数,用于编码处理后的每一张图像帧。函数返回值:调用成功,返回0;调用失败,返回非0。Set the HDR parameter function, which is used for each image frame after encoding. Function return value: if the call is successful, it returns 0; if the call fails, it returns non-zero.

写文件尾函数,用于写输出视频文件尾,确保所输出视频文件的完整性。函数返回值:调用成功,返回0;调用失败,返回非0。The write file tail function is used to write the output video file tail to ensure the integrity of the output video file. Function return value: if the call is successful, it returns 0; if the call fails, it returns non-zero.

视频编码任务初始化函数,用于初始化视频编码任务。函数返回值:调用成功,返回0;调用失败,返回非0。The video encoding task initialization function is used to initialize the video encoding task. Function return value: if the call is successful, it returns 0; if the call fails, it returns non-zero.

视频编码任务数据处理函数,用于编码处理后的每一张图像帧,并和其他算法任务进行数据传递。函数返回值:调用成功,返回0;调用失败,返回非0。The video encoding task data processing function is used to encode each image frame after processing and transfer data with other algorithm tasks. Function return value: if the call is successful, it returns 0; if the call fails, it returns non-zero.

视频编码任务资源释放函数,用于编写文件尾,并释放处理资源。函数返回值:调用成功,返回0;调用失败,返回非0。The video encoding task resource release function is used to write the file tail and release the processing resources. Function return value: if the call is successful, it returns 0; if the call fails, it returns non-zero.

音频编码任务初始化函数,用于初始化视频编码任务。函数返回值:调用成功,返回0;调用失败,返回非0。The audio encoding task initialization function is used to initialize the video encoding task. Function return value: if the call is successful, it returns 0; if the call fails, it returns non-zero.

音频编码任务数据处理函数,用于编码处理后的每一张图像帧,并和其他算法任务进行数据传递。函数返回值:调用成功,返回0;调用失败,返回非0。The audio encoding task data processing function is used to encode each image frame after processing and transfer data with other algorithm tasks. Function return value: if the call is successful, it returns 0; if the call fails, it returns non-zero.

音频编码任务资源释放函数,用于是编写文件尾,并释放处理资源。函数返回值:调用成功,返回0;调用失败,返回非0。The audio encoding task resource release function is used to write the file tail and release the processing resources. Function return value: if the call is successful, it returns 0; if the call fails, it returns non-zero.

可以理解的是,通过前述方式输出的处理后视频即为4K HDR视频,该视频可以由显示终端进行解码,并进一步渲染显示。其中,各个相邻任务的目标处理组件之间除了传递对视频帧图像进行处理的中间数据之外,还可以传递相应的静态元数据和/或动态元数据,以便后续组件顺利处理所述中间数据。It is understandable that the processed video outputted in the above manner is a 4K HDR video, which can be decoded by a display terminal and further rendered for display. In addition to transmitting intermediate data for processing video frame images, the target processing components of each adjacent task can also transmit corresponding static metadata and/or dynamic metadata so that subsequent components can smoothly process the intermediate data.

在上述过程中,所述算法服务可以对解码任务、AI模型处理任务和编码任务进行流程化管理,对各个任务进行数据处理系统高并发调度,实现资源的最大利用,已达到最高效的处理效率。例如,算法服务可以管理和调度算法任务、控制在各个算法任务之间传递和同步数据、对各个算法任务进行资源分配、监管各个算法任务的任务执行状态、在任务执行完毕后释放算法任务占用的资源等。In the above process, the algorithm service can manage the decoding tasks, AI model processing tasks and encoding tasks in a process-based manner, and perform high-concurrency scheduling of the data processing system for each task to maximize the utilization of resources and achieve the most efficient processing efficiency. For example, the algorithm service can manage and schedule algorithm tasks, control the transmission and synchronization of data between algorithm tasks, allocate resources to each algorithm task, monitor the task execution status of each algorithm task, and release the resources occupied by the algorithm task after the task is completed.

通过该方案,可以向用户提供针对算法服务和算法任务的调用接口,以便用户通过上述接口便捷高效的调用相应的算法功能,从而实现针对目标数据的处理。显然,该方案可以简化用户的配置和调用操作,从而进一步提升视频处理效率。Through this solution, users can be provided with a calling interface for algorithm services and algorithm tasks, so that users can conveniently and efficiently call the corresponding algorithm functions through the above interface to achieve processing of target data. Obviously, this solution can simplify the user's configuration and calling operations, thereby further improving video processing efficiency.

与前述数据处理方法的实施例相对应,本发明还提供了数据处理装置的实施例。所述装置应用于数据处理系统,所述数据处理系统包括管理组件和处理组件,所述装置包括一个或多个处理器,所述处理器被配置为:Corresponding to the above-mentioned data processing method embodiment, the present invention also provides an embodiment of a data processing device. The device is applied to a data processing system, the data processing system includes a management component and a processing component, the device includes one or more processors, and the processor is configured to:

根据待处理任务确定多个目标处理组件,所述待处理任务用于处理目标数据;Determine a plurality of target processing components according to the tasks to be processed, wherein the tasks to be processed are used to process target data;

所述管理组件加载所述多个目标处理组件;The management component loads the multiple target processing components;

加载完成的所述多个目标处理组件按序处理所述目标数据的数据片段,其中,各个目标处理组件在同一时刻分别处理不同的数据片段,至少一个数据片段被各个目标处理组件依次处理。The multiple target processing components that have completed loading process the data segments of the target data in sequence, wherein each target processing component processes different data segments at the same time, and at least one data segment is processed in sequence by each target processing component.

在一个实施例中,所述数据处理系统还包括源组件,所述源组件包含预定义规则,所述处理器还被配置为:In one embodiment, the data processing system further comprises a source component, the source component comprising predefined rules, and the processor is further configured to:

所述源组件基于所述预定义规则生成所述目标处理组件。The source component generates the target processing component based on the predefined rule.

在一个实施例中,所述源组件是基类,所述处理器还被配置为:In one embodiment, the source component is a base class, and the processor is further configured to:

所述基类派生生成所述目标处理组件。The base class is derived to generate the target processing component.

在一个实施例中,所述处理器还被配置为:In one embodiment, the processor is further configured to:

所述管理组件将所述多个目标处理组件添加至组件列表中,并启动所述组件列表中的各个目标处理组件。The management component adds the multiple target processing components to a component list, and starts each target processing component in the component list.

在一个实施例中,所述处理器还被配置为:In one embodiment, the processor is further configured to:

所述管理组件识别所述至少一个目标处理组件是否由所述源组件生成,若是,则将所述至少一个目标处理组件添加至组件列表中。The management component identifies whether the at least one target processing component is generated by the source component, and if so, adds the at least one target processing component to a component list.

在一个实施例中,所述处理器还被配置为:In one embodiment, the processor is further configured to:

所述管理组件获取所述组件列表中的各个目标处理组件的组件信息,并基于所述组件信息,启动所述各个目标处理组件。The management component obtains component information of each target processing component in the component list, and starts each target processing component based on the component information.

在一个实施例中,所述数据处理系统还包括前向节点和后向节点,所述目标处理组件对应一个或多个前向节点,以及所述目标处理组件对应一个或多个后向节点;其中,所述前向节点用于获取前向数据片段以供所述目标处理组件读取,所述后向节点用于获取目标处理组件处理后的后向数据片段。In one embodiment, the data processing system also includes a forward node and a backward node, the target processing component corresponds to one or more forward nodes, and the target processing component corresponds to one or more backward nodes; wherein the forward node is used to obtain forward data segments for the target processing component to read, and the backward node is used to obtain backward data segments processed by the target processing component.

在一个实施例中,所述处理器还被配置为:In one embodiment, the processor is further configured to:

获取所述前向数据片段后,所述前向节点更新为可写状态;After acquiring the forward data fragment, the forward node is updated to a writable state;

所述目标处理组件执行数据处理操作以得到相应的后向数据片段;The target processing component performs a data processing operation to obtain a corresponding backward data segment;

在所述后向节点处于可写状态时,所述后向节点获取所述后向数据片段;When the backward node is in a writable state, the backward node obtains the backward data segment;

获取所述后向数据片段后,所述后向节点更新为可读状态。After acquiring the backward data segment, the backward node is updated to a readable state.

在一个实施例中,所述目标处理组件包括数据等待模块,所述处理器还被配置为:In one embodiment, the target processing component includes a data waiting module, and the processor is further configured to:

响应所述目标处理组件在所述前向节点处于可读状态时获取所述前向数据片段。In response to the target processing component acquiring the forward data segment when the forward node is in a readable state.

在一个实施例中,所述目标处理组件包括数据传递模块,所述处理器还被配置为:In one embodiment, the target processing component includes a data transfer module, and the processor is further configured to:

在所述后向节点处于可写状态时将所述后向数据片段传递至所述后向节点。The backward data segment is transferred to the backward node when the backward node is in a writable state.

所述目标处理组件的前向节点与其前一目标处理组件的后向节点是同一节点。The forward node of the target processing component and the backward node of its previous target processing component are the same node.

在一个实施例中,所述处理器还被配置为:所述管理组件在加载所述多个目标处理组件完成后,In one embodiment, the processor is further configured to: after the management component completes loading the multiple target processing components,

响应于针对任一其他处理组件的加载指令,继续加载所述任一其他处理组件;和/或,In response to a load instruction for any other processing component, continue to load any other processing component; and/or,

响应于针对已加载的任一目标处理组件的卸载指令,卸载所述任一目标处理组件。In response to an uninstall instruction for any loaded target processing component, the any loaded target processing component is uninstalled.

在一个实施例中,所述处理器还被配置为:In one embodiment, the processor is further configured to:

所述管理组件为各个目标处理组件分配相应的处理资源;以及,在任一目标处理组件处理所述目标数据的最后一个数据片段完成后,释放为所述任一目标处理组件分配的处理资源;或者,The management component allocates corresponding processing resources to each target processing component; and, after any target processing component completes processing the last data fragment of the target data, releases the processing resources allocated to any target processing component; or,

若所述多个目标处理组件在按序处理所述目标数据的数据片段的过程中出现异常,则输出异常提醒消息、记录所述异常的相关信息和/或触发停止针对所述目标数据的处理过程。If an exception occurs when the multiple target processing components sequentially process the data segments of the target data, an exception reminder message is output, relevant information of the exception is recorded, and/or the processing process for the target data is stopped.

在一个实施例中,所述目标数据包括音频和/或视频,所述多个目标处理组件包括编码组件、智能算法组件和解码组件。In one embodiment, the target data includes audio and/or video, and the multiple target processing components include an encoding component, an intelligent algorithm component, and a decoding component.

在一个实施例中,在所述目标数据包括视频的情况下,所述智能算法组件包括下述至少之一的子算法组件:In one embodiment, when the target data includes a video, the intelligent algorithm component includes at least one of the following sub-algorithm components:

插帧组件、降噪组件、超分辨率组件、高动态范围组件、细节修复组件。Interpolation component, noise reduction component, super resolution component, high dynamic range component, detail restoration component.

在一个实施例中,所述智能算法组件的数量为多个,所述目标处理组件还包括分发组件和集合组件,所述目标数据中的各个数据片段分别具有相应的序列号,所述序列号用于表征所述各个数据片段在所述目标数据中的先后顺序,所述处理器还被配置为:In one embodiment, the number of the intelligent algorithm components is multiple, the target processing component further includes a distribution component and a collection component, each data fragment in the target data has a corresponding sequence number, and the sequence number is used to characterize the order of each data fragment in the target data, and the processor is further configured to:

所述分发组件将所述解码组件输出的各个数据片段分别分发至相应的智能算法组件,以由各个智能算法组件分别处理自身接收到的数据片段,并将处理得到的处理后数据片段分别传递至所述集合组件;The distribution component distributes each data segment output by the decoding component to the corresponding intelligent algorithm component, so that each intelligent algorithm component processes the data segment received by itself, and transmits the processed data segment to the collection component;

所述集合组件接收各个智能算法组件分别传递的处理后数据片段,并将接收到的各个处理后数据片段按照所述序列号依次发送至所述编码组件。The collection component receives the processed data fragments respectively transmitted by each intelligent algorithm component, and sends the received processed data fragments to the encoding component in sequence according to the serial number.

在一个实施例中,所述处理器还被配置为:In one embodiment, the processor is further configured to:

根据待处理任务的需求信息确定多个目标处理组件,所述需求信息包括以下至少之一:所述目标数据的元信息、所述待处理任务的发起方配置信息、所述数据处理系统提供的默认功能信息。A plurality of target processing components are determined according to the requirement information of the task to be processed, wherein the requirement information includes at least one of the following: meta information of the target data, configuration information of the initiator of the task to be processed, and default function information provided by the data processing system.

与前述视频处理方法的实施例相对应,本发明还提供了视频处理装置的实施例。所述装置应用于视频处理系统,所述视频处理系统包括管理组件和处理组件,所述装置包括一个或多个处理器,所述处理器被配置为:Corresponding to the above-mentioned embodiment of the video processing method, the present invention also provides an embodiment of a video processing device. The device is applied to a video processing system, the video processing system includes a management component and a processing component, the device includes one or more processors, and the processor is configured to:

根据待处理任务确定目标处理组件,所述待处理任务用于处理目标视频,所述目标处理组件包括解码组件、编码组件和至少一个智能算法组件;Determine a target processing component according to a task to be processed, wherein the task to be processed is used to process a target video, and the target processing component includes a decoding component, an encoding component, and at least one intelligent algorithm component;

所述管理组件加载所述目标处理组件;The management component loads the target processing component;

加载完成的所述智能算法组件按序处理所述目标视频的视频帧,其中,各个目标处理组件在同一时刻分别处理不同的视频帧,至少一个视频帧被各个目标处理组件依次处理。The loaded intelligent algorithm component processes the video frames of the target video in sequence, wherein each target processing component processes different video frames at the same time, and at least one video frame is processed in sequence by each target processing component.

在一个实施例中,所述视频处理系统还包括前向节点和后向节点,所述目标处理组件对应一个或多个前向节点,以及所述目标处理组件对应一个或多个后向节点;其中,所述前向节点用于获取前向视频帧信息以供所述目标处理组件读取,所述后向节点用于获取目标处理组件处理后的后向视频帧信息。In one embodiment, the video processing system also includes a forward node and a backward node, the target processing component corresponds to one or more forward nodes, and the target processing component corresponds to one or more backward nodes; wherein the forward node is used to obtain forward video frame information for the target processing component to read, and the backward node is used to obtain backward video frame information processed by the target processing component.

在一个实施例中,所述处理器还被配置为:In one embodiment, the processor is further configured to:

所述目标处理组件在所述前向节点处于可读状态时,获取前向视频帧信息;The target processing component acquires forward video frame information when the forward node is in a readable state;

获取所述前向视频帧信息后,所述前向节点更新为可写状态;After acquiring the forward video frame information, the forward node is updated to a writable state;

所述目标处理组件处理执行数据处理操作以得到相应的后向视频帧信息;The target processing component processes and performs data processing operations to obtain corresponding backward video frame information;

在所述后向节点处于可写状态时,所述后向节点获取所述后向视频帧信息;When the backward node is in a writable state, the backward node obtains the backward video frame information;

获取所述后向视频帧信息后,所述后向节点更新为可读状态。After acquiring the backward video frame information, the backward node is updated to a readable state.

在一个实施例中,所述智能算法组件包括下述至少之一的子算法组件:In one embodiment, the intelligent algorithm component includes at least one of the following sub-algorithm components:

插帧组件、降噪组件、超分辨率组件、高动态范围组件、细节修复组件。Interpolation component, noise reduction component, super resolution component, high dynamic range component, detail restoration component.

在一个实施例中,所述智能算法组件的数量为多个,所述目标处理组件还包括分发组件和集合组件,所述目标视频中的各个视频帧分别具有相应的序列号,所述序列号用于表征所述各个视频帧在所述目标视频的时间轴中所处的位置,所述处理器还被配置为:In one embodiment, the number of the intelligent algorithm components is multiple, the target processing component further includes a distribution component and a collection component, each video frame in the target video has a corresponding serial number, and the serial number is used to characterize the position of each video frame in the timeline of the target video, and the processor is further configured to:

所述分发组件将所述解码组件输出的各个视频帧分别分发至相应的智能算法组件,以由各个智能算法组件分别处理自身接收到的视频帧,并将处理得到的处理后视频帧分别传递至所述集合组件;The distribution component distributes each video frame output by the decoding component to the corresponding intelligent algorithm component, so that each intelligent algorithm component processes the video frame received by itself, and transmits the processed video frames to the collection component respectively;

所述集合组件接收各个智能算法组件分别传递的处理后视频帧,并将接收到的各个处理后视频帧按照所述序列号依次发送至所述编码组件。The collection component receives the processed video frames respectively transmitted by each intelligent algorithm component, and sends each received processed video frame to the encoding component in sequence according to the sequence number.

本发明的实施例还提出一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为实现上述任一实施例所述的数据处理方法或者数据处理方法。An embodiment of the present invention further proposes an electronic device, comprising: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to implement the data processing method or data processing method described in any of the above embodiments.

本发明的实施例还提出一种非瞬态计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现上述任一实施例所述的数据处理方法或者数据处理方法中的步骤。An embodiment of the present invention further provides a non-volatile computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the data processing method or steps in the data processing method described in any of the above embodiments.

关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在相关方法的实施例中进行了详细描述,此处将不做详细阐述说明。Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment of the relevant method, and will not be elaborated here.

图11是根据本发明的实施例示出的一种用于数据存证或者驾驶模式的确定的装置1100的示意框图。例如,装置1100可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等。11 is a schematic block diagram of an apparatus 1100 for data storage or driving mode determination according to an embodiment of the present invention. For example, the apparatus 1100 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

参照图11,装置1100可以包括以下一个或多个组件:处理组件1112,存储器1104,电第一源组件1106,多媒体组件1108,音频组件1110,输入/输出(I/O)的接口1112,传感器组件1114,以及通信组件1116。需要说明的是,此处的处理组件1112是装置1100的功能性组件,而并非本发明前述实施例所述的任一处理组件或目标处理组件。11 , the device 1100 may include one or more of the following components: a processing component 1112, a memory 1104, an electrical first power component 1106, a multimedia component 1108, an audio component 1110, an input/output (I/O) interface 1112, a sensor component 1114, and a communication component 1116. It should be noted that the processing component 1112 here is a functional component of the device 1100, and is not any processing component or target processing component described in the foregoing embodiments of the present invention.

处理组件1112通常控制装置1100的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件1112可以包括一个或多个处理器1120来执行指令,以完成上述数据处理方法或者视频处理方法的全部或部分步骤。此外,处理组件1112可以包括一个或多个模块,便于处理组件1112和其他组件之间的交互。例如,处理组件1112可以包括多媒体模块,以方便多媒体组件1108和处理组件1112之间的交互。The processing component 1112 generally controls the overall operation of the device 1100, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 1112 may include one or more processors 1120 to execute instructions to complete all or part of the steps of the above-mentioned data processing method or video processing method. In addition, the processing component 1112 may include one or more modules to facilitate the interaction between the processing component 1112 and other components. For example, the processing component 1112 may include a multimedia module to facilitate the interaction between the multimedia component 1108 and the processing component 1112.

存储器1104被配置为存储各种类型的数据以支持在装置1100的操作。这些数据的示例包括用于在装置1100上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器1104可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。The memory 1104 is configured to store various types of data to support operations on the device 1100. Examples of such data include instructions for any application or method operating on the device 1100, contact data, phone book data, messages, pictures, videos, etc. The memory 1104 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

电第一源组件1106为装置1100的各种组件提供电力。电第一源组件1106可以包括电源管理系统,一个或多个电源,及其他与为装置1100生成、管理和分配电力相关联的组件。The electrical first source component 1106 provides power to the various components of the device 1100. The electrical first source component 1106 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device 1100.

多媒体组件1108包括在所述装置1100和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件1108包括一个前置摄像头和/或后置摄像头。当装置1100处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。The multimedia component 1108 includes a screen that provides an output interface between the device 1100 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1108 includes a front camera and/or a rear camera. When the device 1100 is in an operating mode, such as a shooting mode or a video mode, the front camera and/or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

音频组件1110被配置为输出和/或输入音频信号。例如,音频组件1110包括一个麦克风(MIC),当装置1100处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器1104或经由通信组件1116发送。在一些实施例中,音频组件1110还包括一个扬声器,用于输出音频信号。The audio component 1110 is configured to output and/or input audio signals. For example, the audio component 1110 includes a microphone (MIC), and when the device 1100 is in an operation mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 1104 or sent via the communication component 1116. In some embodiments, the audio component 1110 also includes a speaker for outputting audio signals.

I/O接口1112为处理组件1112和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。The I/O interface 1112 provides an interface between the processing component 1112 and the peripheral interface module, which may be a keyboard, a click wheel, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

传感器组件1114包括一个或多个传感器,用于为装置1100提供各个方面的状态评估。例如,传感器组件1114可以检测到装置1100的打开/关闭状态,组件的相对定位,例如所述组件为装置1100的显示器和小键盘,传感器组件1114还可以检测装置1100或装置1100一个组件的位置改变,用户与装置1100接触的存在或不存在,装置1100方位或加速/减速和装置1100的温度变化。传感器组件1114可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件1114还可以包括光传感器,如CMOS或处理组件D图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件1114还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。The sensor assembly 1114 includes one or more sensors for providing various aspects of the status assessment of the device 1100. For example, the sensor assembly 1114 can detect the open/closed state of the device 1100, the relative positioning of components, such as the display and keypad of the device 1100, the sensor assembly 1114 can also detect the position change of the device 1100 or a component of the device 1100, the presence or absence of user contact with the device 1100, the orientation or acceleration/deceleration of the device 1100, and the temperature change of the device 1100. The sensor assembly 1114 can include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 1114 can also include an optical sensor, such as a CMOS or processing component D image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1114 can also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

通信组件1116被配置为便于装置1100和其他设备之间有线或无线方式的通信。装置1100可以接入基于通信标准的无线网络,如WiFi,2G或3G,4G LTE、6G NR或它们的组合。在一个示例性实施例中,通信组件1116经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件1116还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。The communication component 1116 is configured to facilitate wired or wireless communication between the device 1100 and other devices. The device 1100 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, 4G LTE, 6G NR or a combination thereof. In an exemplary embodiment, the communication component 1116 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1116 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

在示例性实施例中,装置1100可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述数据处理方法或者视频处理方法。In an exemplary embodiment, the device 1100 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned data processing method or video processing method.

在示例性实施例中,还提供了一种包括指令的非瞬态计算机可读存储介质,例如包括指令的存储器1104,上述指令可由装置1100的处理器1120执行以完成上述数据处理方法或者数据处理方法。例如,所述非瞬态计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 1104 including instructions, and the above instructions can be executed by the processor 1120 of the device 1100 to complete the above data processing method or data processing method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

本领域技术人员在考虑说明书及实践这里公开的实施例后,将容易想到本发明的其它实施方案。本发明旨在涵盖本发明的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本发明的一般性原理并包括本发明未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本发明的真正范围和精神由下面的权利要求指出。Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the embodiments disclosed herein. The present invention is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed by the present invention. The specification and embodiments are to be regarded as exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.

应当理解的是,本发明并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本发明的范围仅由所附的权利要求来限制。It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. The terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprises a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

以上对本发明实施例所提供的方法和装置进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本发明内容不应理解为对本发明的限制。The method and device provided in the embodiments of the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of the present invention should not be understood as a limitation on the present invention.

Claims (26)

1.一种数据处理方法,应用于数据处理系统,所述数据处理系统包括管理组件和处理组件,所述方法包括:1. A data processing method, applied to a data processing system, wherein the data processing system comprises a management component and a processing component, and the method comprises: 根据待处理任务确定多个目标处理组件,所述待处理任务用于处理目标数据;Determine a plurality of target processing components according to the tasks to be processed, wherein the tasks to be processed are used to process target data; 所述管理组件加载所述多个目标处理组件;The management component loads the multiple target processing components; 加载完成的所述多个目标处理组件按序处理所述目标数据的数据片段,其中,各个目标处理组件在同一时刻分别处理不同的数据片段,至少一个数据片段被各个目标处理组件依次处理。The multiple target processing components that have completed loading process the data segments of the target data in sequence, wherein each target processing component processes different data segments at the same time, and at least one data segment is processed in sequence by each target processing component. 2.根据权利要求1所述的方法,所述数据处理系统还包括源组件,所述源组件包含预定义规则,所述方法还包括:2. The method according to claim 1, wherein the data processing system further comprises a source component, wherein the source component comprises a predefined rule, and the method further comprises: 所述源组件基于所述预定义规则生成所述目标处理组件。The source component generates the target processing component based on the predefined rule. 3.根据权利要求2所述的方法,所述源组件是基类,所述源组件基于所述预定义规则生成所述目标处理组件,包括:3. The method according to claim 2, wherein the source component is a base class, and the source component generates the target processing component based on the predefined rule, comprising: 所述基类派生生成所述目标处理组件。The base class is derived to generate the target processing component. 4.根据权利要求2所述的方法,所述管理组件加载所述多个目标处理组件,包括:4. The method according to claim 2, wherein the management component loads the plurality of target processing components, comprising: 所述管理组件将所述多个目标处理组件添加至组件列表中,并启动所述组件列表中的各个目标处理组件。The management component adds the multiple target processing components to a component list, and starts each target processing component in the component list. 5.根据权利要求4所述的方法,所述管理组件将所述多个目标处理组件中的至少一个目标处理组件添加至组件列表中,包括:5. The method according to claim 4, wherein the management component adds at least one target processing component among the plurality of target processing components to the component list, comprising: 所述管理组件识别所述至少一个目标处理组件是否由所述源组件生成,若是,则将所述至少一个目标处理组件添加至组件列表中。The management component identifies whether the at least one target processing component is generated by the source component, and if so, adds the at least one target processing component to a component list. 6.根据权利要求4所述的方法,所述管理组件启动所述组件列表中的各个目标处理组件,包括:6. The method according to claim 4, wherein the management component starts each target processing component in the component list, comprising: 所述管理组件获取所述组件列表中的各个目标处理组件的组件信息,并基于所述组件信息,启动所述各个目标处理组件。The management component obtains component information of each target processing component in the component list, and starts each target processing component based on the component information. 7.根据权利要求1所述的方法,所述数据处理系统还包括前向节点和后向节点,所述目标处理组件对应一个或多个前向节点,以及所述目标处理组件对应一个或多个后向节点;其中,所述前向节点用于获取前向数据片段以供所述目标处理组件读取,所述后向节点用于获取目标处理组件处理后的后向数据片段。7. According to the method according to claim 1, the data processing system also includes a forward node and a backward node, the target processing component corresponds to one or more forward nodes, and the target processing component corresponds to one or more backward nodes; wherein the forward node is used to obtain forward data segments for the target processing component to read, and the backward node is used to obtain backward data segments processed by the target processing component. 8.根据权利要求7所述的方法,所述加载完成的所述多个目标处理组件按序处理所述目标数据的数据片段,包括:8. The method according to claim 7, wherein the plurality of target processing components that have completed loading process the data segments of the target data in sequence, comprising: 所述目标处理组件在所述前向节点处于可读状态时,获取前向数据片段;The target processing component acquires the forward data segment when the forward node is in a readable state; 获取所述前向数据片段后,所述前向节点更新为可写状态;After acquiring the forward data fragment, the forward node is updated to a writable state; 所述目标处理组件执行数据处理操作以得到相应的后向数据片段;The target processing component performs a data processing operation to obtain a corresponding backward data segment; 在所述后向节点处于可写状态时,所述后向节点获取所述后向数据片段;When the backward node is in a writable state, the backward node obtains the backward data segment; 获取所述后向数据片段后,所述后向节点更新为可读状态。After acquiring the backward data segment, the backward node is updated to a readable state. 9.根据权利要求8所述的方法,所述目标处理组件包括数据等待模块,所述数据等待模块用于:9. The method according to claim 8, wherein the target processing component comprises a data waiting module, wherein the data waiting module is used to: 响应所述目标处理组件在所述前向节点处于可读状态时获取所述前向数据片段。In response to the target processing component acquiring the forward data segment when the forward node is in a readable state. 10.根据权利要求8所述的方法,所述目标处理组件包括数据传递模块,所述数据传递模块用于:10. The method according to claim 8, wherein the target processing component comprises a data transfer module, wherein the data transfer module is configured to: 在所述后向节点处于可写状态时将所述后向数据片段传递至所述后向节点。The backward data segment is transferred to the backward node when the backward node is in a writable state. 11.根据权利要求8所述的方法,所述目标处理组件的前向节点与其前一目标处理组件的后向节点是同一节点。11. The method according to claim 8, wherein the forward node of the target processing component and the backward node of its previous target processing component are the same node. 12.根据权利要求1所述的方法,还包括:所述管理组件在加载所述多个目标处理组件完成后,12. The method according to claim 1, further comprising: after the management component completes loading the plurality of target processing components, 响应于针对任一其他处理组件的加载指令,继续加载所述任一其他处理组件;和/或,In response to a load instruction for any other processing component, continue to load any other processing component; and/or, 响应于针对已加载的任一目标处理组件的卸载指令,卸载所述任一目标处理组件。In response to an uninstall instruction for any loaded target processing component, the any target processing component is uninstalled. 13.根据权利要求1所述的方法,还包括:13. The method according to claim 1, further comprising: 所述管理组件为各个目标处理组件分配相应的处理资源;以及,在任一目标处理组件处理所述目标数据的最后一个数据片段完成后,释放为所述任一目标处理组件分配的处理资源;或者,The management component allocates corresponding processing resources to each target processing component; and, after any target processing component completes processing the last data fragment of the target data, releases the processing resources allocated to any target processing component; or, 若所述多个目标处理组件在按序处理所述目标数据的数据片段的过程中出现异常,则输出异常提醒消息、记录所述异常的相关信息和/或触发停止针对所述目标数据的处理过程。If an exception occurs when the multiple target processing components sequentially process the data segments of the target data, an exception reminder message is output, relevant information of the exception is recorded, and/or the processing process for the target data is stopped. 14.根据权利要求1所述的方法,所述目标数据包括音频和/或视频,所述多个目标处理组件包括编码组件、智能算法组件和解码组件。14. The method according to claim 1, wherein the target data comprises audio and/or video, and the multiple target processing components comprise an encoding component, an intelligent algorithm component and a decoding component. 15.根据权利要求14所述的方法,在所述目标数据包括视频的情况下,所述智能算法组件包括下述至少之一的子算法组件:15. The method according to claim 14, wherein when the target data includes a video, the intelligent algorithm component includes at least one of the following sub-algorithm components: 插帧组件、降噪组件、超分辨率组件、高动态范围组件、细节修复组件。Interpolation component, noise reduction component, super resolution component, high dynamic range component, detail restoration component. 16.根据权利要求14所述的方法,所述智能算法组件的数量为多个,所述目标处理组件还包括分发组件和集合组件,所述目标数据中的各个数据片段分别具有相应的序列号,所述序列号用于表征所述各个数据片段在所述目标数据中的先后顺序,所述方法还包括:16. The method according to claim 14, wherein the number of the intelligent algorithm components is multiple, the target processing component further comprises a distribution component and a collection component, each data fragment in the target data has a corresponding sequence number, and the sequence number is used to characterize the order of each data fragment in the target data, and the method further comprises: 所述分发组件将所述解码组件输出的各个数据片段分别分发至相应的智能算法组件,以由各个智能算法组件分别处理自身接收到的数据片段,并将处理得到的处理后数据片段分别传递至所述集合组件;The distribution component distributes each data segment output by the decoding component to the corresponding intelligent algorithm component, so that each intelligent algorithm component processes the data segment received by itself, and transmits the processed data segment to the collection component; 所述集合组件接收各个智能算法组件分别传递的处理后数据片段,并将接收到的各个处理后数据片段按照所述序列号依次发送至所述编码组件。The collection component receives the processed data fragments respectively transmitted by each intelligent algorithm component, and sends the received processed data fragments to the encoding component in sequence according to the serial number. 17.根据权利要求1所述的方法,所述根据待处理任务确定多个目标处理组件,包括:17. The method according to claim 1, wherein determining a plurality of target processing components according to the tasks to be processed comprises: 根据待处理任务的需求信息确定多个目标处理组件,所述需求信息包括以下至少之一:所述目标数据的元信息、所述待处理任务的发起方配置信息、所述数据处理系统提供的默认功能信息。A plurality of target processing components are determined according to the requirement information of the task to be processed, wherein the requirement information includes at least one of the following: meta information of the target data, configuration information of the initiator of the task to be processed, and default function information provided by the data processing system. 18.一种视频处理方法,应用于视频处理系统,所述视频处理系统包括管理组件和处理组件,所述方法包括:18. A video processing method, applied to a video processing system, the video processing system comprising a management component and a processing component, the method comprising: 根据待处理任务确定目标处理组件,所述待处理任务用于处理目标视频,所述目标处理组件包括解码组件、编码组件和至少一个智能算法组件;Determine a target processing component according to a task to be processed, wherein the task to be processed is used to process a target video, and the target processing component includes a decoding component, an encoding component, and at least one intelligent algorithm component; 所述管理组件加载所述目标处理组件;The management component loads the target processing component; 加载完成的所述智能算法组件按序处理所述目标视频的视频帧,其中,各个目标处理组件在同一时刻分别处理不同的视频帧,至少一个视频帧被各个目标处理组件依次处理。The loaded intelligent algorithm component processes the video frames of the target video in sequence, wherein each target processing component processes different video frames at the same time, and at least one video frame is processed in sequence by each target processing component. 19.根据权利要求18所述的方法,所述视频处理系统还包括前向节点和后向节点,所述目标处理组件对应一个或多个前向节点,以及所述目标处理组件对应一个或多个后向节点;其中,所述前向节点用于获取前向视频帧信息以供所述目标处理组件读取,所述后向节点用于获取目标处理组件处理后的后向视频帧信息。19. According to the method of claim 18, the video processing system further includes a forward node and a backward node, the target processing component corresponds to one or more forward nodes, and the target processing component corresponds to one or more backward nodes; wherein the forward node is used to obtain forward video frame information for the target processing component to read, and the backward node is used to obtain backward video frame information processed by the target processing component. 20.根据权利要求19所述的方法,所述加载完成的所述智能算法组件按序处理所述目标视频的视频帧,包括:20. The method according to claim 19, wherein the loaded intelligent algorithm component processes the video frames of the target video in sequence, comprising: 所述目标处理组件在所述前向节点处于可读状态时,获取前向视频帧信息;The target processing component acquires forward video frame information when the forward node is in a readable state; 获取所述前向视频帧信息后,所述前向节点更新为可写状态;After acquiring the forward video frame information, the forward node is updated to a writable state; 所述目标处理组件处理执行数据处理操作以得到相应的后向视频帧信息;The target processing component processes and performs data processing operations to obtain corresponding backward video frame information; 在所述后向节点处于可写状态时,所述后向节点获取所述后向视频帧信息;When the backward node is in a writable state, the backward node obtains the backward video frame information; 获取所述后向视频帧信息后,所述后向节点更新为可读状态。After acquiring the backward video frame information, the backward node is updated to a readable state. 21.根据权利要求18所述的方法,所述智能算法组件包括下述至少之一的子算法组件:21. The method according to claim 18, wherein the intelligent algorithm component comprises at least one of the following sub-algorithm components: 插帧组件、降噪组件、超分辨率组件、高动态范围组件、细节修复组件。Interpolation component, noise reduction component, super resolution component, high dynamic range component, detail restoration component. 22.根据权利要求18所述的方法,所述智能算法组件的数量为多个,所述目标处理组件还包括分发组件和集合组件,所述目标视频中的各个视频帧分别具有相应的序列号,所述序列号用于表征所述各个视频帧在所述目标视频的时间轴中所处的位置,所述方法还包括:22. The method according to claim 18, wherein the number of the intelligent algorithm components is multiple, the target processing component further comprises a distribution component and a collection component, each video frame in the target video has a corresponding sequence number, and the sequence number is used to characterize the position of each video frame in the timeline of the target video, and the method further comprises: 所述分发组件将所述解码组件输出的各个视频帧分别分发至相应的智能算法组件,以由各个智能算法组件分别处理自身接收到的视频帧,并将处理得到的处理后视频帧分别传递至所述集合组件;The distribution component distributes each video frame output by the decoding component to the corresponding intelligent algorithm component, so that each intelligent algorithm component processes the video frame received by itself, and transmits the processed video frames to the collection component respectively; 所述集合组件接收各个智能算法组件分别传递的处理后视频帧,并将接收到的各个处理后视频帧按照所述序列号依次发送至所述编码组件。The collection component receives the processed video frames respectively transmitted by each intelligent algorithm component, and sends the received processed video frames to the encoding component in sequence according to the serial number. 23.一种视频处理装置,所述装置应用于数据处理系统,所述数据处理系统包括管理组件和处理组件,所述装置包括一个或多个处理器,所述处理器被配置为:23. A video processing device, the device being applied to a data processing system, the data processing system comprising a management component and a processing component, the device comprising one or more processors, the processors being configured to: 根据待处理任务确定多个目标处理组件,所述待处理任务用于处理目标数据;Determine a plurality of target processing components according to the tasks to be processed, wherein the tasks to be processed are used to process target data; 所述管理组件加载所述多个目标处理组件;The management component loads the multiple target processing components; 加载完成的所述多个目标处理组件按序处理所述目标数据的数据片段,其中,各个目标处理组件在同一时刻分别处理不同的数据片段,至少一个数据片段被各个目标处理组件依次处理。The multiple target processing components that have completed loading process the data segments of the target data in sequence, wherein each target processing component processes different data segments at the same time, and at least one data segment is processed in sequence by each target processing component. 24.一种视频处理装置,所述装置应用于视频处理系统,所述视频处理系统包括管理组件和处理组件,所述装置包括一个或多个处理器,所述处理器被配置为:24. A video processing device, the device being applied to a video processing system, the video processing system comprising a management component and a processing component, the device comprising one or more processors, the processors being configured to: 根据待处理任务确定目标处理组件,所述待处理任务用于处理目标视频,所述目标处理组件包括解码组件、编码组件和至少一个智能算法组件;Determine a target processing component according to a task to be processed, wherein the task to be processed is used to process a target video, and the target processing component includes a decoding component, an encoding component, and at least one intelligent algorithm component; 所述管理组件加载所述目标处理组件;The management component loads the target processing component; 加载完成的所述智能算法组件按序处理所述目标视频的视频帧,其中,各个目标处理组件在同一时刻分别处理不同的视频帧,至少一个视频帧被各个目标处理组件依次处理。The loaded intelligent algorithm component processes the video frames of the target video in sequence, wherein each target processing component processes different video frames at the same time, and at least one video frame is processed in sequence by each target processing component. 25.一种电子设备,其特征在于,包括:25. An electronic device, comprising: 处理器;processor; 用于存储处理器可执行指令的存储器;a memory for storing processor-executable instructions; 其中,所述处理器被配置为实现权利要求1至17中任一项所述的数据处理方法或者权利要求18至22中任一项所述的视频处理方法。The processor is configured to implement the data processing method described in any one of claims 1 to 17 or the video processing method described in any one of claims 18 to 22. 26.一种非瞬态计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现权利要求1至17中任一项所述的数据处理方法或者权利要求18至22中任一项所述的视频处理方法中的步骤。26. A non-volatile computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the program implements the steps of the data processing method described in any one of claims 1 to 17 or the video processing method described in any one of claims 18 to 22.
CN202211528132.2A 2022-11-30 2022-11-30 Data and video processing method and device Pending CN118118677A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202211528132.2A CN118118677A (en) 2022-11-30 2022-11-30 Data and video processing method and device
PCT/CN2023/134051 WO2024114534A1 (en) 2022-11-30 2023-11-24 Data and video processing methods and apparatuses

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211528132.2A CN118118677A (en) 2022-11-30 2022-11-30 Data and video processing method and device

Publications (1)

Publication Number Publication Date
CN118118677A true CN118118677A (en) 2024-05-31

Family

ID=91212675

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211528132.2A Pending CN118118677A (en) 2022-11-30 2022-11-30 Data and video processing method and device

Country Status (2)

Country Link
CN (1) CN118118677A (en)
WO (1) WO2024114534A1 (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2377031A4 (en) * 2008-12-05 2012-11-21 Social Communications Co REAL TIME CORE
US10943407B1 (en) * 2019-01-25 2021-03-09 Wellovate, LLC XR health platform, system and method
CN110673844A (en) * 2019-09-26 2020-01-10 苏州中科全象智能科技有限公司 Image processing software development method and system
CN110825356B (en) * 2019-11-12 2023-04-18 东方电子股份有限公司 Micro-service development framework and real-time monitoring implementation method
CN112839239B (en) * 2020-12-30 2023-03-21 广州虎牙科技有限公司 Audio and video processing method and device and server

Also Published As

Publication number Publication date
WO2024114534A1 (en) 2024-06-06

Similar Documents

Publication Publication Date Title
US20230418696A1 (en) Method for performing drawing operation by application and electronic device
CN112749022B (en) Camera resource access method, operating system, terminal and virtual camera
US12293218B2 (en) Method and apparatus for a step-enabled workflow
US20230405455A1 (en) Method and apparatus for processing cloud gaming resource data, computer device, and storage medium
US12079537B2 (en) Screen projection method and system, and related apparatus
CN109522131A (en) Resource allocation method, device and equipment
CN116700819B (en) Camera hardware module startup method, device and storage medium
CN113867817B (en) Data processing method and device, electronic equipment and storage medium
WO2020243973A1 (en) Model-based signal inference method and apparatus
CN118118677A (en) Data and video processing method and device
CN116546228B (en) Plug flow method, device, equipment and storage medium for virtual scene
CN116055715B (en) Codec scheduling method and electronic equipment
CN115623318B (en) Focusing method and related device
CN116761080B (en) Image data processing method and terminal equipment
CN116700987A (en) Computing power scheduling for cloud applications, file processing method for cloud applications, and cloud computing platform
CN116055738B (en) Video compression method and electronic equipment
CN117707563B (en) Application resource processing method and related equipment
CN118474528B (en) Camera resource management method and related equipment
CN116738073B (en) Residence identification methods, equipment and storage media
CN117112087B (en) Ordering method of desktop cards, electronic equipment and medium
CN120295693A (en) Coding and decoding method and related device
CN117908839A (en) Method for generating operating system based on microservice architecture and terminal device
CN118606006A (en) Computer vision algorithm integration method, device, computer equipment, readable storage medium and program product
CN117406992A (en) Special effect display method and device, electronic equipment and readable storage medium
CN119762373A (en) Image processing method and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication