Data processing method and device, electronic equipment and storage medium

By selecting key nodes and paths in the data flow graph, the problem of excessive processor resource consumption by the data flow graph is solved, thus improving the computing speed of electronic devices.

CN114840401BActive Publication Date: 2026-03-31BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-29
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

When data flow graphs are deployed on electronic devices, they consume too much computing resources from processors that are used for accelerated computing, resulting in slower computing speeds.

Method used

By acquiring the performance metrics of each node in the target data flow graph, key nodes and paths that meet preset conditions are selected, and the key paths are executed on the target executor to avoid non-critical paths consuming resources.

Benefits of technology

This effectively reduces the resource consumption of the data flow graph on the target executor and improves the processor's execution speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114840401B_ABST
    Figure CN114840401B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a data processing method and device, electronic equipment and storage medium. The method comprises: obtaining performance index information corresponding to each node in a target data flow graph corresponding to a target application; the target data flow graph comprises nodes and links between data flows among the nodes, and the target data flow graph is used to describe a logical operation process of data among the nodes and the links between the data flows among the nodes; in each node, a key node whose performance index information meets a preset performance index condition is selected; in the links between the data flows among the nodes, a key path corresponding to the key node is selected, and the key path is executed on a target executor. In the technical scheme provided by the present disclosure, by executing the key path on the target executor, other nodes except the key path in the target data flow graph can be avoided to be executed on the target executor, the resource occupation of the target data flow graph on the target executor is effectively reduced, and the execution speed of the target executor is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data processing technology, and in particular to data processing methods, apparatus, electronic devices and storage media. Background Technology

[0002] Data Flow Diagram (DFD) is a tool used in structured analysis methods. It graphically depicts the flow and processing of data in a system. DFDs express the logical functions of a system, the logical flow of data within the system, and the logical transformation process in a graphical way.

[0003] Currently, with the development of artificial intelligence technology, deploying machine learning models on electronic devices has become a trend. After the machine learning model is trained, it is submitted to the electronic device in the form of a data flow graph. The electronic device parses the data flow graph and allocates computing resources to each node in the data flow graph in the processor used for accelerated computing. However, the complex structure of the data flow graph will consume a lot of computing resources in the processor used for accelerated computing, thus reducing the computing speed of the processor. Summary of the Invention

[0004] This disclosure provides a data processing method, apparatus, electronic device, and storage medium to at least solve the problem in related technologies where data flow graphs consume significant computing resources of the processor used for accelerated computing, thus reducing the computing speed of the processor. The technical solution of this disclosure is as follows:

[0005] According to a first aspect of the present disclosure, a data processing method is provided, comprising:

[0006] Obtain the performance index information corresponding to each node in the target data flow graph of the target application; the target data flow graph includes nodes and the links of data flow between the nodes, and the target data flow graph is used to describe the logical operation process of data between the nodes and the links of data flow between the nodes;

[0007] Among these nodes, select the key nodes whose performance index information meets the preset performance index conditions;

[0008] In the data flow link between the nodes, the critical path corresponding to the critical node is selected, and the critical path is executed on the target executor.

[0009] Optionally, in the data flow link between the nodes, the critical path corresponding to the critical node is selected, including:

[0010] In the data flow link between the nodes, select the data propagation path where the key node is located;

[0011] In the data propagation path, a key path corresponding to a key node whose path length meets a preset path length condition is selected; the preset path length condition includes the maximum value of the path length or the path length being greater than a set value.

[0012] Optionally, obtaining the performance metric information corresponding to each node in the target data flow graph corresponding to the target application includes:

[0013] For each node in the target data flow graph corresponding to the target application:

[0014] Determine the associated nodes corresponding to the node, and there is a data input relationship or a data output relationship between the node and the associated nodes;

[0015] Determine the target metrics between the associated nodes and the nodes; the target metrics are used to indicate the execution time or computational complexity of data between nodes.

[0016] Based on the target metric, determine the performance metric information corresponding to the node in the target data flow graph.

[0017] Optionally, determining the performance indicator information corresponding to the node in the target data flow graph based on the target indicator includes:

[0018] The sum of the target metrics between the associated nodes and the nodes is determined as the performance metric information corresponding to the node.

[0019] Optionally, determining the performance indicator information corresponding to the node in the target data flow graph based on the target indicator includes:

[0020] Determine the preset influence coefficient corresponding to the associated node;

[0021] The calculation results of the target indicators between the associated nodes and the preset influence coefficients are determined as the performance indicator information corresponding to the nodes.

[0022] Optionally, the method further includes:

