Model optimization and task processing method and device, electronic equipment and storage medium

By constructing a tree-shaped search graph and optimizing the node merging and concurrent operation of the deep learning model, the problem of time-consuming inference computing of deep learning models is solved, efficient model optimization and resource utilization are achieved, and the development process is simplified.

CN119272802APending Publication Date: 2025-01-07JINGDONG TECH HLDG CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310781079.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-28
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

In the inference calculation, the existing deep learning models are huge and time-consuming due to the increase in network width and depth. The existing inference acceleration methods rely on model or hardware optimization, have poor versatility and do not fully utilize equipment resources.

Method used

By constructing a tree-shaped search graph, optimizing model operator operation based on node merging and concurrent operation schemes, using branch bounding algorithms to find the global optimal solution, implementing model optimization, reducing memory access and computing time, and improving resource utilization.

Benefits of technology

It improves the model optimization effect, simplifies the optimization process, reduces the development complexity, improves computing efficiency and resource utilization, and achieves the acceleration of model inference.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119272802A_ABST
    Figure CN119272802A_ABST
Patent Text Reader

Abstract

The invention provides a model optimization and task processing method and device, electronic equipment and a storage medium. The model optimization method comprises the following steps: constructing a tree search graph according to a preset operator operation scheme of a preset task processing model; a current search node set is determined according to the current in-degree of each original node of the tree search graph, current degree expansion nodes of the tree search graph are constructed according to candidate operation schemes corresponding to each original node in the current search node set, and the candidate operation schemes comprise node merging operation and / or node concurrent operation; determining a local optimization node from the current degree expansion nodes according to the operation overhead of the global operation scheme corresponding to the current degree expansion nodes; determining a global optimization node according to a local optimization node determined from each degree expansion node; and optimizing a preset operator operation scheme according to a global operation scheme corresponding to the global optimization node. The optimization method is high in universality, simple and easy to implement, and hardware resources of equipment deployed by the model can be fully utilized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of deep learning technology, and in particular to a model optimization and task processing method, device, electronic device and storage medium. Background Art

[0002] With the development of deep learning technology, more and more deep learning models are being applied in different task processing. In order to pursue the accuracy of model processing tasks, the network of deep learning models has become wider and wider, and the number of network layers has become deeper and deeper, which has led to the overall model becoming larger and larger, and the model processing tasks (i.e. reasoning calculations) have taken longer and slower time, which has brought great difficulty to the real-time reasoning calculation of the model. In addition, the model is deployed on different devices and needs to meet the computing requirements of the model in the specified scenario. In order to meet the high-speed deep learning model reasoning on limited device resources, model reasoning acceleration is required.

[0003] In the process of implementing the present invention, the inventors found that the current solutions for accelerating model reasoning mainly rely on the optimization of the model operators themselves or on the optimization of the hardware devices. For example, acceleration is achieved by optimizing the matrices in the operators or optimizing the configurations of the hardware devices. These optimization methods increase the workload and complexity of development, require different optimization solutions to be designed for different operators, have poor versatility, and do not fully utilize the hardware resources of the devices on which the model is deployed. Summary of the invention

[0004] The embodiments of the present invention provide a model optimization and task processing method, device, electronic device and storage medium. The optimization method is versatile, simple, easy to implement, and can fully utilize the hardware resources of the device on which the model is deployed.

[0005] In a first aspect, the model optimization method provided by the embodiment of the present invention includes:

[0006] Constructing a tree search graph according to a preset operator operation scheme of a preset task processing model;

[0007] Determine a current search node set according to the current in-degree of each original node of the tree search graph, and construct a current-degree expansion node of the tree search graph according to the candidate operation schemes corresponding to each original node in the current search node set, wherein the candidate operation schemes include node merging operation and / or node concurrent operation;

[0008] Determine a local optimization node from the corresponding degree expansion node according to the operation cost of the global operation solution corresponding to the corresponding degree expansion node;

[0009] Determine a global optimization node according to the local optimization nodes determined from each degree expansion node;

[0010] The preset operator operation plan of the preset task processing model is optimized according to the global operation plan corresponding to the global optimization node to obtain the target task processing model.

[0011] In a second aspect, an embodiment of the present invention provides a task processing method, including:

[0012] Get the task data of the target task;

[0013] The task data is input into the target task processing model optimized by the model optimization method described in any embodiment of the present invention, and processed to obtain the processing result of the target task.

[0014] In a third aspect, the model optimization device provided by the embodiment of the present invention includes:

[0015] A graph construction module, used to construct a tree search graph according to a preset operator operation scheme of a preset task processing model;

[0016] A node expansion module, used to determine a current search node set according to the current in-degree of each original node of the tree search graph, and to construct a current-degree expansion node of the tree search graph according to the candidate operation schemes corresponding to each original node in the current search node set, wherein the candidate operation schemes include node merging operation and / or node concurrent operation;

[0017] A first determination module is used to determine a local optimization node from the corresponding degree expansion node according to the operation cost of the global operation solution corresponding to the corresponding degree expansion node;

[0018] A second determination module is used to determine a global optimization node according to the local optimization nodes determined from each degree expansion node;

[0019] The model optimization module is used to optimize the preset operator operation plan of the preset task processing model according to the global operation plan corresponding to the global optimization node to obtain the target task processing model.

[0020] In a fourth aspect, an embodiment of the present invention provides a task processing device, including:

[0021] A data acquisition module, used to acquire task data of a target task;

[0022] The task processing module is used to input the task data into the target task processing model optimized by the model optimization method described in any embodiment of the present invention, so as to obtain the processing result of the target task.

[0023] In a fifth aspect, an electronic device provided by an embodiment of the present invention comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the model optimization method as described in any embodiment of the present invention is implemented, or when the processor executes the program, the task processing method as described in any embodiment of the present invention is implemented.

[0024] In a sixth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the model optimization method as described in any embodiment of the present invention is implemented, or when the program is executed by a processor, the task processing method as described in any embodiment of the present invention is implemented.

