WO2023224547A2 - 数据处理方法、装置、设备及存储介质 - Google Patents

数据处理方法、装置、设备及存储介质 Download PDF

Info

Publication number
WO2023224547A2
WO2023224547A2 PCT/SG2023/050306 SG2023050306W WO2023224547A2 WO 2023224547 A2 WO2023224547 A2 WO 2023224547A2 SG 2023050306 W SG2023050306 W SG 2023050306W WO 2023224547 A2 WO2023224547 A2 WO 2023224547A2
Authority
WO
WIPO (PCT)
Prior art keywords
algorithm
processing
processor
execute
group
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/SG2023/050306
Other languages
English (en)
French (fr)
Other versions
WO2023224547A3 (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.)
Lemon Inc Cayman Island
Original Assignee
Lemon Inc Cayman Island
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 Lemon Inc Cayman Island filed Critical Lemon Inc Cayman Island
Priority to US18/866,266 priority Critical patent/US20260017090A1/en
Publication of WO2023224547A2 publication Critical patent/WO2023224547A2/zh
Publication of WO2023224547A3 publication Critical patent/WO2023224547A3/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • 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/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • 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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5066Algorithms for mapping a plurality of inter-dependent sub-tasks onto a plurality of physical CPUs
    • 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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5038Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
    • 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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5044Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering hardware capabilities
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5017Task decomposition
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/509Offload

