Processing method and apparatus based on heterogeneous computing framework, device, and medium

By encapsulating algorithm modules into heterogeneous processing units through a heterogeneous computing framework, a heterogeneous computing engine framework is established, which solves the problems of low computing efficiency and poor scalability in existing technologies, realizes an efficient and flexible computing system design, and meets the computing power requirements of complex businesses.

CN116360971BActive Publication Date: 2026-11-27BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111629485.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-28
Publication Date
2026-11-27
Estimated Expiration
2041-12-28

AI Technical Summary

Technical Problem

The existing computing system has low computing efficiency, cannot be flexibly expanded, cannot meet complex business needs, and takes a long time to compute, making it unsuitable for expansion. The algorithm module is modified in sync with the upper-layer business requirements.

Method used

By creating a heterogeneous computing framework, encapsulating algorithm modules into heterogeneous processing units, and establishing a heterogeneous computing engine framework, including data input and output ends, calling APIs to execute data processing tasks, supporting modular design and cascaded computing, and inserting custom algorithm nodes and position termination nodes.

Benefits of technology

It improves computing efficiency, reduces computing time, enhances system flexibility and scalability, meets the computing power requirements of complex businesses, and realizes layered architecture design and intelligent scheduling of hybrid computing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116360971B_ABST
    Figure CN116360971B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure relate to a processing method and device based on a heterogeneous computing framework, equipment and medium, wherein the method comprises: creating a corresponding application program interface (API) for each algorithm module in at least one heterogeneous processing unit, wherein each heterogeneous processing unit is generated by encapsulating at least one algorithm module; creating a heterogeneous computing engine framework according to the interface of at least one heterogeneous processing unit according to a data processing task; executing the data processing task according to the application program interface (API) of the required algorithm module of the heterogeneous computing engine framework, and outputting the task processing result to the target device. In the embodiments of the present disclosure, by constructing the heterogeneous computing engine framework, the scalability and flexibility are improved, the computing power advantage of the heterogeneous processing unit can be exerted, the computing efficiency is improved, and the computing time is reduced, so that the demand for computing power of the current business can be met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a processing method, apparatus, device and medium based on a heterogeneous computing framework. Background Technology

[0002] With the diversification and increasing complexity of business needs, the demand for logical computing power in computing systems is growing. However, current computing systems implement algorithms directly on the algorithm modules based on upper-layer business requirements, such as CPU algorithm modules and GPU algorithm modules. If the upper-layer business needs to expand or change the algorithm implementation, the implementation between the algorithm module and the upper layer must also be modified synchronously. Therefore, the current computing system has low computing efficiency, long computation time, is not suitable for expansion, is inflexible, and cannot meet the current computing power requirements of the business. Summary of the Invention

[0003] In order to solve the above-mentioned technical problems, or at least partially solve the above-mentioned technical problems, this disclosure provides a processing method, apparatus, device and medium based on a heterogeneous computing framework.

[0004] In a first aspect, embodiments of this disclosure provide a processing method based on a heterogeneous computing framework, the method comprising:

[0005] A corresponding application programming interface (API) is created for each algorithm module in at least one heterogeneous processing unit, wherein each heterogeneous processing unit is generated by encapsulating at least one algorithm module;

[0006] A heterogeneous computing engine framework is created by calling the interface of at least one heterogeneous processing unit according to the data processing task. The heterogeneous computing engine framework includes at least one data input terminal, at least one heterogeneous processing unit, and at least one data output terminal.

[0007] The heterogeneous computing engine framework calls the application programming interface (API) of the required algorithm module to execute the data processing task and outputs the task processing result to the target device.

[0008] In one optional implementation, creating a corresponding application programming interface (API) for each algorithm module in at least one heterogeneous processing unit includes:

[0009] Create a calling interface and a task execution interface corresponding to each algorithm module, wherein the algorithm module includes any one or more combinations of: a central processing unit module (CPU), a digital signal processing module (DSP), an image processor module (GPU), an application-specific integrated circuit module (ASIC), and a field-programmable gate array module (FPGA).

[0010] In one optional implementation, it further includes:

[0011] The input data of the heterogeneous processing unit is segmented to generate multiple data blocks;

[0012] In the heterogeneous processing unit, multiple computing threads are established corresponding to the multiple data blocks, wherein the multiple computing threads are used to perform parallel processing on the multiple data blocks to generate multiple corresponding data processing results;

[0013] The multiple data processing results are merged and processed to generate output data corresponding to the heterogeneous processing unit.

[0014] In one optional implementation, it further includes:

[0015] Identify multiple subtasks corresponding to the data processing task, and establish a corresponding sub-flowchar for each subtask;

