[go: up one dir, main page]

CN113434551B - Data processing method, apparatus, device and computer storage medium - Google Patents

Data processing method, apparatus, device and computer storage medium Download PDF

Info

Publication number
CN113434551B
CN113434551B CN202110721414.3A CN202110721414A CN113434551B CN 113434551 B CN113434551 B CN 113434551B CN 202110721414 A CN202110721414 A CN 202110721414A CN 113434551 B CN113434551 B CN 113434551B
Authority
CN
China
Prior art keywords
algorithm
data
processing
module
handle
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.)
Active
Application number
CN202110721414.3A
Other languages
Chinese (zh)
Other versions
CN113434551A (en
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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202110721414.3A priority Critical patent/CN113434551B/en
Publication of CN113434551A publication Critical patent/CN113434551A/en
Application granted granted Critical
Publication of CN113434551B publication Critical patent/CN113434551B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • 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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Image Processing (AREA)

Abstract

本公开公开了数据处理方法、装置、设备和计算机存储介质,涉及增强现实、深度学习、计算机视觉技术等人工智能技术领域。具体实现方案为:算法缓存模块获取算法模块对待处理数据进行第一处理得到的算法数据,并将封装有所述待处理数据的时间戳、算法能力类型和所述算法数据的句柄传递给管理模块;所述管理模块依据所述算法能力类型确定对应的处理模块,将所述时间戳和所述算法数据传递给所述处理模块;所述处理模块依据所述时间戳确定对应的待处理数据,并利用所述算法数据对所述待处理数据进行第二处理。本公开能够保证算法数据和待处理数据的同步,提高数据处理的效果。

Figure 202110721414

The present disclosure discloses a data processing method, device, device and computer storage medium, and relates to the technical fields of artificial intelligence such as augmented reality, deep learning, and computer vision technology. The specific implementation scheme is as follows: the algorithm cache module obtains the algorithm data obtained by the first processing of the data to be processed by the algorithm module, and transmits the time stamp encapsulated with the data to be processed, the algorithm capability type and the handle of the algorithm data to the management module ; The management module determines the corresponding processing module according to the algorithm capability type, and transmits the timestamp and the algorithm data to the processing module; the processing module determines the corresponding data to be processed according to the timestamp, and using the algorithm data to perform second processing on the data to be processed. The present disclosure can ensure the synchronization of algorithm data and data to be processed, and improve the effect of data processing.

Figure 202110721414

Description

数据处理方法、装置、设备和计算机存储介质Data processing method, apparatus, device and computer storage medium

技术领域technical field

本公开涉及数据处理技术领域,尤其涉及增强现实、深度学习、计算机视觉技术等人工智能技术领域。The present disclosure relates to the technical field of data processing, and in particular, to the technical field of artificial intelligence such as augmented reality, deep learning, and computer vision technology.

背景技术Background technique

随着计算机视觉技术的不断发展,越来越多的应用实现了复杂的视觉处理效果。例如图像增强技术、图像特效、3D渲染等等。然而在目前的数据处理过程中,对于数据源输出的数据和算法数据两者很难同步,从而造成处理效果不佳。例如,数据源输出各帧数据,原本进行的诸如人脸、头发等区域分割数据(即算法数据)是针对第一帧数据的,但却因为一些原因将该算法数据施加到了第二帧数据或第三帧数据等上,造成针对各区域进行的上色存在偏差。With the continuous development of computer vision technology, more and more applications realize complex visual processing effects. Such as image enhancement technology, image special effects, 3D rendering and so on. However, in the current data processing process, it is difficult to synchronize both the data output from the data source and the algorithm data, resulting in poor processing results. For example, when the data source outputs each frame of data, the original segmentation data such as face, hair and other regions (ie algorithm data) is for the first frame of data, but for some reasons the algorithm data is applied to the second frame of data or The third frame data, etc., cause deviations in the coloring performed for each area.

发明内容SUMMARY OF THE INVENTION

有鉴于此,本公开提供了一种数据处理方法、装置、设备和计算机存储介质,以便于提高数据处理的效果。In view of this, the present disclosure provides a data processing method, apparatus, device, and computer storage medium, so as to improve the effect of data processing.

根据本公开的第一方面,提供了一种数据处理方法,包括:According to a first aspect of the present disclosure, there is provided a data processing method, comprising:

算法缓存模块获取算法模块对待处理数据进行第一处理得到的算法数据,并将封装有所述待处理数据的时间戳、算法能力类型和所述算法数据的句柄传递给管理模块;The algorithm cache module obtains the algorithm data obtained by the first processing of the data to be processed by the algorithm module, and transmits the time stamp encapsulated with the data to be processed, the algorithm capability type and the handle of the algorithm data to the management module;

所述管理模块依据所述算法能力类型确定对应的处理模块,将所述时间戳和所述算法数据传递给所述处理模块;The management module determines a corresponding processing module according to the algorithm capability type, and transmits the timestamp and the algorithm data to the processing module;

所述处理模块依据所述时间戳确定对应的待处理数据,并利用所述算法数据对所述待处理数据进行第二处理。The processing module determines the corresponding data to be processed according to the time stamp, and performs second processing on the data to be processed by using the algorithm data.

根据本公开的第二方面,提供了一种数据处理装置,包括算法缓存模块、管理模块和一个以上的处理模块;According to a second aspect of the present disclosure, a data processing apparatus is provided, including an algorithm cache module, a management module, and one or more processing modules;

所述算法缓存模块,用于获取算法模块对待处理数据进行第一处理得到的算法数据,并将封装有所述待处理数据的时间戳、算法能力类型和所述算法数据的句柄传递给所述管理模块;The algorithm cache module is used to obtain the algorithm data obtained by the algorithm module performing the first processing on the data to be processed, and pass the timestamp encapsulated with the data to be processed, the algorithm capability type and the handle of the algorithm data to the management module;

所述管理模块,用于依据所述算法能力类型确定对应的处理模块,将所述时间戳和所述算法数据传递给确定出的处理模块;The management module is configured to determine a corresponding processing module according to the algorithm capability type, and transmit the time stamp and the algorithm data to the determined processing module;

所述处理模块,用于依据所述时间戳确定对应的待处理数据,并利用所述算法数据对所述待处理数据进行第二处理。The processing module is configured to determine the corresponding data to be processed according to the time stamp, and use the algorithm data to perform second processing on the data to be processed.

根据本公开的第三方面,提供了一种电子设备,包括:According to a third aspect of the present disclosure, there is provided an electronic device, comprising:

至少一个处理器;以及at least one processor; and

与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein,

所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如上所述的方法。The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method as described above.

根据本公开的第四方面,提供了一种存储有计算机指令的非瞬时计算机可读存储介质,其中,所述计算机指令用于使所述计算机执行如上所述的方法。According to a fourth aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to perform the method as described above.

根据本公开的第五方面,一种计算机程序产品,包括计算机程序,所述计算机程序在被处理器执行时实现如上所述的方法。According to a fifth aspect of the present disclosure, a computer program product comprising a computer program, when executed by a processor, implements the method as described above.

应当理解,本部分所描述的内容并非旨在标识本公开的实施例的关键或重要特征,也不用于限制本公开的范围。本公开的其它特征将通过以下的说明书而变得容易理解。It should be understood that what is described in this section is not intended to identify key or critical features of embodiments of the disclosure, nor is it intended to limit the scope of the disclosure. Other features of the present disclosure will become readily understood from the following description.

附图说明Description of drawings

附图用于更好地理解本方案,不构成对本公开的限定。其中:The accompanying drawings are used for better understanding of the present solution, and do not constitute a limitation to the present disclosure. in:

图1是本公开实施例所涉及的系统架构示意图;1 is a schematic diagram of a system architecture involved in an embodiment of the present disclosure;

图2是本公开实施例提供的数据处理方法的流程图;2 is a flowchart of a data processing method provided by an embodiment of the present disclosure;

图3是本公开实施例提供的一个详细方法流程图;3 is a flowchart of a detailed method provided by an embodiment of the present disclosure;

图4是本公开实施例提供的装置结构图;4 is a structural diagram of an apparatus provided by an embodiment of the present disclosure;

图5是用来实现本公开实施例的电子设备的框图。5 is a block diagram of an electronic device used to implement embodiments of the present disclosure.

具体实施方式Detailed ways

以下结合附图对本公开的示范性实施例做出说明,其中包括本公开实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本公开的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding and should be considered as exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted from the following description for clarity and conciseness.

为了方便对本公开的理解,首先对本公开所涉及的系统架构进行描述。如图1中所示,该系统架构主要包括:数据获取装置、数据源模块、算法模块、算法缓存模块、管理模块和处理模块。In order to facilitate the understanding of the present disclosure, the system architecture involved in the present disclosure is first described. As shown in Figure 1, the system architecture mainly includes: a data acquisition device, a data source module, an algorithm module, an algorithm cache module, a management module and a processing module.

其中,数据获取装置和算法模块是客户端上的模块。数据获取装置用以采集数据,该数据即为本公开中的待处理数据。待处理数据可以是文本、图像、视频、音频等。作为一种典型的应用场景,在本公开后续实施例中,待处理数据以视频所包含的各图像帧为例进行描述。Wherein, the data acquisition device and the algorithm module are modules on the client. The data acquisition device is used for collecting data, and the data is the data to be processed in the present disclosure. The data to be processed can be text, images, video, audio, etc. As a typical application scenario, in subsequent embodiments of the present disclosure, the data to be processed is described by taking each image frame included in the video as an example.

算法模块用以对待处理数据执行与算法相关的处理,得到算法数据。该部分将在后续实施例中详述。The algorithm module is used to perform algorithm-related processing on the data to be processed to obtain algorithm data. This part will be described in detail in subsequent examples.

数据源模块、管理模块和处理模块是引擎中的模块。数据源模块用以从数据获取装置获取采集数据并进行缓存,在引擎中作为数据源进行数据分发。处理模块是用以对待处理数据进行处理的模块,执行的是产生最终效果的处理,例如对图片进行增强、特效、3D渲染等处理。通常在一个引擎中会包含一个以上的处理模块,用以完成不同类型的处理。管理模块是用以对各处理模块进行调度管理的模块。The data source module, management module and processing module are modules in the engine. The data source module is used to obtain the collected data from the data acquisition device, cache it, and distribute the data as a data source in the engine. The processing module is a module used to process the data to be processed, and performs processing to produce final effects, such as image enhancement, special effects, and 3D rendering. Usually, more than one processing module is included in an engine to complete different types of processing. The management module is a module for scheduling and managing each processing module.

算法缓存模块是本公开新增的模块,用以串连算法模块和管理模块。在通常情况下,算法缓存模块与管理模块之间会通过诸如LUA虚拟机等进行数据的传递。本公开中提高数据处理效果的改进在于上述算法缓存模块和引擎中的模块,对于端上的算法模块不产生影响,能够完美适配。The algorithm cache module is a newly added module in the present disclosure, and is used to connect the algorithm module and the management module in series. Under normal circumstances, data is transferred between the algorithm caching module and the management module through a virtual machine such as a LUA. The improvement in the present disclosure to improve the data processing effect lies in the above-mentioned algorithm cache module and the module in the engine, which do not affect the algorithm module on the end and can be perfectly adapted.

下面结合实施例对本公开提供的数据处理方法进行详细描述。图2为本公开实施例提供的数据处理方法的流程图,如图2中所示,该方法可以包括以下步骤:The data processing method provided by the present disclosure will be described in detail below with reference to the embodiments. FIG. 2 is a flowchart of a data processing method provided by an embodiment of the present disclosure. As shown in FIG. 2 , the method may include the following steps:

在201中,算法缓存模块获取算法模块对待处理数据进行第一处理得到的算法数据。In 201, the algorithm cache module obtains algorithm data obtained by performing first processing on the data to be processed by the algorithm module.

在202中,算法缓存模块将封装有所述待处理数据的时间戳、算法能力类型和所述算法数据的句柄传递给管理模块。In 202, the algorithm cache module transmits the timestamp encapsulated with the data to be processed, the algorithm capability type and the handle of the algorithm data to the management module.

在203中,管理模块依据算法能力类型确定对应的处理模块,将时间戳和算法数据传递给处理模块。In 203, the management module determines the corresponding processing module according to the algorithm capability type, and transmits the timestamp and the algorithm data to the processing module.

在204中,处理模块依据时间戳确定对应的待处理数据,并利用算法数据对待处理数据进行第二处理。In 204, the processing module determines the corresponding data to be processed according to the timestamp, and performs second processing on the data to be processed by using the algorithm data.

在上述实施例中,对算法模块和处理模块对待处理数据进行的处理进行区分,分别表示为“第一处理”和“第二处理”。需要说明的是,此处的“第一”和“第二”仅仅在名称上对两种处理进行了区分,并不具备顺序、数量、大小等限制含义。其中,本公开中算法模块提供的第一处理最终是为了第二处理服务的,即作为第二处理服务的基础。举个例子,如果第二处理为诸如美妆等图像特效处理,则第一处理就可是图像特效处理之前的一些预处理算法,例如人脸识别、区域分割处理,得到的算法数据可以是人脸的关键点,区域分割结果等。再举个例子,如果第二处理为诸如加滤镜等图像增强处理,则第一处理就可以是加滤镜处理之前的一些算法,算法数据就可以是采用诸如最大值法确定出的各像素新的颜色值等。In the above-mentioned embodiment, the processing of the data to be processed by the algorithm module and the processing module is distinguished, which are respectively expressed as "first processing" and "second processing". It should be noted that "first" and "second" here only distinguish the two processes in name, and do not have limiting meanings such as order, quantity, and size. Wherein, the first processing provided by the algorithm module in the present disclosure is ultimately for the second processing service, that is, as the basis of the second processing service. For example, if the second processing is image special effects processing such as beauty makeup, the first processing can be some preprocessing algorithms before image special effects processing, such as face recognition, region segmentation processing, and the algorithm data obtained can be human faces. key points, region segmentation results, etc. For another example, if the second processing is image enhancement processing such as adding filters, the first processing can be some algorithms before the filtering processing, and the algorithm data can be the pixels determined by the maximum value method. new color values, etc.

由以上技术方案可以看出,算法缓存模块通过句柄传递待处理数据的时间戳、算法类型和算法数据给管理模块,管理模块能够在确定出算法能力类型对应的处理模块后,将时间戳和算法数据传递给处理模块,使得处理模块能够依据时间戳保证算法数据和待处理数据的同步,提高数据处理的效果。It can be seen from the above technical solutions that the algorithm cache module transmits the time stamp of the data to be processed, the algorithm type and the algorithm data to the management module through the handle. The data is transmitted to the processing module, so that the processing module can ensure the synchronization of the algorithm data and the data to be processed according to the time stamp, and improve the effect of data processing.

下面结合图3对上述方法进行详细描述,在该实施例中待处理数据以视频中的各图像帧为例。The above method will be described in detail below with reference to FIG. 3 . In this embodiment, the data to be processed takes each image frame in the video as an example.

首先在301中,数据获取装置会将当前图像帧提供给数据源模块,由数据源模块缓存至图像帧序列。First, in 301, the data acquisition device will provide the current image frame to the data source module, and the data source module will buffer the image frame sequence.

在本公开中,数据获取装置可以从诸如终端摄像头等采集设备获取视频,也可以从服务器端获取视频,还可以获取本地存储视频。In the present disclosure, the data acquisition apparatus may acquire videos from a collection device such as a terminal camera, or acquire videos from a server, or acquire locally stored videos.

数据获取装置会逐帧将图像提供给引擎中的数据源模块,由数据源模块对图像进行缓存,例如缓存至图像队列中。The data acquisition device will provide the image frame by frame to the data source module in the engine, and the data source module will cache the image, for example, into an image queue.

在302中,数据源模块会将当前图像帧预先提供给算法模块先进行第一处理。In 302, the data source module will provide the current image frame to the algorithm module in advance for first processing.

为了尽量减小算法数据和图像帧到达处理模块的时间差,数据源模块在将图像帧发送给处理模块之前,预先提供给算法模块进行处理。In order to minimize the time difference between the algorithm data and the image frame arriving at the processing module, the data source module provides the image frame to the algorithm module for processing in advance before sending the image frame to the processing module.

在303中,算法模块对图像帧进行第一处理后,将得到的算法数据送入同步算法队列。In 303, after the algorithm module performs the first processing on the image frame, the obtained algorithm data is sent to the synchronization algorithm queue.

算法模块同样是客户端的模块,对于不同客户端、不同操作系统而言,在执行相同的第一处理时,采用的算法或代码可能并不相同。但由于本公开对于算法模块本身并未进行改进和影响,因此可以直接适配各种算法模块。另外,本公开对于数据获取模块和数据源模块也并未进行改进和影响,可以直接进行适配。The algorithm module is also a module of the client. For different clients and different operating systems, the algorithms or codes used may be different when the same first processing is performed. However, since the present disclosure does not improve or affect the algorithm module itself, various algorithm modules can be directly adapted. In addition, the present disclosure does not improve or affect the data acquisition module and the data source module, and can be directly adapted.

其中对图像帧进行的第一处理可以包括但不限于:SLAM(SimultaneousLocalization And Mapping,并发建图与定位)、人脸识别、区域分割、手势识别、物体检测、姿态检测,等等。其中区域分割可以进一步包括人像分割、头发分割、天空分割等等。具体进行了什么第一处理反映了算法能力类型,也就是说,算法模块所具有的算法能力决定了第一处理的内容。各种算法能力类型可以采用类型标识进行区分,例如,SLAM的类型标识为5,人脸识别的类型标识为10,等等。The first processing performed on the image frame may include, but is not limited to: SLAM (Simultaneous Localization And Mapping), face recognition, region segmentation, gesture recognition, object detection, gesture detection, and the like. The region segmentation may further include portrait segmentation, hair segmentation, sky segmentation and so on. The specific first processing performed reflects the type of algorithm capability, that is, the algorithm capability possessed by the algorithm module determines the content of the first processing. Various algorithm capability types can be distinguished by type identifiers, for example, the type identifier of SLAM is 5, the type identifier of face recognition is 10, and so on.

进行第一处理后得到的结果就是算法数据。例如人脸识别后,得到人脸的关键点信息。再例如,区域分割后,得到区域信息。如果客户端对这些算法数据具有同步要求,则可以送入同步算法队列,执行本公开所述的处理方式来保证同步。如果客户端对这些算法数据没有同步要求,则可以送入异步算法队列,执行现有的异步处理方式。The result obtained after the first process is performed is the algorithm data. For example, after face recognition, the key point information of the face is obtained. For another example, after the region is divided, region information is obtained. If the client has synchronization requirements for these algorithm data, it can be sent to the synchronization algorithm queue, and the processing method described in the present disclosure can be executed to ensure synchronization. If the client does not have synchronization requirements for these algorithm data, it can be sent to the asynchronous algorithm queue to execute the existing asynchronous processing method.

上述同步算法队列是在内存中为需要进行同步的算法数据分配的存储空间。The above synchronization algorithm queue is a storage space allocated in the memory for the algorithm data that needs to be synchronized.

在304中,算法缓存模块检测到同步算法队列中存在算法数据且图像帧序列存在图像帧,则获取该图像帧对应的时间戳。In 304, the algorithm cache module detects that algorithm data exists in the synchronization algorithm queue and an image frame exists in the image frame sequence, and then acquires a timestamp corresponding to the image frame.

同步算法队列中存在算法数据则说明对应时间戳的图像帧需要保证与算法数据在时间上的同步。The existence of algorithm data in the synchronization algorithm queue indicates that the image frame corresponding to the time stamp needs to be synchronized with the algorithm data in time.

在本公开中,关于图像帧序列的检测可以由管理模块调用诸如相机更新回调接口来触发算法缓存模块执行。其中,相机更新回调接口可以采用诸如:In the present disclosure, the detection of the sequence of image frames may be invoked by the management module, such as the camera update callback interface, to trigger the execution of the algorithm caching module. Among them, the camera update callback interface can be used such as:

void algo_handle_update()void algo_handle_update()

算法缓存模块在从同步算法队列中获取算法数据时,可以通过调用获取算法接口实现。其中,获取算法接口可以采用诸如:When the algorithm cache module obtains algorithm data from the synchronous algorithm queue, it can be implemented by calling the obtain algorithm interface. Among them, the acquisition algorithm interface can be used such as:

long long get_algo_handle(int algo_type,long long pts)long long get_algo_handle(int algo_type, long long pts)

其中,algo_type表示算法能力类型,pts表示时间戳。Among them, algo_type represents the algorithm capability type, and pts represents the timestamp.

在305中,算法缓存模块将封装有该时间戳、算法能力类型和算法数据的句柄通过LUA虚拟机传递给管理模块。In 305, the algorithm cache module transmits the handle encapsulated with the timestamp, the algorithm capability type and the algorithm data to the management module through the LUA virtual machine.

在本步骤中,作为一种可实现的方式,算法缓存模块可以在存储算法数据的内存中设置算法能力类型和时间戳,将标识该内存资源的句柄放入与算法能力类型对应的句柄队列,以通过句柄队列传递给管理模块。In this step, as an achievable way, the algorithm cache module can set the algorithm capability type and time stamp in the memory storing the algorithm data, and put the handle identifying the memory resource into the handle queue corresponding to the algorithm capability type, to be passed to the management module through the handle queue.

其中,系统在创建资源(例如本公开的同步算法队列中的各算法数据)时会为它们分配内存,并返回标识这些资源的标识号,即句柄(handle)。句柄指的是一个核心对象在某一个进程中的唯一索引。在本公开中,内存中除了存储算法数据之外,还进一步设置了算法能力类型和时间戳。可以理解为算法数据、算法能力类型和时间戳作为“一条数据”存储于内存中,指向该“一条数据”的句柄相当于封装了该时间戳、算法能力类型和算法数据。Wherein, when creating resources (for example, each algorithm data in the synchronization algorithm queue of the present disclosure), the system allocates memory for them, and returns an identification number identifying these resources, that is, a handle. A handle refers to the unique index of a core object in a process. In the present disclosure, in addition to storing algorithm data, an algorithm capability type and a timestamp are further set in the memory. It can be understood that the algorithm data, algorithm capability type and time stamp are stored in the memory as "a piece of data", and the handle pointing to the "a piece of data" is equivalent to encapsulating the time stamp, algorithm capability type and algorithm data.

其中,算法缓存模块在将封装了时间戳、算法能力类型和算法数据的句柄放入与算法能力类型对应的算法队列时,可以通过调用设置算法句柄接口实现。其中设置算法句柄接口可以采用诸如:The algorithm cache module can implement by calling the set algorithm handle interface when placing the handle encapsulating the timestamp, the algorithm capability type and the algorithm data into the algorithm queue corresponding to the algorithm capability type. Among them, the setting algorithm handle interface can be used such as:

void set_algo_handle(long long algo_handle)void set_algo_handle(long long algo_handle)

另外,本实施例中,句柄队列可以针对算法能力类型分别设置,也可以统一设置。In addition, in this embodiment, the handle queues may be set separately for algorithm capability types, or may be set uniformly.

由于算法模块在同步算法队列中存储的算法数据可由算法模块删除。为了避免算法模块因为一些原因删除算法数据导致后续处理模块在进行第二处理时算法数据缺失,作为另一种可实现的方式,算法缓存模块可以对算法数据进行拷贝,在存储拷贝的算法数据的内存中设置算法能力类型和时间戳,将标识该内存资源的句柄放入与该算法能力类型对应的句柄队列,以通过句柄队列传递给管理模块。Since the algorithm data stored in the synchronization algorithm queue by the algorithm module can be deleted by the algorithm module. In order to prevent the algorithm module from deleting the algorithm data due to some reasons and causing the algorithm data to be missing when the subsequent processing module performs the second processing, as another achievable method, the algorithm cache module can copy the algorithm data, and store the copied algorithm data in the location where the copied algorithm data is stored. The algorithm capability type and time stamp are set in the memory, and the handle identifying the memory resource is put into the handle queue corresponding to the algorithm capability type, so as to be passed to the management module through the handle queue.

在本公开实施例中,LUA虚拟机仅仅执行句柄的透传处理。In the embodiment of the present disclosure, the LUA virtual machine only performs the transparent transmission process of the handle.

在本公开中客户端可以在算法模块初始化成功后,通过调用新增算法类型接口增加新的句柄队列。其中新增算法类型接口可以采用诸如:In the present disclosure, the client can add a new handle queue by calling the interface of the new algorithm type after the algorithm module is successfully initialized. The new algorithm type interface can be used such as:

bool add_algo_type(std::vector<int>&type_list,int sync_mode)bool add_algo_type(std::vector<int>&type_list,int sync_mode)

其中,type_list参数表示需要增加的新的算法能力类型列表;sync_mode表示增加的新的算法能力类型是否需要同步。调用该接口的返回值表示是否有足够的内存创建对应的缓存空间。Among them, the type_list parameter indicates the list of new algorithm capability types that need to be added; sync_mode indicates whether the added new algorithm capability type needs to be synchronized. The return value of calling this interface indicates whether there is enough memory to create the corresponding cache space.

对于句柄队列而言,可以在适当的情况下对其进行删除以释放内存资源。其中,句柄队列的删除可以采用但不限于以下两种方式:For handle queues, they can be deleted to free memory resources when appropriate. Among them, the deletion of the handle queue can be adopted but not limited to the following two ways:

第一种方式:若完成算法能力类型对应的所有第二处理,则删除算法能力类型对应的句柄队列。例如,当前图像处理任务执行完毕,则可以将该图像处理任务下算法能力类型对应的句柄队列删除。可以由客户端调用移除算法类型接口实现,其中移除算法类型接口可以采用诸如:The first way: if all the second processing corresponding to the algorithm capability type is completed, the handle queue corresponding to the algorithm capability type is deleted. For example, after the execution of the current image processing task is completed, the handle queue corresponding to the algorithm capability type under the image processing task may be deleted. The removal algorithm type interface implementation can be invoked by the client, where the removal algorithm type interface can be implemented using methods such as:

void remove_algo_type(std::vector<int>&type_list)void remove_algo_type(std::vector<int>&type_list)

其中,type_list表示需要删除的算法能力类型列表。Among them, type_list represents the list of algorithm capability types to be deleted.

第二种方式:若完成所有算法能力类型对应的所有第二处理,或者,检测到退出应用,则删除所有算法能力类型对应的句柄队列。例如,应用退出时,该应用的客户端调用清空算法类型接口,其中清空算法类型接口可以采用诸如:The second way: if all the second processing corresponding to all the algorithm capability types is completed, or it is detected that the application exits, the handle queue corresponding to all the algorithm capability types is deleted. For example, when the application exits, the client of the application calls the flushing algorithm type interface, where the flushing algorithm type interface can be used such as:

void clear_algo_cache()void clear_algo_cache()

另外,需要说明的是,在一些情况下,处理模块进行第二处理可能用到多种算法数据。例如进行美妆处理可能会涉及到人脸识别结果、区域分割结果等。这种情况下,算法缓存模块需要将同一时间戳对应的多个算法结果的句柄均传递给管理模块。In addition, it should be noted that, in some cases, the processing module may use multiple algorithm data to perform the second processing. For example, beauty processing may involve face recognition results, region segmentation results, etc. In this case, the algorithm cache module needs to pass the handles of multiple algorithm results corresponding to the same timestamp to the management module.

对于没有同步需求的算法数据,例如在异步算法队列中的算法数据,则将最早的算法数据传递给管理模块即可。For algorithm data without synchronization requirements, such as algorithm data in the asynchronous algorithm queue, the earliest algorithm data can be passed to the management module.

在步骤306中,管理模块依据算法能力类型确定对应的处理模块,将时间戳和算法数据传递给处理模块。In step 306, the management module determines the corresponding processing module according to the algorithm capability type, and transmits the timestamp and the algorithm data to the processing module.

对于具备图像处理功能的引擎中可以存在多种处理模块,不同处理模块具有不同的功能,用以执行不同的第二处理。例如,引擎中可能包含滤镜处理模块、渲染模块、颜色填充模块,等等。There may be multiple processing modules in an engine with image processing functions, and different processing modules have different functions for performing different second processing. For example, the engine may contain filter processing modules, rendering modules, color fill modules, and so on.

由于处理模块执行的第二处理与算法能力是对应的,在管理模块中,预先存储有算法能力类型与处理模块之间的对应关系。依据句柄封装的算法能力类型能够确定对应的处理模块,即由哪个处理模块执行对应图像帧的第二处理。然后从句柄对应的内存空间中获取时间戳和算法数据并传递给处理模块。Since the second processing performed by the processing module corresponds to the algorithm capability, in the management module, the correspondence relationship between the type of the algorithm capability and the processing module is pre-stored. The corresponding processing module, that is, which processing module performs the second processing of the corresponding image frame, can be determined according to the algorithm capability type encapsulated by the handle. Then the timestamp and algorithm data are obtained from the memory space corresponding to the handle and passed to the processing module.

在步骤307中,处理模块从数据源模块获取该时间戳对应的图像帧,并利用算法数据对图像帧进行第二处理。In step 307, the processing module obtains the image frame corresponding to the timestamp from the data source module, and performs second processing on the image frame by using the algorithm data.

处理模块接收到管理模块发送的时间戳和算法数据后,依据时间戳就能够知晓哪个图像帧需要与该算法数据保证同步。然后利用算法数据对该图像帧进行第二处理。After the processing module receives the time stamp and the algorithm data sent by the management module, it can know which image frame needs to be synchronized with the algorithm data according to the time stamp. The image frame is then subjected to a second processing using the algorithm data.

在步骤308中,处理模块将第二处理后的图像帧提供给显示装置。In step 308, the processing module provides the second processed image frame to the display device.

例如,处理模块利用算法数据对图像帧进行滤镜处理后,滤镜效果就能够上屏显示。再例如,处理模块利用算法数据进行3D渲染后,3D渲染效果就能够上屏显示。For example, after the processing module uses algorithm data to filter the image frame, the filter effect can be displayed on the screen. For another example, after the processing module uses the algorithm data to perform 3D rendering, the 3D rendering effect can be displayed on the screen.

上面是对一帧图像帧进行的处理过程,对于后续具有同步要求的图像帧依据上述流程逐帧进行处理即可。The above is the processing process for one frame of image frame, and the subsequent image frames with synchronization requirements can be processed frame by frame according to the above process.

由以上实施例可以看出,本公开提供的上述方法可以具备以下优点:It can be seen from the above embodiments that the above method provided by the present disclosure can have the following advantages:

1)能够保证算法数据和待处理数据的同步,提高数据处理的效果。例如,将针对某一图像帧所产生的算法数据应用于该图像帧的处理,而不产生偏差。1) It can ensure the synchronization of algorithm data and data to be processed, and improve the effect of data processing. For example, algorithm data generated for an image frame is applied to the processing of the image frame without bias.