Definitions

  • Embodiments of the present disclosure provide a data processing method, device, equipment, and storage medium, which can reduce the number of switching times between the CPU and the GPU, thereby saving computing and memory resources, and improving the efficiency of data processing.
  • a data processing method including: obtaining an algorithm directed graph corresponding to a target task; wherein, the algorithm directed graph includes multiple algorithm nodes, and one algorithm node corresponds to one type of processing. Algorithm; Re-edit the processing algorithm that meets the set conditions to obtain the rewritten processing algorithm; According to the execution sequence of the algorithm directed graph, call the first processor to execute the unre-edited processing algorithm, call the second processing The processor executes the rewritten processing algorithm O.
  • embodiments of the present disclosure also provide a data processing device, including: an algorithm directed graph acquisition module, configured to obtain an algorithm directed graph corresponding to the target task; wherein, The directed graph of the above algorithm contains multiple algorithm nodes, one algorithm node corresponding to i processing algorithms; the processing algorithm editing module is set to re-edit the processing algorithm that meets the set conditions, and obtain the rewritten processing algorithm; The processor calling module is configured to call the first processor to execute the unre-edited processing algorithm and call the second processor to execute the rewritten processing algorithm according to the execution order of the algorithm directed graph.
  • embodiments of the present disclosure also provide an electronic device, which includes: one or more processing devices; a storage device configured to store one or more programs; when the one or more programs are processed The one or more processing devices execute, so that the one or more processing devices implement the data processing method described in the embodiments of the present disclosure.
  • embodiments of the present disclosure also provide a computer-readable medium. A computer program is stored on the computer-readable medium. When the computer program is executed by a processing device, the methods described in the embodiments of the present disclosure are implemented.
  • Intelligent Creation The image and video content generation method based on computer vision and graphics used in the special 4B video IT communication platform, through the application of artificial intelligence (such as traditional machine learning or deep learning) and virtual reality/augmented reality technology, enables The video content provided by users has more diverse and rich content.
  • Algorithm platform A software system that supports algorithm scheduling and execution used when users use mobile platforms or other Personal Computer (PC) platforms for intelligent creation.
  • the input of this system is picture or video information from the camera and the required
  • the execution sequence and dependencies of these algorithms are described and connected through directed graphs.
  • the output of the system is the result of the algorithm operation, including image classification information, target object detection bounding box and confidence, object segmentation information, Generate image, human body or object key point information, etc.
  • each algorithm node in the algorithm directed graph is enabled to support CPU functions and at the same time realize function expansion on the GPU, so that algorithms of a set category can be run on the GPU.
  • Figure 1 is a flow chart of a data processing method provided by an embodiment of the present disclosure. This embodiment can be applied to situations where a processor is called to process data.
  • the method can be executed by a data processing device, which can be composed of hardware and/or ' or software, and generally can be integrated in a device with data processing functions, which can be an electronic device such as a server, mobile terminal or server cluster. As shown in Figure 1, the method may include the following steps:
  • the algorithm directed graph contains multiple algorithm nodes, and each algorithm node corresponds to a processing algorithm. Multiple algorithm nodes are connected through directed edges. The algorithm nodes at both ends of the directed edge have a dependency relationship. The algorithm nodes at the end of the directed edge depend on the algorithm nodes at the starting end.
  • Figure 2 is an example diagram of an algorithm directed graph in this embodiment.
  • the algorithm directed graph contains 5 algorithm nodes, where, Algorithm node 2 and algorithm node 3 both depend on algorithm node 1, algorithm node 4 depends on algorithm node 2 and algorithm node 3, algorithm node 5 depends on algorithm node 4 o
  • the target task can be a data processing task that needs to be completed by calling multiple algorithms, It can be an image processing task or an audio processing task, etc.
  • the method of obtaining the algorithm directed graph corresponding to the target task may be: obtaining multiple processing algorithms required for the target task; determining the dependencies of the multiple processing algorithms; establishing an algorithm directed graph based on the dependencies.
  • the process of obtaining multiple processing algorithms required for the target task can be: first determine the initial state and target state of the image or audio that needs to be processed by the target task, and then divide the target task into multiple stages based on the initial state and the target state. , and then determine the processing algorithm that needs to be called at each stage.
  • the way to determine the dependencies of multiple processing algorithms can be: first determine the execution order of multiple processing algorithms required for the target task, and then determine the dependencies between the processing algorithms based on the execution order. Establish an algorithm directed graph based on the dependencies.
  • the method can be: Add directed edges between algorithm nodes corresponding to the processing algorithm.
  • the dependent algorithm node is set at the starting end of the directed edge, and the dependent algorithm node is set at the end of the directed edge.
  • a target task is to perform special effects processing on images. The stages it goes through are: first detecting the human face in the image, then detecting key points in the face, and then determining the eye position and mouth based on the key points. position, then cut out the eyes and mouth, and finally deform the eyes and mouth.
  • the algorithms that need to be called for this target task include: face detection algorithm, key point detection algorithm, eye detection algorithm, mouth detection algorithm, image segmentation algorithm, and image deformation algorithm.
  • the dependencies of each algorithm are: the key point detection algorithm depends on the processing results of the face detection algorithm, the eye detection algorithm and the mouth detection algorithm depend on the processing results of the key point detection algorithm, the image segmentation algorithm depends on the processing results of the eye detection algorithm and the mouth detection algorithm. , The image deformation algorithm relies on the processing results of the image segmentation algorithm. Therefore, the directed graph of the algorithm determined is shown in Figure 3.
  • the technical solution of this embodiment establishes an algorithm directed graph based on the dependency relationship between processing algorithms, which can improve the accuracy of the algorithm directed graph.
  • the set condition may be that the processing algorithm is a set category.
  • the setting categories can be key point detection (Landmaric Detection), image segmentation (Segmentalioii) and image transformation (such as Generative adversarial network (GAN)).
  • GAN Generative adversarial network
  • a property of set-category processing algorithms is that the output data can be represented in the form of images (i.e., renderable processes). For example: The GAN class can output red, green, blue (Red, Greed-.
  • the class can output a multi-dimensional normalized grayscale image (i.e. mask), and the Landmark Detection class can output a multi-dimensional normalized grayscale image of each key point.
  • the process of re-editing the processing algorithm that meets the set conditions and obtaining the rewritten processing algorithm may be: re-editing the processing algorithm that meets the set conditions according to the format supported by the second processor, and Rewrite the input interface and output interface of the processing algorithm to interfaces supported by the second processor to obtain the rewritten processing algorithm.
  • the second processor may be a GPU.
  • the interface supported by the second processor may be a texture interface.
  • Table 1 is the rewritten interface format: As can be seen from Table 1, the data categories supported by the rewritten interface can be RGB, RGBA and R O.
  • the data size can be expressed as NHWC, where N represents the parallelism of the GPU, H represents the height of the image, and W represents the width of the image. , C represents the number of channels of the image.
  • the processing algorithm that meets the set conditions is rewritten into a format supported by GPIJ, so that the processing algorithm is executed by the GPU, so that the data can be completely (or mostly) executed on the GPU during the transmission process of the algorithm directed graph. Reduce the number of data copies between CPU and GPU.
  • the first processor can be a CPU
  • the second processor can be a GPU.
  • the writing format cannot be written, and CPIJ still needs to be called for execution.
  • the image classification algorithm Classifieatkm
  • the object detection class object Detection
  • the output data is in vector format rather than image format
  • the original CPU interface continues to be used.
  • the first thread is called through the created thread.
  • the processor and the second processor execute corresponding processing algorithms.
  • a thread can be created, and according to the execution order of the algorithm directed graph, the first processor is called through the created thread to execute the processing algorithm that has not been re-edited, and the second processing is called through the created thread
  • the processor executes the rewritten processing algorithm.
  • different threads can also be created and tasks assigned to different threads to call the first processor or the second processor to execute the corresponding processing algorithm.
  • the method of calling the first processor to execute the unrewritten processing algorithm, and calling the second processor to execute the rewritten processing algorithm can be:
  • the processing algorithm is divided into two groups, front and back, to obtain the front algorithm group and the back algorithm group; create a first thread for the front algorithm group, and call the first processor and/or the second processor through the first thread to execute the processing algorithm in the front algorithm group ; Create a second thread for the post-algorithm group, and call the first processor and/or the second processor through the second thread to execute the processing algorithm in the post-algorithm group.
  • dividing the processing algorithms in the algorithm directed graph into two groups before and after can be understood as: dividing the processing algorithms at the front in the algorithm directed graph into a group, dividing the processing algorithms at the back into a group, among which, the algorithm
  • the way to divide the processing algorithms in the directed graph into two groups can be: Get the first number of the rewritten processing algorithms that are sorted in the algorithm directed graph; if the first number is less than or equal to the algorithm directed graph is half of the total number of nodes in the graph, then the first number of rewritten processing algorithms are divided into a group as the post-algorithm group, and the remaining processing algorithms are divided into a group as the pre-algorithm group; if the first number is greater than the algorithm If half the total number of nodes in the directed graph is half, then the rewritten processing algorithms with half the total number of nodes are divided into one group as the post-algorithm group, and the remaining processing algorithms are divided into one group as the pre-algorithm group.
  • the processing algorithms that meet the set conditions are re-edited, most or all of the processing algorithms in the algorithm directed graph may be re-edited, and the processing algorithms ranked higher in the algorithm directed graph (that is, the processing in the pre-processing stage Algorithm) may not meet the set conditions, that is, it has not been re-edited. Therefore, the processing algorithms that are ranked lower and are consecutively rewritten can be obtained in the algorithm directed graph. If the first number is less than or equal to half of the total number of nodes in the algorithm directed graph, then the first number of rewritten processing algorithms are directly used as post-algorithm groups, and the remaining processing algorithms are divided into pre-algorithm groups.
  • the pre-algorithm group divided in this way contains the processing algorithm that has not been re-edited and/or the re-written processing algorithm, and the post-algorithm group only contains the re-written processing algorithm.
  • Create a first thread for the former algorithm group and call the first processor and/or the second processor through the first thread to execute the processing algorithm in the former algorithm group.
  • Create a second thread for the rear algorithm group and call the second processor through the second thread to execute the processing algorithm in the front algorithm group. Dividing the consecutive rewritten processing algorithms into a group can avoid the second thread from calling the second processor all the time without switching to call other processors.
  • the rewritten processing,algorithms with half the total number of nodes will be,divided into a group.
  • the post-algorithm group the remaining,processing algorithms will be divided into a, group, as the pre-algorithm group.
  • the pre-algorithm group divided in this way contains the processing algorithm that has not been re-edited and/or the re-written processing algorithm.
  • the post-algorithm group only contains the re-written processing algorithm, and the number of nodes contained in the two groups is similar.
  • First thread calls the first processor and/' or the second processor through the first thread
  • the processor executes the processing algorithm within the pre-algorithm group.
  • Create a second thread for the rear algorithm group and call the second processor through the second thread to execute the processing algorithm in the front algorithm group.
  • the number of nodes contained in the two groups before and after is similar, which can ensure a balanced distribution of resources.
  • the process of calling the first processor and/or the second processor to execute the processing algorithm in the previous algorithm group through the first thread may be: according to the execution order of the previous algorithm group, through the first thread Call the first processor to execute the unre-edited processing algorithm, call the second processor to execute the rewritten processing algorithm; call the first processor and/' or the second processor to execute the processing within the algorithm group through the second thread
  • the process of the algorithm may be: according to the execution order of the last algorithm group, through the second thread, the thread calls the first processor to execute the un-reedited processing algorithm, and calls the second processor to execute the rewritten processing algorithm.
  • the first thread is started.
  • the first processor is called for execution; if the execution When the rewritten processing algorithm is reached, the second processor is called for execution.
  • the post-algorithm group since the post-algorithm group only contains the rewritten processing algorithm, when the processing algorithm of the post-algorithm group is executed, the second thread is started, and the second processor is called to execute in sequence according to the execution order of the pre-algorithm group. .
  • the processing algorithms are executed sequentially according to the order of the algorithm directed graph, which can ensure the smooth and accurate completion of the target task.
  • the first processor is called to execute the processing algorithm that has not been re-edited.
  • the way to call the second processor to execute the rewritten processing algorithm can be: create a third thread for the unrewritten processing algorithm, and create a fourth thread for the rewritten processing algorithm; follow the execution order of the algorithm directed graph , the third thread calls the first processor to execute the unrewritten processing algorithm, and the fourth thread calls the second processor to execute the rewritten processing algorithm.
  • the processing algorithms that have not been re-edited are divided into one group, and the rewritten processing algorithms are divided into another group.
  • One thread is created for the processing algorithm that has not been re-edited, that is, the third thread, and one thread is created for the rewritten processing algorithm, that is, the fourth thread.
  • the third thread is started (the fourth thread sleeps at this time) to call the first processor to execute the processing algorithm; when executing When the rewritten processing algorithm is reached, the fourth thread is started (the third thread sleeps at this time) to call the second processor to execute the processing algorithm.
  • a thread is created for the same type of processing algorithm, so that the thread calls the same processor during the entire task execution process, which can avoid switching frequency when the thread calls the processor.
  • the required processing algorithms are: texture input (texture bhf), face detection (face detect), face calibration (face align), texture rendering (render), Image conversion (iih-image transform), image reasoning (nh-iiifereiice) and image post-processing (nh-post process).
  • Figure 4 is an example diagram of the processing process of the target task instance. As shown in Figure 4, in the directed graph of this algorithm, the first three processing algorithms: texture blit ⁇ face detect and face align call the CPU, and the last four processing algorithms: render -, nh-image transfoim, iih -iiiferenceM The nh-post process calls the GPU to execute.
  • the technical solution of the embodiment of the present disclosure obtains the algorithm directed graph corresponding to the target task; wherein, the algorithm directed graph contains multiple algorithm nodes, and one algorithm node corresponds to a processing algorithm; for a processing algorithm that satisfies the set condition - Re-edit to obtain the rewritten processing algorithm; according to the execution order of the algorithm directed graph, call the first processor to execute the unre-edited processing algorithm, and call the second processor to execute the rewritten processing algorithm.
  • FIG. 5 is a schematic structural diagram of a data processing device disclosed in an embodiment of the present disclosure.
  • the device includes: an algorithm directed graph acquisition module S10, configured to obtain an algorithm directed graph corresponding to a target task; wherein, The algorithm directed graph contains multiple algorithm nodes, and one algorithm node corresponds to one processing algorithm; the processing algorithm editing module 520 is set to re-edit the processing algorithm that meets the set conditions, and obtain the rewritten processing algorithm; processor call Module 530 is set to call the first processor to execute the unre-edited processing algorithm and call the second processor to execute the rewritten processing algorithm according to the execution order of the algorithm directed graph.
  • the set condition is that the processing algorithm is a set category
  • the processing algorithm editing module 520 is set to re-edit the processing algorithm that meets the set conditions in the following manner to obtain a rewritten processing algorithm:
  • the conditional processing algorithm is re-edited according to the format supported by the second processor, and the input interface and output interface of the processing algorithm are rewritten to interfaces supported by the second processor to obtain the rewritten processing algorithm.
  • the set categories include any of the following: key point detection category, image segmentation category, and image transformation category.
  • the processor calling module 530 is configured to call the processor to execute the processing algorithm in the following manner: Divide the processing algorithms in the algorithm directed graph into two groups, the front and back, to obtain the front algorithm group and the back algorithm group; Create a first thread, and call the first processor and/or the second processor to execute the processing algorithm in the pre-algorithm group through the first thread; Create a second thread for the post-algorithm group, and call the first processor and/or the second processor through the second thread to execute the processing algorithm in the post-algorithm group.
  • the processor calls module 530, which is configured to obtain the pre-algorithm group and the post-algorithm group in the following manner: obtain the first number of processing algorithms that are sorted later and are consecutive after rewriting in the algorithm directed graph; if the first The number is less than or equal to half of the total number of nodes in the algorithm directed graph, then the first number of rewritten processing algorithms are divided into a group as the post-algorithm group, and the remaining processing algorithms are divided into a group as the pre-algorithm group.
  • the processor calling module 530 is configured to call the processor to execute the processing algorithm according to the execution order of the previous algorithm group in the following manner: According to the execution order of the previous algorithm group, call the first processor through the first thread to execute the unre-edited The processing algorithm is called and the second processor is called to execute the rewritten processing algorithm.
  • the processor calling module 530 is configured to call the processor to execute the processing algorithm according to the execution order of the last algorithm group in the following manner: According to the execution order of the last algorithm group, use the second thread to use the first processor The processing algorithm that has not been re-edited is executed, and the second processor is called to execute the re-written processing algorithm.
  • the processor calling module 530 is configured to create a thread in the following manner and call the processor to execute the processing algorithm through the process: create a third thread for the unre-edited processing algorithm, and create a fourth thread for the rewritten processing algorithm.
  • the first processor is called through the third thread to execute the unrewritten processing algorithm
  • the second processor is called through the fourth thread to execute the rewritten processing algorithm.
  • the above-mentioned device can execute the methods provided by all the foregoing embodiments of the present disclosure, and has corresponding functional modules and beneficial effects for executing the above-mentioned methods.
  • FIG. 6 shows a schematic structural diagram of an electronic device 300 suitable for implementing embodiments of the present disclosure. .
  • Electronic devices in embodiments of the present disclosure may include mobile phones, notebook computers, digital broadcast receivers, personal digital assistants (Personal Digital Assistant, PDA), tablet computers (Portable Android Device, PAD), portable multimedia players ( Portable Media Player, PMP), mobile terminals such as vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and fixed terminals such as digital TVs, desktop computers, etc., or various forms of servers, such as independent servers or server clusters.
  • the electronic device shown in FIG. 6 is only an example.
  • the electronic device 300 may include a processing device (such as a central processing unit, a graphics processor, etc.) 301.
  • the processing device 301 may process data according to a program stored in a read-only memory device (Read only Memory, ROM) 302 or from a program.
  • the storage device 308 loads the program in the random access memory device (RAM) 303 to perform various appropriate actions and processes.
  • RAM random access memory
  • various programs and data required for the operation of the electronic device 300 are also stored.
  • the processing device 301, ROM 302 and RAM 303 are connected to each other via a bus 304.
  • Input/output (1 tap. 1 cutter, I/O) interface 305 is also connected to bus 3.
  • the following devices can be connected to the I/O interface 305: input devices 306 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a Liquid Costal Display (LCD) ), an output device 307 such as a speaker, a vibrator, etc.; a storage device 308 including a magnetic tape, a hard disk, etc.; and a communication device 309.
  • the communication device 309 may allow the electronic device 300 to communicate wirelessly or wiredly with other devices to exchange data.
  • FIG. 6 illustrates electronic device 300 with various means, it should be understood that implementation or availability of all illustrated means is not required. More or fewer means may alternatively be implemented or provided.
  • embodiments of the present disclosure include a computer program product including a computer program carried on a computer-readable medium, the computer program including program code for performing a data processing method.
  • the computer The program can be downloaded and installed from the network through the communication device 309, or installed from the storage device 3.8, or installed from the ROM 302.
  • the computer program is executed by the processing device 301, the above functions defined in the method of the embodiment of the present disclosure are performed.
  • the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or a combination of the above two.
  • the computer-readable storage medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or a combination of the above.
  • Examples of computer readable storage media may include: an electrical connection having one or more wires, a portable computer disk, a hard drive, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (such as Electronic Programable Read Only Memory (EPROM) or flash memory), optical fiber, portable compact disk read-only memory (Compact Disc-Read Only Memory, CD-ROM), optical storage device, magnetic storage device , or a suitable combination of the above.
  • a computer-readable storage medium may be a tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.
  • the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, in which computer-readable program code is carried. This propagated data signal can take many forms, including electromagnetic signals, optical signals, or suitable combinations of the above.
  • the computer-readable signal medium can also be any computer-readable medium other than computer-readable storage media.
  • the computer-readable signal medium can also be any computer-readable medium other than computer-readable storage media.
  • a signal medium may transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
  • client, server Communication can be performed using any currently known or future developed network protocol, such as HyperText Transfer Protocol (HTTP), and can interact with any form or medium of digital data communication (e.g., communication network) even.
  • HTTP HyperText Transfer Protocol
  • Examples of communication networks include Local Area Network (LAN), Wide Area Network (WAN), Internet (eg, Internet), and end-to-end networks (eg, ad hoc end-to-end network), as well as currently known or networks for future research and development.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device; it may also exist independently without being assembled into the electronic device.
  • the computer-readable medium carries at least one program.
  • the electronic device When the at least one program is executed by the electronic device, the electronic device: obtains an algorithm directed graph corresponding to the target task; wherein, the algorithm directed graph includes multiple algorithms. Node, an algorithm node corresponds to a processing algorithm; re-edit the processing algorithm that meets the set conditions to obtain the rewritten processing algorithm; according to the execution order of the directed graph of the algorithm, call the first processor to execute the rewritten The edited processing algorithm calls the second processor to execute the rewritten processing algorithm.
  • each box in the flowchart or block diagram may represent a module, segment, or portion of code. Or a portion of code contains one or more executable instructions for implementing specified logical functions.
  • the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown one after another may actually execute substantially in parallel, or they may sometimes execute in the reverse order, depending on the functionality involved.
  • each block in the block diagram and/or flowchart illustration, and combinations of blocks in the block diagram and/or flowchart illustration can be constructed by specialized hardware-based systems that perform the specified functions or operations. Implemented, or may be implemented using a combination of dedicated hardware and computer instructions.
  • the units involved in the embodiments of the present disclosure may be implemented in software or hardware. Among them, the name of a unit does not constitute a limitation on the unit itself under certain circumstances.
  • the functions described above herein may be performed, at least in part, by at least one hardware logic component.
  • exemplary types of hardware logic components include: Field-Programmable Gate Array (FPGA), Application Specific Integrated Circuit (ASIC), Application Specific Standard Parts (ASSP) ), system on chip (System cm Chip, SOC), complex programmable logic device (Complex Programmable Logic Device, CPLD), etc.,
  • a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device.
  • the machine may
  • the read medium may be a machine-readable signal medium or a machine-readable storage medium.
  • Machine-readable media may include electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or a suitable combination of the above.
  • machine-readable storage media may include one or more wire-based electrical connections, portable computer disks, hard drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory Memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or a suitable combination of the above.
  • RAM random access memory
  • ROM read-only memory
  • EPROM or flash memory erasable programmable read-only memory Memory
  • CD-ROM compact disk read-only memory
  • the present disclosure discloses a data processing method, including: obtaining an algorithm directed graph corresponding to a target task; wherein, the algorithm directed graph includes a plurality of algorithm nodes.
  • one algorithm node corresponds to one processing algorithm; re-edit the processing algorithm that meets the set conditions to obtain the rewritten processing algorithm; according to the execution order of the directed graph of the algorithm, call the first processor to execute the next
  • the re-edited processing algorithm calls the second processor to execute the rewritten processing algorithm.
  • the set condition is that the processing algorithm is a set category, and the processing that satisfies the set condition
  • the algorithm is re-edited to obtain the rewritten processing algorithm, including: re-editing the processing algorithm that meets the set conditions according to the format supported by the second processor, and rewriting the input interface and output interface of the processing algorithm. For the interface D supported by the second processor, a rewritten processing algorithm is obtained.
  • the setting categories include any one of the following: key point detection category, image segmentation category, and image transformation category.
  • calling the first processor to execute the unre-edited processing algorithm calling the second processor to execute the rewritten processing algorithm, including: inserting the algorithm directed graph into The processing algorithm is divided into two groups before and after, and the pre-algorithm group and the post-algorithm group are obtained; a first thread is created for the pre-algorithm group, and the first processor and/or the second processor are called through the first thread to execute the The processing algorithm in the pre-algorithm group; Create a second thread for the post-algorithm group, and call the first processor and/or the second processor through the second thread to execute the processing algorithm in the post-algorithm group.
  • the processing algorithms in the directed graph of the algorithm into two groups, including: Obtain the first number of processing algorithms that are ranked lower in the directed graph of the algorithm and are consecutive after rewriting; if If the first number is less than or equal to half of the total number of nodes in the algorithm directed graph, then the first number of rewritten processing algorithms are divided into a group, as the post-algorithm group, and the remaining processing algorithms are divided into One group, as the pre-algorithm group; if the first number is greater than half of the total number of nodes in the algorithm directed graph, then divide the rewritten processing algorithms with half of the total number of nodes into one group, As the post-algorithm group, the remaining processing algorithms are divided into one group, as the pre-algorithm group O.
  • the processing algorithm includes: according to the execution order of the former algorithm group, the first thread calls the first processor to execute the unre-edited processing algorithm, and calls the second processor to execute the rewritten processing algorithm; by.
  • the second thread calls the first processor and/or the second processor to execute the processing algorithm in the post-algorithm group, including: calling the first processing through the second thread according to the execution order of the post-algorithm group.
  • the first processor executes the processing algorithm that has not been rewritten, and the second processor is called to execute the rewritten processing algorithm.
  • the first processor is called to execute the non-restarted
  • the edited processing algorithm calls the second processor to execute the rewritten processing algorithm, including: creating a third thread for the unrewritten processing algorithm, and creating a fourth thread for the rewritten processing algorithm; directed according to the algorithm
  • the third thread calls the first processor to execute the unrewritten processing algorithm
  • the fourth thread calls the second processor to execute the rewritten processing algorithm.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Image Processing (AREA)
  • Stored Programmes (AREA)