[0016] The at least one data input terminal is simultaneously input into multiple sub-flowcharts corresponding to the multiple sub-tasks, wherein the multiple sub-flowcharts are used to execute heterogeneous computing in parallel to generate multiple sub-task results;

[0017] The results of the multiple subtasks are all connected to the data output terminal, wherein the data output terminal is used to merge the results of the multiple subtasks.

[0018] In one optional implementation, it further includes:

[0019] A custom algorithm node is inserted into the heterogeneous computing engine framework. The custom algorithm node is connected to the data input terminal or the output terminal of the heterogeneous processing unit. The custom algorithm node is used to perform calculations on the data provided by the data input terminal or the output terminal of the heterogeneous processing unit according to the custom algorithm, and feed back the calculated result to the next node connected to the data input terminal or the output terminal of the heterogeneous processing unit.

[0020] In one optional implementation, it further includes:

[0021] A position termination node is inserted into the heterogeneous computing engine framework. The position termination node is connected to the output of the heterogeneous processing unit. The position termination node is used to stop the processing nodes after the output of the heterogeneous processing unit from continuing to calculate, and outputs the data provided by the output of the heterogeneous processing unit as the processing result.

[0022] Secondly, embodiments of this disclosure also provide a processing apparatus based on a heterogeneous computing framework, the apparatus comprising:

[0023] The first creation module is used to create a corresponding application programming interface (API) for each algorithm module in at least one heterogeneous processing unit, wherein each heterogeneous processing unit is generated by encapsulating at least one algorithm module;

[0024] The second creation module is used to create a heterogeneous computing engine framework by calling the interface of at least one heterogeneous processing unit according to the data processing task. The heterogeneous computing engine framework includes at least one data input end, at least one heterogeneous processing unit, and at least one data output end.

[0025] The acquisition module is used to execute the data processing task by calling the application programming interface (API) of the required algorithm module according to the heterogeneous computing engine framework, and output the task processing result to the target device.

[0026] Thirdly, this disclosure provides a computer-readable storage medium storing instructions that, when executed on a terminal device, cause the terminal device to implement the above-described method.

[0027] Fourthly, this disclosure provides an apparatus comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the method described above.

[0028] Fifthly, this disclosure provides a computer program product comprising a computer program / instruction that, when executed by a processor, implements the method described above.

[0029] The technical solution provided in this disclosure has the following advantages compared with the prior art:

[0030] In summary, the processing method based on a heterogeneous computing framework in this disclosure involves creating a corresponding application programming interface (API) for each algorithm module in at least one heterogeneous processing unit, wherein each heterogeneous processing unit is generated by encapsulating at least one algorithm module; creating a heterogeneous computing engine framework by calling the interface of at least one heterogeneous processing unit according to a data processing task, wherein the heterogeneous computing engine framework includes at least one data input terminal, at least one of the heterogeneous processing units, and at least one data output terminal; executing the data processing task by calling the API of the required algorithm module according to the heterogeneous computing engine framework, and outputting the task processing result to the target device. In this embodiment, a heterogeneous computing engine framework is established through a heterogeneous processing unit based on the data processing task. This framework connects to the data processing task. If the algorithm implementation needs to be expanded or modified due to changes in the data processing task, the heterogeneous computing engine framework can be adjusted to accommodate these changes. Therefore, it is suitable for expansion and offers high flexibility. For large-scale algorithm systems, it can improve processing efficiency. Furthermore, the heterogeneous computing engine framework integrates the characteristics of different algorithm modules within the heterogeneous processing unit, thereby leveraging the computing power advantages of the heterogeneous processing unit, improving computational efficiency, reducing computation time, and enhancing the performance of the heterogeneous processing unit. This meets the current business demands for computing power. Simultaneously, the heterogeneous computing engine framework implements layered architecture design, modular design, algorithm cascading, and intelligent scheduling of hybrid computing, thereby improving the efficiency of the framework design. Attached Figure Description

[0031] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.

[0032] Figure 1 A flowchart illustrating a processing method based on a heterogeneous computing framework provided in an embodiment of this disclosure;

[0033] Figure 2 A schematic diagram of a heterogeneous processing unit provided in an embodiment of this disclosure;

[0034] Figure 3 A schematic diagram of a heterogeneous computing engine framework provided in an embodiment of this disclosure;

[0035] Figure 4 A flowchart illustrating another processing method based on a heterogeneous computing framework provided in this embodiment of the present disclosure;

[0036] Figure 5 A schematic diagram of another heterogeneous computing engine framework provided in an embodiment of this disclosure;

[0037] Figure 6 A flowchart illustrating another processing method based on a heterogeneous computing framework provided in this embodiment of the present disclosure;

[0038] Figure 7 A schematic diagram of yet another heterogeneous computing engine framework provided in an embodiment of this disclosure;

[0039] Figure 8 This is a schematic diagram illustrating the insertion of a custom algorithm node according to an embodiment of this disclosure;

