Data processing method, text processing method, image processing method, computing device, computer storage medium and computer program product

By constructing static calculation graphs before the model is run and combining the flexibility of dynamic calculation graphs, the problem of being unable to efficiently handle dynamic models in the existing technology is solved, and efficient model inference is realized when hardware resources are constrained.

WO2025181595A1PCT designated stage Publication Date: 2025-09-04CLOUD INTELLIGENCE ASSETS HOLDING (SINGAPORE) PTE LTD

Patent Information

Application Number
PCT/IB2025/051210
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-02-27
Filing Date
2025-02-05
Publication Date
2025-09-04

AI Technical Summary

Technical Problem

Existing static graph optimization techniques cannot flexibly cope with models with iterative diffusion processes and dynamic behaviors, such as Stable-Diffusion, making it difficult to achieve efficient inference on computer hardware resources.

Method used

Using static computing graph optimization technology, combined with the flexibility of dynamic computing graphs, by building target computing graphs and compiling them before the model is run, it reduces hardware resource consumption and realizes efficient data processing and model inference.

Benefits of technology

Compilation and optimization are carried out before model inference, reducing processor computing burden, improving execution efficiency, reducing hardware resource requirements, and achieving efficient and accurate data processing and model inference.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure IB2025051210_04092025_PF_FP_ABST
    Figure IB2025051210_04092025_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the embodiments of the present description are a data processing method, a text processing method, an image processing method, a computing device, a computer storage medium and a computer program product. The data processing method comprises: determining a target computation graph of a target model and inputting target data of the target model; determining from the target computation graph the current node for processing the target data; and determining a data processing computation graph corresponding to the current node, processing the target data on the basis of the current node and / or the data processing computation graph, and obtaining a data processing result. By means of flexibly calling a data processing computation graph, it can be ensured that a target model performs an efficient and accurate pre-processing or post-processing operation on target data, a computation process is dynamically inserted into a target computation graph, and secondary compilation is not needed, such that the overheads of computation graph compilation are saved on, the requirement and consumption for computer hardware resources are reduced, and the model inference efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Data Processing Method, Text Processing Method, Image Processing Method, Computing Device, Computer Storage Medium, and Computer Program Product. This disclosure claims priority to Chinese patent application number 202410217614.9, filed with the China Patent Office on February 27, 2024, and entitled "Data Processing Method, Text Processing Method, Image Processing Method, Computing Device, Computer Storage Medium, and Computer Program Product," the entire contents of which are incorporated herein by reference. Technical Field: The embodiments of this specification relate to the field of computer technology, and more particularly to a data processing method, a text processing method, an image processing method, a computing device, a computer storage medium, and a computer program product. Background: Traditional deep learning inference acceleration solutions can significantly improve model inference efficiency by utilizing static graph optimization technology. Specifically, by fusing nodes in the computational graph and selecting highly optimized kernel functions to perform operations, the computational overhead of computer hardware resources is reduced and the execution speed of the model inference process is improved. However, for models with iterative diffusion processes and dynamic behavior, such as Stable-Diffusion (an image generation model whose working principle involves multiple iterations to gradually transform from noise to a clear image. Each iteration requires dynamic adjustment of parameters or computational processes based on the results of the previous iteration. This dynamic and recursive nature makes this model difficult to directly represent and optimize using static graphs). This static graph solution cannot flexibly address the model's characteristic of dynamically determining subsequent steps based on the previous step during inference. Therefore, it is difficult to directly apply and achieve the same acceleration effect. This means that for such models, new optimization techniques that adapt to their inherent dynamic properties are needed. In view of this, embodiments of this specification provide a data processing method, a text processing method, an image processing method, a computing device, a computer storage medium, and a computer program product to address the technical deficiencies existing in the prior art.According to a first aspect of an embodiment of this specification, a data processing method is provided, comprising: determining a target computation graph of a target model and inputting target data into the target model, wherein the target model is a machine learning model, the target computation graph is constructed by multiple nodes and edges connecting the nodes, and the target computation graph is a computation graph that cannot be updated while the target model is running; determining a current node for processing the target data from the target computation graph, wherein the current node is any one of the multiple nodes; determining a data processing computation graph corresponding to the current node, processing the target data according to the current node and / or the data processing computation graph, and obtaining a data processing result. According to a second aspect of an embodiment of this specification, a data processing device is provided, comprising: a data determination module, configured to determine a target computation graph of a target model and target data input into the target model, wherein the target model is a machine learning model, the target computation graph is constructed by multiple nodes and edges connecting the nodes, and the target computation graph is a computation graph that cannot be updated when the target model is running; a node determination module, configured to determine a current node for processing the target data from the target computation graph, wherein the current node is any one of the multiple nodes; and a result acquisition module, configured to determine a data processing computation graph corresponding to the current node, process the target data according to the current node and / or the data processing computation graph, and obtain a data processing result. According to a third aspect of an embodiment of this specification, a text processing method is provided, comprising: determining a target computation graph of a target model and inputting a target text into the target model, wherein the target model is a machine learning model, the target computation graph is constructed by a plurality of nodes and edges connecting the nodes, and the target computation graph is a computation graph that cannot be updated while the target model is running; determining a current node for processing the target text from the target computation graph, wherein the current node is any one of the plurality of nodes; determining a text processing computation graph corresponding to the current node, and processing the target text according to the current node and / or the text processing computation graph to obtain a text processing result.According to a fourth aspect of the embodiments of this specification, a text processing device is provided, comprising: a text determination module, configured to determine a target computation graph of a target model and a target text input into the target model, wherein the target model is a machine learning model, the target computation graph is constructed by multiple nodes and edges connecting the nodes, and the target computation graph is a computation graph that cannot be updated when the target model is running; a node determination module, configured to determine a current node for processing the target text from the target computation graph, wherein the current node is any one of the multiple nodes; and a result acquisition module, configured to determine a text processing computation graph corresponding to the current node, process the target text according to the current node and / or the text processing computation graph, and obtain a text processing result. According to a fifth aspect of the embodiments of this specification, an image processing method is provided, comprising: determining a target computation graph of a target model and inputting a target image into the target model, wherein the target model is a machine learning model, the target computation graph is constructed by multiple nodes and edges connecting the nodes, and the target computation graph is a computation graph that cannot be updated when the target model is running; determining a current node for processing the target image from the target computation graph, wherein the current node is any one of the multiple nodes; determining an image processing computation graph corresponding to the current node, processing the target image according to the current node and / or the image processing computation graph, and obtaining an image processing result. According to a sixth aspect of the embodiments of this specification, an image processing device is provided, comprising: an image determination module, configured to determine a target computation graph of a target model and a target image input into the target model, wherein the target model is a machine learning model, the target computation graph is constructed by multiple nodes and edges connecting the nodes, and the target computation graph is a computation graph that cannot be updated when the target model is running; a node determination module, configured to determine a current node for processing the target image from the target computation graph, wherein the current node is any one of the multiple nodes; a result acquisition module, configured to determine an image processing computation graph corresponding to the current node, process the target image according to the current node and / or the image processing computation graph, and obtain an image processing result.According to a seventh aspect of embodiments of this specification, a computing device is provided, comprising: a memory and a processor; the memory is configured to store a computer program / instructions, and the processor is configured to execute the computer program / instructions. When executed by the processor, the computer program / instructions implement the steps of the aforementioned data processing method, text processing method, or image processing method. According to an eighth aspect of embodiments of this specification, a computer-readable storage medium is provided, storing a computer program / instructions. When executed by the processor, the computer program / instructions implement the steps of the aforementioned data processing method, text processing method, or image processing method. According to a ninth aspect of embodiments of this specification, a computer program product is provided, comprising a computer program / instructions. When executed by the processor, the computer program / instructions implement the steps of the aforementioned data processing method, text processing method, or image processing method. One embodiment of the present specification provides a data processing method, including: determining a target computation graph of a target model and inputting target data into the target model, wherein the target model is a machine learning model, the target computation graph is constructed by multiple nodes and edges connecting the nodes, and the target computation graph is a computation graph that cannot be updated while the target model is running; determining a current node for processing the target data from the target computation graph, wherein the current node is any one of the multiple nodes; determining a data processing computation graph corresponding to the current node, and processing the target data according to the current node and / or the data processing computation graph to obtain a data processing result. The data processing method provided in the embodiments of this specification determines a target computation graph for a target model. When target data is input into the target model, the target computation graph cannot be updated while the target model is running. That is, the target computation graph is fully defined and compiled before the target model is running. This facilitates optimizing the compilation of the target computation graph before model inference, reducing the computational burden on the processor and improving the execution efficiency of the processor. Furthermore, by flexibly calling the data processing computation graph, the target model can be ensured to perform efficient and accurate pre-processing or post-processing operations on the target data, enabling dynamic insertion of computation flows into the target computation graph without the need for secondary compilation. This reduces computation graph compilation overhead, reduces the demand and consumption of computer hardware resources, and improves model inference efficiency.BRIEF DESCRIPTION OF THE DRAWINGS FIG1 is a schematic diagram of a data processing method according to an embodiment of this specification; FIG2 is a flow chart of a data processing method according to an embodiment of this specification; FIG3 is a schematic diagram of a pre-processing table according to an embodiment of this specification; FIG4 is a schematic diagram of a UNET model structure according to an embodiment of this specification; FIG5 is a schematic diagram of a target mapping table according to an embodiment of this specification; FIG6 is a flow chart of a single-node processing process of a data processing method according to an embodiment of this specification; FIG7 is a flow chart of a text processing method according to an embodiment of this specification; FIG8 is a flow chart of an image processing method according to an embodiment of this specification; FIG9 is a schematic diagram of the structure of a data processing device according to an embodiment of this specification; FIG10 is a schematic diagram of the structure of a text processing device according to an embodiment of this specification; FIG11 is a schematic diagram of the structure of an image processing device according to an embodiment of this specification; FIG12 is a block diagram of the structure of a computing device according to an embodiment of this specification. DETAILED DESCRIPTION The following description sets forth numerous specific details to facilitate a thorough understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art may make similar generalizations without departing from the scope of this specification. Therefore, this specification is not limited to the specific implementations disclosed below. The terms used in one or more embodiments of this specification are for the purpose of describing specific embodiments only and are not intended to limit the one or more embodiments of this specification. As used in one or more embodiments of this specification and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and encompasses any and all possible combinations of one or more of the associated listed items. It should be understood that while the terms "first," "second," and so on may be employed in one or more embodiments of this specification to describe various information, such information should not be limited to these terms. These terms are used solely to distinguish information of the same type from one another. For example, "first" could be referred to as "second," and similarly, "second" could be referred to as "first," without departing from the scope of one or more embodiments of this specification. Depending on the context, the term "if" as used herein could be interpreted as meaning "at the time," "when," or "in response to determining."Furthermore, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, storage, and display) referred to in one or more embodiments of this specification are all authorized by the user or fully authorized by all parties. Furthermore, the collection, use, and processing of the relevant data must comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or deny. In one or more embodiments of this specification, a large model refers to a deep learning model with large-scale model parameters, typically containing hundreds of millions, tens of billions, hundreds of billions, trillions, or even more than ten trillion model parameters. Large models, also known as foundation models, are pre-trained on large-scale unlabeled corpora to produce pre-trained models with more than 100 million parameters. Such models are adaptable to a wide range of downstream tasks and have good generalization capabilities. Examples include large language models (LLMs) and multi-modal pre-training models. In practical applications, large models only require a small number of samples to fine-tune the pre-trained model and can be applied to various tasks. Large models can be widely used in fields such as natural language processing (NLP) and computer vision. Specifically, they can be applied to computer vision tasks such as visual question answering (VQA), image captioning (IC), and image generation, as well as natural language processing tasks such as text-based sentiment classification, text summarization, and machine translation. Key application scenarios for large models include digital assistants, intelligent robots, search, online education, office software, e-commerce, and intelligent design. First, the terms used in one or more embodiments of this specification are explained.