[0025] The scheme of the embodiment of the present invention can construct a tree search graph based on the preset operator operation scheme of the model, the original nodes in the tree search graph correspond to the operators of the model, and the expanded nodes of the tree search graph are constructed according to the candidate node merging operation schemes and / or node concurrent operation schemes. The expanded nodes are used as the solution space of branch limits, and the solution space is searched step by step until the global optimization node is found, and the model operator is optimized based on the global operation scheme corresponding to the global optimization node (that is, the preset operator operation scheme of the preset task processing model is optimized); that is, a complete solution space is created according to the possible merging and / or concurrent operation schemes of the nodes (that is, the operators), and the global optimal solution can be found from the solution space by using the branch and bound algorithm, which ensures that the global optimal operator operation scheme can be found in the end, thereby improving the model optimization effect; by merging and / or merging nodes The development operation optimizes the operator operation plan of the model without considering the matrix situation in the operator. A general algorithm can be used to optimize different operators. There is no need to design different optimization plans for different operators. The optimization method is highly general, and the entire optimization process is simple and easy to implement, reducing the workload and complexity of development. For the optimized model processing tasks, since the operators of the model will be merged and run concurrently, the merged operation of operators can reduce the number of memory accesses and reduce computing overhead, thereby improving computing efficiency. The concurrent operation of operators can reduce computing time, thereby achieving acceleration. Using the optimized model to process tasks can reduce task processing time and increase task processing speed. The merging and / or concurrent operation of operators can also make full use of the storage, computing and other hardware resources of the equipment deployed by the model, thereby improving resource utilization. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solution of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0027] Figure 1 It is a flow chart of the model optimization method provided by an embodiment of the present invention;

[0028] Figure 2 is another flow chart of the model optimization method provided by an embodiment of the present invention;

[0029] Figure 3a to Figure 3c is an example comparison diagram of some model optimization methods provided by embodiments of the present invention;

[0030] Figure 4 is a flowchart of a task processing method provided by an embodiment of the present invention;

[0031] Figure 5 is a structural schematic diagram of a model optimization device provided by an embodiment of the present invention;

[0032] Figure 6 is a structural diagram of a task processing device provided by an embodiment of the present invention;

[0033] Figure 7 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0034] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0035] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0036] Figure 1It is a flow chart of a model optimization method provided by an embodiment of the present invention. The model optimization method provided by an embodiment of the present invention can be used for the optimization of any model with a task processing operator. The model optimization method can be executed by a model optimization device provided by an embodiment of the present invention, and the device can be implemented in software and / or hardware. In a specific embodiment, the device can be integrated in an electronic device, such as a computer, a server, etc., in which a preset task processing model is deployed. This embodiment will be specifically described from the following steps.

[0037] Step 101, constructing a tree search graph according to a preset operator operation scheme of a preset task processing model.

[0038] The preset task processing model can be a deep learning model pre-deployed on an electronic device for processing any task; any task such as a translation task, a demand (such as sales) prediction task, a click-through rate prediction task, etc. The preset task processing model can include multiple operators, the types of these operators can be the same or different, and there may be multiple operators of the same type, and different types of operators usually have different functions. After the preset task processing model is deployed on the electronic device, each operator of the model can run under the resources provided by the electronic device.

[0039] For example, the preset task processing model can be a Convolutional Neural Network (CNN) model, a Recurrent Neural Network (RNN) model, etc. Taking the preset task processing model as a CNN model as an example, the operator is the basic computing unit of the CNN model. Different combinations of operators can form different network structures and realize different tasks. The operator is the core component of the CNN model. The CNN model mainly includes the following four types of operators: Convolution Operator, Pooling Operator, Activation Function Operator and Fully Connected Operator. There may be one or more operators of each type. Among them, the convolution operator is one of the most basic operators in the CNN model. By convolving the input image with a sliding convolution kernel, the high-level abstract features of the image can be extracted. The convolution operator is usually used to process signal data such as images and speech. The pooling operator is a nonlinear downsampling operator that can reduce the spatial size of the feature map and reduce the intermediate details of the feature map while keeping the important features of the feature map unchanged. Common pooling operators include the maximum pooling operator and the average pooling operator. The activation function operator can map the input data from the linear space to the nonlinear space, making the model more suitable for processing practical problems. In CNN, commonly used activation functions include ReLU, Sigmoid, Tanh, etc. The fully connected operator is one of the most classic operators in the CNN model. By multiplying the feature map after the convolution operation with the weight matrix, the final classification output or regression value is obtained. Since the fully connected operator requires a large number of parameters and calculations, it is usually only used in the last layer of the network.

[0040] After the preset task processing model is designed or trained, the operation plan of these operators in the model is usually available, that is, the preset operator operation plan. The preset operator operation plan includes each operator in the model and its preset operation order. Before the model is optimized, these operators are usually run in series. Taking the preset task processing model as a CNN model as an example, in the CNN model, the execution order of these four main operators is usually: convolution operator, pooling operator, activation function operator and fully connected operator. If a type of operator includes multiple operators, the multiple operators in this type are usually run in series, and serial operation takes a long time.

[0041] Specifically in this embodiment, in order to optimize the operation plans of these operators, a tree search graph can be constructed according to the preset operator operation plans of the preset task processing model. The nodes in the tree search graph correspond to the operators in the preset task processing model, that is, each operator in the model is used as a node in the graph, and edges are created between the nodes according to the operation order between the operators, that is, the edges reflect the relationship and execution order between the operators. The tree search graph can be a directed graph.

[0042] Step 102, determine the current search node set according to the current in-degree of each original node of the tree search graph, and construct the current-degree expansion node of the tree search graph according to the candidate operation schemes corresponding to each original node in the current search node set, and the candidate operation schemes include node merging operation and / or node concurrent operation.

[0043] In-degree usually refers to the sum of the number of times a point in a directed graph serves as the end point of an edge in the graph, and can also be understood as the sum of the number of edges entering the point. The current in-degree of each original node in the tree search graph may be different. For example, the current in-degree of some original nodes may be 0, and the current in-degree of some original nodes may be 1 or other values. In this embodiment, the optimization order of each original node is determined by the current in-degree of each original node, that is, which original nodes are optimized first, so as to ensure the correctness and effectiveness of the optimization order, effectively control the search space, avoid unnecessary computational overhead, and improve search efficiency.