[0040] Figure 9 A schematic diagram of an insertion position termination node provided in an embodiment of this disclosure;

[0041] Figure 10 This is a schematic diagram illustrating the insertion of a custom algorithm node and a position termination node, provided as an embodiment of this disclosure.

[0042] Figure 11 A schematic diagram of a processing device based on a heterogeneous computing framework provided in an embodiment of this disclosure;

[0043] Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0044] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0045] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.

[0046] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.

[0047] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.

[0048] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0049] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.

[0050] To address the aforementioned issues, this disclosure provides a processing method based on a heterogeneous computing framework, which will be described below with reference to specific embodiments.

[0051] Figure 1 This is a flowchart illustrating a processing method based on a heterogeneous computing framework, provided as an embodiment of this disclosure. This method can be executed by a processing device based on the heterogeneous computing framework, wherein the device can be implemented in software and / or hardware, and is generally integrated into an electronic device. For example... Figure 1 As shown, the method includes:

[0052] Step 101: Create a corresponding application programming interface (API) for each algorithm module in at least one heterogeneous processing unit, wherein each heterogeneous processing unit is generated by encapsulating at least one algorithm module.

[0053] In this embodiment, the data processing task is implemented based on heterogeneous processing units. The number of heterogeneous processing units implementing this data processing task can be one or more. Each heterogeneous processing unit is an abstract execution layer for the data processing task, and it encapsulates at least one algorithm module. If a heterogeneous processing unit encapsulates multiple algorithm modules, these multiple algorithm modules can be of the same type or different types. The differences between different types of algorithm modules include, but are not limited to: different process architectures, different instruction sets, and one or more different functionalities.

[0054] For example, the algorithm module includes: a Central Processing Unit (CPU), a Digital Signal Processing (DSP), a Graphics Processing Unit (GPU), an Application Specific Integrated Circuit (ASIC), and a Field Programmable Gate Array (FPGA). A heterogeneous processing unit can encapsulate any one or more of these algorithm modules. For instance, a CPU, GPU, and DSP can be encapsulated within a single heterogeneous processing unit.

[0055] In this embodiment, a corresponding Application Programming Interface (API) needs to be created in advance for each algorithm module. This API includes a backend interface that can call the corresponding algorithm module and a runtime interface that can control the operation of the corresponding algorithm module. By calling the API, the algorithm module can run normally, thereby enabling data processing tasks to be performed.

[0056] Figure 2 This is a schematic diagram of a heterogeneous processing unit provided in an embodiment of this disclosure, see below. Figure 2 Here, Backend represents the calling interface, Runtime represents the task execution interface, and Process represents the heterogeneous processing unit. It should be noted that, for simplicity, in subsequent embodiments and accompanying drawings, the heterogeneous processing unit may also be referred to as Process. Assuming an image recognition function is implemented through a Process, this Process may encapsulate both a GPU and a CPU. Before performing heterogeneous computing, it is necessary to create a GPU Backend interface and a GPU Runtime interface for the GPU, and a CPU Backend interface and a CPU Runtime interface for the CPU. The GPU Backend interface and CPU Backend interface include... Figure 2 In the Backend; the GPU Runtime interface and CPU Runtime interface are included Figure 2 In the Runtime.

[0057] Step 102: Create a heterogeneous computing engine framework by calling the interface of at least one heterogeneous processing unit according to the data processing task. The heterogeneous computing engine framework includes at least one data input end, at least one heterogeneous processing unit, and at least one data output end.

[0058] Understandably, different algorithm modules have corresponding high-efficiency task types. For example, GPUs are efficient at processing image-type tasks, while DSPs are efficient at processing digital signal-type tasks. Therefore, in order to unleash the computing power of each algorithm module, a heterogeneous computer engine framework can be created by calling the interface of at least one heterogeneous processing unit according to the data processing task and the characteristics of each algorithm module.

[0059] It should be noted that, in this embodiment, the heterogeneous computing engine framework includes one or more data input terminals for inputting data and one or more data output terminals for outputting data, and also includes at least one heterogeneous processing unit. The at least one heterogeneous processing unit may encapsulate one or more algorithm modules. For example, the heterogeneous computing engine framework may include one heterogeneous processing unit, which encapsulates two algorithm modules of the same type; or, the heterogeneous computing engine framework may include two heterogeneous processing units, each of which encapsulates one algorithm module, and the two algorithm modules are of different types.