[0002] Stable-Diffusion: A text-to-image generative model that is primarily used to generate detailed images based on text descriptions. It can also be applied to other tasks such as infilling, outfilling, and image-to-image transformation guided by prompts.

[0003] Controlnet: An important supporting plug-in in the Stable Diffusion model. Its function is to guide the image generation process by controlling the feature representation to ensure that the generated image is more consistent with the input text description.

[0004] TensorRT: A high-performance deep learning inference SDK (Software Development Kit) that includes a deep learning inference optimizer and runtime environment, providing low latency and high throughput for deep learning inference applications. For modern large models, such as the Large Language Model (LLM) and the Stable-Diffusion visual generative model, a series of lightweight control techniques are employed during inference to precisely adjust output results. For example, Controlnet (a key supporting plugin for the Stable-Diffusion model) employs a parallel architecture that integrates the resulting tensors from a dedicated network module dedicated to processing reference image information into the Stable-Diffusion model's computation, thereby controlling and influencing the generated images. Another approach involves inserting specialized upsampling and downsampling modules within the model to enable style transfer and dynamic style control of the generated images without changing the overall model architecture. One prior art method leverages the dynamic adjustability of dynamic graphs. By replacing specific operators in the computation graph, it can adaptively optimize the inference process for different inputs or stages, accelerating model inference. However, this method limits the optimization options and cannot achieve operator fusion on a larger scale. Another prior art acceleration method relies entirely on static graph computation, which cannot dynamically modify the computation graph and dynamically support solutions such as ControlNet. Therefore, an embodiment of this specification provides a data processing method based on static graph optimization while retaining dynamic computation graph modification. This method achieves dynamic modification of the computation graph while saving computer hardware resources. This specification also provides a data processing method. One or more embodiments of this specification also relate to a data processing device, a text processing method, a text processing device, an image processing method, an image processing device, a computing device, a computer-readable storage medium, and a computer program product, each of which is described in detail in the following embodiments. See Figure 1, which shows a scenario diagram of a data processing method provided according to one embodiment of this specification.Specifically, the data processing method is implemented using a client 102 and a server 104. The client 102 is used to send target data to the server 104. The server 104 deploys a target model. The target model is converted into a static computation graph, where nodes in the static computation graph represent mathematical operations (i.e., processing operations performed by the target model when performing data processing), and edges represent data flows (i.e., the relationships between processing operations). The static computation graph of the target model can be compiled and optimized, for example, by merging repeated operations and reducing redundant computations to improve processing efficiency. Furthermore, hardware such as GPUs (Graphics Processing Units) can be utilized to accelerate computation, so that the compiled static computation graph can be efficiently executed. When target data is input into the target model, the target model's inference process is executed, performing calculations node by node according to the static computation graph. Specifically, the current node processing the target data is determined from the target model's static computation graph, and the data processing computation graph corresponding to the current node is determined. The data processing computation graph is used to perform pre- and / or post-processing on the target data. The target data is processed according to the current node and / or the data processing computation graph to obtain a data processing result, which is then returned to the client 102. Specifically, by determining whether a corresponding data processing computation graph exists for the current node and, if so, invoking the corresponding data processing computation graph for the current node, in actual applications, the data processing computation graph includes a pre- and post-processing data processing computation graph, thereby enabling the addition, deletion, and modification of data processing computation graphs before and after the current node. The client 102 may include a browser, an APP (Application), or a web application such as an H5 (Hyper Text Markup Languages, version 5) application, a light application (also known as a mini-program, a lightweight application), or a cloud application. The client may be developed based on a software development kit (SDK) for a corresponding service provided by the server, such as a real-time communication (RTC) SDK. The client may be deployed in an electronic device and may rely on the device or certain APPs in the device to run. The electronic device may have a display and support information browsing, and may be, for example, a personal mobile terminal such as a mobile phone, a tablet computer, or a personal computer.Electronic devices can also typically be configured with various other types of applications, such as human-computer interaction applications, model training applications, data processing applications, web browser applications, shopping applications, search applications, instant messaging tools, email clients, and social platform software. Server 104 can be understood as a server that provides various services, including physical servers and cloud servers. For example, a server that provides communication services to multiple clients, a server that supports backend training of models used on clients, or a server that processes data sent by clients. It should be noted that server 104 can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. Server 104 can also be a server for a distributed system, or a server integrated with blockchain. The server 104 may also be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), big data and artificial intelligence platforms, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. It is worth noting that the data processing methods provided in the embodiments of this specification can be executed by the server 104. In other embodiments of this specification, the target model can be deployed on the client 102, allowing the client 102 to have similar functionality to the server 104 and thereby execute the data processing methods provided in the embodiments of this specification. In other embodiments, the data processing methods provided in the embodiments of this specification can also be jointly executed by the client 102 and the server 104. The data processing method provided in the embodiments of this specification determines a target computation graph for a target model. When target data is input into the target model, the target computation graph cannot be updated while the target model is running. That is, the target computation graph is fully defined and compiled before the target model is running. This facilitates optimizing the compilation of the target computation graph before model inference, reducing the computational burden on the processor and improving the execution efficiency of the processor. Furthermore, by flexibly calling the data processing computation graph, the target model can be ensured to perform efficient and accurate pre-processing or post-processing operations on the target data, enabling dynamic insertion of computation flows into the target computation graph without the need for secondary compilation. This reduces computation graph compilation overhead, reduces the demand and consumption of computer hardware resources, and improves model inference efficiency.Referring to FIG. 2 , FIG. 2 shows a flow chart of a data processing method provided by one embodiment of this specification, specifically comprising the following steps. Specifically, the data processing method is applied to computer hardware supporting machine learning model calculations. Step 202: Determine a target computation graph for a target model and target data to be input into the target model. The target model is a machine learning model, and the target computation graph is constructed from multiple nodes and edges connecting the nodes. The target computation graph cannot be updated while the target model is running. The target model can be understood as any data processing model, such as a text processing model or an image processing model, without limitation herein. The target computation graph can be understood as a static computation graph, constructed based on the target model's model structure and computational flow. It is an immutable computation graph defined and compiled before the target model executes the inference process. Specifically, the target computation graph for the target model is determined, as well as the target data to be input into the target model. The input target data is converted into input nodes of the target computation graph. Data is transmitted within the target model through model inference, and a data processing result is obtained after processing the target data. In practical applications, when determining a static computation graph for a target model, since static computation graphs allow for higher levels of optimization than dynamic computation graphs, such as memory pre-allocation, computation graph optimization, and hardware-specific optimization, target models compiled using static computation graphs can achieve higher performance and faster execution efficiency compared to dynamic computation graphs during deployment and large-scale production environments. In one or more embodiments of this specification, since the computation and construction of a dynamic computation graph are performed simultaneously, that is, the values ​​of the preceding nodes in the dynamic computation graph are first calculated, and then the subsequent dynamic computation graph is constructed based on these values, if the constructed dynamic computation graph needs to be modified, the entire dynamic computation graph must be rebuilt, which also requires recompilation. This compilation process incurs a significant amount of computer hardware resource overhead. Therefore, to reduce the computer hardware resource overhead associated with compilation, a static computation graph for the target model is determined. The specific implementation method is as follows: Determining the target computation graph for the target model and inputting target data for the target model includes: determining the target computation graph for the target model and inputting target data for the target model based on the hardware resources of the computer hardware supporting machine learning model calculations. Hardware resources include but are not limited to CPU (Central Processing Unit), memory, storage, network, etc.Specifically, before using the target model for actual reasoning, the computation graph corresponding to the target model needs to be compiled. This involves converting source code into target code for computer execution. In practical applications, compiling computation graphs, whether static or dynamic, requires significant computer hardware resources. For example, the compilation process requires the CPU to perform numerous computations, such as lexical analysis and parsing. Memory is required to store data, including source code, intermediate code, and target code. Storage resources are needed to read and write numerous files, such as source code and header files. Furthermore, network resources are required to download dependencies or libraries from the network. Due to the fact that dynamic computation graphs are constructed as they are computed, modifications to a constructed dynamic computation graph require a re-compilation, requiring the newly constructed dynamic computation graph to be recompiled. This consumes significant computer hardware resources. The data processing methods provided in the embodiments of this specification are applied to computer hardware supporting machine learning model calculations. Based on the hardware resources of the computer hardware supporting machine learning model calculations, the target computation graph of the target model is determined. Specifically, when the computer hardware resources are limited or insufficiently configured, the target model can be converted into a static computation graph. When the static computation graph needs to be modified, this can be achieved by dynamically calling the data processing computation graph. Therefore, there is no need for secondary compilation, i.e., there is no need to recompile the static computation graph, which can significantly save computation graph compilation overhead and reduce the demand and consumption of computer hardware resources. In one or more embodiments of this specification, to accurately construct the target computation graph of the target model, once the target model is obtained, the nodes and edges in the target computation graph are determined based on the target model. The specific implementation method is as follows: Determining the target computation graph of the target model includes: obtaining the target model, using the processing operations of the target model for data processing as the nodes, and using the relationships between the processing operations as edges; and constructing the target computation graph based on the nodes and edges. Among them, a node can be understood as a specific mathematical calculation or data processing operation; an edge is used to represent the direction of data flow and the dependency relationship between data processing operations.Specifically, the target model structure is first designed and implemented based on the requirements of the machine learning task to obtain the target model. Alternatively, a pre-designed target model can be obtained. The processing operations of the target model during data processing are used as nodes to construct a target computation graph. For example, in a neural network, nodes can represent matrix multiplication, addition, activation function application, loss function calculation, optimizer update steps, and so on. The relationships between the various processing operations are then used as edges to construct the target computation graph. For example, during target model inference, the output of the first convolutional layer serves as the input for the next convolutional layer or pooling layer. This connection between the previous and next layers can be expressed through edges. The target computation graph is then constructed based on the nodes and edges. The data processing method provided in the present embodiment, by constructing a target computation graph, can clearly indicate the computational steps that can be executed in parallel within the target computation graph. This facilitates efficient model inference on large datasets. In a distributed environment, the structure of the target computation graph can also be used to decompose data processing tasks onto different computing resources, improving the performance and stability of the computer system. In one or more embodiments of this specification, an initial computation graph is first constructed based on nodes and edges. If the initial computation graph is also a static computation graph, the graph is optimized by compiling each node in the initial computation graph to obtain a target computation graph. The specific implementation is as follows: Constructing the target computation graph based on the nodes and edges includes: constructing an initial computation graph based on the nodes and edges; performing redundancy elimination on target nodes and target edges in the initial computation graph to obtain a target computation graph for the target model, so that the target model runs under low target processor utilization. A target node can be understood as a node that requires optimization or adjustment, such as a duplicate computation node or a node that can be fused; a target edge can be understood as an edge associated with a target node. For example, if a target node is deleted, the associated target edges need to be deleted as well; and a target processor can be understood as a processor that runs the target model and provides computing resources for the target model during model inference, such as a central processing unit (CPU) or a graphics processing unit (GPU), without limitation herein. Specifically, when constructing an initial computation graph based on nodes and edges, since the initial computation graph is a static computation graph, the nodes in the initial computation graph can be compiled to implement graph optimization of the initial computation graph, including but not limited to redundant elimination operations such as constant folding, operator fusion, and dead code removal, thereby obtaining a more concise and efficient target computation graph.By eliminating unnecessary repeated calculations or merging consecutive operations to obtain a target computation graph, the number of computational steps and memory accesses during the target model inference process can be reduced. Furthermore, after removing the target nodes, no additional memory needs to be allocated for these invalid or repeated calculations, helping to reduce memory usage and enabling the target processor to run the target model at a low utilization rate. The data processing method provided in this embodiment improves the execution performance of the target model by eliminating redundancy on nodes in the initial computation graph. A more concise and efficient target computation graph also facilitates the deployment and porting of the target model on different hardware platforms. Step 204: Determine the current node processing the target data from the target computation graph, where the current node is any one of the multiple nodes. The current node can be understood as the specific node at which the target model is executing operations according to the structural sequence of the target computation graph. Specifically, when the target model executes inference, the engine performs calculations node by node according to the target computation graph. In deep learning frameworks, the engine can be understood as the core component that processes the target computation graph. It can parse the target computation graph's structure, schedule node execution order, and leverage the underlying computer hardware for parallel computing and memory management. In practical applications, when target data is input into the target model, it is first passed to the first node in the target computation graph for processing. This node may correspond to the target model's input layer and is responsible for performing preliminary transformations on the target data. As the computational process progresses, each node receives the output of the previous node as input and generates new outputs based on its defined processing operations and associated edges. Step 206: Determine the data processing computation graph corresponding to the current node, process the target data according to the current node and / or the data processing computation graph, and obtain a data processing result. The data processing computation graph can be understood as a static computation graph outside the target computation graph that performs data processing. Specifically, the data processing computation graph corresponding to the current node can be determined. Based on whether pre- and / or post-processing of the target processing data is required, the current node and / or the data processing computation graph can be used to process the target data to obtain a data processing result. In practical applications, if the data processing computation graph is also a static computation graph, a computation graph framework implemented by combining the target computation graph with the data processing computation graph can implement diverse dynamic computation logic. Furthermore, the data processing computation graph can be adaptively called at any time based on actual needs, providing great flexibility.In one or more embodiments of the present specification, a pre-data processing computation graph corresponding to a target structure unit of a target model corresponding to a current node is determined by determining whether the target structure unit is in a pre-processing table. A specific implementation is as follows: Determining the data processing computation graph corresponding to the current node includes: determining the target structure unit of the target model corresponding to the current node according to a target mapping table; and if the target structure unit is in the pre-processing table, determining the pre-data processing computation graph corresponding to the target structure unit from the pre-processing table. The pre-processing table includes a mapping relationship between the target structure unit and the pre-data processing computation graph, and the pre-data processing computation graph is used to perform pre-processing on the target processing data. The target mapping table can be understood as a data structure that describes the correspondence between nodes in the target computation graph and the structural units of the target model. The structural units of the target model can be understood as the basic components used to construct the target model. For example, in a neural network, structural units can be understood as network layers, including but not limited to input layers, hidden layers (fully connected layers, convolutional layers, recurrent layers, etc.), and output layers. The target structural unit can be understood as the structural unit corresponding to the current node, as determined according to the target mapping table. The pre-processing computation graph can be understood as the computation graph that processes the target data before executing the current node. Specifically, the target structural unit of the target model corresponding to the current node is first determined according to the target mapping table. A check is then performed to see if the target structural unit is in the pre-processing table. If so, the pre-processing computation graph corresponding to the target structural unit is determined from the pre-processing table. If not, the target data is processed according to the current node. Figure 3 shows a schematic diagram of a pre-processing table provided in an embodiment of this specification.For example, in Controlnet, the input data is usually added to a constant value outside the target calculation graph to realize the processing of the input data; at this time, according to the target mapping table, the target structure unit of the target model corresponding to the current node is determined to be structure unit 1. Through the pre-processing table shown in Figure 3, structure unit 1 points to an external addition calculation graph (i.e., pre-data processing calculation graph), where input[0]=getInput() (input[O]=getInputs()) means getting input data; input[1]=constant() (input[l]=Constant()) means setting a constant value; output[0]=input[0]+input[1] (output[0]=input[0]+input[l]) means adding the input data to the constant value to obtain the output result; return output[0] (return output[0]) means returning the calculated output result; thus, through the external addition calculation graph, the input data is added to the external data before the current node. The insertion of the external addition computation graph is completed. In the data processing method provided in the embodiments of this specification, when the target structural unit determined according to the target mapping table is in the pre-processing table, the pre-data processing computation graph corresponding to the target structural unit is determined from the pre-processing table. The target data is processed using the pre-data processing computation graph, thereby dynamically inserting the computation graph before the current node. In one or more embodiments of this specification, a target mapping table is constructed based on the mapping relationship between nodes in the target computation graph and the structural units of the target model. A specific implementation method is as follows: Before determining the target structural unit of the target model corresponding to the current node according to the target mapping table, the method further includes: determining the structural unit for constructing the target model, wherein the structural unit is a network layer of the target model; determining the structural unit corresponding to each node in the target computation graph; and constructing the target mapping table based on the mapping relationship between the nodes in the target computation graph and the structural units of the target model. Specifically, a UNET model containing multiple structural units is used as an example. UNET (U-Net) is a convolutional neural network (CNN) architecture, named U-Net for its unique U-shaped structure.As shown in FIG4 , FIG4 shows a schematic diagram of a UNET model structure provided by an embodiment of this specification. The UNET model structure mainly includes two parts: an encoder block and a decoder block. The encoder block typically has a multi-layer structure, with each layer including a self-attention mechanism and a feedforward neural network (FFN). Therefore, each encoder block includes submodules, and similarly, the decoder block includes submodules. During the conversion of the target model into a target computation graph, the target model is converted into a static computation graph comprising several nodes. The structural unit position and index of each node in the target computation graph in the target model are recorded as a target mapping table, i.e., a table of correspondences between nodes and each block and its submodules. As shown in FIG5 , FIG5 shows a schematic diagram of a target mapping table provided in an embodiment of this specification. Node 1 corresponds to structural unit 0.0, node 2 corresponds to structural unit 0.1, node 3 corresponds to structural unit 0.2, node 4 corresponds to structural unit 1.0, and so on, up to node n corresponding to structural unit nn. The data processing method provided in this embodiment of this specification constructs a target mapping table to locate the specific structural unit within the target model corresponding to the current node in the target computation graph and accurately perform the relevant data processing and calculations. This provides a clearer understanding and control of the entire target model computation process, ensuring that data is processed according to the design requirements of the target model as it passes through each node in the target computation graph. In one or more embodiments of this specification, data processing is accurately performed according to actual conditions through the pre-data processing calculation graph, the current node, and the post-data processing calculation graph, and functions such as inserting and deleting nodes in the target calculation graph are implemented through the pre-data processing calculation graph and the post-data processing calculation graph.The specific implementation is as follows: Processing the target data according to the current node and / or the data processing computation graph to obtain a data processing result includes: processing the target data according to the pre-processing computation graph to obtain pre-processing data; when the current node is determined to be executed according to the pre-processing data, processing the pre-processing data according to the current node to obtain current processing data; when the target structure unit is in a post-processing table, determining the post-processing computation graph corresponding to the target structure unit from the post-processing table, wherein the post-processing table includes a mapping relationship between the target structure unit and the post-processing computation graph, and the post-processing computation graph is used to perform post-processing on the target processing data; processing the current processing data according to the post-processing computation graph to obtain the data processing result. The pre-processing data can be understood as processed data obtained by processing the target data using the pre-processing computation graph; and the current processing data can be understood as a processing result obtained by processing the pre-processing data output by the pre-processing computation graph using the current node. The post-data processing calculation graph can be understood as a calculation graph that processes the target processing data after executing the current node. Specifically, when the pre-processing data is obtained and the current node is not executed, the target processing data can be understood as the pre-processing data, that is, the pre-processing data is processed using the post-data processing calculation graph to obtain the data processing result; when the pre-processing data is obtained and the current node is executed, the target processing data can be understood as the current processing data, that is, the data processing result is obtained by using the post-data processing calculation graph for the current processing data; or, when the structural unit corresponding to the current node is not in the pre-processing table, the target data is processed using the current node to obtain the target processing result. In this case, the target processing data can be understood as the target processing result, that is, the target processing result is processed using the post-data processing calculation graph to obtain the data processing result.Specifically, if the target structural unit is in the pre-processing table, the pre-data processing computation graph corresponding to the target structural unit is determined from the pre-processing table. The target data is processed using the pre-data processing computation graph to obtain pre-processing data. Furthermore, based on the pre-processing data, it is determined whether to continue executing the current node (for example, if the pre-data processing computation graph is used to detect environmental readiness, which is a necessary step before executing the current node, subsequent nodes are executed only when the pre-processing data is in the "Ready" state). If so, the pre-processing data is processed based on the current node to obtain the current processing data. At this point, the computation graph is added before the current node. After executing the current node, it is determined whether the target structural unit is in the post-processing table. If so, the post-data processing computation graph corresponding to the target structural unit is retrieved from the post-processing table and the current processing data is processed based on the post-data processing computation graph to obtain a data processing result. If not, the current processing data is determined as the data processing result. The processing of the target data to obtain a data processing result according to the current node and / or the data processing calculation graph includes: processing the target data according to the pre-data processing calculation graph to obtain pre-processing data; if it is determined according to the pre-processing data that the current node is not to be executed and the target structural unit is in a post-processing table, determining a post-data processing calculation graph corresponding to the target structural unit from the post-processing table, processing the pre-processing data according to the post-data processing calculation graph to obtain the data processing result; or, if it is determined according to the pre-processing data that the current node is not to be executed and the target structural unit is not in the post-processing table, determining the pre-processing data as the data processing result. Specifically, when the target structural unit is in the pre-processing table, the pre-data processing calculation graph corresponding to the target structural unit is determined from the pre-processing table, and the target data is processed using the pre-data processing calculation graph to obtain pre-processing data. When it is determined based on the pre-processing data that the current node is not to be executed further, it is determined whether the target structural unit is in the post-processing table. If so, the pre-processing data is processed using the post-data processing calculation graph to obtain a data processing result. If not, that is, the target structural unit is not in the post-processing table, the pre-processing data is determined as the data processing result. When the current node is not to be executed further, the current node is deleted.The data processing method provided in the present embodiment implements dynamic insertion of other computational flows into the target computation graph by inserting a pre-data processing computation graph and a post-data processing computation graph before / after executing the current node during target model inference. In one or more embodiments of this specification, if the target structural unit is not in the pre-processing table, the target data is processed using the current node. The specific implementation is as follows: Determining the data processing computation graph corresponding to the current node includes: determining the target structural unit of the target model corresponding to the current node according to a target mapping table; if the target structural unit is not in the pre-processing table, processing the target data according to the current node to obtain the currently processed data; and if the target structural unit is in the post-processing table, determining the post-data processing computation graph corresponding to the target structural unit from the post-processing table. Specifically, if the target structural unit is not in the pre-processing table, the current node is executed according to the order in the target computation graph. The target data is processed using the current node to obtain the currently processed data. After executing the current node, it is determined whether the target structural unit is in the post-processing table. If so, the post-data computation graph corresponding to the target structural unit in the post-processing table is used to process the data. The data processing method provided in the embodiments of this specification uses the pre-processing table and the post-processing table to orderly manage the data processing process of each structural unit in a complex model, ensuring that data flows and is processed according to preset rules at different stages. In one or more embodiments of this specification, after executing the current node, if the target structural unit is in the post-processing table, a post-data processing computation graph is determined and used to process the currently processed data. A specific implementation method is as follows: Processing the target data according to the current node and / or the data processing computation graph to obtain a data processing result includes processing the currently processed data according to the post-data processing computation graph to obtain the data processing result. Specifically, when the target structural unit is in the post-processing table, the post-data processing calculation graph corresponding to the target structural unit is determined from the post-processing table, and the post-data processing calculation graph is used to process the current processing data to obtain the data processing result.The data processing method provided in the embodiments of this specification determines whether the target structural unit is in a post-processing table after executing the current node. If the target structural unit is in the post-processing table, the corresponding post-processing calculation graph can be found in the post-processing table to ensure that the data undergoes necessary pre-processing before entering the next node, thereby improving the accuracy of data transmission. In one or more embodiments of this specification, the target calculation graph of the target model has multiple nodes. After executing the entire calculation process of the current node, it is determined whether the next node of the current node still exists. If so, the data processing result is transferred to the next node, and the next node is determined as the current node. The specific implementation method is as follows: After obtaining the data processing result, the method further includes: determining whether the next node of the current node exists. If so, the next node of the current node is determined as the current node, and the data processing result is used as the target data. The step of determining the data processing calculation graph corresponding to the current node is executed, and the target data is processed according to the current node and / or the data processing calculation graph to obtain the data processing result. If not, the data processing result is output. During the target model inference process, a check is performed to determine whether the current node has a subsequent node. If the current node has a subsequent node, the next node is set as the current node, and the data processing result obtained at the current node is used as the target data. Then, the steps of determining the data processing computation graph corresponding to the current node are executed based on the newly determined current node. The target data is processed according to the current node and / or the data processing computation graph to obtain a data processing result. The target data is then processed accordingly to obtain a data processing result. This process is repeated until all nodes in the target computation graph have been executed. If the current node has no subsequent node, it means that the model inference process has reached the end of the target computation graph. At this point, iteration to the next node is not continued, and the current data processing result is directly output. The data processing method provided in this embodiment ensures that the input target data can be calculated and processed layer by layer at each node according to the design of the target computation graph, ultimately resulting in the model prediction or inference result.The data processing method provided in the embodiments of this specification determines a target computation graph for a target model. When target data is input to the target model, the target computation graph cannot be updated while the target model is running. That is, the target computation graph is fully defined and compiled before the target model is running. This facilitates optimizing the compilation of the target computation graph before model inference, reducing the processor's computational burden and improving processor execution efficiency. Furthermore, by flexibly invoking the data processing computation graph, the target model can perform efficient and accurate pre-processing or post-processing operations on the target data, enabling dynamic insertion of computational flows into the target computation graph without the need for secondary compilation. This reduces computation graph compilation overhead, reduces the demand and consumption of computer hardware resources, and improves model inference efficiency. Referring to FIG6 , FIG6 shows a flowchart of a single-node processing process of a data processing method provided in one embodiment of this specification, specifically including the following steps: Step 602: Obtain the target structural unit corresponding to the current node based on the target mapping table. In practical applications, a target model implemented using a dynamic graph architecture is obtained, and the target model's dynamic computation graph is converted into a static computation graph. Based on the correspondence between each node in the static computation graph and each structural unit in the model structure, a node->block mapping table (i.e., the target mapping table) is constructed. A node represents each node in the static computation graph, and a block represents a structural unit in the model structure. When executing the model inference process, calculations are performed node by node according to the static computation graph. For the current node, the block corresponding to the current node is first obtained according to the node->block mapping table. Step 604: Determine whether the target structural unit is in the pre-processing table. If so, execute step 606; if not, execute step 610. Determine whether the block corresponding to the current node is in the pre_process table (i.e., the pre-processing table in the above embodiment). If so, execute step 606, i.e., execute the computation graph corresponding to the block in the pre_process table. If not, execute step 610, i.e., directly execute the computation for the current node. Step 606: Execute the pre-data processing computation graph corresponding to the target structural unit in the pre-processing table. If the block corresponding to the current node is in the pre_process table, the computation graph corresponding to the block in the pre_process table is executed, and the returned data (i.e., the pre-processed data in the above embodiment) and the result of whether to continue the computation are obtained. Step 608: Determine whether to continue the computation. If so, execute step 610; if not, execute step 612.If the calculation is determined to continue, the calculation of the current node is executed. This is equivalent to inserting a calculation graph before the current node, implementing the calculation graph addition function. If the calculation is not to continue, the calculation of the current node is skipped, and the returned data is passed to the node next to the current node, implementing the current node deletion function. Step 610: Execute the calculation of the current node. Step 612: Determine whether the target structural unit is in the post-processing table. If so, execute step 614; if not, execute step 616. Similarly, after executing the current node, the block of the current node is obtained according to the node->block mapping table. Then, the block is checked to see if it is in the after_process table. If it is, execute step 614, executing the calculation graph corresponding to the block in the after_process table. If not, the entire calculation process for the current node is terminated. Step 614: Execute the post-data processing calculation graph corresponding to the target structural unit in the post-processing table. If the block of the current node is in the after_process table, the computation graph corresponding to the block in the after_process table is executed, and the return data (i.e., the data processing result in the above embodiment) is obtained. Step 616: End. The entire computation flow of the current node is completed, and the obtained data processing result is passed to the node next to the current node. The data processing method provided in the embodiments of this specification, by flexibly calling the data processing computation graph, can ensure that the target model performs efficient and accurate pre-processing or post-processing operations on the target data. This allows for the dynamic insertion of computation flows into the target computation graph without the need for secondary compilation, saving computation graph compilation overhead, reducing the demand and consumption of computer hardware resources, and improving model inference efficiency. Referring to Figure 7, Figure 7 shows a flowchart of a text processing method provided in one embodiment of this specification, which specifically includes the following steps.Step 702: Determine a target computation graph for a target model and input a target text into the target model, wherein the target model is a machine learning model, the target computation graph is constructed from multiple nodes and edges connecting the nodes, and the target computation graph cannot be updated while the target model is running. Step 704: Determine a current node for processing the target text from the target computation graph, wherein the current node is any one of the multiple nodes. Step 706: Determine a text processing computation graph corresponding to the current node, and process the target text based on the current node and / or the text processing computation graph to obtain a text processing result. Specifically, the text processing method will be described in detail using a deep learning text classification model as an example. The text classification model is constructed in the form of a dynamic graph, which is first converted into a static computation graph to facilitate management and optimize the inference process. Based on the model structure (such as word embedding layer, convolutional layer, recurrent neural network layer, fully connected layer, etc.), a node->block mapping table is constructed. Each node represents a computational step in the static computation graph, while the block corresponds to the actual structural unit of the text classification model. During the model inference phase, given the target text as input, node computations are performed sequentially according to the static computation graph. Assuming the current node corresponds to the word embedding layer (block), the preprocessing table is searched to find a preprocessing graph for this block. For example, preprocessing such as word segmentation or padding is performed on the input target text to obtain the preprocessed data. The preprocessed data is then determined to meet the conditions for continued computation (such as data validity and appropriate length). If the conditions are met, the actual computation of the current node (word embedding layer) is performed, converting the preprocessed text into a word vector representation. After the current node's calculation is complete, the post-processing table is checked to see if there is a pre-text processing computation graph for the current node, such as one that performs data normalization or other post-processing steps. If so, the corresponding post-data processing computation graph is executed and the result is obtained. If not, the current node's calculation process is terminated and the result is passed to the next node. The text processing method provided in the embodiments of this specification, by calling the data processing computation graph, can flexibly insert or delete portions of the static computation graph to accommodate different data pre-processing or post-processing requirements, thereby optimizing the inference efficiency and effectiveness of the entire target model. Referring to Figure 8, a flowchart of an image processing method provided in one embodiment of this specification is shown, specifically including the following steps.Step 802: Determine a target computation graph for a target model and a target image to be input into the target model, wherein the target model is a machine learning model, the target computation graph is constructed from multiple nodes and edges connecting the nodes, and the target computation graph cannot be updated while the target model is running. Step 804: Determine a current node for processing the target image from the target computation graph, wherein the current node is any one of the multiple nodes. Step 806: Determine an image processing computation graph corresponding to the current node, and process the target image based on the current node and / or the image processing computation graph to obtain an image processing result. Specifically, the image processing method is described in detail using an image classification model as an example. The image classification model includes multiple structural units, such as an input layer, a convolutional layer, a pooling layer, a fully connected layer, and an output layer. After converting the dynamic graph to a static computation graph, first, a mapping relationship between nodes and model structural units is constructed based on the static computation graph of the image classification model. For example, a certain node corresponds to the computation of the first convolutional layer. During the model inference phase, when a target image is input, node calculations are performed sequentially according to the static computation graph. Based on the node->block mapping table, it is determined that the current node corresponds to the first convolutional layer. A determination is made as to whether this convolutional layer is in the pre-processing table. If so, the computation graph corresponding to this convolutional layer in the pre-processing table is executed. Pre-processing operations are performed on the input target image according to this computation graph to obtain normalized image data. A determination is then made as to whether the computation for the current node needs to continue. The computation for the current node (i.e., the first convolutional layer) is then executed, and feature extraction is performed on the pre-processed image data to obtain a feature extraction result. A determination is then made as to whether the current node is in the post-processing table. If not, the feature extraction result is passed to the next node. The image processing methods provided in the embodiments of this specification, by invoking the data processing computation graph, can flexibly insert or delete portions of the static computation graph to accommodate different data pre-processing or post-processing requirements, thereby optimizing the inference efficiency and effectiveness of the entire target model. Corresponding to the aforementioned method embodiments, this specification also provides embodiments of a data processing device. Figure 9 shows a schematic structural diagram of a data processing device provided in one embodiment of this specification.As shown in Figure 9, the device includes: a data determination module 902, configured to determine a target computation graph of a target model and target data input into the target model, wherein the target model is a machine learning model, the target computation graph is constructed by multiple nodes and edges connecting the nodes, and the target computation graph is a computation graph that cannot be updated when the target model is running; a node determination module 904, configured to determine a current node for processing the target data from the target computation graph, wherein the current node is any one of the multiple nodes; a result acquisition module 906, configured to determine a data processing computation graph corresponding to the current node, process the target data according to the current node and / or the data processing computation graph, and obtain a data processing result. Optionally, the result acquisition module 906 is further configured to: determine, according to a target mapping table, a target structure unit of the target model corresponding to the current node; and if the target structure unit is in a pre-processing table, determine, from the pre-processing table, a pre-data processing calculation graph corresponding to the target structure unit, wherein the pre-processing table includes a mapping relationship between the target structure unit and the pre-data processing calculation graph, and the pre-data processing calculation graph is used to perform pre-processing on the target processing data. Optionally, the result acquisition module 906 is further configured to: process the target data according to the pre-data processing calculation graph to obtain pre-processing data; when it is determined to execute the current node according to the pre-processing data, process the pre-processing data according to the current node to obtain current processing data; when the target structure unit is in a post-processing table, determine the post-data processing calculation graph corresponding to the target structure unit from the post-processing table, wherein the post-processing table includes a mapping relationship between the target structure unit and the post-data processing calculation graph, and the post-data processing calculation graph is used to perform post-processing on the target processing data; and process the current processing data according to the post-data processing calculation graph to obtain the data processing result.Optionally, the result obtaining module 906 is further configured to: process the target data according to the pre-data processing calculation graph to obtain pre-processing data; if it is determined according to the pre-processing data that the current node is not to be executed and the target structural unit is in the post-processing table, determine the post-data processing calculation graph corresponding to the target structural unit from the post-processing table, and process the pre-processing data according to the post-data processing calculation graph to obtain the data processing result; or, if it is determined according to the pre-processing data that the current node is not to be executed and the target structural unit is not in the post-processing table, determine the pre-processing data as the data processing result. Optionally, the result obtaining module 906 is further configured to: determine the target structural unit of the target model corresponding to the current node according to a target mapping table; if the target structural unit is not in the pre-processing table, process the target data according to the current node to obtain current processing data; and if the target structural unit is in the post-processing table, determine the post-data processing calculation graph corresponding to the target structural unit from the post-processing table. Optionally, the result acquisition module 906 is further configured to: process the current processing data according to the post-data processing computation graph to obtain the data processing result. Optionally, the data determination module 902 is further configured to: obtain the target model, use the processing operations of the target model for data processing as the nodes, and use the associations between the processing operations as edges; and construct the target computation graph based on the nodes and edges. Optionally, the data determination module 902 is further configured to: construct an initial computation graph based on the nodes and edges; perform redundancy elimination on target nodes and target edges in the initial computation graph to obtain a target computation graph for the target model, so that the target model runs under a low utilization state of the target processor. The apparatus further includes: a construction module configured to determine structural units for constructing the target model, wherein the structural units are network layers of the target model; determine the structural units corresponding to each node in the target computation graph; and construct the target mapping table based on the mapping relationships between the nodes in the target computation graph and the structural units of the target model.The apparatus further includes a post-processing module configured to determine whether a next node exists for the current node. If so, the next node is determined as the current node, and the data processing result is used as the target data. The module then executes the step of determining the data processing computation graph corresponding to the current node, processes the target data according to the current node and / or the data processing computation graph, and obtains a data processing result. If the next node does not exist, the module outputs the data processing result. Optionally, the data determination module 902 is further configured to determine a target computation graph for the target model and input target data for the target model based on the hardware resources of the computer hardware supporting machine learning model calculations. The above is a schematic diagram of a data processing apparatus according to this embodiment. It should be noted that the technical solution of this data processing apparatus and the technical solution of the above-described data processing method are based on the same concept. For details not described in detail in the technical solution of the data processing apparatus, please refer to the description of the technical solution of the above-described data processing method. Corresponding to the above-described method embodiment, this specification also provides an embodiment of a text processing apparatus. Figure 10 shows a schematic structural diagram of a text processing apparatus according to one embodiment of this specification. As shown in Figure 10 , the device includes: a text determination module 1002 configured to determine a target computation graph for a target model and input a target text into the target model, wherein the target model is a machine learning model, the target computation graph is constructed from multiple nodes and edges connecting the nodes, and the target computation graph is a computation graph that cannot be updated while the target model is running; a node determination module 1004 configured to determine a current node for processing the target text from the target computation graph, wherein the current node is any one of the multiple nodes; and a result acquisition module 1006 configured to determine a text processing computation graph corresponding to the current node, and process the target text based on the current node and / or the text processing computation graph to obtain a text processing result. The above is a schematic diagram of a text processing device according to this embodiment. It should be noted that the technical solution of the text processing device and the technical solution of the aforementioned data processing method are based on the same concept. Details not described in detail in the technical solution of the text processing device can be found in the description of the technical solution of the aforementioned data processing method. Corresponding to the above method embodiments, this specification also provides an image processing device embodiment. FIG11 shows a schematic structural diagram of an image processing device provided in one embodiment of this specification.As shown in Figure 11 , the apparatus includes: an image determination module 1102 configured to determine a target computation graph for a target model and a target image input to the target model, wherein the target model is a machine learning model, the target computation graph is constructed from multiple nodes and edges connecting the nodes, and the target computation graph is a computation graph that cannot be updated while the target model is running; a node determination module 1104 configured to determine a current node for processing the target image from the target computation graph, wherein the current node is any one of the multiple nodes; and a result acquisition module 1106 configured to determine an image processing computation graph corresponding to the current node, and process the target image based on the current node and / or the image processing computation graph to obtain an image processing result. The above is a schematic diagram of an image processing apparatus according to this embodiment. It should be noted that the technical solution of the image processing apparatus and the technical solution of the aforementioned data processing method share the same concept. Details not described in detail in the technical solution of the image processing apparatus can be found in the description of the technical solution of the aforementioned data processing method. Figure 12 shows a block diagram of a computing device 1200 according to one embodiment of this specification. The components of the computing device 1200 include, but are not limited to, a memory 1210 and a processor 1220. The processor 1220 is connected to the memory 1210 via a bus 1230. A database 1250 is used to store data. The computing device 1200 also includes an access device 1240 that enables the computing device 1200 to communicate via one or more networks 1260. Examples of such networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet.The access device 1240 may include one or more of any type of wired or wireless network interface (e.g., a network interface card (NIC)), such as an IEEE802.11 wireless local area network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, and a universal serial bus.