[0023] Obtain a complete data flow graph; the complete data flow graph includes all nodes corresponding to the target application and the links of data flow between all nodes, and the complete data flow graph is used to describe the logical operation process of data between all nodes and the links of data flow between all nodes;

[0024] The complete data flow graph is divided to obtain at least two target data flow graphs.

[0025] Optionally, the method further includes:

[0026] A memory resource sharing pool is set up, which consists of executors corresponding to the target data flow graph. Different executors share memory data, and the executors include the target executor.

[0027] According to a second aspect of the present disclosure, a data processing apparatus is provided, comprising:

[0028] The information acquisition module is configured to acquire the performance index information corresponding to each node in the target data flow graph of the target application. The target data flow graph includes nodes and the links of data flow between the nodes. The target data flow graph is used to describe the logical operation process of data between the nodes and the links of data flow between the nodes.

[0029] The node determination module is configured to select key nodes whose performance index information meets preset performance index conditions from among the nodes.

[0030] The path determination module is configured to select the critical path corresponding to the critical node in the data flow link between the nodes, and execute the critical path on the target executor.

[0031] Optionally, the path determination module includes:

[0032] The first determining unit is configured to select the data propagation path where the key node is located in the data flow link between the nodes;

[0033] The second determining unit is configured to select, in the data propagation path, the critical path corresponding to the critical node whose path length meets the preset path length condition; the preset path length condition includes the maximum value of the path length or the path length being greater than a set value.

[0034] Optionally, the information acquisition module includes:

[0035] The third determining unit is configured to, for each node in the target data flow graph corresponding to the target application, determine the associated node corresponding to the node, wherein there is a data input relationship or a data output relationship between the node and the associated node;

[0036] The fourth determining unit is configured to determine the target metric between the associated node and the node; the target metric is used to indicate the execution time or computational complexity of data between the nodes;

[0037] The fifth determining unit is configured to determine the performance indicator information corresponding to the node in the target data flow graph based on the target indicator.

[0038] Optionally, the fifth determining unit is configured to determine the sum of the target indicators between the associated node and the node as the performance indicator information corresponding to the node.

[0039] Optionally, the fifth determining unit is configured to determine the preset influence coefficient corresponding to the associated node; and to determine the calculation result of the target index between the associated node and the node and the preset influence coefficient as the performance index information corresponding to the node.

[0040] Optionally, the apparatus further includes: a flow graph partitioning module;

[0041] The flow graph partitioning module is configured to obtain a complete data flow graph; the complete data flow graph includes all nodes corresponding to the target application and the links of data flow between all nodes, and the complete data flow graph is used to describe the logical operation process of data between all nodes and the links of data flow between all nodes; the complete data flow graph is partitioned to obtain at least two target data flow graphs.

[0042] Optionally, the device further includes:

[0043] The shared processing module is configured to set up a memory resource sharing pool, which consists of executors corresponding to the target data flow graph. Different executors share memory data, and the executors include the target executor.

[0044] According to a third aspect of the present disclosure, an electronic device is provided, comprising:

[0045] processor;

[0046] Memory used to store the processor's executable instructions;

[0047] The processor is configured to execute the instructions to implement the data processing method as described in the first aspect.

[0048] According to a fourth aspect of the present disclosure, a storage medium is provided such that, when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the data processing method as described in the first aspect.

[0049] According to a fifth aspect of the present disclosure, a computer program product is provided, the computer program product including readable program code that, when executed by a processor of an electronic device, enables the electronic device to perform the data processing method as described in the first aspect.

[0050] The technical solutions provided by the embodiments of this disclosure bring at least the following beneficial effects:

[0051] This disclosure, after obtaining the target data flow graph, determines the performance indicator information corresponding to each node in the target data flow graph. The target data flow graph consists of nodes and the links of data flow between nodes. This target data flow graph describes the logical operation process between data nodes and the links of data flow between nodes. The performance indicator information is data used to characterize the performance of nodes; different nodes can correspond to different performance indicator information. Further, among each node, key nodes whose performance indicator information meets preset performance indicator conditions are selected. Then, in the links of data flow between nodes, the critical paths corresponding to the key nodes are selected. The selected critical paths are a subset of all paths in the target data flow graph. By executing the critical paths on the target executor, execution of other nodes outside the critical paths in the target data flow graph on the target executor can be avoided, effectively reducing the resource consumption of the target data flow graph on the target executor and ensuring the execution speed of the target executor.

[0052] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0053] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.

[0054] Figure 1 This is a flowchart illustrating a data processing method according to an exemplary embodiment. Figure 1 ;

[0055] Figure 2 This is a schematic diagram of a target data flow graph in a data processing method according to an exemplary embodiment;

[0056] Figure 3 This is a flowchart illustrating a data processing method according to an exemplary embodiment. Figure 2 ;