[0060] The connection relationships between the data input terminals, heterogeneous processing units, and data output terminals in the aforementioned heterogeneous computing engine framework can be matched and configured according to data processing tasks. Therefore, when the data processing task changes and requires expansion or modification of the algorithm implementation, the data processing task can be achieved by adjusting the heterogeneous computing engine framework. For example, the connection relationships in the heterogeneous computing engine framework can be used to achieve cascaded processing of multiple algorithm modules, or to reuse algorithm modules (e.g., reuse of related algorithms in image preprocessing and image postprocessing). Furthermore, the number of heterogeneous processing units in the heterogeneous computing engine framework can be determined based on the performance of a single heterogeneous processing unit, device compatibility, and the characteristics of the algorithm executed by that heterogeneous processing unit. This embodiment does not impose any limitations on the aforementioned heterogeneous computing engine framework.

[0061] Figure 3 This is a schematic diagram of a heterogeneous computing engine framework provided in an embodiment of this disclosure. For a clearer explanation, please refer to [link to relevant documentation]. Figure 3The heterogeneous computing engine framework includes a data input terminal and a data output terminal, as well as seven processes. Some processes encapsulate CPUs, while others encapsulate GPUs. If image processing is performed based on this heterogeneous computing engine framework, the image preprocessing (Process 2 and Process 3) and image postprocessing (Process 5 and Process 6) parts of the image processing process can be reused. Therefore, Process 2 can be the same as Process 5, and Process 3 can be the same as Process 6. Specifically, the data transmission direction in this heterogeneous computing engine framework is from the data input terminal to Process 1, from Process 1 to Process 2 and Process 4, from Process 2 to Process 3, from Process 3 and Process 1 to Process 4, from Process 4 to Process 5 and Process 7, from Process 5 to Process 6, from Process 6 and Process 4 to Process 7, and from Process 7 to the data output terminal.

[0062] Step 103: According to the heterogeneous computing engine framework, call the application programming interface (API) of the required algorithm module to execute the data processing task and output the task processing result to the target device.

[0063] After determining the heterogeneous computing engine framework through the above steps, the business processing results of data processing tasks can be obtained based on this framework. Specifically, the data processing tasks need to be executed by calling the application programming interface (API) corresponding to the required algorithm modules according to the heterogeneous computing engine framework, thereby achieving orderly scheduling of the algorithm module execution and outputting the task processing results to the target device. The target device can be selected according to the application scenario; this embodiment does not impose any restrictions, such as mobile phones, microcomputers, etc.

[0064] Taking a data processing task implemented through a Process as an example, the Process encapsulates both CPU and GPU. If the heterogeneous computing engine framework requires the use of the CPU, the CPU Backend interface is called to start the CPU, and the CPURuntime interface is called to control the CPU's operation. Similarly, if the heterogeneous computing engine framework requires the use and operation of the GPU, the GPU Backend interface and the GPU Runtime interface are called. It should be noted that the specific order of calling the application interfaces is determined according to the calling order of the corresponding algorithm modules in the heterogeneous computing engine framework, which will not be elaborated here.

[0065] In summary, the processing method based on a heterogeneous computing framework in this disclosure involves creating a corresponding application programming interface (API) for each algorithm module in at least one heterogeneous processing unit, wherein each heterogeneous processing unit is generated by encapsulating at least one algorithm module; creating a heterogeneous computing engine framework by calling the interface of at least one heterogeneous processing unit according to the data processing task, wherein the heterogeneous computing engine framework includes at least one data input end, at least one heterogeneous processing unit, and at least one data output end; executing the data processing task by calling the API of the required algorithm module according to the heterogeneous computing engine framework, and outputting the task processing result to the target device.

[0066] In related technologies, the corresponding algorithm is run directly on the algorithm modules such as CPU and GPU according to the data processing task. The specific algorithm implementation is connected to the data processing task. If it is necessary to expand or change the algorithm implementation, the implementation between the algorithm and the data processing task must also be modified synchronously. Therefore, it is not suitable for expansion, is inflexible, and has very low processing efficiency for large-scale algorithm systems.

[0067] In this embodiment, a heterogeneous computing engine framework is established through a heterogeneous processing unit based on the data processing task. The heterogeneous computing engine framework connects to the data processing task. If the algorithm implementation needs to be expanded or changed due to changes in the data processing task, the application programming interface between the heterogeneous computing engine framework and the data processing task does not need to be modified synchronously. Therefore, it is suitable for expansion and has high flexibility. It can improve the processing efficiency for large-scale algorithm systems. Furthermore, the heterogeneous computing engine framework integrates the characteristics of different algorithm modules in the heterogeneous processing unit, thereby leveraging the computing power advantages of the heterogeneous processing unit, improving computing efficiency, reducing computing time, and improving the performance of the heterogeneous processing unit, thus meeting the current business demand for computing power.

[0068] Meanwhile, the heterogeneous computing engine framework enables layered architecture design, modular design, algorithm cascading, and intelligent scheduling of hybrid computing, thereby improving the efficiency of the framework design.