[0005] (USB, Universal Serial Bus) interface, cellular network interface, Bluetooth interface, Near Field Communication (NFC). In one embodiment of this specification, the aforementioned components of computing device 1200 and other components not shown in FIG12 may also be connected to each other, for example, via a bus. It should be understood that the computing device structure block diagram shown in FIG12 is for illustrative purposes only and does not limit the scope of this specification. Those skilled in the art may add or replace other components as needed. Computing device 1200 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, personal digital assistant, laptop computer, notebook computer, netbook, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or personal computer (PC). Computing device 1200 may also be a mobile or stationary server. The processor 1220 is configured to execute the following computer program / instructions, which, when executed by the processor, implement the steps of the aforementioned data processing method, text processing method, or image processing method. The various embodiments in this specification are described in a progressive manner. Similar or identical portions between the various embodiments may be referred to in conjunction with each other. Each embodiment focuses on the differences from other embodiments. In particular, the computing device embodiment is generally similar to the data processing method embodiment, so the description is relatively simple. For relevant portions, refer to the description of the data processing method embodiment. This specification also provides a computer-readable storage medium storing a computer program / instructions. When executed by the processor, the computer program / instructions implement the steps of the aforementioned data processing method, text processing method, or image processing method. The various embodiments in this specification are described in a progressive manner. Similar or identical portions between the various embodiments may be referred to in conjunction with each other. Each embodiment focuses on the differences from other embodiments. In particular, the computer-readable storage medium embodiment is generally similar to the data processing method embodiment, so the description is relatively simple. For relevant portions, refer to the description of the data processing method embodiment.One embodiment of this specification also provides a computer program product, including a computer program / instructions. When executed by a processor, these computer program / instructions implement the steps of the aforementioned data processing method, text processing method, or image processing method. The above is an illustrative embodiment of a computer program product according to this embodiment. It should be noted that the technical solution of this computer program product and the technical solution of the aforementioned data processing method are based on the same concept. For details not described in detail in the technical solution of the computer program product, please refer to the description of the technical solution of the aforementioned data processing method. The above describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. In addition, the processes depicted in the figures do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous. The computer instructions include computer program code, which may be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium may include any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electric carrier signal, a telecommunications signal, and a software distribution medium. It should be noted that the content of the computer-readable medium may be appropriately increased or decreased based on the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electric carrier signals and telecommunications signals. It should be noted that for ease of description, the aforementioned method embodiments are described as a series of actions. However, those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, as certain steps may be performed in a different order or simultaneously according to the embodiments of this specification. Furthermore, those skilled in the art should also be aware that the embodiments described in this specification are preferred embodiments, and the actions and modules involved are not necessarily required for the embodiments of this specification. In the above embodiments, the description of each embodiment has its own focus. For parts not described in detail in a particular embodiment, reference can be made to the relevant descriptions of other embodiments. The preferred embodiments disclosed above are only used to help explain this specification.The optional embodiments do not describe all details in detail, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations are possible based on the content of the embodiments in this specification. This specification selects and describes these embodiments in detail to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.