Abstract

说明书摘要本公开实施例公开了一种数据处理方法、装置、设备及存储介质。该方法包括:获取目标任务对应的算法有向图;其中,所述算法有向图包含多个算法节点,一个算法节点对应一种处理算法;对满足设定条件的处理算法进行重新编辑,获得重写后的处理算法;按照所述算法有向图的执行顺序,调用第一处理器执行未重新编辑的处理算法,调用第二处理器执行重写后的处理算法。

Description

数据 处理方 法、 装置、 设备及存储介 质 本公 开要求在 2022年 5月 16日提交中国专 利局、申请号 为 202210530042.0 的 中国专利 申请的优 先权, 以上申请的全部 内容通过 引用结合 '在本公开中。 技术 领域 本公 开实施 例涉及 计算机 技术领域 , 例如涉及一 种数据处 理方法 、 装置、 设 备及存储 介质 O 智素 技术 对于 一个 图像处理任 务, 通常需要调用多 个算法 实现。 在运行这 些算法 时 存 在多次 中央处 理器 ( central processing unit , CPU ) 和图形处理器 ( graphics processing unit, GPU) 之间的切换, 而 CPU和 GPU之 间的切 换需要 •进行数据 拷 贝, 按照相关技 术的方 案, 需要进行多 次数据 拷贝, 这样存在 较大的 计算和 内 存开销, 在一定程度上影 响整个任 务的处理 效率。 爰 明内容 本公 开实施 例提供 一种数据 处理方 法、 装置、 设备及存储 介质, 可以减少 CPU 和 GPU 的切换 次数, 从而节省计算 和内存 资源, 且可以提高 数据处理 的效 率 。 第一 方面, 本公开实施例提供 了 --种数据处理方 法, 包括: 获取 目标任 务对应 的算法 有向图 ; 其中, 所述算法有向 图包含多 个算法 节 点 , 一个算法节点对 应一种 处理算法 ; 对满 足设定 条件的处 理算法进 行重新 编辑, 获得重写 后的处理 算法; 按照 所述算 法有向 图的执行 顺序, 调用第一处理 器执行未 重新编 辑的处 理 算 法, 调用第二处理 器执行 重写后的 处理算 法 O 第二 方面, 本公开实施例还提 供了一 种数据处 理装置 , 包括: 算 法有向 图获取模 块, 设置为获取 目标任 务对应 的算法有 向图 ; 其中, 所 述 算法有向 图包含 多个算法 节点, 一个算法 节点对应 i种处理算 法; 处理 算法编 辑模块 , 设置为对满足 设定条 件的处 理算法进 行重新 编辑, 获 得 重写后的 处理算法 ; 处理 器调用模 块, 设置为按 照所述 算法有 向图的执 行顺序 , 调用第一处理 器执 行未重 新编辑的 处理算 法, 调用第二处理 器执行 重写后的 处理算 法。 第三 方面, 本公开实 施例还提 供了 种 电子设备 , 所述电子设备 包括: 一个 或多个处 理装置 ; 存储 装置, 设置为存储 一个或 多个程序 ; 当所 述一个 或多个程 序被所 述一个 或多个 处理装置 执行, 使得所述一个或 多个 处理装 置实现如 本公开 实施例所 述的数据 处理方 法。 第四 方面, 本公开实施 例还提 供了一 种计算机 可读介 质, 所述计算 机可读 介质 上存储 甫计算机 程序 , 该计算机程 ./予被处理装置执行时实现 如本公开 实施 例所 述的数据 处理方 法 O 附 图说明 图 !是本公开 实施例 中的 ~种数 据处理 方法的流 程图; 图 2是本公开实 施例中 的一种算 法有向 图的示例 图; 图 3是本公开实 施例中 的一种算 法有向 图示例图 ; 图 4是本公开实 施例中 的目标任 务实例的 处理过程 示例 图; 图 5是本公开实 施例中 的一种数 据处理装 置的结 构示意 图 ; 图 6是本公开实 施例中 的一种电 子设备的 结构示 意图。 具体 实施方 式 下面 将参照 附图描 述本公开 的实施 例。 虽然附图 中显示 了本公开 的 -些实 施例 , 然而应当理解 的是 , 本公开可以通 过各种形 式来实 现。 应当理解 的是, 本公 开的附 图及实施 例仅用于 示例性 作用 O 应 当理解-, 本公开的方法实 施方式 中记载 的各个 步骤可 以按照不 同的顺序 执行 , 和 /'或并行执行。 此外, 方法实施方式可以包括附加的 步骤和 /或省略执行 示 出的步骤 。 本文 使用的 术语 “包括” 及其变形是开 放性包括 , 即 “包括但不 限于” O 术语 “基于” 是 “至少部分 地基于” o 术语 “一个实施例” 表示 “至少一个 实 施例 ” ; 术语“另一实施 例 ” 表示 “至少 ~个 另夕卜的实施例 ” ; 术语“一些实 施例” 表示 “至少一些实 施例” O 其他术语的相 关定义将 在下文 描述中 给出。 需要 注意, 本公开中提及的 “第一 ” 、 “第二 ” 等概念仅 用于对不 同的装 置 、 模块或单元进 行区分 , 并非用于限定 这些装 置、 模块或单元 所执行 的功能 的顺 序或者 相互依存 关系。 需要 注意, 本公开中提及的 “一个” 、 “多个” 的修饰是示 意性的 , 本领 域技 术 .人员应当理解, 除非在上下 文另有 明确指 出, 否则应该理 解为 “ ~个或 多个” O 本公 开实施 方式中 的多个装 置之间 所交互 的消息或 者信息 的名称 仅用于说 明性 的目的 , 而并不是用于对 这些消 息或信 息的范围进 行限制 。 智能 创作: 特 4B视频类 it交平台中所使用的基 于计算机 视觉和 图形学 的图 像视 频内容 生成方 法, 通过人工智能 (例如传统机 器学习或 深度学 习) 和虚拟 现实 /增强现实技术的应 用, 使用户提供的 视频内容 具备更 加多元丰 富的内 容。 算法 平台:在用户 使用移动 平台或 其他个人 计算机 ( Personal Computer , PC) 平 台进行智 能创作 时所使 用的支持 算法调 度与执行 的软件 系统, 该系统的输 入 为来 自相机 的图片 或视频 信息以及 所需要 运行的算 法, 这些算法 的执行顺 序与 依赖 关系通 过有向 图来描 述和连接 , 该系统的输 出为算法 运行的 结果, 包摇图 像分 类信息 、 目标物体检测 包围框 及置信 度、 物体分割信 息、 生成图像 、 人体 或物 体关键 点信息等 。 本 方案的 目标是 使得算 法有 向图中 的设定 类别 的算法 可以 由设定处 理器 (如 GPU) 执行, 使得数据在算法 有向图的 传输过程 中可 以完全 (或者大部分) 在设 定处理 器上执 行 , 通过减少数据 在不同 处理器 间的复制 次数, 达到节省计 算和 内存资 源的效 果。 本实施例 中, 在智能创作中 , 使算法有向 图中各个 算法 节 点在支持 CPU功能的 同时, 实现在 GPU上 的功能扩 展, 使得设定 类别的 算法 可 以在 GPU上运行 。 图 1为本公开实 施例提供 的一种 数据处理 方法的 流程图 , 本实施例可适用 于 调 用处理器 对数据进 行处理 的情况, 该方法 可以由 数据处理 装置来 执行 , 该装 置可 由硬件 和 /'或软件组成, 并一般可集成在具有 数据处 理功能 的设备中 , 该设 备可 以是服 务器、 移动终端或 服务器 集群等电 子设备 。 如图 1所示, 该方法可包 括如 下步骤 :
S110, 获取目标任务 对应的 算法有 向图。 其 中, 算法有向图 包含多个 算法节 点, --个算法节 点对应 --种处理算 法。 多个 算法节 点之间 通过有 向边连接 , 有向边两端 的算法节 点具有 依赖关 系, 有 向边 结束端 的算法 节点依赖起 始端的 算法节 点。 示例性的, 图 2是本实施例中的 一种 算法有 向图的示 例图, 如图 2所示, 该算法有向图 包含 5个算法节点, 其中, 算 法节点 2和算法节点 3均依赖算法节点 1 , 算法节点 4依赖算法节点 2和算法节点 3, 算法节点 5依赖算法节 点 4 o 其 中, 目标任务可 以是需要 调用多 种算法 完成的数 据处理 任务, 可以是图 像处 理任务 或者音 频处理任 务等。 本实施例中, 主要是针对图像 处理任 务的方 案 。 示例 性的, 荻取目标任务对 应的算 法有向 图的方 式可以是 : 荻取目标任 务 所 需的多个 处理算 法; 确定多个处理 算法的依 赖关 系; 基于依赖关系 建立算 法 有 向图。 其 中, 获取目标任 务所需的 多个处 理算法 的过程 可以是 : 首先确定目标任 务所 需处理 的图像 或者音频 的初始 状态以 及目标状 态, 然后基于 初始状 态和 目 标状 态将 目标任务划 分为多个 阶段, 然后确定出每个阶 段所需调 用的处 理算法。 确定 多个处 理算法的 依赖关 系的方 式可以是 : 首先确定 目标任务 所需的多 个处 理算法 的执行顺 序 , 然后根据执行顺 序确定 出处理算 法间的 依赖关 系 O 基于 依赖关 系建立算 法有 向图的方 式可以 是: 在处理算法 对应的 算法节 点 之 间添加有 向边。 其中, 有向边的起始端 设置被依 赖的算 法节点 , 有向边的结 束端 设置依 赖的算 法节点 。 示例性的, 一目标任 务是对 图像进行 特效处 理, 其 经历 的阶段 为: 首先对图像 中的人 体面部 进行检 测, 然后对面部 中的关键 点进 行检 测, 再然后根据 关键 点确定眼 睛位置和 嘴巴位 置, 再然后将 眼睛和嘴 巴截 取 出来, 最后对眼 睛和嘴 巴进行形 变处理 。 从上述可以看 出, 该目标任 务需要 调 用的算法 包括: 面部检测算法、 关键点检测算 法、 眼睛检测算 法、 嘴巴检测 算 法、 图像分割算 法、 图像形变算 法。 且各算法 的依赖关 系为 : 关键点检测算 法依 赖面部 检测算 法的处理 结果、 眼睛检测算法和 嘴巴检 测算法 依赖关键 点检 测算 法的处 理结果 , 图像分割算法 依赖眼 睛检测算 法和嘴 巴检测 算法的 处理结 果 , 图像形变算法依 赖图像 分割算 法的处 理结果 。 因此确定出的 算法有 向图参 见 图 3。 本实施例的技术方案, 基于处理算法间 的依赖 关系建立 算法有向 图, 可 以提 高算法 有向图的 准确性 。
S120, 对满足设定条 件的处理 算法进 行重新编 辑, 获得重写后 的处理算 法。 其 中, 设定条件可 以是处理 算法为 设定类 别。 设定类别可 以是关 键点检 测 类 (Landmaric Detection) 、 图像分割类 (Segmentalioii) 及图像变换类 (如生成 又寸才亢网络 (Generative adversarial network, GAN) ) 。 设定类别的处理算法具有 的特 性是输 出的数据 可以 以图像 (即可渲染的纭理 ) 的形式表征。 例如: GAN 类可 以输 出红色、 绿色、 蓝色 (Red、 Greed-. Blue, RGB) 或者红色、 绿色、 蓝 ■色、 不透明度(Red、 Greed、 Blue, Alpha, RGB A) 类型的数据, Segmentation 类可 以输出 多维归一 化的灰度 图 (即掩膜) , Landmark Detection类可以输出每 个关 键点的 多维归一化 的灰度 图。 本实 施例中 , 对满足设定条 件的处理 算法进 行重新 编辑, 获得重 写后的处 理算 法的过程 可以是 : 将满足设定 条件的 处理算法 按照第 二处理 器支持的 格式 进行 重新编辑 , 并将处理算 法的输 入接口和 输出接 口改写 为第二 处理器支 持的 接 口, 获得重写后的 处理算法 。 其中 , 第二处理器可 以是 GPU。 示例性的, 首先获取满 足设定 条件的处 理 算法 的源代码 , 逐行读取源代 码 , 提取源代码 中的算法 参数, 最后将提取出的 算法 参数按 照 GPU支持的 格式进 行重新编 辑。 其中, 第二处理 器支持 的接口可 以是 纹理接 口。 示例性的, 表 1是改写后的接 口格式:
Figure imgf000007_0001
从表 1可以看出, 改写后的接口 支持的数 据类别可 以是 RGB、 RGBA«RO 数据 尺寸可 以表示为 NHWC, 其 中, N表示 GPU的 并行度, H表示 图像的高 , W 表示 图像的 宽, C表示图像的通 道数。 本实施例中, 将满足设定条 件的处理 算法 改写 为 GPIJ支持的格式, 使得处理算法 由 GPU执行, 使得数据在算 法有向 图的 传输 过程中 可以完 全 (或者大部分) 在 GPU上执行, 减少数据 在 CPU和 GPU间 的复 制次数。
S130, 按照算法有 向图的执 行顺序 , 调用第一处理 器执行 未重新 编辑的处 理算 法, 调用第二处理 器执行 重写后 的处理算 法。 例如 , 第一处理器可 以是 CPU, 第二处理器 可以是 GPUo 对于不满足设 定 条件 的处理算 法, 无法对其编 写格式进 行编写 , 仍然需要调用 CPIJ执行。 例如, 对于 图像分 类算法 (Classifieatkm) 以及目标检测类 (Object Detection) , 由于 其输 出数据为 向量格 式而非 图像格式 , 因此继续沿用原 有 CPU接口 o 本实 施例中 , 通过创建的线程 调用 第一处理 器和第 二处理 器执行 对应的处 理算 法。 可以创建一 个线程 , 按照算法有 向图的执 行顺序 , 通过创建的 线程调 用第 一处理 器执行 未重新编 辑的处 理算法 , 以及通过创建 的线程调 用第二 处理 器执 行重写 后的处 理算法 。 为了提高处理 效率, 也可以创 建不同 的线程 , 对不 同的 线程分 配任务, 以调用第一处理 器或者 第二处理 器执行对 应的处理 算法。 示例 性的, 按照算 法有向 图的执行 顺序, 调用第一处理器 执行未 重新编辑 的处 理算法 , 调用第二处 理器执行 重写后 的处理算 法的方 式可 以是: 将算法有 向 图中的处 理算法 划分为前 后两组 , 获得前算法组 和后算 法组; 对前算法组创 建 第一线程 , 通过第一线程 调用第一 处理器 和/或第二处 理器执行 前算法 组内的 处理 算法; 对后算法组创建 第二线程 , 通过第二线程 调用第 一处理器 和/或第二 处理 器执行 后算法组 内的处理 算法。 其 中, 将算法有向 图中的处 理算法 划分为 前后两组 可以理 解为: 将算法有 向 图中靠前 的处理算 法划分 为一组, 将靠后的 处理算 法划分为 一组 其 中, 将算法有向 图中的处 理算法 划分为 前后两组 的方式 可以是 : 获取算 法有 向图 中排序靠 后且连续 为重写 后的处 理算法 的第一数 量; 若第一数量 小于 或等 于算法 有向图 中总节 点数量的 一半, 则将第一数量的 重写后 的处理 算法划 分 为一组, 作为后算法组 , 剩余的处理算 法划分 为一组, 作为前算法组 ; 若第 一数 量大于 算法有 向图中 总节点数 量的一 半, 则将总节点 数量一 半的重 写后的 处理 算法划 分为一 组, 作为后算法 组, 剩余的处理 算法划 分为一 组, 作为前算 法组 本实 施例, 在将满足设定条 件的处 理算法 重新编辑 后, 算法有向 图中的 大 部分 或者全部 处理算 法可能被 重新编 辑,排在 算法有 向图中 靠前的处 理算法 (即 处于 前处理 阶段的 处理算 法) 可能不满足 设定条 件, 即未被重新 编辑。 因此, 可 以在算法 有向图 中获取到排 序靠后 且连续为 重写后 的处理算 法。 若第 一数量 小于或等 于算 法有向图 中总节 点数量 的一半, 则将第一 数量的 重 写后的处 理算法 直接作 为后算法 组, 剩余的处理 算法划 分为前 算法组 。 这样 划分 出的前 算法组 包含未 .重新编辑的处理算 法和 /或重写后的处理 算法, 后算法 组只 包含重 写后的 处理算 法。 对前算法组 创建第一 线程, 通过第一线程 调用第 一处 理器和 /或第二处理 器执行前 算法组 内的处理 算法。 对后算法组创建 第二线 程 , 通过第二线程 调用第二 处理器 执行前 算法组 内的处理 算法。 将连续的重写 后的 处理算 法划分 为一组 , 可以避免第二 线程一直 调用 第二处理 器, 无需切换 调 用其他处 理器。 若第 一,数量大于算法有 向图中总 节点,数量的一半, 则将总节 点数量 一半的 重 写后的处 理算法 划分为- -组, 作为后算法组, 剩余的处理 算法划 分为一 ■组, 作 为前算法 组。 这样划分出 的前算 法组包含 未重新编 辑的处 理算法和/或 重写后 的处 理算法 , 后算法组只 包含重写 后的处 理算法 , 且前后两组包含 的节 点数量 相近 对前算 法组创建 第一线程 , 通过第一线程 调用 第一处理 器和/ '或第二处理 器执 行前算 法组内 的处理算 法。 对后算法 组创建 第二线程 , 通过第二线程 调用 第二 处理器 执行前 算法组 内的处理 算法。 本实施例中, 前后两组 包含的 节点数 量相 近, 可以保证资 源的分配 均衡。 示例 性的, 通过第一 线 .程调用第一处理器和/ '或第二处理器执行前 算法组 内 的处 理算法 的过程 可以是 : 按照前算法组 的执行 顺序, 通过第一 线 •程调用第一 处理 器执行 未重新 编辑的处 理算法 , 调用第二处理 器执行 重写后 的处理 算法; 通过 第二线程 调用 第一处理 器和/ '或第二处理器执行后算 法组内的 处理算 法的过 程可 以是 : 按照后算法组 的执行顺 序, 通过第二 线,程调用第 处理器执 行未 .重 新编 辑的处 理算法, 调用第二处理器 执行重 写后的处 理算法。 本实 施例中 , 当执行前算 法组内的 处理算 法时, 启动第一 线程, 按照前算 法组 的执行 顺序, 若执行到未重新 编辑的 处理算 法, 则调用第一 ■处理器执行; 若执 行到重 写后的 处理算 法, 则调用第二 处理器执 行。 本应用场 景下, 由于后 算 法组只包 含重写 后的处理 算法, 因此当执行到后 算法组 的处理 算法时 , 启动 第二 线程, 按照前算法组 的执行顺 序, 调用第二 处理器依 次执行 。 本实施例, 按照 算法有 向图的顺 序依次执 行处理 算法, 可以保证顺利 准确地完 成目标任 务 O 可选 的, 按照算法有 向图的 执行顺 序, 调用第一处 理器执 行未重 新编辑 的 处理 算法 , 调用第二 处理器执 行重写 后的处 理算法 的方式可 以是 : 对未重新编 辑的 处理算 法创建 第三线程 , 对重写后的 处理算 法创建 第四线程 ; 按照算法有 向 图的执行 顺序, 通过第三线程调 用第一 处理器执 行未重 新编辑 的处理 算法 , 通过 第四线程 调用第 二处理 器执行重 写后的处 理算法 。 本实 施例中 , 将未重新编辑 的处理 算法划 分为一组 , 将重写后的 处理算 法 划分 为另一 组。 对未重新编 辑的处 理算法 创建一个 线程, 即第三线程, 对重写 后的 处理算 法创建 一 ■个线程, 即第四线程。 示例性的, 按照算法 有向图 的执行 顺序 , 当执行到未重新编辑 的处理 算法时 , 启动第三线程 (此时第四线 程休眠 ) , 以调 用第一 处理器执 行该处 理算法 ; 当执行到重 写后的处 理算法 , 启动第四线, •程 (此时第三 线程休 眠) , 以调用第二处理器 执行该处 理算法 。 本实施例中 , 为 同类型的 处理算 法创建 一个线程 , 使得线程 .在整个任务执行过 程中, 调用同 一个 处理器 , 可以避免线程调 用处理 器时的切 换频率 。 示例 性的, 以“泡沫特 效渲染 ” 为例, 所需要的处理算 法依次 为: 纹理输 入 (texture bhf) 、 面部检测 (face detect) 、 面部校准 (face align) 、 纹 J里渲染 (render) 、 图像转换 (iih-image transform) 、 图像推理 (nh-iiifereiice) 及图像 后处 理 ( nh-post process ) 。 图 4是目标任务实例的处理过程示例图。 如图 4所示 , 在该 算法有 向图中, 其中, 前三个处理算法: texture blit^ face detect及 face align 调 用 CPU 彳亍, 后四个处理算法 : render -, nh-image transfoim、 iih-iiiferenceM nh-post process调用 GPU执彳亍。从图 4中可以看出, 该有向图的链路中只进行了 ― 次 CPU和 GPU 间的切换 ,从而有效 的减少 了 CPU和 GPU之间的数 据交换 ,极 .大的 增加 了数据处 理效率. 本公 开实施 例的技术 方案 , 获取目标任务 对应的算 法有向 图; 其中, 算法 有 向图包含 多个算 法节点 , 一个算法节点 对应一种 处理算 法; 对满足设 定条件- 的处 理算法 进行重 新编辑 , 获得重写后的 处理算 法; 按照算法有向 图的执 行顺 序 , 调用第一处理 器执行 未重新编 辑的处 理算法 , 调用第二处理 器执行 重写后 的处 理算法 。 本公开实施例 提供的 数据处 理方法 , 对满足设定条 件的处 理算法 重新 编辑, 使得重写后的处 理算法 可以被 第二处理 器执行 , 可以在执行 算法有 向 图中的处 理算法 时减少 第一处理 器和第 二处理 器的切换 次数, 从而节省计算 和 内存资源 , 且可以提高数据 处理的 效率。 图 5是本公开 实施例公 开的一 种数据 处理装 置的结构 示意图 , 如图 5所示, 该装 置包括 : 算法 有向图获 取模块 S10, 设置为获 取目标任 务对应 的算法有 向图; 其中, 算 法有向图 包含多个 算法节 点, 一个算法节点对 应一种 处理算法; 处理 算法编辑 模块 520, 设置为对满 足设定条 件的处 理算法进 行重新编 辑, 获得 重写后 的处理算 法; 处理 器调用模 块 530, 设置为按照算 法有向 图的执行顺 序, 调用第一处 理器 执行 未重新 编辑的处 理算法 , 调用第二处理器 执行重 写后的处 理算法 。 可选 的, 设定条件为处 理算法 为设定 类别, 处理算法编 辑模块 520, 设置为 通过 以下方 式对 -满足设定条件的处 理算法 进行重新 编辑, 获得重写后的 处理算 法 : 将满 足设定 条件的处 理算 法按照第 二处理 器支持 的格式进 行重新 编辑, 并 将处 理算法 的输入接 口和输 出接 口改写为 第二处理 器支持 的接 口, 获得重写后 的处 理算法 。 可选 的, 设定类别 包括如下 任意一 种: 关键点检测 类、 图像分割类及图 像 变换 类。 可选 的, 处理器调用模 块 530, 设置为通过以 下方式调 用处理 器执行处 理算 法 : 将算 法有向 图中的处 理算法划 分为前后 两组, 获得前算法组和后 算法组 ; 对前 算法组创 建第一 线程, 通过第一 线程调 用第一处 理器和/或第 二处理 器 执行 前算法 组内的处 理算法 ; 对后 算法组创 建第二 线程 , 通过第二线 程调用 第一处理 器和 /或第二处理器 执行 后算法 组内的处 理算法 。 可选 的, 处理器调用模 块 530, 设置为通过以 下方式获 得前算 法组和后 算法 组 : 获取 算法有 向图中排 序靠后且 连续为 重写后的 处理算法 的第一数 量; 若第 一数量 小于或等 于算 法有向图 中总节 点数量 的一半, 则将第一数量 的 重 写后的处 理算法 划分为 一组, 作为后算 法组, 剩余的处 理算法 划分为一 组, 作 为前算法 组; 若第 一数量 大于算 法有向 图中总节 点数量 的一 •半, 则将总节点数量一 '半的 重 写后的处 理算法 划分为 一组, 作为后算 法组, 剩余的处理算法 划分为一 组, 作 为前算法 组。 可选 的, 处理器调用模 块 530, 设置为通过以 下方式按 照前算 法组的执 行顺 序调 用处理 器执行处 理算法 : 按照 前算法 组的执行 顺序 , 通过第一线程 调用第一 处理器 执行未 重新编辑 的处 理算法 , 调用第二处理 器执行重 写后的处 理算法 。 可.选的, 处理器调用模 块 530, 设置为通过以 下方式按 照后算 法组的执 行顺 序调 用处理 器执行处 理算法 : 按照 后算法 组的执 行顺序 , 通过第二线程 倜用第 ~~~处理器执行未重 新编辑 的处 理算法 , 调用第二处理 器执行重 写后的处 理算法 。 可选 的, 处理器调用模 块 530, 设置为通过以 下方式创 建线程 并通过程 调用 处理 器执行 处理算法 : 对未 重新编 辑的处理 算法创 建第三 线程, 对重写后的处理 算法创 建第四 线 程 ; 按照 算法有 向图的执 行顺序 , 通过第三线程 调用 第 —处理器 执行未 重新编 辑的 处理算 法, 通过第四线程 调用 第二处理器 执行重 写后的处 理算法 。 上述 .装置可执行本公 开前述 所有实 施例所提 供的 方法, 具备执行 上述方 法 .相应的功能 模块和 有益效果 。 未在本实施 例中详尽 描述的 技术细 节, 可参见本 公开 前述所 有实施例 所提供 的方法 O 下面 参考图 6, 其示出了适于 用来实现 本公开 实施例的 电子设 备 300的结构 示意 图。 本公开实 施例中 的电子设 备可以 包括诸如 移动 电话, 笔记本电脑 、 数 字 广播接 收器、 个人数字助 理 ( Personal Di gital Assi stant , PDA ) 、 平板电脑 (Portable Android Device, PAD)、便携式多媒体播放器 (Portable Media Player, PMP) 、 车载终端 (例如车载 导航终端) 等的移 动终端 以及诸如 数字 TV、 台式 计舁 机等的 固定终端 , 或者各种形式 的服务器 , 如独-正服务器或者服务 器集群 。 图 6示出的电 子设备仅 仅是一 个示例。 如 图 6所示, 电子设备 300可以包括处理 装置 (例如中央 处理器 、 图形处理 器 等) 301 , 处理装置 301可以根据存储在只读 存储装 置 (Read only Memory, ROM ) 302中的程序 或者从 存储 装置 308加载到 随机 访问存 储装 置 ( Rmidom Access Memory, RAM) 303中的程序而执 行各种 适当的动 作和处 理。在 RAM 303 中 , 还存储有电子设备 300操作所需 的各种程 序和数 据。处理装 置 301. ROM 302 以 及 RAM 303<过总线 304彼此.相连。 输入 /输出 (1叩血。1切皿, I/O) 接口 305 也连 接至总 线 3。轧 通 常, 以下装置可 以连接至 I/O接口 305 : 包括例如触摸屏、 触摸板、 键盘、 鼠标 、 摄像头、 麦克风、 加速度计、 陀螺仪等的输入装 置 306; 包括例如液晶 显 示 器 (Liquid Costal Display, LCD) 、 扬声器、 振动器等的输出装置 307 ; 包括 例如 磁带、 硬盘等的 存储装置 308 ; 以及通信装置 309。 通信装置 309可以允 •许电 子 设备 300与其他设备 进行无 线或有 线通信 以交换数据 。 虽然图 6示出了具有 各 种 装置的 电子设备 300,但是应 理解的是 ,并不要求 实施或具 备所有示 出的装 置。 可 以替代地 实施或具 备更多 或更少的 装置 O 在一 实施例 中, 根据本公开 的实施 例, 上文参考 流 •程图描述的过程可以 被 实现 为计算 机软件 程序。 例如, 本公开的实施例 包括一种 计算机 程序产 品, 其 包括 承载在 计算机 可读介 质上的计 算机程 序 , 该计算机程序 包含 用于执行 数据 处理 方法的 程序代码. 在这样的 实施例 中, 该计算机程序 可以通过 通信装 置 309 从 网络上被 下载和安 装, 或者从存储 装置 3。8被安装, 或者从 ROM 302被安装。 在 该计算机 程序被处 理装置 301执行时 , 执行本公开 实施例的 方法中 限定的上 述 功 能。 需要 说明的 是, 本公开上 述的计算 机可读 介质可 以是计算 机可读 信号介 质 或 者计算机 可读存 储介质 或者是上 述两者 的组合 。 计算机可读存 储介质 例如可 以是 电、 磁、 光、 电磁、 红外线、 或半导体的系 统、 装置或器件, 或者以 上的 组 合。 计算机可读 存储介 质的示例 可以包 括: 具有一个或 多个导线 的电连 接、 便携 式计算 机磁盘、 硬盘、 随机访问存储器 (RAM) 、 只读存储器 (ROM) 、 可 擦式可 编程只 读存储 器 (如电子可 编程只 读存储 器 (Electronic Programable Read Only Memory, EPROM) 或 闪存) 、 光纤、 便携式紧凑磁 盘只读 存储 器 ( Compact Di sc-Read Only Memory , CD-ROM ) 、 光存 ■储器件、 磁存储器件、 或 者上述 的合适的 组合。 在本公开 中, 计算机可 读存储介 质可 以是包含 或存储 程序 的有形 介质, 该程序可以被指 令执行 系统、 装置或者器件使 用或者 与其结 合使 用。 而在本公开 •中, 计算机可读信号介质可 以包括在 基带 中或者作 为载波 一部 分传播 的数据 信号, 其中承载 了计算机 可读的程 序代码 。 这种传播的 数据 信 号可以采 用多种 形式 , 包括电磁信 号、 光信号或 上述的合 适的组 合 o 计算机 可读 信号介 质还可 以是计 算机可读 存储介 质以外 的任何计 算机可 读介质 , 该计 算机 可读信 号介质 可以发送 、 传播或者传 输用于 由指令执 行系统 、 装置或者器 件使 用或者 与其结 合使用 的程序 。 计算机可读介 质上包含 的程序 代码可 以用任 何适 当的介 质传输 , 包括: 电线、 光缆、 射频 (Radi。 Frequency, RF) 等, 或 者 上述的合 适的组合 O 在 一些 实施 方式 中, 客户端、 服务器可 以利 用诸 如超 文 本传 输协 议 ( HyperT ext T ransfer Protocol , HTTP ) 之类的任何当前已知或未来研发的网络 协议 进行通 信, 并且可以与任 意形式 或介质 的数字数据 通信 (例如, 通信网络) 互连 。通信网络 的示例 包括局域 网 (Local Area Network, LAN) , 广域网 (Wide Area Network, WAN) , 网际网 (例如, 互联网) 以及端对端网络 (例如, ad hoc 端 对端网络) , 以及当前已知或 未来研 发的网络 。 上述 计算机 可读介质 可以是上 述电子 设备中所 包含的 ; 也可以是单独存 在, 而 未装配入 该电子设 备中。 上述 计算机 可读介 质承载 有至少一 个程序 , 当上述至少一 个程序 被该电 子 设备 执行 时, 使得该电子设 备: 获取目标 任务对 应的算 法有向 图; 其中, 所述 算 法有向 图包含多 个算法 节点, 一个算法 节点对 应一种处 理算法; 对满足 设定 条件 的处理 算法进 行重新 编辑, 获得重写 后的处 理算法 ; 按照所述算法 有向图 的执 行顺序 , 调用第一处 理器执行 未重新 编辑的 处理算 法, 调用第二处 理器执 行 重写后的 处理算法 。
Figure imgf000013_0001
附 图中的流 程图和框 图, 图示了按照本公 开各种 实施例的 系统、 方法和计 算机 程序产 品的可 能实现 的体系架 构、 功能和操 作。 在这点上, 流程图或框图 中 的每个方 框可以代 表 --个模块、 程序段、 或代码的一部 分, 该模块、 程序段、 或代 码的一 部分包 含一个 或多个 用于实现 规定的 逻辑功 能的可执 行指令 。 也应 当 注意, 在有些作 为替换 的实现 中, 方框中所标 注的功能 也可 以以不同 于附图 中 所标注的 顺序发 生。 例如, 两个接连地 表示的 方框实际 上可以 基本并 行地执 行 , Z们有时 也可以 按相反 的顺序执 行, 这依所涉 及的功 能而定。 也要注意的 是 , 框图和 /'或流程图中的每个方框、 以及框图和/或流程 图中的 方框的组 合, 可 以 用执行规 定的功 能或操作 的专 用的基于 硬件的 系统来 实现, 或者可以 用专用 硬 件与计算 机指令的 组合来 实现。 描述 于本公 开实施例 中所 涉及到的 单元可 以通过 软件的 方式实现 , 也可以 通 过硬件的 方式来 实现。 其中, 单元的名称在某 种情况下 并不构 成对该 单元本 身 的限定。 本文 中以上 描述的 功能可 以至少部 分地由 至少一 -个硬件逻辑部件 来执行 。 例 如, 可以使 用的 示范 类 型的 硬件 逻辑 部 件包 括 : 现场可编 程 门阵 列 (Field-Programmable Gate Airay, FPGA) 、 专用集成电路 (Application Specific Integrated Circuit, ASIC) 、 专用标准产品 (Application Specific Standard Parts, ASSP) 、 片上系统 ( System cm Chip , SOC) 、 复杂可编程逻辑设备 (Complex Programmable Logic Device, CPLD ) 等、
.在本公开的 上下文 中, 机器可读介 质可 以是有形 的介质 , 其可以包含或 存 储 以供指令 执行 系统、 装置或设备 使用或 与指令 执行系 统、 装置或设备 结合地 使 用的程序 o 机器可读介质 可以是机 器可读 信号介 质或机 器可读储 存介质 。 机 器 可读介质 可以包 括电子 的、 磁性的、 光学的、 电磁的、 红外的、 或半导体系 统 、 装置或设备, 或者上述内容的 合适组 合。 机器可读存 储介质 的示例 可以包 括 基于一 个或多 个线 的电气 连接、 便携式计算机 盘、 硬盘、 随机存取存 ■储器 (RAM) 、 只读存储器 (ROM) 、 可擦除可 编程只读 存储器 (EPROM 或 快闪 存储 器) 、 光纤、 便捷式紧凑盘只读 存储 器 (CD-ROM) 、 光学储存设备 、 磁 储 存设备、 或上述内容的合 适组合。 根据 本公开 实施例 的一个 或多个实 施例, 本公开实施例公 开了一 种数据 处 理 方法, 包括: 获取 目标任 务对应 的算法 有向图 ; 其中, 所述算法有向 图包含多 个算法 节 点 , 一个算法节点对 应 ~种处 理算法 ; 对满 足设定 条件的处 理算法进 行重新 编辑, 获得重写 后的处理 算法; 按照 所述算 法有向 图的执行 顺序, 调用第一 处理器执 彳亍未重新编辑的处 理 算 法, 调用第二处理 器执行 重写后的 处理算 法。 进一 步地, 所述设定条件 为处理算 法为设 定类别 , 对满足设定条 件的处 理 算法 进行重新 编辑, 获得重写后的处 理算法, 包括: 将满 足设定条 件的处理 算法按 照所述 第二处理 器支持的 格式进行 重新编 辑, 并将 所述处 理算法 的输入接 口和输 出接口 改写为所 述第二 处理器 支持的接 D , 获得 重写后 的处理算 法。 进一 步地, 所述设定 类别包 括如下任 意一种 : 关键点检测 类、 图像分割 类 及 图像变换 类。 进一 步地, 按照所述算 法有向 图的执 行顺序 , 调用第一处理器 执行未 重新 编辑 的处理算 法, 调用第二处理 器执行重 写后的 处理算 法, 包括: 将所 述算法 有向图 中的处理 算法划 分为前后 两组 , 获得前算 法组和后 算法 组 ; 对所 述前算法 组创建 第一线程 , 通过所述第一 线程调 用第一处 理器和 /或第 二处 理器执行 所述前 算法组 内的处理 算法; 对所 述后算法 组创建 第二线程 , 通过所述第 二线程调 用第一处 理器和 /或第 二处 理器执行 所述 .后算法组内的处理 算法. 进一 步地, 将所述算 法有向 图中的处理 算法划 分为前后 两组, 包摇: 获取 所述算法 有向图 中排序靠 后且连续 为重写后 的处理 算法的 第一数量 ; 若所 述第一 ■数量小于或等于 所述算 法有向 图中总节 点数量 的一半 , 则将所 述第 一数量 的重写后 的处理 算法划 分为一 组, 作为后算法 组, 剩余的处理 算法 划分 为一组 , 作为前算法组; 若所 述第一数 量大于 所述算 法有向 图中总 节点数量 的一 •半, 则将所述总节 点数 量一半 的重写后 的处理 算法划 分为一 组, 作为后算法 组, 剩余的处理 算法 划分 为一组 , 作为前算法组 O 进一 步地, 通过所述 第一线程 .调用第 --处理器和 /或第二处理器执行 所述前 算法 组内的处 理算法 , 包括: 按照 所述前算 法组的 执行顺 序 , 通过所述第一 线程调 用第一 处理器执 行未 重新 编辑的处 理算法 , 调用第二处理 器执行重 写后的 处理算法 ; 通 .过所述第二线程调 用第一处 理器和 /或第二处理 器执行所 述后算 法组内 的 处理 算法, 包括: 按照 所述后算 法组的 执行顺 序, 通过所述 第二线程 调用第 一处理 器执行未 重新 编辑的处 理算法 , 调用第二处理 器执行重 写后的处 理算法 。 进一 步地, 按照所述 算法有 向图的 执行顺序 , 调用第一处 理器执 行未重新 编辑 的处理 算法, 调用第二处理 器执行 重写后的 处理算 法, 包括: 对未 重新编 辑的处理 算法创 建第三 线程, 对重写后的处理 算法创 建第四 线 程 ; 按照 所述算 法有向 图的执行 顺序, 通过所述第三 线程调 用第一处 理器执 行 未重 新编辑 的处理 算法, 通过所述 第四线 程调用 第二处理 器执行 重写后 的处理 算 法. 应该 理解, 可以使用上面所 示的各 种形式 的流程 , 重新排序、 增加或删除 步骤 。 例如, 本公开中记载 的各步 骤可以 并行地执 行也可 以顺序 地执行 也可以 不 同的次序执 行, 只要能够 实现本公 开的技术 方案所期 望的结 果。