2)本公开对于客户端不产生改进和影响,能够适配各种客户端,且避免了因客户端平台(例如IOS或安卓)不同所产生的差异影响,提供了一套统一的缓存和同步策略。2) The present disclosure has no improvement or impact on the client, can adapt to various clients, and avoids the impact of differences due to different client platforms (eg, IOS or Android), and provides a unified set of caching and synchronization Strategy.

以上是对本公开所提供方法进行的详细描述,下面结合实施例对本公开所提供的装置进行详细描述。The above is a detailed description of the method provided by the present disclosure, and the device provided by the present disclosure is described in detail below with reference to the embodiments.

图4为本公开实施例提供的装置结构图,该装置可以为位于引擎中的功能单元、插件或软件开发工具包,本公开实施例对此不加以特别限定。如图4中所示,该装置400可以包括:算法缓存模块401、管理模块402和一个以上的处理模块403,还可以进一步包括队列维护模块404。其中各组成模块的主要功能如下:FIG. 4 is a structural diagram of an apparatus provided in an embodiment of the present disclosure. The apparatus may be a functional unit, a plug-in, or a software development kit located in an engine, which is not particularly limited in this embodiment of the present disclosure. As shown in FIG. 4 , the apparatus 400 may include: an algorithm caching module 401 , a management module 402 , and one or more processing modules 403 , and may further include a queue maintenance module 404 . The main functions of each component module are as follows:

算法缓存模块401,用于获取算法模块对待处理数据进行第一处理得到的算法数据,并将封装有待处理数据的时间戳、算法能力类型和算法数据的句柄传递给管理模块402。The algorithm cache module 401 is configured to obtain algorithm data obtained by the algorithm module performing the first processing on the data to be processed, and transmit the time stamp encapsulating the data to be processed, the algorithm capability type and the handle of the algorithm data to the management module 402 .

管理模块402,用于依据算法能力类型确定对应的处理模块403,将时间戳和算法数据传递给确定出的处理模块403。The management module 402 is configured to determine the corresponding processing module 403 according to the algorithm capability type, and transmit the timestamp and the algorithm data to the determined processing module 403 .

处理模块403,用于依据时间戳确定对应的待处理数据,并利用算法数据对待处理数据进行第二处理。The processing module 403 is configured to determine the corresponding data to be processed according to the time stamp, and perform second processing on the data to be processed by using the algorithm data.

作为其中一种可实现的方式,算法缓存模块401可以在存储算法数据的内存中设置算法能力类型和时间戳,将标识内存资源的句柄放入与算法能力类型对应的句柄队列,以通过句柄队列传递给管理模块402。As one of the achievable ways, the algorithm cache module 401 can set the algorithm capability type and time stamp in the memory storing the algorithm data, and put the handle identifying the memory resource into the handle queue corresponding to the algorithm capability type, so as to pass the handle queue Passed to the management module 402 .