[0044] Node merging operation is operator merging operation. Operator merging is to merge multiple computing operations into a large operation, thereby reducing the amount of calculation, reducing the number of memory accesses, and reducing computing overhead, which can improve computing efficiency. In some cases, operator merging can improve the network structure of the model itself and improve model accuracy. Node concurrent operation is operator concurrent operation. Operator concurrency refers to calling multiple processors or threads at the same time to perform parallel calculations on complex computing tasks, thereby improving computing efficiency. This method can make full use of hardware resources and accelerate computing. Merging can be understood as the optimization of operators in the two dimensions of space and time, while concurrency is mainly the optimization of operators in the time dimension.

[0045] In practical applications, the current search node set can be determined starting from the root node of the tree search graph, that is, the current search node set is determined by the nodes in each original node whose current in-degree is 0. The current search node set usually includes multiple nodes, and the original nodes in the current search node set can be arbitrarily combined in accordance with the rules. The combination method may include merging and / or concurrency, so as to construct the current degree expansion node of the tree search graph. That is, the original node represents the corresponding operator in the preset task processing model, and the expansion node represents the possible combination of the corresponding operators in the current search node set. The current degree expansion node can be understood as the expansion node determined under this in-degree, and the current degree expansion node can include the corresponding original node and various possible combinations of the original node, that is, the current degree expansion node can be considered as a node set composed of various possible combinations. For example, the current search node set of the preset task processing model includes node a, node b and node c. Qualified combinations may include, for example: a, b, c, a plus b, a plus c, b plus c, a plus b plus c, a plus b, a plus c, b plus c, a plus b plus c, (a plus b) plus c, a plus (b plus c), etc. These possible combinations can be used as appropriate degree expansion nodes of the tree search graph.

[0046] Step 103: determine a local optimization node from the current degree expansion node according to the operation cost of the global operation solution corresponding to the current degree expansion node.

[0047] In actual applications, after the preset task processing model is deployed on the electronic device, the resource configuration for the model operation is determined, and the operation cost of each operator in the model is also determined. The operation cost can be understood as the operation speed, operation time, etc. The resource configuration for model operation can include software and hardware configuration. For example, the resource configuration can include the central processing unit (CPU) configuration, the graphics processing unit (GPU) configuration, the memory configuration, the software system configuration, etc.

[0048] Specifically, after deploying the preset task processing model on the electronic device, the preset task processing model can be used to perform test tasks under the resource configuration currently provided by the electronic device. Through multiple online test calculations, the operating overhead of each operator itself and the operating overhead of each operator under possible combinations or optimization methods can be measured, thereby providing data support for model optimization.

[0049] After the current degree expansion node is determined, the operation cost of the current degree expansion node can be obtained by querying the test data, and the operation cost of the nodes (i.e., other nodes) in the tree search graph except the current degree expansion node can also be obtained by querying the test data. Other nodes still run according to the corresponding operation plan (usually in series) in the preset operator operation plan. The operation plan of the current degree expansion node and the operation plan of other nodes are connected in series to obtain the global operation plan corresponding to the current degree expansion node. The local optimization node can be determined from the current degree expansion node according to the operation cost of the global operation plan corresponding to each expansion node in the current degree expansion node. The local optimization node can be considered as the node or node combination (merged and / or parallel) corresponding to the optimal or better operation mode determined under this or this round of in-degree. The local optimization node determined from the current degree expansion node can be the expansion node with the smallest operation cost of the corresponding global operation plan, or it can be the expansion node with the operation cost of the corresponding global operation plan lower than the preset cost threshold.

[0050] Step 104: determine a global optimization node according to the local optimization nodes determined from each degree of expansion node.

[0051] In practical applications, for the tree search graph, steps 102 and 103 can be repeatedly executed until a local optimization node is determined from the last degree expanded node (i.e., a leaf node in the tree search graph is searched), so that a local optimization node determined from each degree expanded node can be obtained, and a global optimization node can be determined based on the local optimization node determined from each degree expanded node.

[0052] Step 105 , optimizing the preset operator operation plan of the preset task processing model according to the global operation plan corresponding to the global optimization node to obtain the target task processing model.

[0053] Specifically, the preset operator operation plan of the preset task processing model can be updated to the global operation plan corresponding to the global optimization node, thereby achieving optimization of the model.

[0054] For example, the preset task processing model includes 6 operators, and the corresponding tree search graph includes nodes a, b, c, d, e, and f. If the preset operator operation plan of the preset task processing model is the operator operation plan corresponding to a→b→c→d→e→f, that is, all operators are operated in series; if the local optimization node found in the first step is a and b, the local optimization node found in the second step is c, and the local optimization node found in the third step is (d and e) and f, then the global operation plan corresponding to the global optimization node can be the operator operation plan corresponding to a and b→c→(d and e) and f. Then the operator operation plan corresponding to a and b→c→(d and e) and f can be used to replace the operator operation plan corresponding to a→b→c→d→e→f.

[0055] The scheme of the embodiment of the present invention can construct a tree search graph based on the preset operator operation scheme of the model, the original nodes in the tree search graph correspond to the operators of the model, and the expanded nodes of the tree search graph are constructed according to the candidate node merging operation schemes and / or node concurrent operation schemes. The expanded nodes are used as the solution space of branch limits, and the solution space is searched step by step until the global optimization node is found, and the model operator is optimized based on the global operation scheme corresponding to the global optimization node (that is, the preset operator operation scheme of the preset task processing model is optimized); that is, a complete solution space is created according to the possible merging and / or concurrent operation schemes of the nodes (that is, the operators), and the global optimal solution can be found from the solution space by using the branch and bound algorithm, which ensures that the global optimal operator operation scheme can be found in the end, thereby improving the model optimization effect; by merging and / or merging nodes The development operation optimizes the operator operation plan of the model without considering the matrix situation in the operator. A general algorithm can be used to optimize different operators. There is no need to design different optimization plans for different operators. The optimization method is highly general, and the entire optimization process is simple and easy to implement, reducing the workload and complexity of development. For the optimized model processing tasks, since the operators of the model will be merged and run concurrently, the merged operation of operators can reduce the number of memory accesses and reduce computing overhead, thereby improving computing efficiency. The concurrent operation of operators can reduce computing time, thereby achieving acceleration. Using the optimized model to process tasks can reduce task processing time and increase task processing speed. The merging and / or concurrent operation of operators can also make full use of the storage, computing and other hardware resources of the equipment deployed by the model, thereby improving resource utilization.