Claims

权 利 要 求 书
1. 一种数据 处理方 法, 包括: 获取 目标任 务对应的 算法有 向图; 其中, 所述算法有向 图包含多 个算法 节 点, 一个算法节点对 应一种处 理算法 ; 对满 足设定 条件的处理 算法进 行重新编 辑, 获得重写后的 处理算 法; 按照 所述算 法有向 图的执行 顺序, 调用第一 处理器执 行未重 新编辑 的处理 算法 , 调用第二处理 器执行重 写后的 处理算法 。
2. 根据权利 要求 1所述的方法 , 其中, 所 •述设定条件为处理算法为设 定类 别 , 所述对满足设定 条件的 处理算法 进行重 新编辑, 获得重写 后的处 理算法 , 包括 : 将满 足设 定条件 的处理 算法按 照所 述第二 处理 器支持 的格式 进行重 新编 辑, 并将所述 处理算 法的输入 接口和 输出接 口改写 为所述第 二处理 器支持 的接 口, 获得重写后的处 理算法 。
3. 根据权利 要求 2所述的方法 , 其中, 所述设定类别 包括如下 任意 - -种: 关键 点检测 类、 图像分割类及 图像变 换类 O
4. 根据权利 要求 1所述的方法 , 其中, 按照所述算法 有向图的 执行顺 序, 调 用第一处 理器执行 未重新 编辑的 处理算 法, 调用第二处 理器执 行重写后 的处 理算 法, 包括: 将所 述算法 有向图 中的处理 算法划 分为前 后两组, 获得前算法组 和后算法 组 ; 对所 述前算 法组创建 第 ~线程 * 通过所述第一 线程调 用第一处 理器和 第二 处理 器中的 至少之一 执行所述 前算法 组内的处 理算法 ; 对所 述后算 法组创建 第二线 程, 通过所述 第二线程 调用第 一处理 器和第二 处理 器中的 至少之一 '执行所述后算法 组内的 处理算法 。
5. 根据权利 要求 4所述的方法 , 其中, 所述将所述算 法有向 图中的处 理算 法划 分为前后 两组, 包括: 获取 所述算法 有向图 中 4-1 F序靠后且连续为重写后的处理算法的第一 数量; 响应 于所述 第一数量 小于或 等于所 述算法 有向图 中总节点 数量的 一半 , 将 所述 第一数 量的重 写后的处 理算法 划分为 一组, 作为后算 法组, 剩余的处理算 法划 分为一 组, 作为前算法组 ; 响应 于所述 第一 '数量大于所述算法 有向图 中总节点 数量的 一半, 将所述总 节点 数量- ■■半的重写后的处理 算法划 分为一 组, 作为后算法 组, 剩余的处理 算 法划 分为一 组, 作为前算法组 。
6. 根据权利 要求 4所述的方法 , 其中, 所述通过所述 第一线程 调用第 一处 理器 和第二 处理器 中的至少之 一执行 所述前算 法组内 的处理算 法, 包括: 按照 所述前 算法组 的执行顺 序 , 通过所述第 一线程调 用第一 处理器 执行未 重新 编辑的 处理算法 , 调用第二处理 器执行重 写后的 处理算法 ; 所述 通过所 述 .第二线程调用第一处 理器和 第二处理 器中的 至少之 一执行 所 述后 算法组 内的处理 算法, 包括: 按照 所述后 算法组 的执行顺 序, 通过所述 第二线程 调用第 一处理 器执行 未 重新 编辑的 处理算法 , 调用第二处理 器执行重 写后的 处理算法 。
7. 根据权利 要求 1所述 .的方法, 其中, 所述按照所述算法有 向图的执 行顺 序 , 调用第一处理 器执行 未重新编 辑的处 理算法 , 调用第二处理 器执行 重写后 的处 理算法 , 包括: 对未 重新编 辑的处理 算法创 建第三 线程 , 对重写后的 处理算 法创建 第四线 程 ; 按照 所述算 法有向 图的执行 顺序 , 通过所述 第三线程 调用第 一处理 器执行 未重 新编辑 的处理 算法, 通过所述 第四线 程调用 第二处理 器执行 重写后 的处理 算 法。
8. 一种数据 处理装置 , 包括: 算法 有向图 获取模块 , 设置为获取 目标任 务对应 的算法有 向图; 其中, 所 述.算法有向 图包含 多个算法 节点 , 1 ■■个算法节点对应 i种处理算法; 处理 算法编 辑模块 , 设置为对满足 设定条 件的处理 算法进 行重新 编辑, 获 得重 写后的 处理算法 ; 处理 器调用模 块, 设置为按 照所述 算法有 向图的执 行顺序 , 调用第一处 理 器执 行未重 新编辑的 处理算 法, 调用第二处理 器执行 重写后的 处理算 法。
9. 一种电子 设备, 所述电子 设备包括 :
— 个或 多个处理 装置; 存储 装置, 设置为存 储一个或 多个程序 ; 当所 述 ~个或 多个程序 被所述 一个或 多个处 理装置执 行, 使得所述 ~个或 多个 处理装 置实现如 权利要 求 1 -7中任一所述的数据 处理方 法。
10. 一种计算 机可读介 质, 所述计算机可 读介质上 存储有 计算机程 序, 所述 计算 机程序被 处理装 置执彳亍时实现如权利要 求 1-7中任一所述的数 据处理 方法 o
PCT/SG2023/050306 2022-05-16 2023-05-05 数据处理方法、装置、设备及存储介质 Ceased WO2023224547A2 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US18/866,266 US20260017090A1 (en) 2022-05-16 2023-05-05 Data processing method and apparatus, device, and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210530042.0A CN114880122A (zh) 2022-05-16 2022-05-16 数据处理方法、装置、设备及存储介质
CN202210530042.0 2022-05-16