作为另一种可实现的方式,算法缓存模块401可以对算法数据进行拷贝,在存储拷贝的算法数据的内存中设置算法能力类型和时间戳,将标识内存资源的句柄放入与算法能力类型对应的句柄队列,以通过句柄队列传递给管理模块402。As another achievable way, the algorithm cache module 401 can copy the algorithm data, set the algorithm capability type and time stamp in the memory for storing the copied algorithm data, and put the handle identifying the memory resource into the corresponding algorithm capability type The handle queue is passed to the management module 402 through the handle queue.

更进一步地,算法缓存模块401可以在将封装有待处理数据的时间戳、算法能力类型和算法数据的句柄传递给管理模块之前,从数据源模块检测到待处理数据的时间戳,且在同步算法队列存在该时间戳对应的算法数据。Further, the algorithm cache module 401 can detect the time stamp of the data to be processed from the data source module before passing the time stamp encapsulating the data to be processed, the algorithm capability type and the handle of the algorithm data to the management module, and synchronize the algorithm. Algorithm data corresponding to this timestamp exists in the queue.

其中数据源模块在从数据获取模块获取到新一帧的待处理数据后,会将该待处理数据送入缓存队列进行进行缓存,算法缓存模块401从该缓存队列中检测待处理数据的时间戳。另外,上述同步算法队列是算法模块将需要进行同步的算法数据所送入的队列。对于不需要进行同步的算法数据,可以送入异步算法队列。The data source module, after acquiring the pending data of a new frame from the data acquisition module, will send the pending data to the cache queue for caching, and the algorithm cache module 401 detects the timestamp of the pending data from the cache queue. . In addition, the above-mentioned synchronization algorithm queue is a queue into which the algorithm module sends the algorithm data that needs to be synchronized. For algorithm data that does not need to be synchronized, it can be sent to the asynchronous algorithm queue.