[0056] The model optimization method provided by the embodiment of the present invention is further described below. Figure 2 As shown, Figure 2 is another flow chart of the model optimization method provided by an embodiment of the present invention. The optimization method may specifically include the following steps:

[0057] Step 201 , taking each task operator of the preset task processing model as the original node in the graph, and creating edges between the original nodes according to the running order of each task operator, thereby obtaining a tree search graph.

[0058] For ease of description, this embodiment takes the preset task processing model as a CNN model as an example for explanation. The various task operators of the CNN model are, for example, convolution operators, pooling operators, activation function operators, and fully connected operators. Each type of operator may include one or more operators. The tree search graph may be a directed graph, in which the nodes in the graph represent the corresponding operators, and the edges between the nodes represent the relationship and operation order between the operators.

[0059] Step 202, determine the original in-degree of each original node, and determine whether each original node has a parent node. If there is no parent node, execute step 203; if there is a parent node, execute step 204.

[0060] The original in-degree of an original node may represent the sum of the number of edges entering the original node, or the sum of the number of parent nodes of the original node. An original node may have any number of parent nodes (e.g., 0, 1, 2, ...). In this embodiment, when calculating the current in-degree of each original node, it is necessary to combine the original in-degree of the corresponding original node and the situation of its parent node.

[0061] Step 203: determine the original in-degree of the original node as the current in-degree of the original node.

[0062] That is, if an original node has no parent node, its current in-degree is the original node of the original node.

[0063] Step 204, determining the current in-degree of the original node according to the original in-degree of the original node and the optimization result of the corresponding parent node.

[0064] The optimization results of the parent nodes of the original node may include existing optimization results or no optimization results. If an original node has a parent node, its current in-degree = original in-degree - the number of parent nodes with existing optimization results. For example, if an original node has 3 parent nodes, that is, its original in-degree is 3, and 2 of the parent nodes have already had optimization results, then in this calculation, the current in-degree of the original node is 1 (that is, 3-2).

[0065] For original nodes that have already had optimization results, the in-degree of these original nodes can be set to empty or specially marked, that is, these nodes will not be used as candidate nodes for determining the current search node set for the next time. In addition, the current in-degree of the same node in different search rounds may be the same or different, depending on the optimization of itself and its parent nodes. For example, an original node has two parent nodes. In the first search, neither of its two parent nodes has an optimization result. In the first search, the current in-degree of the original node is 2; after the first search, one of the parent nodes of the original node has an optimization result. In the second search, the current in-degree of the original node becomes 1 (i.e., 2-1).

[0066] Step 205: determine the original nodes whose current in-degrees in the tree search graph are all preset in-degrees as the current search node set.

[0067] In a specific implementation, in order to facilitate the search, the preset in-degree can be set to 0, that is, each time the original node with the current in-degree of 0 is searched from the tree search graph, and the searched node is put into the current search node set.

[0068] Step 206, determining mergeable running nodes from each original node according to the operator features corresponding to each original node in the current search node set, and determining concurrent running nodes from each original node according to the resources provided by the electronic device where the preset task processing model is located.

[0069] For example, operator features may include the type, size, size, function, etc. of the operator. The mergeable running nodes may be nodes corresponding to the same type, size, function, etc. of the corresponding operators. For example, if the operators corresponding to the nodes are all convolution operators and the convolution kernels are the same size (for example, all are 1*1, 3*3, etc.), then these nodes (or operators) can be merged. The concurrently running nodes can be determined based on the maximum number of operators that can be run in parallel that the resources provided by the electronic device can support. For example, if the maximum number of operators that can be run in parallel that the resources provided by the electronic device can support is 5, then up to 5 operators can be run concurrently.

[0070] Step 207: construct the corresponding degree expansion node of the tree search graph according to the original nodes, the mergeable running nodes and the concurrently running nodes in the current search node set.

[0071] The degree expansion node can be composed of possible combinations of original nodes whose current in-degree is 0. The degree expansion node can include each original node in the current search node set, the corresponding mergeable running nodes and concurrently running nodes.

[0072] Step 208, determining the operation cost of the local operation solution corresponding to the node with the current degree of expansion, and determining the operation cost of the local operation solution corresponding to the remaining nodes, where the remaining nodes are the nodes in the original nodes except the node with the current degree of expansion.

[0073] The local operation plan corresponding to the degree expansion node is the operation plan of the operator or operator combination corresponding to the degree expansion node; the local operation plan corresponding to the remaining nodes is the operation plan corresponding to the operator corresponding to the remaining nodes in the preset operator operation plan. The operation cost of the local operation plan corresponding to the degree expansion node and the operation cost of the local operation plan corresponding to the remaining nodes can be obtained by querying the test data.

[0074] Step 209: Determine the running cost of the global running solution corresponding to the node with the current degree of expansion according to the running cost of the local running solution corresponding to the node with the current degree of expansion and the running costs of the local running solutions corresponding to the remaining nodes.

[0075] The local operation plan corresponding to the degree expansion node and the local operation plans corresponding to the remaining nodes are connected in series to form a global operation plan corresponding to the degree expansion node. The operation cost of the local operation plan corresponding to the degree expansion node and the operation cost of the local operation plan corresponding to the remaining nodes are summed to obtain the operation cost of the global operation plan corresponding to the degree expansion node.

[0076] Step 210: determine a local optimization node from the current degree expansion node according to the operation cost of the global operation solution corresponding to the current degree expansion node.