[0057] Figure 4 This is a flowchart illustrating a data processing method according to an exemplary embodiment. Figure 3 ;

[0058] Figure 5 This is a block diagram illustrating a data processing apparatus according to an exemplary embodiment;

[0059] Figure 6 This is a block diagram illustrating an electronic device according to an exemplary embodiment. Detailed Implementation

[0060] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.

[0061] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0062] Figure 1 This is a flowchart illustrating a data processing method according to an exemplary embodiment, including the following steps.

[0063] In step S11, the performance index information corresponding to each node in the target data flow graph corresponding to the target application is obtained; the target data flow graph includes nodes and the links of data flow between the nodes, and the target data flow graph is used to describe the logical operation process of data between the nodes and the links of data flow between the nodes.

[0064] In this step, the type of target application is not specifically limited. For example, the target application can be a video application, instant messaging application, browser application, educational application, live streaming application, etc. The target application can correspond to a machine learning model that performs a certain task. The machine learning model is submitted to an electronic device, such as a mobile terminal, in the form of a data flow graph. Thus, a target data flow graph corresponding to the target application will exist on the electronic device. The target data flow graph consists of nodes and the links of data flow between nodes. Nodes represent data processing operations, and different nodes can correspond to the same or different data processing operations. Specifically, it includes input nodes, processing nodes, and output nodes. Processing nodes include, but are not limited to, addition operations, multiplication operations, or operations that initialize variables. The links of data flow between nodes represent the dependencies between data, facilitating the transfer of data values. For example, the output of one node becomes the input of another node, and there is a flow of tensors between two nodes. In other words, the target data flow graph describes the logical operation process of data between nodes and the links of data flow between nodes.

[0065] Each node in the target data flow graph has its own corresponding performance metric information, which is data used to characterize the node's performance. Specifically, the performance metric information can be data about computational complexity or execution time. After obtaining the performance metric information corresponding to each node in the target data flow graph, the node can be evaluated using this information.

[0066] In one embodiment, step S11, obtaining performance metric information corresponding to each node in the target data flow graph corresponding to the target application, includes:

[0067] In step S111, for each node in the target data flow graph corresponding to the target application: determine the associated node corresponding to the node, and there is a data input relationship or a data output relationship between the node and the associated node.

[0068] In this step, different nodes have different input nodes and output nodes. Therefore, based on the data flow links between nodes in the target data flow graph, the associated nodes that have data input or data output relationships with the nodes can be determined.

[0069] In one possible implementation, where the associated node is a data input node, determining the associated node corresponding to each node specifically involves determining all the data input nodes corresponding to each node. For example, there exist... Figure 2 The target data flow graph, in which letters A to G represent nodes A to G respectively, the lines connecting the nodes represent the data flow links between them, and the direction of the arrows indicates the direction of data flow. Figure 2 Node B's data input node is node A, meaning node A is an associated node of node B; Node C's data input nodes are nodes A and B, meaning nodes A and B are associated nodes of node C; Node D's data input nodes are nodes A, B, and C, meaning nodes A, B, and C are associated nodes of node D; Node E's data input node is node A, meaning node A is an associated node of node E; Node F's data input nodes are nodes A and E, meaning nodes A and E are associated nodes of node F; Node G's data input nodes are nodes A through F, meaning nodes A through F are all associated nodes of node G.

[0070] In one possible implementation, where the associated node is a data output node, determining the associated node corresponding to each node specifically means determining the data output node corresponding to each node. For example, there exist... Figure 2The target data flow graph states that node A's data output nodes are nodes B through G, meaning nodes B through G are associated nodes of node A; node B's data output nodes are nodes C, D, and G, meaning nodes C, D, and G are associated nodes of node B; node C's data output nodes are nodes D and G, meaning nodes D and G are associated nodes of node C; node D's data output node is node G, meaning node G is associated node of node D; node E's data output nodes are nodes F and G, meaning nodes F and G are associated nodes of node E; and node F's data output node is node G, meaning node G is associated node of node E.

[0071] In step S112, a target metric between the associated node and the node is determined; the target metric is used to indicate the execution time or computational complexity of data between nodes.

[0072] In this step, target metrics are set in advance. These target metrics are used to indicate the performance between a node and its associated nodes. Specifically, target metrics can be used to indicate the execution time or computational complexity of data between nodes.

[0073] In one possible implementation, when the associated node is a data input node, the target metric for each associated node and node Vi is the computational complexity or execution time from each Vi's data input node to Vi. For example, Figure 2 The data input nodes for node D are nodes A, B, and C. The execution time from node A to node D, the execution time from node B to node D, and the execution time from node C to node D are determined. The first execution time, the second execution time, and the third execution time are the determined target indicators.