[0069] Based on the above embodiments, in order to further improve the computing power of the heterogeneous computing framework, a method of block-based multi-backend parallel execution can be adopted, as detailed below: Figure 4 A flowchart illustrating another processing method based on a heterogeneous computing framework provided in this disclosure is shown below. Figure 4 As shown, the method also includes the following steps:

[0070] Step 401: The input data of the heterogeneous processing unit is segmented to generate multiple data blocks.

[0071] In this embodiment, to enable the algorithm module to run its suitable business and thus improve the processing efficiency of the heterogeneous processing unit on the input data, the input data is segmented. Optionally, the input data can be segmented according to its data type to obtain corresponding data blocks, and the data in the same segmented data block may belong to the same data type.

[0072] Step 402: Establish multiple computing threads corresponding to multiple data blocks in the heterogeneous processing unit. The multiple computing threads are used to execute multiple data blocks in parallel to generate multiple corresponding data processing results.

[0073] In this embodiment, multiple computing threads corresponding to data blocks can be established, thereby calling application interfaces (e.g., Backend interface and Runtime interface) based on the thread, and processing the data blocks based on the thread, generating corresponding data processing results for each data block.

[0074] Step 403: Merge and process multiple data processing results to generate output data corresponding to the heterogeneous processing unit.

[0075] After obtaining multiple data processing results, these multiple data processing results can be merged to generate output data corresponding to the heterogeneous processing unit.

[0076] For example, such as Figure 5As shown, the input data is segmented. Data related to graphics processing is segmented into a second data block, data related to digital signal processing is segmented into a third data block, and other types of data are segmented into a first data block. A first computation thread Thread1 is created to process the first data block. Thread1 calls the first call interface Backend1 and the first task execution interface Runtime1 to run the CPU and generate the first data processing result. A second computation thread Thread2 is created to process the second data block. Thread2 calls the second call interface Backend2 and the second task execution interface Runtime2 to run the GPU and generate the second data processing result. A third computation thread Thread3 is created to process the third data block. Thread3 calls the third call interface Backend3 and the third task execution interface Runtime3 to run the DSP and generate the third data processing result. It should be noted that Thread1, Thread2, and Thread3 can be executed in parallel within a process to improve the efficiency of input data processing. Furthermore, the first, second, and third data processing results are merged to obtain the output data.

[0077] In summary, the processing method based on a heterogeneous computing framework in this embodiment can divide the input data into blocks and establish computing threads corresponding to the data blocks, thereby further improving the hardware processing efficiency and reducing the processing time.

[0078] In another alternative implementation, a more granular processing method than the previous implementation can be used, employing a multi-task, multi-backend parallel approach, as detailed below: Figure 6 A flowchart illustrating another processing method based on a heterogeneous computing framework provided in this disclosure embodiment is shown below. Figure 6 As shown, the method also includes the following steps:

[0079] Step 601: Identify multiple subtasks corresponding to the data processing task, and create a corresponding sub-flowchart for each subtask.

[0080] In this embodiment, in order to improve the processing efficiency of the heterogeneous processing unit on the input data, the data processing task is subdivided. Optionally, the data processing task can be subdivided according to the business type. After subdivision, multiple sub-tasks can be obtained, and a corresponding sub-flowchart can be established for each sub-task. The number of heterogeneous processing units in the sub-task flowchart, as well as the number and type of algorithm modules in each heterogeneous processing unit, are not limited in this embodiment. Those skilled in the art can design the sub-flowchart according to the processing capability of the heterogeneous processing unit and the complexity of the sub-task.

[0081] Step 602: At least one data input terminal is simultaneously input into multiple sub-flowcharts corresponding to multiple sub-tasks, wherein the multiple sub-flowcharts are used to execute heterogeneous computing in parallel to generate multiple sub-task results.

[0082] In this embodiment, at least one data input terminal can be simultaneously input into the aforementioned multiple sub-flowcharts, thereby performing heterogeneous computation based on each sub-flowchart to generate multiple sub-task results.

[0083] Step 603: Connect the results of multiple subtasks to the data output terminal, whereby the data output terminal is used to merge the results of multiple subtasks.

[0084] In this embodiment, the results of multiple subtasks are merged through the data output terminal to obtain the output data.

[0085] For example, see Figure 7 Assuming the objective task is to acquire images and perform face recognition, this objective task is divided into three subtasks: image denoising, image feature extraction, and processing of the acquired digital signals. Therefore, a first sub-flowchart is established for image denoising, where the Process component encapsulates a CPU; a second sub-flowchart is established for image feature extraction, where the Process component encapsulates a GPU; and a third sub-flowchart is established for digital signal processing, where the Process component encapsulates a DSP. The acquired data is input into these three sub-flowcharts, and heterogeneous computation is performed in parallel according to the corresponding sub-flowcharts, generating the results for the first subtask, the second subtask, and the third subtask. The data output terminal then merges these three subtask results to obtain the output data.