处理模块403从数据源模块获取该时间戳对应的待处理数据。The processing module 403 acquires the data to be processed corresponding to the timestamp from the data source module.

作为一种可实现的方式,若算法能力类型对应的所有第二处理均完成,则队列维护模块404删除算法能力类型对应的句柄队列。As an achievable manner, if all the second processing corresponding to the algorithm capability type is completed, the queue maintenance module 404 deletes the handle queue corresponding to the algorithm capability type.

作为另一种可实现的方式,若所有算法能力类型对应的所有第二处理均完成,或者,检测到退出应用,则队列维护模块404删除所有算法能力类型对应的句柄队列。As another achievable manner, if all second processes corresponding to all algorithm capability types are completed, or if exiting the application is detected, the queue maintenance module 404 deletes the handle queues corresponding to all algorithm capability types.

作为一些典型的应用场景,上述第一处理可以包括但不限于:并发建图与定位、人脸识别、区域分割、手势识别、物体检测或姿态检测;第二处理可以包括但不限于:图像增强处理、图像特效处理或3D渲染处理。As some typical application scenarios, the above-mentioned first processing may include but is not limited to: concurrent mapping and positioning, face recognition, region segmentation, gesture recognition, object detection or gesture detection; the second processing may include but not limited to: image enhancement processing, image effects processing or 3D rendering processing.