[0074] In one possible implementation, when the associated nodes are data output nodes, the target metric for node Vi and each associated node is the computational complexity or execution time from data originating from Vi to each data output node. For example, node C has data output nodes D and G. The target metric is determined as follows: the fourth execution time from node C to node D, and the fifth execution time from node C to node G. The fourth and fifth execution times are the determined target metrics.

[0075] In step S113, based on the target metric, the performance metric information corresponding to the node in the target data flow graph is determined.

[0076] In this step, for each node, the associated nodes and the target metrics of that node are calculated to determine the performance metrics information corresponding to each node in the target data flow graph. In this embodiment, a connection is established between the associated nodes and the corresponding performance metrics information of the node. By fully considering the associated nodes, the determined performance metrics information of the node better reflects the overall performance of the node, avoiding considering each node individually and severing the connections between nodes, thereby ensuring the accuracy of the determined node performance metrics information.

[0077] Optionally, determining the performance indicator information corresponding to the node in the target data flow graph based on the target indicator includes: determining the sum of the target indicators between the associated node and the node as the performance indicator information corresponding to the node. By determining the sum of the target indicators between the associated nodes and the node as the performance indicator information corresponding to each node, the connection between the target indicators of the associated nodes and the performance indicator information corresponding to the nodes can be established simply and quickly, ensuring the efficiency of determining the performance indicator information.

[0078] In one possible implementation, when the associated node is a data input node, the performance metric information of node Vi is the sum of the computational complexity or execution time of all input nodes of Vi to Vi. For example, determining... Figure 2 After calculating the first execution time from node A to node D, the second execution time from node B to node D, and the third execution time from node C to node D, the sum of the first execution time, the second execution time, and the third execution time is determined as the performance index information of node D. This performance index information can be called the next ranking.

[0079] In one possible implementation, when the associated node is a data output node, the performance metric information for node Vi is the sum of the computational complexity or execution time from the data originating from Vi to all output nodes. For example, determining... Figure 2 After the fourth execution time of the data from node C to node D and the fifth execution time of the data from node C to node G, the sum of the fourth and fifth execution times is determined as the performance index information of node D. This performance index information can be called the ranking.

[0080] Optionally, determining the performance indicator information corresponding to the node in the target data flow graph based on the target indicator includes: determining a preset influence coefficient corresponding to the associated node; and determining the calculation result of the target indicator between the associated node and the node and the preset influence coefficient as the performance indicator information corresponding to the node. By pre-determining the influence coefficients corresponding to different associated nodes, which reflect the importance of different associated nodes, the relationship between the target indicator of the associated node and the performance indicator information corresponding to the node is accurately established, ensuring the accuracy of the determined performance indicator information.

[0081] In one possible implementation, when the associated node is a data input node, the performance metric of node Vi is the weighted average of the computational complexity from all input nodes to Vi and a preset influence coefficient, or the performance metric of node Vi is the weighted average of the execution time from all input nodes to Vi and a preset influence coefficient. For example, determining... Figure 2 After determining the first execution time of data from node A to node D, the second execution time of data from node B to node D, and the third execution time of data from node C to node D, the first preset influence coefficient corresponding to node A, the second preset influence coefficient corresponding to node B, and the third preset influence coefficient corresponding to node C are determined. The sum of the first product of the first execution time and the first preset influence coefficient, the second product of the second execution time and the second preset influence coefficient, and the third product of the third execution time and the third preset influence coefficient is divided by 3 to obtain a weighted average value. This weighted average value is determined as the performance index information of node D.

[0082] In step S12, among the nodes, key nodes whose performance index information meets the preset performance index conditions are selected.

[0083] In this step, performance index conditions are preset, and each node is selected using these preset conditions. Key nodes with higher performance index information are selected, meaning those selected based on the preset performance index conditions have higher computational complexity and consume more computing resources. This embodiment does not limit the specific content of the preset performance index conditions. In one possible implementation, the preset performance index conditions include the maximum value of the performance index information or the performance index information being greater than a preset value.

[0084] Specifically, the performance metrics information corresponding to each node is sorted from largest to smallest. When the preset performance metric condition is the maximum value of the performance metric information, the node ranked first is selected as the key node, and the number of key nodes is one. When the preset performance metric condition is that the performance metric information is greater than a preset value, where the preset value can be a fixed setting value (i.e., a predetermined value), and the nodes whose performance metric information is greater than this value are selected as key nodes, multiple key nodes may be identified in this case; the preset value can also be a dynamic setting value, such as determining the preset value based on the value ranked in a preset position, in which case multiple key nodes can be identified.