Claims

Claims 1. A data processing method, comprising: Determine a target computation graph of a target model and target data input into the target model, wherein the target model is a machine learning model, the target computation graph is constructed by multiple nodes and edges connecting the nodes, and the target computation graph is a computation graph that cannot be updated while the target model is running; determine a current node for processing the target data from the target computation graph, wherein the current node is any one of the multiple nodes; determine a data processing computation graph corresponding to the current node, and process the target data according to the current node and / or the data processing computation graph to obtain a data processing result.

2. The data processing method according to claim 1, wherein determining the data processing calculation graph corresponding to the current node comprises: Determining, according to a target mapping table, a target structural unit of the target model corresponding to the current node; In a case where the target structural unit is in a pre-processing table, a pre-data processing calculation graph corresponding to the target structural unit is determined from the pre-processing table, wherein the pre-processing table includes a mapping relationship between the target structural unit and the pre-data processing calculation graph, and the pre-data processing calculation graph is used to perform pre-processing on the target processing data.

3. The data processing method according to claim 2, wherein processing the target data according to the current node and / or the data processing calculation graph to obtain a data processing result comprises: Processing the target data according to the pre-data processing calculation graph to obtain pre-processed data; In a case where the current node is determined to be executed according to the pre-processing data, processing the pre-processing data according to the current node to obtain current processing data; If the target structural unit is in a post-processing table, determining a post-data processing calculation graph corresponding to the target structural unit from the post-processing table, wherein the post-processing table includes a mapping relationship between the target structural unit and the post-data processing calculation graph, and the post-data processing calculation graph is used to perform post-processing on the target processing data; According to the post-data processing calculation graph, the current processing data is processed to obtain the data processing result.