[0077] Specifically, when determining the local optimization node from the current degree expansion node, the operation cost of the global operation scheme corresponding to each expansion node can be calculated in turn. When the operation cost of the global operation scheme corresponding to the first expansion node is calculated, the first expansion node and its operation cost can be recorded; when the operation cost of the global operation scheme corresponding to the second expansion node is calculated, the operation cost of the global operation scheme corresponding to the second expansion node can be compared with the operation cost of the global operation scheme corresponding to the first expansion node recorded; if the operation cost corresponding to the second expansion node is less than the operation cost corresponding to the first expansion node, the first expansion node and its operation cost recorded are deleted, and the second expansion node and its operation cost corresponding are recorded; if the operation cost corresponding to the second expansion node is equal to the operation cost corresponding to the first expansion node, the second expansion node and its operation cost are recorded, and the first expansion node and its operation cost recorded are retained; if the operation cost corresponding to the second expansion node is greater than the operation cost corresponding to the first expansion node, the first expansion node and its operation cost recorded are retained, and the second expansion node and its operation cost are not recorded; for other expansion nodes in the current degree expansion node, a similar method can be adopted to ensure that the expansion nodes and their operation costs with the smallest or smaller operation costs are always recorded.

[0078] Step 211, adding the local optimization node to the optimization node queue, and setting the nodes other than the local optimization node in the current degree expansion node as eliminated nodes.

[0079] The optimization node queue can also be called the active node queue, and the eliminated node can also be called the inactive node. The expanded node set as the eliminated node means that the operation plan corresponding to the operator or operator combination corresponding to the expanded node will not be considered in the future. By classifying nodes (active and inactive), node filtering or pruning can be achieved, thereby reducing the solution space and improving optimization efficiency.

[0080] Step 212 , whether the traversal reaches the last degree expansion node, if so, execute step 213 , otherwise, return to step 205 .

[0081] That is, determine whether the last leaf node of the tree search graph has been traversed. If the last leaf node of the tree search graph has been traversed, determine the global optimization node. If the last leaf node of the tree search graph has not been traversed, continue to traverse to find the local optimization node.

[0082] Step 213: determine the global optimization node according to the local optimization nodes stored in the optimization node queue.

[0083] Specifically, the local optimization nodes determined each time may be connected in series in order (which may be the order in which the corresponding local optimization nodes are obtained) to obtain a global optimization node.

[0084] Step 214, optimizing the preset operator operation plan of the preset task processing model according to the global operation plan corresponding to the global optimization node to obtain the target task processing model.

[0085] Specifically, the preset operator operation plan of the preset task processing model can be updated to the global operation plan corresponding to the global optimization node, thereby achieving optimization of the model.

[0086] The scheme of the embodiment of the present invention can construct a tree search graph based on the preset operator operation scheme of the model, the original nodes in the tree search graph correspond to the operators of the model, and the expanded nodes of the tree search graph are constructed according to the candidate node merging operation schemes and / or node concurrent operation schemes. The expanded nodes are used as the solution space of branch limits, and the solution space is searched step by step until the global optimization node is found, and the model operator is optimized based on the global operation scheme corresponding to the global optimization node (that is, the preset operator operation scheme of the preset task processing model is optimized); that is, a complete solution space is created according to the possible merging and / or concurrent operation schemes of the nodes (that is, the operators), and the global optimal solution can be found from the solution space by using the branch and bound algorithm, which ensures that the global optimal operator operation scheme can be found in the end, thereby improving the model optimization effect; by merging and / or merging nodes The development operation optimizes the operator operation plan of the model without considering the matrix situation in the operator. A general algorithm can be used to optimize different operators. There is no need to design different optimization plans for different operators. The optimization method is highly general, and the entire optimization process is simple and easy to implement, reducing the workload and complexity of development. For the optimized model processing tasks, since the operators of the model will be merged and run concurrently, the merged operation of operators can reduce the number of memory accesses and reduce computing overhead, thereby improving computing efficiency. The concurrent operation of operators can reduce computing time, thereby achieving acceleration. Using the optimized model to process tasks can reduce task processing time and increase task processing speed. The merging and / or concurrent operation of operators can also make full use of the storage, computing and other hardware resources of the equipment deployed by the model, thereby improving resource utilization.

[0087] The following examples are used to compare and illustrate the model optimization method provided by the embodiments of the present invention.

[0088] Assume that the preset task processing model is a CNN model, and the network structure of the CNN model is as follows: Figure 3aAs shown in the figure, there are five convolution operators, namely, convolution operator A (Conv(A)), convolution operator B (Conv(B)), convolution operator C (Conv(C)), convolution operator D (Conv(D)) and convolution operator E (Conv(E)). The convolution kernels of these five convolution operators have the same size, which is 3*3. It should be noted that the CNN model can also include Figure 3a Convolution operators other than those shown are provided here for illustration only.

[0089] Before the convolution operator merging and concurrent operation optimization are performed, Figure 3a The five convolution operators shown need to perform serial calculations of each convolution operator in sequence. The final calculation order and effect are as follows: Figure 3b As shown, the convolution operator needs to be executed serially in five steps, which will result in a long total calculation time for the five convolution operators and low hardware resource utilization during the calculation process of each convolution operator.

[0090] By adopting the method proposed in the embodiment of the present invention, a tree search graph can be first constructed according to the operator operation order shown in 3b. Assume that in the tree search graph, convolution operator A corresponds to node a, convolution operator B corresponds to node b, convolution operator C corresponds to node c, convolution operator D corresponds to node d, and convolution operator E corresponds to node e. Next, the nodes with current in-degree 0 in the tree search graph are searched for the first time, that is, the nodes corresponding to convolution operator A, convolution operator B, and convolution operator D. These nodes constitute the current search node set (a, b, d). At this time, the current in-degree of node c (there is 1 parent node, which is a, and there is no optimization result) is 1, and the current in-degree of e (there is 1 parent node, which is b, and there is no optimization result) is 1. The convolution operators corresponding to each node in the current search node set may be combined and run, and may also run concurrently. According to these possible situations, the corresponding degree expansion node is constructed, and the local optimization node is determined from the corresponding degree expansion node according to the running cost of the global running solution corresponding to the corresponding degree expansion node. For example, when the degree expansion node includes a and b, the running cost of the operator running plan corresponding to a and b can be calculated first, and then the running cost of the operator running plan corresponding to c, d, and e in series can be calculated. The running cost of the global running plan corresponding to a and b can be obtained by adding up these two costs; similarly, the running cost of the global running plan corresponding to other operator combinations can be calculated, and finally the operator or operator combination with the smallest running cost of the global running plan can be found, and the operator or operator combination can be used as the local optimization operator or operator combination searched this time. For example, the local optimization combination searched this time is assumed to be a and b, then the next time the search is performed, the nodes with the current in-degree of 0 are c, d, and e. Searching in a similar way to the previous one, if the local optimization node searched for the second time is d, and the local optimization node searched for the third time is c and e, then the global optimization node is a and b→d→c and e, then the global running plan corresponding to the global optimization node is, for example Figure 3cAs shown in the figure, it is: convolution operator AB merged → convolution operator D → convolution operator CE merged. In this way, all operations of the five convolution operators can be performed in just three steps, which fully utilizes the hardware resources, shortens the calculation time, and improves the processing efficiency.