[0085] In step S13, in the data flow link between the nodes, the critical path corresponding to the critical node is selected, and the critical path is executed on the target executor.

[0086] In this step, different nodes and links will form different data propagation paths. Figure 2 There are two different data propagation paths from node A to node G: data propagation path 1 and data propagation path 2. Data propagation path 1 consists of nodes A, B, C, D, and G, while data propagation path 2 consists of nodes A, E, F, and G. After identifying the critical nodes, the critical paths corresponding to these critical nodes are determined within the different data propagation paths. Since the critical nodes are selected from all nodes, they are a subset of all nodes in the target data flow graph. Further selection is made from the critical nodes across all data propagation paths to identify the critical paths corresponding to these critical nodes. Since the critical paths are a subset of all data propagation paths, when the target executor executes the critical paths, it avoids executing nodes outside the critical paths in the target data flow graph on the target executor, effectively reducing the resource consumption of the target data flow graph on the target executor and ensuring the execution speed of the target executor. The target executor is a processor in an electronic device used for accelerated computation, specifically a GPU (Graphics Processing Unit).

[0087] In one embodiment, step S13, selecting the critical path corresponding to the critical node in the data flow link between the nodes, includes:

[0088] In step S131, the data propagation path where the key node is located is selected in the data flow link between the nodes.

[0089] In step S132, in the data propagation path, a key path corresponding to a key node whose path length meets the preset path length condition is selected; the preset path length condition includes the maximum value of the path length or the path length being greater than a set value.

[0090] In this embodiment, the data propagation path of the key node is determined in the data flow link between nodes. Furthermore, within the data propagation path of the key node, the critical path corresponding to the key node whose path length meets the preset path length condition is determined.

[0091] Optionally, the preset path length condition can be the maximum path length, that is, the longest data propagation path in the data propagation path where the critical node is located is determined as the critical path. After accurately identifying the critical nodes using performance indicator information, the critical path is quickly and accurately determined by the maximum path length corresponding to the critical node. This effectively identifies the critical paths in the target data flow graph that consume a lot of computing resources. When the target executor executes the critical path, it avoids excessive consumption of the target executor, while ensuring that the critical paths in the target data flow graph that have a significant impact on the overall performance are executed.

[0092] Optionally, the preset path length condition can also be that the path length is greater than a set value. The set value can be preset or dynamically determined based on the current path length. For example, if there are multiple data propagation paths containing key nodes, these paths can be sorted in descending order of path length, and the length of the first preset path can be set as the set value. Thus, by using the preset path length condition, the data propagation paths containing key nodes can be effectively filtered, identifying the critical paths that consume a significant amount of computing resources from the target executor.

[0093] Specifically, after identifying the key node, if the associated node is a data input node, the predecessor node of the key node is identified to determine the data propagation path of the key node; if the associated node is a data output node, the successor node of the associated node is identified to determine the data propagation path of the key node.

[0094] For example, when the associated node is a data input node, such as Figure 2As shown, the performance metrics from node A to node G are determined. The performance metrics of node Vi are the sum of the computational complexity or execution time of all input nodes to Vi. Among nodes A to G, node G uses nodes A to F as data input nodes; therefore, node G has the largest performance metrics value, meeting the preset performance metric condition (maximum performance metrics value). Node G is selected as the critical node. The predecessor nodes of the critical node are determined as nodes D and F; the predecessor node of node F is determined as node E; the predecessor node of node E is determined as node A (source vertex); the predecessor node of node D is determined as node C; the predecessor node of node C is determined as node B; and the predecessor node of node B is determined as node A (source vertex). This determines two data propagation paths, one with a length of 5 and the other with a length of 3. The data propagation path with a length of 5 meets the preset path length condition (maximum path length), and is therefore determined as the critical path. Of course, data propagation paths that do not meet the preset path length condition can be further determined as non-critical paths.

[0095] In one possible application scenario, tflite (a machine learning model that can directly achieve functions such as speech recognition and video segmentation through mobile electronic devices) is installed on a mobile terminal. In this case, the target data flow graph corresponds to tflite. When running tflite on a mobile electronic device, the GPU is often used. However, the graphics processor also serves other functions, such as video and rendering. Therefore, there is a problem that when running tflite, it competes with other functions for GPU resources. The method provided in this embodiment determines the critical path in the target data flow graph corresponding to tflite and runs the critical path on the GPU. This can prevent excessive GPU usage and run the critical path that has the greatest impact on the performance of tflite on the GPU.