本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the various embodiments may be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the apparatus embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and reference may be made to some descriptions of the method embodiments for related parts.

本公开的技术方案中,所涉及的用户个人信息的获取,存储和应用等,均符合相关法律法规的规定,且不违背公序良俗。In the technical solution of the present disclosure, the acquisition, storage and application of the user's personal information involved are all in compliance with the provisions of relevant laws and regulations, and do not violate public order and good customs.

根据本公开的实施例,本公开还提供了一种电子设备、一种可读存储介质和一种计算机程序产品。According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.

如图5所示,是根据本公开实施例的数据处理方法的电子设备的框图。电子设备旨在表示各种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本公开的实现。As shown in FIG. 5 , it is a block diagram of an electronic device according to a data processing method according to an embodiment of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are by way of example only, and are not intended to limit implementations of the disclosure described and/or claimed herein.

如图5所示,设备500包括计算单元501,其可以根据存储在只读存储器(ROM)502中的计算机程序或者从存储单元508加载到随机访问存储器(RAM)503中的计算机程序,来执行各种适当的动作和处理。在RAM 503中,还可存储设备500操作所需的各种程序和数据。计算单元501、ROM 502以及RAM 503通过总线504彼此相连。输入/输出(I/O)接口505也连接至总线504。As shown in FIG. 5 , the device 500 includes a computing unit 501 that can be executed according to a computer program stored in a read only memory (ROM) 502 or loaded from a storage unit 508 into a random access memory (RAM) 503 Various appropriate actions and handling. In the RAM 503, various programs and data necessary for the operation of the device 500 can also be stored. The computing unit 501 , the ROM 502 , and the RAM 503 are connected to each other through a bus 504 . An input/output (I/O) interface 505 is also connected to bus 504 .

设备500中的多个部件连接至I/O接口505,包括:输入单元506,例如键盘、鼠标等;输出单元507,例如各种类型的显示器、扬声器等;存储单元508,例如磁盘、光盘等;以及通信单元509,例如网卡、调制解调器、无线通信收发机等。通信单元509允许设备500通过诸如因特网的计算机网络和/或各种电信网络与其他设备交换信息/数据。Various components in the device 500 are connected to the I/O interface 505, including: an input unit 506, such as a keyboard, mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a magnetic disk, an optical disk, etc. ; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, and the like. The communication unit 509 allows the device 500 to exchange information/data with other devices through a computer network such as the Internet and/or various telecommunication networks.

计算单元501可以是各种具有处理和计算能力的通用和/或专用处理组件。计算单元501的一些示例包括但不限于中央处理单元(CPU)、图形处理单元(GPU)、各种专用的人工智能(AI)计算芯片、各种运行机器学习模型算法的计算单元、数字信号处理器(DSP)、以及任何适当的处理器、控制器、微控制器等。计算单元501执行上文所描述的各个方法和处理,例如数据处理方法。例如,在一些实施例中,数据处理方法可被实现为计算机软件程序,其被有形地包含于机器可读介质,例如存储单元508。Computing unit 501 may be various general-purpose and/or special-purpose processing components with processing and computing capabilities. Some examples of computing units 501 include, but are not limited to, central processing units (CPUs), graphics processing units (GPUs), various specialized artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, digital signal processing processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 501 performs the various methods and processes described above, such as data processing methods. For example, in some embodiments, a data processing method may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 508 .