[0091] The following describes a task processing method provided by an embodiment of the present invention. Figure 4 As shown, including:

[0092] Step 401, obtaining task data of the target task.

[0093] The target task is the task to be processed, and the task data may be data such as the characteristics, attributes, and status of the task. For example, the target task may be a translation task, a click-through rate prediction task, a demand (e.g., sales) prediction task, etc. For example, when the target task is a translation task, the task data may be the original language sequence, and the corresponding processing result may be the target language sequence; when the target task is a click-through rate prediction task, the task data may include the characteristics, attributes, delivery time period, delivery location, etc. of the delivered items, and the corresponding processing result may be the predicted click-through rate for the delivered items; when the target task is a demand prediction task, the task data may be the historical demand data, item attributes, item characteristics, etc. of the corresponding items, and the corresponding processing result may be the predicted demand for the items in the future time period.

[0094] Step 402 , input the task data into a target task processing model optimized by the model optimization method of any embodiment of the present invention, and process the target task to obtain a processing result.

[0095] For the specific model optimization method, please refer to the description of the previous embodiment, which will not be repeated here.

[0096] In this embodiment, due to model optimization, when the target task processing model processes the target task, the operators of the model can be merged and / or run concurrently. The merged operation of operators can reduce the number of memory accesses and reduce computing overhead, thereby improving computing efficiency. The concurrent operation of operators can reduce computing time, thereby achieving acceleration. Using the optimized model to process tasks can reduce task processing time and increase task processing speed. The merged and / or concurrent operation of operators can also make full use of the storage, computing and other hardware resources of the device deployed by the model, thereby improving resource utilization.

[0097] Figure 5 is a schematic diagram of a structure of a model optimization device provided in an embodiment of the present invention, and the device is suitable for executing the model optimization method provided in an embodiment of the present invention, such as Figure 5 As shown, the device may specifically include:

[0098] A graph construction module 501 is used to construct a tree search graph according to a preset operator operation scheme of a preset task processing model;

[0099] A node expansion module 502 is used to determine a current search node set according to the current in-degree of each original node of the tree search graph, and to construct a current-degree expansion node of the tree search graph according to the candidate operation schemes corresponding to each original node in the current search node set, wherein the candidate operation schemes include node merging operation and / or node concurrent operation;

[0100] A first determination module 503 is used to determine a local optimization node from the corresponding degree expansion node according to the operation cost of the global operation solution corresponding to the corresponding degree expansion node;

[0101] A second determination module 504 is used to determine a global optimization node according to the local optimization nodes determined from each degree of expansion node;

[0102] The model optimization module 505 is used to optimize the preset operator operation plan of the preset task processing model according to the global operation plan corresponding to the global optimization node to obtain the target task processing model.

[0103] In one embodiment, the preset operator operation scheme includes each task operator of the preset task processing model and the operation order of each task operator, and the graph construction module 501 is specifically used for:

[0104] The respective task operators are used as original nodes in the graph, and edges are created between the original nodes according to the running order of the respective task operators, so as to obtain the tree-shaped search graph.

[0105] In one embodiment, the device further includes an in-degree determination module, and the in-degree determination module is specifically configured to:

[0106] Determine the original in-degree of each original node, and determine whether each original node has a parent node;

[0107] For an original node that does not have a parent node, determining the original in-degree of the original node as the current in-degree of the original node;

[0108] For an original node that has a parent node, the current in-degree of the original node is determined according to the original in-degree of the original node and the optimization result of the corresponding parent node.

[0109] In one embodiment, the node expansion module 502 determines the current search node set according to the current in-degree of each original node of the tree search graph, including:

[0110] The original nodes whose current in-degrees in the tree search graph are all preset in-degrees are determined as the current search node set.

[0111] In one embodiment, the node expansion module 502 constructs the corresponding degree expansion node of the tree search graph according to the candidate operation schemes corresponding to each original node in the current search node set, including:

[0112] Determine the mergeable running nodes from the original nodes according to the operator features corresponding to the original nodes, and determine the concurrent running nodes from the original nodes according to the resources provided by the electronic device where the preset task processing model is located;

[0113] The corresponding degree expansion nodes of the tree search graph are constructed according to the original nodes, the mergeable and executable nodes, and the concurrently executable nodes.

[0114] In one embodiment, the device further includes a cost determination module, and the cost determination module is specifically configured to:

[0115] Determine the operation cost of the local operation scheme corresponding to the equal degree expansion node, and determine the operation cost of the local operation scheme corresponding to the remaining nodes, wherein the remaining nodes are nodes other than the equal degree expansion node in the original nodes;

[0116] The running cost of the global running solution corresponding to the node of the degree of expansion is determined according to the running cost of the local running solution corresponding to the node of the degree of expansion and the running cost of the local running solution corresponding to the remaining nodes.

[0117] In one embodiment, the first determining module 503 is specifically configured to:

[0118] Determine the node with the smallest running cost of the global running solution among the nodes with the same degree of expansion as the local optimization node; or

[0119] The node whose running cost of the global running solution among the nodes with the same degree of expansion is less than a preset cost threshold is determined as the local optimization node.

[0120] In one embodiment, the device further includes a node setting module, and the node setting module is specifically used to:

[0121] Add the local optimization node to the optimization node queue, and set the nodes other than the local optimization node in the current degree expansion node as eliminated nodes;