[0086] In summary, the processing method based on a heterogeneous computing framework in this embodiment can divide the target task into multiple subtasks and establish a corresponding sub-flowchar for each subtask, thereby further improving the hardware processing efficiency and reducing the processing time.

[0087] Based on the above embodiments, it is also possible to insert custom algorithm nodes into the heterogeneous computing engine framework, specifically including:

[0088] Custom algorithm nodes are inserted into the heterogeneous computing engine framework. These nodes connect to either the data input or the output of the heterogeneous processing unit. The custom algorithm nodes perform calculations on the data provided by the data input or the output of the heterogeneous processing unit according to the custom algorithm, and then feed the results back to the next node connected to the data input or the output of the heterogeneous processing unit. Custom algorithms include algorithms written by the user according to their needs, and algorithms selected by the user from a range of provided algorithms.

[0089] Examples are given below. Figure 8 This is a schematic diagram illustrating the insertion of a custom algorithm node according to an embodiment of this disclosure, as shown below. Figure 8 As shown, a first custom algorithm node is inserted between the data input terminal and the first heterogeneous processing unit, and a second custom algorithm node is inserted between the first and second heterogeneous processing units. During heterogeneous computation, data is input from the data input terminal, processed by the first custom algorithm node, input into the first heterogeneous processing unit, processed by the first heterogeneous processing unit, input into the second custom algorithm node, processed by the second custom algorithm node, and input into the second heterogeneous processing unit, where it continues processing.

[0090] Optionally, it is also possible to insert location termination nodes in the heterogeneous computing engine framework, specifically including:

[0091] Insert a position termination node into the heterogeneous computing engine framework. The position termination node is connected to the output of the heterogeneous processing unit. The position termination node is used to stop the processing node after the output of the heterogeneous processing unit from continuing to calculate, and outputs the data provided by the output of the heterogeneous processing unit as the processing result.

[0092] For example, the following is an illustration. Figure 9 This is a schematic diagram of an insertion position termination node provided in an embodiment of the present disclosure, as shown below. Figure 9 As shown, if the processing result of the second heterogeneous processing unit needs to be output after the second heterogeneous processing unit, a termination node can be connected to the output end of the second heterogeneous processing unit. During heterogeneous computation, data is input from the data input end, processed by the first heterogeneous processing unit, and then input into the second heterogeneous processing unit. After processing by the second heterogeneous processing unit, the data output by the second heterogeneous processing unit is output as the processing result.

[0093] Understandably, custom algorithm nodes and location termination nodes can also be inserted simultaneously into a heterogeneous computing engine framework, as illustrated below. Figure 10 This is a schematic diagram illustrating the insertion of a custom algorithm node and a position termination node, as provided in an embodiment of this disclosure. Figure 10 As shown, a custom algorithm node is inserted between the data output terminal and the first heterogeneous processing unit, and the processing result of the first heterogeneous processing unit is output after the first heterogeneous processing unit. During heterogeneous computing, after data is input from the data input terminal, it is processed by the custom algorithm node and then input into the first heterogeneous processing unit. The first heterogeneous processing unit processes the data and outputs the data as the processing result.

[0094] In summary, the processing method based on the heterogeneous computing framework in this disclosure can insert custom algorithm nodes and / or position termination nodes into the heterogeneous computing engine framework. Users can flexibly insert functions that meet their own needs or scenario requirements, and flexibly determine the output nodes of the computing framework, thereby improving the scalability of the heterogeneous computing framework and making the scenarios applicable to the heterogeneous computing framework more diverse.

[0095] Figure 11 This is a schematic diagram of a processing device based on a heterogeneous computing framework, provided as an embodiment of this disclosure. This device can be implemented by software and / or hardware and is generally integrated into an electronic device. For example... Figure 11 As shown, the device includes:

[0096] The first creation module 1101 is used to create a corresponding application programming interface (API) for each algorithm module in at least one heterogeneous processing unit, wherein each heterogeneous processing unit is generated by encapsulating at least one algorithm module;

[0097] The second creation module 1102 is used to create a heterogeneous computing engine framework by calling the interface of at least one heterogeneous processing unit according to the data processing task. The heterogeneous computing engine framework includes at least one data input terminal, at least one heterogeneous processing unit, and at least one data output terminal.

[0098] The acquisition module 1103 is used to call the application programming interface (API) of the required algorithm module according to the heterogeneous computing engine framework to execute the data processing task and output the task processing result to the target device.

[0099] Optionally, the first creation module 1101 is used for:

[0100] Create a calling interface and a task execution interface corresponding to each algorithm module, wherein the algorithm module includes any one or more combinations of: a central processing unit module (CPU), a digital signal processing module (DSP), an image processor module (GPU), an application-specific integrated circuit module (ASIC), and a field-programmable gate array module (FPGA).