在一些实施例中,计算机程序的部分或者全部可以经由ROM 802和/或通信单元509而被载入和/或安装到设备500上。当计算机程序加载到RAM 503并由计算单元501执行时,可以执行上文描述的数据处理方法的一个或多个步骤。备选地,在其他实施例中,计算单元501可以通过其他任何适当的方式(例如,借助于固件)而被配置为执行数据处理方法。In some embodiments, part or all of the computer program may be loaded and/or installed on device 500 via ROM 802 and/or communication unit 509 . When a computer program is loaded into RAM 503 and executed by computing unit 501, one or more steps of the data processing method described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the data processing method by any other suitable means (eg, by means of firmware).

此处描述的系统和技术的各种实施方式可以在数字电子电路系统、集成电路系统、场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、芯片上系统的系统(SOC)、负载可编程逻辑设备(CPLD)、计算机硬件、固件、软件、和/或它们的组合中实现。这些各种实施方式可以包括:实施在一个或者多个计算机程序中,该一个或者多个计算机程序可在包括至少一个可编程处理器的可编程系统上执行和/或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储系统、至少一个输入装置、和至少一个输出装置接收数据和指令,并且将数据和指令传输至该存储系统、该至少一个输入装置、和该至少一个输出装置。Various implementations of the systems and techniques described herein may be implemented in digital electronic circuitry, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on a chip System (SOC), Load Programmable Logic Device (CPLD), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include being implemented in one or more computer programs executable and/or interpretable on a programmable system including at least one programmable processor that The processor, which may be a special purpose or general-purpose programmable processor, may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device an output device.

用于实施本公开的方法的程序代码可以采用一个或多个编程语言的任何组合来编写。这些程序代码可以提供给通用计算机、专用计算机或其他可编程数据处理装置的处理器或控制器,使得程序代码当由处理器或控30制器执行时使流程图和/或框图中所规定的功能/操作被实施。程序代码可完全在机器上执行、部分地在机器上执行,作为独立软件包部分地在机器上执行且部分地在远程机器上执行或完全在远程机器或服务器上执行。Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program code, when executed by the processor or controller, causes the execution of the flowcharts and/or block diagrams The function/operation is implemented. The program code may execute entirely on the machine, partly on the machine, partly on the machine and partly on a remote machine as a stand-alone software package or entirely on the remote machine or server.

在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in connection with the instruction execution system, apparatus or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media would include one or more wire-based electrical connections, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), fiber optics, compact disk read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.