4. The data processing method according to any one of claims 2 to 3, wherein processing the target data according to the current node and / or the data processing computation graph to obtain a data processing result comprises: Processing the target data according to the pre-data processing calculation graph to obtain pre-processed data; If it is determined based on the pre-processing data that the current node is not to be executed and the target structural unit is in the post-processing table, a post-data processing calculation graph corresponding to the target structural unit is determined from the post-processing table, and the pre-processing data is processed according to the post-data processing calculation graph to obtain the data processing result. Alternatively, if it is determined based on the pre-processing data that the current node is not to be executed and the target structural unit is not in the post-processing table, the pre-processing data is determined as the data processing result.

5. The data processing method according to any one of claims 1 to 4, wherein determining the data processing computation graph corresponding to the current node comprises: Determining, according to a target mapping table, a target structural unit of the target model corresponding to the current node; When the target structural unit is not in the pre-processing table, processing the target data according to the current node to obtain current processing data; In the case that the target structural unit is in the post-processing table, a post-data processing calculation graph corresponding to the target structural unit is determined from the post-processing table.

6. The data processing method according to claim 5, wherein the current node and / or the data processing The calculation graph is processed to process the target data to obtain a data processing result, including: According to the post-data processing calculation graph, the current processing data is processed to obtain the data processing result.