[0101] Optionally, the device further includes:

[0102] The segmentation module is used to segment the input data of the heterogeneous processing unit to generate multiple data blocks;

[0103] The first establishment module is used to establish multiple computing threads corresponding to the multiple data blocks in the heterogeneous processing unit, wherein the multiple computing threads are used to execute the multiple data blocks in parallel to generate multiple corresponding data processing results;

[0104] The generation module is used to merge and process the multiple data processing results to generate output data corresponding to the heterogeneous processing unit.

[0105] Optionally, the device further includes:

[0106] The second establishment module is used to determine multiple sub-tasks corresponding to the data processing task, and to establish a corresponding sub-flowchar for each sub-task.

[0107] An input module is used to simultaneously input the at least one data input terminal into multiple sub-flowcharts corresponding to the multiple sub-tasks, wherein the multiple sub-flowcharts are used to perform heterogeneous computing in parallel to generate multiple sub-task results;

[0108] An output module is used to connect the results of the multiple subtasks to the data output terminal, wherein the data output terminal is used to merge the results of the multiple subtasks.

[0109] Optionally, the device further includes:

[0110] The first insertion module is used to insert a custom algorithm node into the heterogeneous computing engine framework. The custom algorithm node is connected to the data input terminal or the output terminal of the heterogeneous processing unit. The custom algorithm node is used to perform calculations on the data provided by the data input terminal or the output terminal of the heterogeneous processing unit according to the custom algorithm, and feed back the calculated result to the next node connected to the data input terminal or the output terminal of the heterogeneous processing unit.

[0111] Optionally, the device further includes:

[0112] The second insertion module is used to insert a position termination node in the heterogeneous computing engine framework. The position termination node is connected to the output end of the heterogeneous processing unit. The position termination node is used to stop the processing nodes after the output end of the heterogeneous processing unit from continuing to calculate, and outputs the data provided by the output end of the heterogeneous processing unit as the processing result.

[0113] The processing apparatus based on a heterogeneous computing framework provided in this disclosure can execute the processing method based on a heterogeneous computing framework provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects of executing the method.

[0114] To implement the above embodiments, this disclosure also proposes a computer program product, including a computer program / instructions, which, when executed by a processor, implements the processing method based on a heterogeneous computing framework as described in the above embodiments.

[0115] Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure.

[0116] The following is a detailed reference. Figure 12 The diagram illustrates a structural schematic suitable for implementing the electronic device 1200 in the embodiments of this disclosure. The electronic device 1200 in the embodiments of this disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 12 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0117] like Figure 12 As shown, the electronic device 1200 may include a processing unit (e.g., a central processing unit, a graphics processor, etc.) 1201, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1202 or a program loaded from a storage device 1208 into a random access memory (RAM) 1203. The RAM 1203 also stores various programs and data required for the operation of the electronic device 1200. The processing unit 1201, ROM 1202, and RAM 1203 are interconnected via a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.

[0118] Typically, the following devices can be connected to I / O interface 1205: input devices 1206 including, for example, a touchscreen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 1207 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1208 including, for example, magnetic tape, hard disk, etc.; and communication devices 1209. Communication device 1209 allows electronic device 1200 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 12An electronic device 1200 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0119] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 1209, or installed from storage device 1208, or installed from ROM 1202. When the computer program is executed by processing device 1201, it performs the functions defined in the processing method based on a heterogeneous computing framework according to embodiments of this disclosure.

[0120] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0121] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.

[0122] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0123] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to:

[0124] A corresponding application programming interface (API) is created for each algorithm module in at least one heterogeneous processing unit, wherein each heterogeneous processing unit is generated by encapsulating at least one algorithm module. A heterogeneous computing engine framework is created by calling the interface of at least one heterogeneous processing unit according to the data processing task. The heterogeneous computing engine framework includes at least one data input end, at least one heterogeneous processing unit, and at least one data output end. The data processing task is executed by calling the API of the required algorithm module according to the heterogeneous computing engine framework, and the task processing result is output to the target device. In this embodiment, a heterogeneous computing engine framework is established through heterogeneous processing units according to the data processing task. The heterogeneous computing engine framework is used to connect with the data processing task. If the algorithm implementation needs to be expanded or changed due to changes in the data processing task, the corresponding changes can be met by adjusting the heterogeneous computing engine framework. Therefore, it is suitable for expansion and has strong flexibility. It can improve the processing efficiency for large-scale algorithm systems. Furthermore, the heterogeneous computing engine framework integrates the characteristics of different algorithm modules in the heterogeneous processing unit, thereby leveraging the computing power advantages of the heterogeneous processing unit, improving computing efficiency, reducing computing time, and improving the performance of the heterogeneous processing unit, thus meeting the current business demand for computing power. Meanwhile, the heterogeneous computing engine framework enables layered architecture design, modular design, algorithm cascading, and intelligent scheduling of hybrid computing, thereby improving the efficiency of the framework design.