为了提供与用户的交互,可以在计算机上实施此处描述的系统和技术,该计算机具有:用于向用户显示信息的显示装置(例如,CRT(阴极射线管)或者LCD(液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给计算机。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。To provide interaction with a user, the systems and techniques described herein may be implemented on a computer having a display device (eg, a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user ); and a keyboard and pointing device (eg, a mouse or trackball) through which a user can provide input to the computer. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (eg, visual feedback, auditory feedback, or tactile feedback); and can be in any form (including acoustic input, voice input, or tactile input) to receive input from the user.

可以将此处描述的系统和技术实施在包括后台部件的计算系统(例如,作为数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的系统和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:局域网(LAN)、广域网(WAN)和互联网。The systems and techniques described herein may be implemented on a computing system that includes back-end components (eg, as a data server), or a computing system that includes middleware components (eg, an application server), or a computing system that includes front-end components (eg, a user's computer having a graphical user interface or web browser through which a user may interact with implementations of the systems and techniques described herein), or including such backend components, middleware components, Or any combination of front-end components in a computing system. The components of the system may be interconnected by any form or medium of digital data communication (eg, a communication network). Examples of communication networks include: Local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.

计算机系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。服务器可以是云服务器,又称为云计算服务器或云主机,是云计算服务体系中的一项主机产品,以解决传统物理主机与虚拟专用服务器(VPs,Ⅵirtual Private Server)服务中存在的管理难度大,业务扩展性弱的缺陷。服务器也可以为分布式系统的服务器,或者是结合了区块链的服务器。A computer system can include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server arises by computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also known as a cloud computing server or a cloud host. It is a host product in the cloud computing service system to solve the management difficulties in traditional physical host and virtual private server (VPs, VIirtual Private Server) services. Large, weak business expansion defects. The server can also be a server of a distributed system, or a server combined with a blockchain.

应该理解,可以使用上面所示的各种形式的流程,重新排序、增加或删除步骤。例如,本发申请中记载的各步骤可以并行地执行也可以顺序地执行也可以不同的次序执行,只要能够实现本公开公开的技术方案所期望的结果,本文在此不进行限制。It should be understood that steps may be reordered, added or deleted using the various forms of flow shown above. For example, the steps described in the present application can be executed in parallel, sequentially or in different orders, and as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, no limitation is imposed herein.

上述具体实施方式,并不构成对本公开保护范围的限制。本领域技术人员应该明白的是,根据设计要求和其他因素,可以进行各种修改、组合、子组合和替代。任何在本公开的精神和原则之内所作的修改、等同替换和改进等,均应包含在本公开保护范围之内。The above-mentioned specific embodiments do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present disclosure should be included within the protection scope of the present disclosure.

Claims (12)

1. A method of data processing, comprising:
the algorithm cache module acquires algorithm data obtained by the algorithm module performing first processing on data to be processed, transmits a timestamp encapsulating the data to be processed, an algorithm capability type and a handle encapsulating the algorithm data to the management module,
wherein, the transmitting the timestamp encapsulating the data to be processed, the algorithm capability type and the handle of the algorithm data to a management module comprises: setting an algorithm capability type and a timestamp in a memory for storing the algorithm data, and putting a handle for identifying the memory resource into a handle queue corresponding to the algorithm capability type so as to transmit the handle queue to a management module;
the management module determines a corresponding processing module according to the algorithm capability type, and transmits the timestamp and the algorithm data to the processing module;
and the processing module determines corresponding data to be processed according to the time stamp and performs second processing on the data to be processed by utilizing the algorithm data.
2. The method of claim 1, wherein communicating the timestamp encapsulating the data to be processed, the algorithm capability type, and the handle of the algorithm data to a management module further comprises:
copying the algorithm data, setting an algorithm capability type and a timestamp in a memory for storing the copied algorithm data, and putting a handle for identifying the memory resource into a handle queue corresponding to the algorithm capability type so as to transmit the handle queue to a management module.
3. The method of claim 1, prior to said passing a timestamp encapsulating the data to be processed, an algorithm capability type, and a handle to the algorithm data to a management module, further comprising: the algorithm cache module detects a time stamp of the data to be processed from the data source module, and algorithm data corresponding to the time stamp exist in the synchronous algorithm queue;
the processing module determines corresponding data to be processed according to the timestamp, and the determining includes: and the processing module acquires the data to be processed corresponding to the time stamp from the data source module.
4. The method of claim 1 or 2, further comprising:
if all second processing corresponding to the algorithm capability type is completed, deleting the handle queue corresponding to the algorithm capability type; or,
and if all second processing corresponding to all algorithm capability types is finished or quit of application is detected, deleting handle queues corresponding to all algorithm capability types.
5. The method of any of claims 1 to 3, wherein the first processing comprises: drawing and positioning are carried out concurrently, face recognition, region segmentation, gesture recognition, object detection or gesture detection is carried out;
the second processing includes: image enhancement processing, image special effect processing, or 3D rendering processing.
6. A data processing device comprises an algorithm cache module, a management module and more than one processing module;
the algorithm cache module is used for acquiring algorithm data obtained by the algorithm module performing first processing on the data to be processed, transmitting a timestamp encapsulating the data to be processed, an algorithm capability type and a handle encapsulating the algorithm data to the management module,
the algorithm cache module is specifically configured to set an algorithm capability type and a timestamp in a memory for storing the algorithm data, and place a handle for identifying the memory resource in a handle queue corresponding to the algorithm capability type, so as to transmit the handle queue to the management module;
the management module is used for determining a corresponding processing module according to the algorithm capability type and transmitting the timestamp and the algorithm data to the determined processing module;
and the processing module is used for determining corresponding data to be processed according to the time stamp and performing second processing on the data to be processed by utilizing the algorithm data.
7. The apparatus according to claim 6, wherein the algorithm cache module is further configured to copy the algorithm data, set an algorithm capability type and a timestamp in a memory storing the copied algorithm data, and place a handle identifying the memory resource in a handle queue corresponding to the algorithm capability type, so as to transmit the handle queue to the management module.
8. The apparatus according to claim 6, wherein the algorithm cache module, before the time stamp encapsulating the data to be processed, the algorithm capability type and the handle of the algorithm data are transferred to the management module, is further configured to detect the time stamp of the data to be processed from the data source module, and the algorithm data corresponding to the time stamp exists in the synchronization algorithm queue;
the processing module is specifically configured to obtain the to-be-processed data corresponding to the timestamp from the data source module.
9. The apparatus of claim 6 or 7, further comprising:
the queue maintenance module is used for deleting the handle queue corresponding to the algorithm capability type if all second processing corresponding to the algorithm capability type is finished; or,
and if all second processing corresponding to all algorithm capability types is finished or quitting the application is detected, deleting the handle queues corresponding to all algorithm capability types.
10. The apparatus of any of claims 6 to 8, wherein the first process comprises: drawing and positioning are carried out concurrently, face recognition, region segmentation, gesture recognition, object detection or gesture detection is carried out;
the second processing includes: image enhancement processing, image special effect processing, or 3D rendering processing.
11. A data processing electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
12. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-5.
CN202110721414.3A 2021-06-28 2021-06-28 Data processing method, apparatus, device and computer storage medium Active CN113434551B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110721414.3A CN113434551B (en) 2021-06-28 2021-06-28 Data processing method, apparatus, device and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110721414.3A CN113434551B (en) 2021-06-28 2021-06-28 Data processing method, apparatus, device and computer storage medium

Publications (2)

Publication Number Publication Date
CN113434551A CN113434551A (en) 2021-09-24
CN113434551B true CN113434551B (en) 2022-05-27

Family

ID=77754971

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110721414.3A Active CN113434551B (en) 2021-06-28 2021-06-28 Data processing method, apparatus, device and computer storage medium

Country Status (1)

Country Link
CN (1) CN113434551B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113849310A (en) * 2021-09-27 2021-12-28 杭州海康消防科技有限公司 A data processing method, apparatus, device and machine-readable storage medium
CN115426069B (en) * 2022-09-29 2025-01-21 斑马网络技术有限公司 Data transmission method, device, storage medium and product based on multimedia framework

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9870385B2 (en) * 2013-04-01 2018-01-16 Hitachi, Ltd. Computer system, data management method, and computer
US10574777B2 (en) * 2017-06-06 2020-02-25 International Business Machines Corporation Edge caching for cognitive applications
CN110874268B (en) * 2018-09-04 2023-04-18 阿里巴巴集团控股有限公司 Data processing method, device and equipment
CN110782122B (en) * 2019-09-16 2023-11-24 腾讯大地通途(北京)科技有限公司 Data processing method and device and electronic equipment
CN111274019B (en) * 2019-12-31 2023-05-12 深圳云天励飞技术有限公司 Data processing method, device and computer readable storage medium
CN111860163B (en) * 2020-06-17 2023-08-22 北京百度网讯科技有限公司 Image processing method, device, electronic equipment and readable storage medium
CN112579576B (en) * 2020-12-31 2022-10-14 杭州网易智企科技有限公司 Data processing method, device, medium and computing equipment
CN112783614A (en) * 2021-01-20 2021-05-11 北京百度网讯科技有限公司 Object processing method, device, equipment, storage medium and program product

Also Published As

Publication number Publication date
CN113434551A (en) 2021-09-24

Similar Documents

Publication Publication Date Title
CN113327278B (en) Three-dimensional face reconstruction method, device, equipment and storage medium
CN112042182A (en) Manipulating remote avatars by facial expressions
CN113221767B (en) Method for training living body face recognition model and recognizing living body face and related device
CN112784765B (en) Method, apparatus, device and storage medium for recognizing motion
CN113434551B (en) Data processing method, apparatus, device and computer storage medium
CN111768356A (en) A face image fusion method, device, electronic device and storage medium
EP4092636A2 (en) Method and apparatus of generating virtual idol, and electronic device
CN112802037A (en) Portrait extraction method, device, electronic equipment and storage medium
CN113836462B (en) Method, device, equipment and storage medium for generating page description file
WO2022252674A1 (en) Method and apparatus for generating drivable 3d character, electronic device and storage medium
CN113778593A (en) Cloud desktop control method and device, electronic equipment, storage medium and program product
CN115269900A (en) Model display method and device, electronic equipment and storage medium
CN114793274A (en) Data fusion method and device based on video projection
CN117710527B (en) Image processing method, device and product based on artificial intelligence large model
CN113836455B (en) Special effects rendering method, device, equipment, storage medium and computer program product
CN113724355B (en) Method, device and electronic device for drawing charts for video
CN114095758B (en) Cloud image intercepting method and related device
CN116882482A (en) Training of virtual image generation model and virtual image generation method and device
CN115861510A (en) Object rendering method, device, electronic equipment, storage medium and program product
CN116524475A (en) Method and device for generating recommended dressing, vehicle, electronic equipment and storage medium
CN112671970B (en) Control method and control device for mobile equipment and cloud mobile phone, electronic equipment, mobile equipment, cloud server and medium
CN115273178A (en) Training of image processing model, image processing method and related device
CN114971349A (en) Information generation method, device, equipment, storage medium and program product
CN115619960A (en) Image processing method and device and electronic equipment
CN114612971A (en) Face detection method, model training method, electronic device, and program product

Legal Events

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