Publications (2)

Publication Number Publication Date
WO2023224547A2 true WO2023224547A2 (zh) 2023-11-23
WO2023224547A3 WO2023224547A3 (zh) 2024-02-01

Family

ID=82675361

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/SG2023/050306 Ceased WO2023224547A2 (zh) 2022-05-16 2023-05-05 数据处理方法、装置、设备及存储介质

Country Status (3)

Country Link
US (1) US20260017090A1 (zh)
CN (1) CN114880122A (zh)
WO (1) WO2023224547A2 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115421735A (zh) * 2022-09-06 2022-12-02 上海励驰半导体有限公司 一种深度学习任务的异构部署方法、装置及电子设备

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9235871B2 (en) * 2014-02-06 2016-01-12 Oxide Interactive, LLC Method and system of a command buffer between a CPU and GPU
CN109522108B (zh) * 2018-10-30 2020-10-27 西安交通大学 一种基于Kernel合并的GPU任务调度系统及方法
CN111221643B (zh) * 2018-11-23 2023-04-07 阿里巴巴集团控股有限公司 任务处理方法和任务处理装置
CN109918182B (zh) * 2019-01-23 2020-12-15 中国人民解放军战略支援部队信息工程大学 虚拟化技术下的多gpu任务调度方法
US20200301676A1 (en) * 2019-03-19 2020-09-24 ThunderTech Inc. Framework for GPU Code Generation and Debugging
CN110191314A (zh) * 2019-05-07 2019-08-30 百度在线网络技术(北京)有限公司 基于安卓系统的摄像头数据处理方法、装置和车载设备
CN110232087B (zh) * 2019-05-30 2021-08-17 湖南大学 大数据增量迭代方法、装置、计算机设备和存储介质
CN111597028B (zh) * 2020-05-19 2023-08-25 北京百度网讯科技有限公司 用于任务调度的方法和装置
CN111738434B (zh) * 2020-06-03 2023-04-07 中国科学院计算技术研究所 在异构处理单元上执行深度神经网络的方法
CN113312283B (zh) * 2021-05-28 2023-05-02 北京航空航天大学 一种基于fpga加速的异构图学习系统
CN113535367B (zh) * 2021-09-07 2022-01-25 北京达佳互联信息技术有限公司 任务调度方法及相关装置