[0125] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including but not limited to object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0126] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0127] The units described in the embodiments of this disclosure can be implemented in software or hardware. The names of the units are not, in some cases, intended to limit the specific unit.

[0128] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0129] In the context of this disclosure, a machine-readable medium can 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. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0130] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.

[0131] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0132] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.

Claims

1. A processing method based on a heterogeneous computing framework, characterized in that, include: A corresponding application programming interface (API) is created for each algorithm module in at least one heterogeneous processing unit, wherein each heterogeneous processing unit is generated by encapsulating multiple algorithm modules, and the multiple algorithm modules are of at least two types. A heterogeneous computing engine framework is created by calling the interface of at least one of the heterogeneous processing units according to the data processing task. The heterogeneous computing engine framework includes at least one data input end, at least one of the heterogeneous processing units, and at least one data output end. The computing engine framework includes an algorithm module that is called in parallel. The heterogeneous computing engine framework calls the application programming interface (API) of the required algorithm module to execute the data processing task and outputs the task processing result to the target device.

2. The method according to claim 1, characterized in that, The step of creating a corresponding application programming interface (API) for each algorithm module in at least one heterogeneous processing unit includes: Create a calling interface and a task execution interface corresponding to each algorithm module, wherein the algorithm module includes any one or more combinations of: a central processing unit module (CPU), a digital signal processing module (DSP), an image processor module (GPU), an application-specific integrated circuit module (ASIC), and a field-programmable gate array module (FPGA).

3. The method according to claim 1, characterized in that, Also includes: The input data of the heterogeneous processing unit is segmented to generate multiple data blocks; In the heterogeneous processing unit, multiple computing threads corresponding to the multiple data blocks are established, wherein the multiple computing threads are used to perform parallel processing on the multiple data blocks to generate multiple corresponding data processing results; The multiple data processing results are merged and processed to generate output data corresponding to the heterogeneous processing unit.

4. The method according to claim 1, characterized in that, Also includes: Identify multiple subtasks corresponding to the data processing task, and establish a corresponding sub-flowchar for each subtask; The at least one data input terminal is simultaneously input into multiple sub-flowcharts corresponding to the multiple sub-tasks, wherein the multiple sub-flowcharts are used to execute heterogeneous computing in parallel to generate multiple sub-task results; The results of the multiple subtasks are all connected to the data output terminal, wherein the data output terminal is used to merge the results of the multiple subtasks.

5. The method according to any one of claims 1-4, characterized in that, Also includes: A custom algorithm node is inserted into the heterogeneous computing engine framework. The custom algorithm node is connected to the data input terminal or the output terminal of the heterogeneous processing unit. The custom algorithm node is used to perform calculations on the data provided by the data input terminal or the output terminal of the heterogeneous processing unit according to the custom algorithm, and feed back the calculated result to the next node connected to the data input terminal or the output terminal of the heterogeneous processing unit.

6. The method according to any one of claims 1-4, characterized in that, Also includes: A position termination node is inserted into the heterogeneous computing engine framework. The position termination node is connected to the output of the heterogeneous processing unit. The position termination node is used to stop the processing nodes after the output of the heterogeneous processing unit from continuing to calculate, and outputs the data provided by the output of the heterogeneous processing unit as the processing result.

7. A processing device based on a heterogeneous computing framework, characterized in that, include: The first creation module is used to create a corresponding application programming interface (API) for each algorithm module in at least one heterogeneous processing unit, wherein each heterogeneous processing unit is generated by encapsulating multiple algorithm modules, and the multiple algorithm modules are of at least two types. The second creation module is used to create a heterogeneous computing engine framework by calling the interface of at least one heterogeneous processing unit according to the data processing task. The heterogeneous computing engine framework includes at least one data input end, at least one heterogeneous processing unit, and at least one data output end. The computing engine framework includes an algorithm module that is called in parallel. The acquisition module is used to call the application programming interface (API) of the required algorithm module according to the heterogeneous computing engine framework to execute the data processing task and output the task processing result to the target device.

8. An electronic device, characterized in that, The electronic device includes: processor; Memory used to store the processor's executable instructions; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the processing method based on a heterogeneous computing framework as described in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the processing method based on a heterogeneous computing framework as described in any one of claims 1-6.

10. A computer program product, characterized in that, The computer program product includes a computer program / instruction, which, when executed by a processor, implements the processing method based on a heterogeneous computing framework as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Task processing method based on heterogeneous computing and software and hardware framework system

    CN111258744A