7. The data processing method according to any one of claims 1 to 6, wherein determining the target computation graph of the target model comprises: The target model is obtained, processing operations for data processing of the target model are used as the nodes, and associations between the processing operations are used as edges; and the target computation graph is constructed according to the nodes and the edges.

8. The data processing method according to claim 7, wherein constructing the target computation graph according to the nodes and the edges comprises: Constructing an initial computation graph based on the nodes and the edges; A redundancy elimination operation is performed on target nodes and target edges in the initial computation graph to obtain a target computation graph of the target model, so that the target model runs in a state of low utilization of the target processor.

9. The data processing method according to any one of claims 2 to 8, before determining the target structural unit of the target model corresponding to the current node according to the target mapping table, further comprising: Determining a structural unit for constructing the target model, wherein the structural unit is a network layer of the target model; determining a structural unit corresponding to each node in the target computation graph; and constructing the target mapping table based on a mapping relationship between the nodes in the target computation graph and the structural units of the target model.

10. The data processing method according to claim 3, 4 or 6, after obtaining the data processing result, further comprising: Determine whether there is a next node of the current node; if so, determine the next node of the current node as the current node, use the data processing result as the target data, execute the data processing calculation graph corresponding to the current node, process the target data according to the current node and / or the data processing calculation graph, and obtain a data processing result; if not, output the data processing result.