[0096] In the above embodiments, after obtaining the target data flow graph, the performance index information corresponding to each node in the target data flow graph is determined. The target data flow graph consists of nodes and the links of data flow between each node. This target data flow graph is used to describe the logical operation process of data between nodes and the links of data flow between nodes. The performance index information is data used to characterize the performance of nodes, and different nodes may correspond to different performance index information. Further, among each node, key nodes whose performance index information meets the preset performance index conditions are selected; then, in the links of data flow between nodes, the critical paths corresponding to the key nodes are selected. The selected critical paths are some paths among all paths in the target data flow graph. By executing the critical paths on the target executor, it is possible to avoid other nodes outside the critical paths in the target data flow graph from being executed on the target executor, effectively reducing the resource occupation of the target data flow graph on the target executor and ensuring the execution speed of the target executor.

[0097] Optionally, the target data flow graph is a one-step component of the complete data flow graph, i.e., as shown below. Figure 3 As shown, in one embodiment, the method further includes:

[0098] In step S14, a complete data flow graph is obtained; the complete data flow graph includes all nodes corresponding to the target application and the links of data flow between all nodes. The complete data flow graph is used to describe the logical operation process of data between all nodes and the links of data flow between all nodes; the complete data flow graph is divided to obtain at least two target data flow graphs.

[0099] In this embodiment, the complete data flow graph corresponds to the overall neural network of the trained machine learning model, including all nodes corresponding to the target application and the links in the data flow graph between all nodes. This complete data flow graph is used to describe the logical operation process of data in all nodes and the links in the data flow between all nodes. The complete data flow graph often includes a large number of nodes; therefore, it can be divided to obtain at least two target data flow graphs. Furthermore, the critical paths in each target data flow graph can be filtered out. By dividing the complete data flow graph, the critical paths in each target data flow graph can be quickly determined, reducing the concurrent branches in each target data flow graph to critical paths, effectively reducing the resource consumption of the target data flow graph on the target executor. It should be noted that this embodiment does not specifically limit the method or number of divisions of the complete data flow graph. Users can pre-set division rules and divide the complete data flow graph according to the preset rules to obtain at least two target data flow graphs.

[0100] Optionally, the target data flow diagram is the complete data flow diagram corresponding to the target application. Specifically, whether the target data flow diagram corresponds to the complete data flow diagram or a part of the complete data flow diagram can be selected by the user based on the actual application scenario.

[0101] In one embodiment, the method further includes:

[0102] In step S15, a memory resource sharing pool is set up. The memory resource sharing pool consists of executors corresponding to the target data flow graph. Different executors share memory data. The executors include the target executor.

[0103] In the above embodiments, a memory resource sharing pool is set up, and different executors within the memory resource sharing pool can share memory data. Thus, when the same content is executed in different executors, there is no need to copy data between different executors. Instead, the different executors can obtain the content by sharing memory data. Here, different executors represent different hardware in electronic devices. By setting up a memory resource sharing pool, zero-copy technology for different hardware devices is achieved, effectively reducing IO (Input / Output) overhead.

[0104] Figure 4 This is a flowchart illustrating a data processing method according to an exemplary embodiment, including the following steps:

[0105] In step 41, a complete data flow graph corresponding to the target application is obtained; the complete data flow graph is divided to obtain at least two target data flow graphs.

[0106] In this step, the complete data flow graph corresponding to the target application is first obtained. The structure of this complete data flow graph is complex. In order to quickly and accurately determine the critical path in the complete data flow graph, the complete data flow graph is divided to obtain at least two target data flow graphs. That is, the target data flow graph is a part of the complete data flow graph. It should be noted that the complete data flow graph can be divided more than once.

[0107] In step 42, a memory resource sharing pool is set up. The memory resource sharing pool consists of the executors corresponding to the complete data flow graph, and different executors share memory data.

[0108] In this step, to effectively reduce the I / O overhead between different executors, a memory resource sharing pool is set up. The executors in the memory resource sharing pool share memory data, so that when performing subsequent steps, data is transferred between different executors through sharing, avoiding data copying between different executors.

[0109] In step 43, for each of the target data flow graphs: determine the associated nodes corresponding to each node in the target data flow graph; determine the associated nodes and target indicators between the nodes corresponding to each node; and based on the target indicators, determine the performance indicator information corresponding to each node in the target data flow graph.

[0110] In this step, each target data flow graph is determined from the complete data flow graph. For each target data flow graph: the associated nodes corresponding to each node in the target data flow graph are determined; the target indicators between each node and its associated nodes are determined; and the sum of the target indicators between each node and its associated nodes is determined as the performance indicator information of that node.

[0111] In step 44, for each target data flow graph: among each node, select key nodes whose performance index information meets preset performance index conditions; in the data flow links between the nodes, select the data propagation path where the key node is located; in the data propagation path, select the key path corresponding to the key node whose path length meets preset path length conditions; execute the key path on the target executor.