[0122] The second determination module 504 is specifically configured to determine the global optimization node according to the local optimization node stored in the optimization node queue.

[0123] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the functional modules described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0124] The device of the embodiment of the present invention can construct a tree search graph based on the preset operator operation scheme of the model, the original nodes in the tree search graph correspond to the operators of the model, and the expanded nodes of the tree search graph are constructed according to the candidate node merging operation schemes and / or node concurrent operation schemes. The expanded nodes are used as the solution space of branch limits, and the solution space is gradually searched until the global optimization node is found. The model operator is optimized based on the global operation scheme corresponding to the global optimization node (that is, the preset operator operation scheme of the preset task processing model is optimized); that is, a complete solution space is created according to the possible merging and / or concurrent operation schemes of the nodes (that is, the operators), and the global optimal solution can be found from the solution space by using the branch and bound algorithm, which ensures that the global optimal operator operation scheme can be found in the end, thereby improving the model optimization effect; by merging and / or merging nodes The development operation optimizes the operator operation plan of the model without considering the matrix situation in the operator. A general algorithm can be used to optimize different operators. There is no need to design different optimization plans for different operators. The optimization method is highly general, and the entire optimization process is simple and easy to implement, reducing the workload and complexity of development. For the optimized model processing tasks, since the operators of the model will be merged and run concurrently, the merged operation of operators can reduce the number of memory accesses and reduce computing overhead, thereby improving computing efficiency. The concurrent operation of operators can reduce computing time, thereby achieving acceleration. Using the optimized model to process tasks can reduce task processing time and increase task processing speed. The merging and / or concurrent operation of operators can also make full use of the storage, computing and other hardware resources of the equipment deployed by the model, thereby improving resource utilization.

[0125] Figure 6 is a schematic diagram of a structure of a task processing device provided by an embodiment of the present invention, and the device is suitable for executing the task processing method provided by an embodiment of the present invention, such as Figure 6 As shown, the device may specifically include:

[0126] A data acquisition module 601 is used to acquire task data of a target task;

[0127] The task processing module 602 is used to input the task data into the target task processing model optimized by the model optimization method described in any embodiment of the present invention, so as to obtain the processing result of the target task.

[0128] In this embodiment, due to model optimization, when the target task processing model processes the target task, the operators of the model can be merged and / or run concurrently. The merged operation of operators can reduce the number of memory accesses and reduce computing overhead, thereby improving computing efficiency. The concurrent operation of operators can reduce computing time, thereby achieving acceleration. Using the optimized model to process tasks can reduce task processing time and increase task processing speed. The merged and / or concurrent operation of operators can also make full use of the storage, computing and other hardware resources of the device deployed by the model, thereby improving resource utilization.

[0129] An embodiment of the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the model optimization and task processing method provided in any of the above embodiments is implemented.

[0130] An embodiment of the present invention further provides a computer-readable medium on which a computer program is stored. When the program is executed by a processor, the model optimization and task processing method provided in any of the above embodiments is implemented.

[0131] Reference below Figure 7 , which shows a schematic diagram of the structure of a computer system 700 of an electronic device suitable for implementing an embodiment of the present invention. Figure 7 The electronic device shown is only an example and should not bring any limitation to the function and scope of use of the present invention.

[0132] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage part 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the computer system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0133] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage section 708 as needed.

[0134] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the central processing unit (CPU) 701, the above-mentioned functions defined in the system of the present invention are executed.

[0135] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0136] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0137] The modules and / or units involved in the description of the present invention may be implemented by software or hardware. The modules and / or units described may also be set in a processor, for example, it may be described as: a processor including a graph construction module, a node expansion module, a first determination module, a second determination module and a model optimization module; or it may be described as: a processor including: a data acquisition module and a task processing module. The names of these modules do not, in some cases, constitute limitations on the modules themselves.

[0138] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes:

[0139] A tree search graph is constructed according to a preset operator operation plan of a preset task processing model; a current search node set is determined according to the current in-degree of each original node of the tree search graph, and a corresponding degree expansion node of the tree search graph is constructed according to the candidate operation plans corresponding to each original node in the current search node set, wherein the candidate operation plans include node merging operation and / or node concurrent operation; a local optimization node is determined from the corresponding degree expansion node according to the operation overhead of the global operation plan corresponding to the corresponding degree expansion node; a global optimization node is determined according to the local optimization node determined from each degree expansion node; and the preset operator operation plan of the preset task processing model is optimized according to the global operation plan corresponding to the global optimization node to obtain a target task processing model.

[0140] Alternatively, when the above one or more programs are executed by a device, the device includes:

[0141] Acquire task data of the target task; input the task data into the target task processing model optimized by the model optimization method described in any embodiment of the present invention to obtain the processing result of the target task.

[0142] According to the technical solution of the present invention, a tree search graph can be constructed based on the preset operator operation scheme of the model, the original nodes in the tree search graph correspond to the operators of the model, and the expanded nodes of the tree search graph are constructed according to the candidate node merging operation schemes and / or node concurrent operation schemes. The expanded nodes are used as the solution space of branch limits, and the solution space is searched step by step until the global optimization node is found. The model operator is optimized based on the global operation scheme corresponding to the global optimization node (that is, the preset operator operation scheme of the preset task processing model is optimized); that is, a complete solution space is created according to the possible merging and / or concurrent operation schemes of the nodes (that is, the operators), and the branch and bound algorithm is used to find the global optimal solution from the solution space, which ensures that the global optimal operator operation scheme can be found in the end, thereby improving the model optimization effect; through the merging and / or concurrent operation schemes of the nodes, the global optimal solution can be found. Concurrent operation optimizes the operator operation scheme of the model without considering the matrix situation in the operator. A common algorithm can be used to optimize different operators. There is no need to design different optimization schemes for different operators. The optimization method is highly universal, and the entire optimization process is simple and easy to implement, reducing the workload and complexity of development. For the optimized model processing tasks, since the operators of the model will be merged and run concurrently, the merged operation of operators can reduce the number of memory accesses and reduce computing overhead, thereby improving computing efficiency. The concurrent operation of operators can reduce computing time, thereby achieving acceleration. Using the optimized model to process tasks can reduce task processing time and increase task processing speed. The merging and / or concurrent operation of operators can also make full use of the storage, computing and other hardware resources of the equipment deployed by the model, thereby improving resource utilization.