11. The data processing method according to any one of claims 1 to 10, wherein the data processing method is applied to computer hardware that supports machine learning model calculations.

12. The data processing method according to claim 11, wherein determining a target calculation graph of a target model and inputting target data of the target model comprises: Based on the hardware resources of the computer hardware supporting the machine learning model calculation, determine the target calculation graph of the target model and the target data input into the target model.

13. A text processing method, comprising: Determine a target computation graph of a target model and input a target text into the target model, wherein the target model is a machine learning model, the target computation graph is constructed by multiple nodes and edges connecting the nodes, and the target computation graph is a computation graph that cannot be updated when the target model is running; determine a current node for processing the target text from the target computation graph, wherein the current node is any one of the multiple nodes; determine a text processing computation graph corresponding to the current node, and process the target text according to the current node and / or the text processing computation graph to obtain a text processing result.

14. An image processing method, comprising: Determine a target computation graph of a target model and input a target image of the target model, wherein the target model is a machine learning model, the target computation graph is constructed by a plurality of nodes and edges connecting the nodes, and the target computation graph is a computation graph that cannot be updated when the target model is running; determine a current node for processing the target image from the target computation graph, wherein the current node is Any one of the multiple nodes; determining an image processing calculation graph corresponding to the current node, processing the target image according to the current node and / or the image processing calculation graph, and obtaining an image processing result.

15. A computing device comprising: memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, the steps of the method according to any one of claims 1 to 14 are implemented.

16. A computer-readable storage medium storing a computer program / instruction, wherein the computer program / instruction, when executed by a processor, implements the steps of the method according to any one of claims 1 to 14.

17. A computer program product comprising a computer program / instructions, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 14.

Citation Information

Patent Citations

  • Graph compiling method and device for calculation graph, equipment and storage medium

    CN111338635A

  • Processing unit, calculation device, and calculation graph processing method of deep learning model

    CN113642721A

  • Data processing method and device, electronic equipment and storage medium

    CN113760394A

  • Image processing method and device, computer equipment and storage medium

    CN113887396A

  • Model compiling method and device, compiler and model operation system

    CN116029385A

Cited By

  • Techniques to optimize neural networks

    CN114638335A

  • A deep learning kernel fusion method and device based on image-driven analysis

    CN122433024A