[0112] The preset performance index conditions include the maximum value of the performance index information or the performance index information being greater than a first set value; the preset path length conditions include the maximum value of the path length or the path length being greater than a second set value; and the target executor is at least one of the executors corresponding to the complete data flow graph.

[0113] In this step, key nodes are selected based on preset performance metrics, and key paths are selected based on preset path length criteria. The selected key paths are a subset of all data propagation paths in the target data flow graph. By executing the key paths on the target executor, execution of nodes outside the key paths in the target data flow graph is avoided, effectively reducing the resource consumption of the target data flow graph on the target executor and ensuring the execution speed of the target executor. By identifying the key paths corresponding to each target data flow graph, multiple key paths with significant impact on overall performance are selected in the overall data flow graph. These key paths are then executed using the target executor, avoiding excessive executor usage. Furthermore, when different executors execute these paths, a shared memory approach is used to acquire data, effectively reducing the I / O overhead of different executors.

[0114] Figure 5 This is a block diagram illustrating a data processing apparatus according to an exemplary embodiment. The apparatus includes an information acquisition module 51, a node determination module 52, and a path determination module 53;

[0115] The information acquisition module 51 is configured to acquire the performance index information corresponding to each node in the target data flow graph of the target application. The target data flow graph includes nodes and the links of data flow between the nodes. The target data flow graph is used to describe the logical operation process of data between the nodes and the links of data flow between the nodes.

[0116] The node determination module 52 is configured to select key nodes whose performance index information meets preset performance index conditions from among the nodes.

[0117] The path determination module 53 is configured to select the critical path corresponding to the critical node in the data flow link between the nodes, and execute the critical path on the target executor.

[0118] In an exemplary embodiment of this disclosure, the path determination module includes:

[0119] The first determining unit is configured to select the data propagation path where the key node is located in the data flow link between the nodes;

[0120] The second determining unit is configured to select, in the data propagation path, the critical path corresponding to the critical node whose path length meets the preset path length condition; the preset path length condition includes the maximum value of the path length or the path length being greater than a set value.

[0121] In an exemplary embodiment of this disclosure, the information acquisition module includes:

[0122] The third determining unit is configured to, for each node in the target data flow graph corresponding to the target application, determine the associated node corresponding to the node, wherein there is a data input relationship or a data output relationship between the node and the associated node;

[0123] The fourth determining unit is configured to determine the target metric between the associated node and the node; the target metric is used to indicate the execution time or computational complexity of data between the nodes;

[0124] The fifth determining unit is configured to determine the performance indicator information corresponding to the node in the target data flow graph based on the target indicator.

[0125] In an exemplary embodiment of this disclosure, the fifth determining unit is configured to determine the sum of the target indicators between the associated node and the node as the performance indicator information corresponding to the node;

[0126] In an exemplary embodiment of this disclosure, the fifth determining unit is configured to determine a preset influence coefficient corresponding to the associated node; and to determine the calculation result of the target index between the associated node and the node and the preset influence coefficient as the performance index information corresponding to the node.

[0127] In an exemplary embodiment of this disclosure, the apparatus further includes: a flow graph partitioning module;

[0128] The flow graph partitioning module is configured to obtain a complete data flow graph; the complete data flow graph includes all nodes corresponding to the target application and the links of data flow between all nodes, and the complete data flow graph is used to describe the logical operation process of data between all nodes and the links of data flow between all nodes; the complete data flow graph is partitioned to obtain at least two target data flow graphs.

[0129] In an exemplary embodiment of this disclosure, the apparatus further includes:

[0130] The shared processing module is configured to set up a memory resource sharing pool, which consists of executors corresponding to the target data flow graph. Different executors share memory data, and the executors include the target executor.

[0131] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0132] Figure 6 This is a block diagram illustrating an electronic device according to an exemplary embodiment. For example, the electronic device 600 may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.

[0133] Reference Figure 6 The electronic device 600 may include one or more of the following components: a processing component 602, a memory 604, a power component 606, a multimedia component 608, an audio component 610, an input / output (I / O) interface 612, a sensor component 614, and a communication component 616.

[0134] Processing component 602 typically controls the overall operation of electronic device 600, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 602 may include one or more processors 620 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 602 may include one or more modules to facilitate interaction between processing component 602 and other components. For example, processing component 602 may include a multimedia module to facilitate interaction between multimedia component 608 and processing component 602.

[0135] Memory 604 is configured to store various types of data to support the operation of electronic device 600. Examples of this data include instructions for any application or method operating on electronic device 600, contact data, phonebook data, messages, pictures, videos, etc. Memory 604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0136] Power supply component 606 provides power to various components of electronic device 600. Power supply component 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 600.