Also Published As

Publication number Publication date
US20260017090A1 (en) 2026-01-15
CN114880122A (zh) 2022-08-09
WO2023224547A3 (zh) 2024-02-01

Similar Documents

Publication Publication Date Title
CN110413812B (zh) 神经网络模型的训练方法、装置、电子设备及存储介质
CN114330236A (zh) 文字生成方法、装置、电子设备及存储介质
US12489950B2 (en) Playback control
CN114332590B (zh) 联合感知模型训练、联合感知方法、装置、设备和介质
CN114422698B (zh) 视频生成方法、装置、设备及存储介质
CN113453073B (zh) 一种图像渲染方法、装置、电子设备及存储介质
CN114332323B (zh) 一种粒子效果渲染方法、装置、设备及介质
WO2019080702A1 (zh) 图像处理方法和装置
CN114816719A (zh) 多任务模型的训练方法及装置
WO2025056001A1 (zh) 视频生成方法、装置、电子设备及存储介质
US20260120230A1 (en) Image processing
WO2023224547A2 (zh) 数据处理方法、装置、设备及存储介质
CN111680754B (zh) 图像分类方法、装置、电子设备及计算机可读存储介质
WO2020134547A1 (zh) 数据的定点化加速方法、装置、电子设备及存储介质
CN112308205B (zh) 基于预训练模型的模型改进方法及装置
CN115937338B (zh) 图像处理方法、装置、设备及介质
WO2024251060A1 (zh) 图文排版方法、装置、介质和电子设备
CN114037715B (zh) 图像分割方法、装置、设备及存储介质
CN112884787B (zh) 图像剪裁方法、装置、可读介质及电子设备
CN114741193A (zh) 场景渲染方法、装置、计算机可读介质和电子设备
CN117376631A (zh) 特效添加方法、装置、电子设备以及存储介质
CN117034959A (zh) 数据处理方法、装置、电子设备及存储介质
US20250321785A1 (en) Scheduling method, apparatus, device and storage medium
CN115454923A (zh) 数据计算的装置、板卡、方法以及存储介质
CN114647472B (zh) 图片处理方法、装置、设备、存储介质和程序产品

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 18866266

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 23808010

Country of ref document: EP

Kind code of ref document: A2

WWP Wipo information: published in national office

Ref document number: 18866266

Country of ref document: US