[0143] In addition, due to model optimization, when the target task processing model processes the target task, the operators of the model can be merged and / or run concurrently. The merged operation of operators can reduce the number of memory accesses and reduce computing overhead, thereby improving computing efficiency. The concurrent operation of operators can reduce computing time, thereby achieving acceleration. Using the optimized model to process tasks can reduce task processing time and increase task processing speed. The merged and / or concurrent operation of operators can also make full use of the storage, computing and other hardware resources of the equipment deployed by the model, thereby improving resource utilization.

[0144] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0145] It should be noted that the collection, collection, updating, analysis, processing, use, transmission, storage and other aspects of user personal information involved in the technical solution of this disclosure are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information, network security and national security.

[0146] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A model optimization method, characterized in that: include: Constructing a tree search graph according to a preset operator operation scheme of a preset task processing model; Determine a current search node set according to the current in-degree of each original node of the tree search graph, and construct a current-degree expansion node of the tree search graph according to the candidate operation schemes corresponding to each original node in the current search node set, wherein the candidate operation schemes include node merging operation and / or node concurrent operation; Determine a local optimization node from the corresponding degree expansion node according to the operation cost of the global operation solution corresponding to the corresponding degree expansion node; Determine a global optimization node according to the local optimization nodes determined from each degree expansion node; The preset operator operation plan of the preset task processing model is optimized according to the global operation plan corresponding to the global optimization node to obtain the target task processing model.

2. The model optimization method according to claim 1, characterized in that: The preset operator operation scheme includes each task operator of the preset task processing model and the operation order of each task operator. The tree search graph is constructed according to the preset operator operation scheme of the preset task processing model, including: The respective task operators are used as original nodes in the graph, and edges are created between the original nodes according to the running order of the respective task operators, so as to obtain the tree-shaped search graph.

3. The model optimization method according to claim 1, characterized in that: Before determining the current search node set according to the current in-degree of each original node of the tree search graph, the method further includes: Determine the original in-degree of each original node, and determine whether each original node has a parent node; For an original node that does not have a parent node, determining the original in-degree of the original node as the current in-degree of the original node; For an original node that has a parent node, the current in-degree of the original node is determined according to the original in-degree of the original node and the optimization result of the corresponding parent node.

4. The model optimization method according to claim 1, characterized in that: The step of determining the current search node set according to the current in-degree of each original node of the tree search graph comprises: The original nodes whose current in-degrees in the tree search graph are all preset in-degrees are determined as the current search node set.

5. The model optimization method according to claim 1, characterized in that: The step of constructing the corresponding degree expansion node of the tree search graph according to the candidate operation schemes corresponding to the original nodes in the current search node set includes: Determine the mergeable running nodes from the original nodes according to the operator features corresponding to the original nodes, and determine the concurrent running nodes from the original nodes according to the resources provided by the electronic device where the preset task processing model is located; The corresponding degree expansion nodes of the tree search graph are constructed according to the original nodes, the mergeable and executable nodes, and the concurrently executable nodes.

6. The model optimization method according to claim 1, characterized in that: Before determining the local optimization node from the equal degree expansion node according to the operation cost of the global operation solution corresponding to the equal degree expansion node, the method further includes: Determine the operation cost of the local operation scheme corresponding to the equal degree expansion node, and determine the operation cost of the local operation scheme corresponding to the remaining nodes, wherein the remaining nodes are nodes other than the equal degree expansion node in the original nodes; The running cost of the global running solution corresponding to the node of the degree of expansion is determined according to the running cost of the local running solution corresponding to the node of the degree of expansion and the running cost of the local running solution corresponding to the remaining nodes.

7. The model optimization method according to claim 1, characterized in that: The step of determining a local optimization node from the corresponding degree expansion node according to the operation cost of the global operation solution corresponding to the corresponding degree expansion node comprises: Determine the node with the smallest running cost of the global running solution among the nodes with the same degree of expansion as the local optimization node; or The node whose running cost of the global running solution among the nodes with the same degree of expansion is less than a preset cost threshold is determined as the local optimization node.

8. The model optimization method according to claim 7, characterized in that: After determining the local optimization node from the equal degree expansion node according to the operation cost of the global operation scheme corresponding to the equal degree expansion node, the method further includes: adding the local optimization node to the optimization node queue, and setting the nodes in the equal degree expansion node except the local optimization node as eliminated nodes; The determining of the global optimization node according to the local optimization node determined from the nodes at each degree of expansion includes: determining the global optimization node according to the local optimization node stored in the optimization node queue.

9. A task processing method, characterized in that: include: Get the task data of the target task; The task data is input into the target task processing model optimized by the model optimization method according to any one of claims 1 to 8, and the processing result of the target task is obtained.

10. A model optimization device, characterized in that: include: A graph construction module, used to construct a tree search graph according to a preset operator operation scheme of a preset task processing model; A node expansion module, used to determine a current search node set according to the current in-degree of each original node of the tree search graph, and to construct a current-degree expansion node of the tree search graph according to the candidate operation schemes corresponding to each original node in the current search node set, wherein the candidate operation schemes include node merging operation and / or node concurrent operation; A first determination module is used to determine a local optimization node from the corresponding degree expansion node according to the operation cost of the global operation solution corresponding to the corresponding degree expansion node; A second determination module is used to determine a global optimization node according to the local optimization nodes determined from each degree expansion node; The model optimization module is used to optimize the preset operator operation plan of the preset task processing model according to the global operation plan corresponding to the global optimization node to obtain the target task processing model.

11. A task processing device, characterized in that: include: A data acquisition module, used to acquire task data of a target task; The task processing module is used to input the task data into the target task processing model optimized by the model optimization method described in any one of claims 1 to 8, so as to obtain the processing result of the target task.

12. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the model optimization method according to any one of claims 1 to 8 is implemented, or when the processor executes the program, the task processing method according to claim 9 is implemented.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the model optimization method according to any one of claims 1 to 8 is implemented, or when the program is executed by a processor, the task processing method according to claim 9 is implemented.