[0137] Multimedia component 608 includes a screen that provides an output interface between the electronic device 600 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 608 includes a front-facing camera and / or a rear-facing camera. When the electronic device 600 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0138] Audio component 610 is configured to output and / or input audio signals. For example, audio component 610 includes a microphone (MIC) configured to receive external audio signals when electronic device 600 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 604 or transmitted via communication component 616. In some embodiments, audio component 610 also includes a speaker for outputting audio signals.

[0139] I / O interface 612 provides an interface between processing component 602 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.

[0140] Sensor assembly 614 includes one or more sensors for providing state assessments of various aspects of electronic device 600. For example, sensor assembly 614 can detect the on / off state of electronic device 600, the relative positioning of components such as the display and keypad of electronic device 600, changes in position of electronic device 600 or a component of electronic device 600, the presence or absence of user contact with electronic device 600, orientation or acceleration / deceleration of electronic device 600, and temperature changes of electronic device 600. Sensor assembly 614 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 614 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 614 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.

[0141] Communication component 616 is configured to facilitate wired or wireless communication between electronic device 600 and other devices. Electronic device 600 can access wireless networks based on communication standards, such as WiFi, carrier networks (such as 2G, 3G, 4G, or 6G), or combinations thereof. In one exemplary embodiment, communication component 616 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 616 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0142] In an exemplary embodiment, the electronic device 600 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the data processing method described above.

[0143] In an exemplary embodiment, a storage medium including instructions is also provided, which, when executed by a processor of a server, enables the server to perform the data processing method as described in any of the above method embodiments. Optionally, the storage medium may be a non-transitory computer-readable storage medium, such as a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device.

[0144] In an exemplary embodiment, a computer program product is also provided, comprising readable program code executable by a processor to perform the data processing method described above. Optionally, the program code may be stored in a storage medium of an electronic device, which may be a non-transitory computer-readable storage medium, such as a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device. Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0145] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A data processing method, characterized by, The method comprises: obtaining performance index information corresponding to each node in a target data flow graph corresponding to a target application; the target data flow graph comprises nodes and links of data flow between the nodes, and the target data flow graph is used to describe a logical operation process of data between the nodes and the links of data flow between the nodes; in the nodes, selecting key nodes whose performance index information meets a preset performance index condition; in the links of data flow between the nodes, selecting a key path corresponding to the key nodes, and executing the key path on a target executor; obtaining a complete data flow graph; the complete data flow graph comprises all nodes and links of data flow between all nodes corresponding to the target application, and the complete data flow graph is used to describe a logical operation process of data between the all nodes and the links of data flow between the all nodes; dividing the complete data flow graph to obtain at least two target data flow graphs.

2. The method of claim 1, wherein, In the links of data flow between the nodes, selecting a key path corresponding to the key nodes comprises: in the links of data flow between the nodes, selecting a data propagation path in which the key nodes are located; in the data propagation path, selecting a key path corresponding to a key node whose path length meets a preset path length condition; the preset path length condition comprises a maximum path length or a path length greater than a set value.

3. The method of claim 1, wherein, The method further comprises: setting a memory resource sharing pool, the memory resource sharing pool is composed of executors corresponding to the target data flow graph, memory data of different executors is shared, and the executors comprise the target executor. The method comprises: an information obtaining module configured to obtain performance index information corresponding to each node in a target data flow graph corresponding to a target application; the target data flow graph comprises nodes and links of data flow between the nodes, and the target data flow graph is used to describe a logical operation process of data between the nodes and the links of data flow between the nodes; ​ 4. The method of claim 3, wherein, ​ ​ ​ ​ 5. The method of claim 1, wherein, ​ ​ 6. A data processing apparatus, characterized by, ​ ​ A node determining module is configured to select a key node in the nodes, the key node meeting a preset performance index condition; A path determining module is configured to select a key path corresponding to the key node in a link of a data flow between the nodes, and execute the key path on a target executor; A flowchart dividing module is configured to obtain a complete data flowchart; The complete data flowchart includes all nodes corresponding to the target application and links of data flows between the all nodes, and is used to describe a logical operation process of data between the all nodes and the links of data flows between the all nodes; The complete data flowchart is divided to obtain at least two target data flowcharts.

7. An electronic device, comprising: Comprise: A processor; A memory for storing executable instructions of the processor; The processor is configured to execute the instructions to implement the data processing method of any one of claims 1 to 5.

8. A storage medium, characterized by When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device can execute the data processing method of any one of claims 1 to 5.

9. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the data processing method of any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method and equipment for determining key node

    CN106506188A