Data processing method and device based on model calling, equipment and storage medium
By pre-deploying multiple deep learning models in the cloud server and using the model calling method to process client requests, the problem of long loading and inference time caused by the increase in the size of deep learning model parameters is solved, achieving user-friendly use and A wide range of model application scenarios.
Patent Information
- Application Number
- CN202310158585.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-22
- Publication Date
- 2024-08-23
AI Technical Summary
The increase in the parameter volume of deep learning models causes model loading and result inference to take too long, limiting user usage scenarios.
Using a data processing method based on model calling, multiple models are pre-deployed through the cloud server. The client requests data processing and then processes it in the cloud server. The model layer, algorithm layer and adaptation layer are used for data processing, result integration and format conversion. , return the processing result.
There is no need for users to load and reason about large model parameters on the client, which reduces hardware requirements, enables users to use it conveniently at any time, and expands the use scenarios of the model.
Smart Images

Figure CN118536615A
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a data processing method, device, equipment and storage medium based on model calling. Background Art
[0002] While deep learning models can bring higher-precision results, the magnitude of their weight parameters also increases. For example, the Resnet50 model, a benchmark network in the field of visual perception, has 25 million parameters; and the GPT-4 (Generative Pre-Training) model, a benchmark network in the field of natural language models, has parameters as high as 10 trillion.
[0003] The increase in the size of model parameters causes the model loading and result inference to take too long, and users cannot use it at any time and conveniently, which limits the model's usage scenarios. Summary of the invention
[0004] The main purpose of this application is to provide a data processing method based on model calling, aiming to solve the technical problem of limited usage scenarios of the model.
[0005] To achieve the above-mentioned purpose, the present application provides a data processing method based on model calling, which is applied to a cloud server, wherein a plurality of models are pre-deployed in the cloud server. The data processing method based on model calling comprises the following steps:
[0006] Receive data processing requests provided by the client;
[0007] Inputting the data processing request into a preset model reasoning structure, and processing the data processing request based on the preset model reasoning structure to obtain a target processing result;
[0008] The preset model reasoning structure includes a model layer, and the model layer is used to call a data processing model from the pre-deployed multiple models, and process the data processing request based on the data processing model;
[0009] The target processing result is returned to the client.
[0010] In a possible implementation of the present application, the preset model reasoning structure further includes an algorithm layer and an adaptation layer, and the step of processing the data processing request based on the preset model reasoning structure to obtain a target processing result includes:
[0011] Processing the data processing request based on the data processing model called by the model layer from the pre-deployed multiple models to obtain a first processing result;
[0012] Based on the algorithm layer, analyzing and integrating the first processing result to obtain a second processing result;
[0013] Based on the adaptation layer, the second processing result is format converted to obtain a target processing result.
[0014] In a possible implementation manner of the present application, the step of processing the data processing request based on the data processing model called by the model layer from the pre-deployed multiple models to obtain a first processing result includes:
[0015] Based on the model layer, a data processing model is called from a GPU server deployed with NVIDIA Triton server, and the data processing request is processed in the GPU server based on the data processing model to obtain a first processing result.
[0016] In a possible implementation manner of the present application, the data processing algorithm includes an integration algorithm, and the step of analyzing and integrating the first processing result based on the algorithm layer to obtain the second processing result includes:
[0017] Selecting a corresponding data processing algorithm based on the processing type of the data processing request;
[0018] Based on the integration algorithm in the data processing algorithm, the first processing result is analyzed and integrated to obtain a second processing result.
[0019] In a possible implementation manner of the present application, the step of selecting a corresponding data processing algorithm based on the processing type of the data processing request includes:
[0020] Based on the processing type of the data processing request, calling at least one corresponding data processing algorithm from outside the preset model reasoning structure;
[0021] The step of analyzing and integrating the first processing result based on the integration algorithm in the data processing algorithm to obtain the second processing result includes:
[0022] Based on the integration algorithm in the at least one data processing algorithm, the first processing result is analyzed and integrated to obtain at least one second processing result.
[0023] In a possible implementation manner of the present application, the data processing algorithm further includes a model processing algorithm. Before the step of analyzing and integrating the first processing result based on the integration algorithm in the data processing algorithm to obtain the second processing result, the method further includes:
[0024] If there are multiple data processing algorithms, then based on the model algorithms among the multiple data processing algorithms, the data processing models are tested respectively using preset test data sets;
[0025] Determine the model algorithm corresponding to the data processing model with the highest accuracy, so that the algorithm layer can analyze and integrate the first processing result based on the corresponding model algorithm to obtain the second processing result.
[0026] In a possible implementation manner of the present application, after the step of receiving the data processing request provided by the client, the method further includes:
[0027] If there are multiple data processing requests, multiple processes are configured for the multiple data processing requests;
[0028] Each process performs the following operations respectively: inputting a data processing request into a corresponding preset model reasoning structure, so that the corresponding preset model reasoning structure processes the data processing request.
[0029] The present application also provides a data processing device based on model calling, which is applied to a cloud server, wherein a plurality of models are pre-deployed in the cloud server, and the device comprises:
[0030] A request receiving module, used for receiving a data processing request provided by a client;
[0031] A data processing module, used for inputting the data processing request into a preset model reasoning structure, processing the data processing request based on the preset model reasoning structure, and obtaining a target processing result, wherein the preset model reasoning structure includes a model layer, the model layer is used for calling a data processing model from the pre-deployed multiple models, and processing the data processing request based on the data processing model;
[0032] The result returning module is used to return the target processing result to the client.
[0033] The present application also provides a model-call-based data processing device, the device comprising: a memory, a processor, and a model-call-based data processing program stored in the memory and executable on the processor, the model-call-based data processing program being configured to implement the steps of the model-call-based data processing method as described in any one of the above items.
[0034] The present application also provides a storage medium, on which a model-based data processing program is stored. When the model-based data processing program is executed by a processor, the steps of the model-based data processing method as described in any one of the above items are implemented.
[0035] The present application provides a data processing method based on model calling. Compared with the prior art, the increase in the volume of model parameters causes the model loading and result inference to take too long, and users cannot use it at any time and conveniently, resulting in limited model usage scenarios. The present application is applied to a cloud server, and multiple models are pre-deployed in the cloud server. By receiving a data processing request provided by a client; inputting the data processing request into a preset model inference structure, processing the data processing request based on the preset model inference structure, and obtaining a target processing result; wherein the preset model inference structure includes a model layer, and the model layer is used to call a data processing model from the pre-deployed multiple models, and process the data processing request based on the data processing model; and returning the target processing result to the client. It can be understood that the client's data processing request is processed through the preset model reasoning structure. Specifically, the client's data processing request is processed through the model layer in the preset model reasoning structure. During the processing, the model layer will call the data processing model from the pre-deployed multiple models, and based on the data processing model, process the data processing request. In this way, even if the model parameter volume is large, the user does not need to load the model and reason about the results on the client, but it is done in the cloud server. The hard conditions of the client are not high, and the user can use it at any time and conveniently, making the model more widely used. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 A schematic flow chart of a first embodiment of a data processing method based on model calling in the present application;
[0037] Figure 2 A schematic diagram of a first scenario of a data processing method based on model calling according to a first embodiment of the present application;
[0038] Figure 3 A schematic diagram of a second scenario of the data processing method based on model calling in the first embodiment of the present application;
[0039] Figure 4 It is a structural diagram of a data processing device based on model call in a hardware operating environment involved in an embodiment of the present application;
[0040] Figure 5 This is a schematic diagram of a data processing device based on model calling according to the first embodiment of the present application.
[0041] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0042] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application. Although the terms first, second, third, etc. may be used herein to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this article, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information.
[0043] The present application embodiment provides a data processing method based on model calling, referring to Figure 1 and Figure 2 In this embodiment, the data processing method based on model calling includes:
[0044] Step S10: receiving a data processing request provided by the client;
[0045] Step S20: inputting the data processing request into a preset model reasoning structure, and processing the data processing request based on the preset model reasoning structure to obtain a target processing result;
[0046] The preset model reasoning structure includes a model layer, and the model layer is used to call a data processing model from the pre-deployed multiple models, and process the data processing request based on the data processing model;
[0047] Step S30: Return the target processing result to the client.
[0048] At present, artificial intelligence is the theory and development of computer systems that can achieve visual perception, speech recognition, decision-making and language translation. Since the introduction of the AlexNet neural network in 2012, the excellent performance of deep learning algorithms has far exceeded that of traditional algorithms, and the era of deep learning has officially arrived. As the accuracy of deep learning models continues to improve, deep learning models can bring higher-precision results, while the magnitude of their weight parameters also increases. For example, the benchmark network Resnet50 model in the field of visual perception has 25 million parameters; and the benchmark network GPT-4 (Generative Pre-Training) model in the field of natural language models has parameters as high as 10 megabytes. The increase in the size of model parameters causes the model to take too long to load and reason about the results, and users cannot use it at any time and conveniently, resulting in limited usage scenarios of the model.
[0049] The purpose of this embodiment is to: when a model with a large parameter volume needs to be used, the use scenario of the model is no longer restricted by model calling.
[0050] The specific steps are as follows:
[0051] Step S10: receiving a data processing request provided by the client;
[0052] In this embodiment, the data processing method based on model calling can be applied to a cloud server.
[0053] In this embodiment, at least a CPU (Central Processing Unit) server or a GPU (Graphics Processing Unit) server is deployed in the cloud server, which is not limited here.
[0054] In this embodiment, the cloud server is pre-deployed with multiple models. Specifically, the multiple models may be deployed in the CPU server and / or the GPU server, which is not limited here.
[0055] In this embodiment, the data processing request provided by the client is received through the preset service interface of the cloud server. The preset service interface can be a Flask web server or an HTTP type interface, etc., which is not limited here.
[0056] In this embodiment, the client may be a web browser or a mobile client, etc., which is not limited here.
[0057] In this embodiment, the data processing request can be submitted by the user through the client, and the client sends the data processing request to the preset service interface. It can also be sent to the preset service interface after being automatically triggered based on the user's operation on the client, which is not limited here.
[0058] As an example, the data processing request may be an image recognition request, or an audio content translation request, etc., which is not limited here.
[0059] As an example, the data processing request may include data to be processed and / or request information, etc., which is not limited here.
[0060] Step S20: inputting the data processing request into a preset model reasoning structure, and processing the data processing request based on the preset model reasoning structure to obtain a target processing result, wherein the preset model reasoning structure includes a model layer, and the model layer is used to call a data processing model from the pre-deployed multiple models, and process the data processing request based on the data processing model;
[0061] In this embodiment, the data processing request is input into a preset model reasoning structure through a preset service interface, wherein the preset model reasoning structure includes at least a model layer.
[0062] In this embodiment, the model layer is used to call a data processing model from the pre-deployed multiple models, and process the data processing request based on the data processing model.
[0063] In this embodiment, in order to improve the data processing efficiency of the model layer and to provide a clear division of labor between the various levels in the preset model reasoning structure, the preset model reasoning structure is further provided with an algorithm layer and an adaptation layer.
[0064] Specifically, Figure 3 As shown, the preset model reasoning structure is a logical encapsulation of the model layer, algorithm layer and adaptation layer.
[0065] As an example, the adaptation layer is used to perform log management, exception management, input and output specification management, etc. on the preset model reasoning structure, which is not limited here.
[0066] As an example, the algorithm layer is used to provide algorithms for the model layer, and is also used to analyze and integrate the results output by the model layer, etc., which is not limited here.
[0067] In this embodiment, the step of inputting the data processing request into a preset model reasoning structure includes:
[0068] Step A1: inputting the data processing request into a preset model inference structure, wherein the data processing request is uploaded by a user in a preset input format through a preset service interface;
[0069] As an example, when the data processing request is input into the preset model reasoning structure through the preset service interface, in order to take into account the universality and stability of the preset model reasoning structure, its input format needs to be checked by the adaptation layer. If the preset input format is not met, the data processing service cannot be provided.
[0070] As an example, the preset input format can be a JSON (JavaScript Object Notation) string format, which is lightweight and can speed up data transmission; it can also be an xml (Extensible Markup Language) format, etc., without specific limitation.
[0071] Step A2: Based on the adaptation layer, the data processing request is parsed to obtain the data to be processed, so that the algorithm layer and the model layer can process the data to be processed to obtain the target processing result.
[0072] As an example, after the data processing request is input into the preset model inference structure through the preset service interface, first, the adaptation layer needs to verify the format of the data processing request based on the preset input format; secondly, since the data processing request not only includes the data to be processed, but also includes some request information, etc., specifically, the request information may be the request time, the processing type of the data to be processed, etc., the data to be processed is the part that the user needs to process, therefore, the adaptation layer also needs to parse out the data to be processed in the data processing request.
[0073] Specifically, based on the adaptation layer, the data processing request is parsed to obtain the data to be processed and the request information. The adaptation layer needs to transfer the data to be processed to the algorithm layer, and the algorithm layer then transfers the data to be processed to the model layer, so that the algorithm layer and the model layer can process the data to be processed and obtain the target processing result.
[0074] In this embodiment, the data to be processed is a base64 visible character code obtained by a user after encoding a picture or an audio file.
[0075] Since the data to be processed may be pictures, audio files, or numbers, in order to ensure that there will be no errors when uploading pictures and audio files in JSON format, users need to encode pictures and audio files to obtain base64 visible character codes, and then upload the base64 visible character codes in JSON format. Specifically, the base64 visible character codes obtained by users after encoding pictures or audio files are as follows:
[0076]
[0077] As an example, since the JSON format is a lightweight format, it has certain requirements on the size of the uploaded data to be processed, that is, the size of the base64 visible character code obtained after encoding also has certain requirements. Therefore, it is necessary to announce the size requirements of the data to be processed and the preset input format in advance for users to refer to when uploading data.
[0078] In this embodiment, the step of parsing the data processing request based on the adaptation layer to obtain the data to be processed includes:
[0079] Step D1: Based on the adaptation layer, the data processing request is parsed to obtain the identification of the data to be processed and the processing type, so that the model layer can call the corresponding data processing model based on the identification of the processing type.
[0080] As an example, since the request information includes the processing type of the data to be processed, the processing type of the data to be processed may be determined based on an identifier of the processing type carried in the data processing request.
[0081] As an example, the identification of the processing type may be an Image identification (image recognition), an Audio identification (audio translation), etc., which is not limited here.
[0082] As an example, the adaptation layer determines the processing type of the data processing request based on the identification of the processing type. The model layer can call the corresponding data processing model based on the processing type, and the algorithm layer can also call the corresponding algorithm based on the processing type, so that the model layer and the algorithm layer can improve the efficiency of model calling.
[0083] In this embodiment, the step of processing the data processing request based on the preset model reasoning structure to obtain the target processing result includes:
[0084] Step B1: Based on the data processing model called by the model layer from the pre-deployed multiple models, the data processing request is processed to obtain a first processing result;
[0085] As an example, the pre-deployed multiple models may include a data processing model, a natural language model, etc. Specifically, the data processing model may include an image recognition model, an audio translation model, etc., which is not limited here.
[0086] As an example, the pre-deployed multiple models can be deployed in a CPU server, or in a GPU server, etc. Specifically, the pre-deployed multiple models are models that are trained in advance and meet accuracy requirements and can be directly put into use.
[0087] As an example, the pre-deployed multiple models may include models with larger parameter magnitudes, or models with smaller parameter magnitudes, etc., without specific limitation.
[0088] As an example, the multiple pre-deployed models are relatively general models. Therefore, the model layer calls the data processing model from the multiple pre-deployed models, and uses the data processing model to process the data processing request based on different algorithms provided by the algorithm layer, and the first processing results obtained are different. The purpose is to be applicable to more types of data to be processed, without limiting the algorithm of the data processing model, so that the application scope of the model can be wider, and the model layer only needs to process the data to be processed at the digital level, and the first processing result obtained is the deep expression of the result by the model, which can reduce the workload of the model layer.
[0089] As an example, the model layer calls the data processing model from the pre-deployed multiple models. Specifically, it can be called from outside the preset model reasoning structure or from inside the preset model reasoning structure. The outside of the preset model reasoning structure can be other servers other than the server where the preset model reasoning structure is located, or it can be different processors in the server where the preset model reasoning structure is located, etc., which is not limited here.
[0090] In this embodiment, the step of processing the data processing request based on the data processing model called by the model layer from the pre-deployed multiple models to obtain a first processing result includes:
[0091] Step C1: Based on the model layer, a data processing model is called from a GPU server on which NVIDIA Triton server is deployed, and the data processing request is processed in the GPU server based on the data processing model to obtain a first processing result.
[0092] As an example, since NVIDIA Triton server (model inference server) supports simultaneous processing of multiple models, it also supports multiple deep learning model frameworks such as TensorFlow, PyTorch, ONNX, etc. The deep learning model framework is an open file format designed for machine learning and is used to store trained models.
[0093] As an example, models with larger parameter sizes can be pre-deployed in the NVIDIA Triton server. The NVIDIA Triton server can support the simultaneous running of multiple models with larger parameter sizes. In general, models with larger parameter sizes require the support of GPU servers. Therefore, deploying the NVIDIA Triton server that can deploy multiple models with larger parameter sizes on the GPU server can support model calls at the model layer.
[0094] As an example, the preset model reasoning structure can be deployed on the same GPU server as the NVIDIA Triton server, or on different servers (GPU server and / or CPU server, etc.). Specifically, if the two are deployed on the same server, the model layer can directly call the data processing model on the local server and run it on the local server when calling the data processing model; if the two are deployed on different servers, the data processing model can be called in the GPU server through the model layer and run on the GPU server (the data to be processed is processed based on the data processing model in the GPU server) to save the model import time between the two servers and reduce the hardware requirements for the server where the preset model reasoning structure is located. It only requires the server with a model with a larger parameter magnitude to have GPU processing capabilities and the ability to process multiple models simultaneously.
[0095] Step B2: Based on the algorithm layer, analyzing and integrating the first processing result to obtain a second processing result;
[0096] As an example, the algorithm layer is used to determine the algorithm used by the model layer in the data processing process, and is also used to analyze and integrate the results output by the model layer.
[0097] Specifically, the first processing result may be explicitly expressed through an activation function, or may be translated through a preset function to obtain a second processing result, where the second processing result is a simple expression of information that a user can directly obtain.
[0098] Step B3: Based on the adaptation layer, the second processing result is format converted to obtain a target processing result.
[0099] As an example, the adaptation layer is not only used to check the format of the input data processing request, but also used to convert the format of the output target processing result so that the user can receive the target processing result in the same format as the input format, ensuring the user experience and content readability.
[0100] As an example, the target processing result may be an image recognition result output in a JSON string format, or an audio translation result output in an XML format, etc., which is not limited here.
[0101] Step S30: Return the target processing result to the client.
[0102] As an example, after the adaptation layer obtains the target processing result, it sends the target processing result to the client through a preset service interface for the user to view on the client, thereby completing the data processing flow based on the model call.
[0103] In this embodiment, the data processing request of the client is processed by a preset model reasoning structure. Specifically, the data processing request of the client is processed by the model layer in the preset model reasoning structure. During the processing, the model layer calls the data processing model from the pre-deployed multiple models, and processes the data processing request based on the data processing model. In this way, even if the model parameter volume is large, the user does not need to load the model and infer the results on the client, but it is performed in the cloud server. The hard conditions of the client are not high, which lowers the threshold for the use of artificial intelligence algorithms. Users only need to understand the remote call to use it at any time and conveniently, and the client does not need a powerful computing device locally, which makes the model more widely used.
[0104] Further, based on the first embodiment of the present application, another embodiment of the present application is provided. In this embodiment, the step of analyzing and integrating the first processing result based on the algorithm layer to obtain the second processing result includes:
[0105] Step E1: Selecting a corresponding data processing algorithm based on the processing type of the data processing request;
[0106] As an example, the processing type may be an image recognition type, an audio translation type, etc. Specifically, it may be an identifier of the processing type obtained by analyzing the data processing request by the adaptation layer, the processing type is determined, and based on the processing type, the corresponding data processing algorithm is called.
[0107] As an example, the data processing algorithm includes a model algorithm of a data processing model and an integration algorithm for analyzing and integrating the first processing results.
[0108] Step E2: Based on the integration algorithm in the data processing algorithm, the first processing result is analyzed and integrated to obtain a second processing result.
[0109] As an example, the algorithm layer analyzes and integrates the first processing result based on the integration algorithm in the called data processing algorithm to obtain the second processing result.
[0110] In this embodiment, the step of selecting a corresponding data processing algorithm based on the processing type of the data processing request includes:
[0111] Step F1: Based on the processing type of the data processing request, calling at least one corresponding data processing algorithm from outside the preset model reasoning structure;
[0112] As an example, there may be multiple data processing algorithms based on the same data processing model, and there may be multiple data processing algorithms corresponding to the same processing type. Therefore, there may be multiple model algorithms and integration algorithms to be called.
[0113] As an example, the data processing algorithm is called from outside the preset model reasoning structure. Specifically, it can be called from the server where the preset model reasoning structure is located, or it can be called from other servers other than the server where the model reasoning structure is located.
[0114] The step of analyzing and integrating the first processing result based on the integration algorithm in the data processing algorithm to obtain the second processing result includes:
[0115] Step F2: Based on the integration algorithm in the at least one data processing algorithm, the first processing result is analyzed and integrated to obtain at least one second processing result.
[0116] As an example, if there is only one corresponding data processing algorithm (a model algorithm and an integration algorithm), then the model layer obtains only one first processing result based on the model algorithm, and the algorithm layer obtains only one second processing result based on the integration algorithm.
[0117] In this embodiment, before the step of analyzing and integrating the first processing result based on the integration algorithm in the at least one data processing algorithm to obtain at least one second processing result, the method further includes:
[0118] Step G1: if there are multiple data processing algorithms, then based on the multiple data processing algorithms, the data processing model is tested using a preset test data set respectively;
[0119] As an example, if there are multiple corresponding data processing algorithms (multiple model algorithms and / or multiple integration algorithms), the model layer may obtain multiple first processing results based on the multiple model algorithms, and the algorithm layer may also obtain multiple second processing results based on the multiple integration algorithms.
[0120] As an example, the multiple second processing results may be in different forms of expression, or may be substantially different processing results, etc., which is not limited here.
[0121] As an example, the obtained multiple second processing results can be sent to the adaptation layer, so that the adaptation layer processes them and sends them to the client, and the user can obtain multiple results, so that the user can obtain more comprehensive and diverse results.
[0122] As an example, a result with the highest accuracy can be screened out from multiple second processing results and sent to the adaptation layer. Specifically, it can be based on a model algorithm among the multiple data processing algorithms, and the data processing model can be tested using preset test data sets to obtain the accuracy of the multiple first processing results calculated through the multiple first processing results.
[0123] Step G2: Determine the model algorithm corresponding to the data processing model with the highest accuracy, analyze and integrate the first processing results, and obtain at least one second processing result.
[0124] As an example, the model algorithm used by the data processing model corresponding to the multiple first processing results with the highest accuracy is determined, and the algorithm layer then analyzes and integrates the first processing results with the highest accuracy based on the integration algorithm to obtain the second processing result, which is the result with the highest accuracy among the multiple second processing results. This method can further provide users with more accurate processing results and improve the accuracy of the results of multi-model processing.
[0125] In this embodiment, a method for model calling and result analysis integration in a multi-algorithm and multi-model situation is provided, which can provide users with multiple processing results after multi-algorithm and multi-model processing, and can also provide users with a processing result with the highest accuracy after multi-algorithm and multi-model processing, providing users with more choices and improving the diversity of the preset model reasoning structure.
[0126] Further, based on the first embodiment of the present application, another embodiment of the present application is provided. In this embodiment, after the step of receiving the data processing request provided by the client, the method further includes:
[0127] Step S40: If there are multiple data processing requests, multiple processes are configured for the multiple data processing requests, wherein each process performs the following operations: inputs the data processing request into the corresponding preset model reasoning structure, so that the corresponding preset model reasoning structure processes the data processing request.
[0128] As an example, since a preset service interface can receive multiple data processing requests, if the same channel is used for data processing, the processing efficiency of the preset model inference structure may be reduced. Therefore, if there are multiple data processing requests, multiple processes are configured for the multiple data processing requests.
[0129] In this embodiment, each process performs the following operations respectively: inputting a data processing request into a corresponding preset model reasoning structure, so that the corresponding preset model reasoning structure processes the data processing request.
[0130] Specifically, process 1 processes data processing request 1, process 2 processes data processing request 2, and process n processes data processing request n. The preset service interface n in process n inputs the data processing request to the preset model reasoning structure n. The preset model reasoning structure n processes the data processing request n and then returns it to the client through the preset service interface n, which can avoid the efficiency impact when processing multiple data processing requests at the same time.
[0131] In this embodiment, if there are multiple data processing requests, the step of configuring multiple processes for the multiple data processing requests includes:
[0132] Step H1: if there are multiple data processing requests, configuring the multiple processes for the multiple data processing requests according to computing resources;
[0133] Specifically, if there are multiple data processing requests, the method of configuring multiple processes for the multiple data processing requests may be to configure the multiple processes for the multiple data processing requests according to computing resources.
[0134] As an example, the multiple processes may be determined according to the current user request status, or may be a preset fixed number, etc.
[0135] As an example, the computing resources may be CPU resources, GPU resources, etc. Specifically, the GPU resources refer to the number of GPU servers in the cloud server, or the computing power of a GPU server, etc., which is not limited here.
[0136] The computing resources include GPU resources, and the step of configuring the multiple processes for the multiple data processing requests according to the computing resources includes:
[0137] Step H2: Based on the number of the multiple processes and the number of GPU servers, evenly distribute the multiple processes in the CPU resources.
[0138] Specifically, the multiple processes may be evenly distributed in the CPU resources based on the number of the multiple processes and the number of GPU servers, or the multiple processes may be respectively distributed in each CPU server based on the number of the multiple processes and the computing power of each GPU server, or the multiple processes may be evenly distributed in the CPU resources based on the request time and processing end time of the data processing request in each GPU server, etc., and no limitation is made here.
[0139] In this embodiment, considering that when the number of data processing requests is too large, a preset model inference structure cannot complete all processing tasks, the multiple processes are configured, each process is assigned a preset model inference structure, and each preset model inference structure corresponds to one or more computing resources. The multiple processes are configured for the multiple data processing requests according to the computing resources, which can maximize the processing efficiency of the data processing requests and minimize the queuing time, thereby improving the user experience.
[0140] Reference Figure 4 , Figure 4 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present application.
[0141] like Figure 4 As shown, the data processing device based on model calling may include: a processor 1001 , a memory 1005 , and a communication bus 1002 . The communication bus 1002 is used to realize the connection and communication between the processor 1001 and the memory 1005 .
[0142] Optionally, the data processing device based on model call may also include a user interface, a network interface, a camera, an RF (Radio Frequency) circuit, a sensor, a WiFi module, etc. The user interface may include a display screen (Display), an input submodule such as a keyboard (Keyboard), and the optional user interface may also include a standard wired interface and a wireless interface. The network interface may include a standard wired interface and a wireless interface (such as a WI-FI interface).
[0143] Those skilled in the art will understand that Figure 4 The structure of the model-based call data processing device shown in the figure does not constitute a limitation on the model-based call data processing device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0144] like Figure 4 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, and a data processing program based on model call. The operating system is a program that manages and controls the hardware and software resources of the data processing device based on model call, and supports the operation of the data processing program based on model call and other software and / or programs. The network communication module is used to realize the communication between the components inside the memory 1005, and the communication with other hardware and software in the data processing system based on model call.
[0145] exist Figure 4In the model-based call data processing device shown, the processor 1001 is used to execute the model-based call data processing program stored in the memory 1005 to implement the steps of any of the above-mentioned model-based call data processing methods.
[0146] The specific implementation of the data processing device based on model calling in the present application is basically the same as the various embodiments of the data processing method based on model calling mentioned above, and will not be repeated here.
[0147] The present application also provides a data processing device based on model calling, such as Figure 5 As shown, the device comprises:
[0148] The request receiving module 10 is used to receive a data processing request provided by a client;
[0149] A data processing module 20, used for inputting the data processing request into a preset model reasoning structure, processing the data processing request based on the preset model reasoning structure, and obtaining a target processing result, wherein the preset model reasoning structure includes a model layer, the model layer is used for calling a data processing model from the pre-deployed multiple models, and processing the data processing request based on the data processing model;
[0150] The result returning module 30 is used to return the target processing result to the client.
[0151] Optionally, in a possible implementation manner of the present application, the data processing module 20 includes:
[0152] A first processing submodule, configured to process the data processing request based on the data processing model called by the model layer from the pre-deployed multiple models to obtain a first processing result;
[0153] A second processing submodule, configured to analyze and integrate the first processing result based on the algorithm layer to obtain a second processing result;
[0154] The third processing submodule is used to convert the format of the second processing result based on the adaptation layer to obtain a target processing result.
[0155] Optionally, in a possible implementation manner of the present application, the first processing submodule includes:
[0156] The data processing unit is used to call a data processing model from a GPU server deployed with NVIDIA Triton server based on the model layer, and process the data processing request based on the data processing model in the GPU server to obtain a first processing result.
[0157] Optionally, in a possible implementation manner of the present application, the data processing algorithm includes an integration algorithm, and the second processing submodule includes:
[0158] an algorithm selection unit, configured to select a corresponding data processing algorithm based on the processing type of the data processing request;
[0159] The algorithm analysis unit is used to analyze and integrate the first processing result based on the integration algorithm in the data processing algorithm to obtain a second processing result.
[0160] Optionally, in a possible implementation manner of the present application, the algorithm selection unit includes:
[0161] An algorithm calling subunit, configured to call at least one corresponding data processing algorithm from outside the preset model reasoning structure based on the processing type of the data processing request;
[0162] The algorithm analysis unit comprises:
[0163] The algorithm analysis subunit is used to analyze and integrate the first processing result based on the integration algorithm in the at least one data processing algorithm to obtain at least one second processing result.
[0164] Optionally, in a possible implementation manner of the present application, the data processing algorithm further includes a model processing algorithm, and before the step of analyzing and integrating the first processing result based on the integration algorithm in the at least one data processing algorithm to obtain at least one second processing result, the device further includes:
[0165] A model testing module, for testing the data processing model using preset test data sets based on the multiple data processing algorithms if there are multiple data processing algorithms;
[0166] The algorithm analysis model is used to determine the model algorithm corresponding to the data processing model with the highest accuracy, analyze and integrate the first processing results, and obtain at least one second processing result.
[0167] Optionally, in a possible implementation manner of the present application, the data processing module 20 includes:
[0168] A data input submodule, used for inputting the data processing request into a preset model inference structure, wherein the data processing request is uploaded by a user through the client in a preset input format through a preset service interface;
[0169] The data parsing submodule is used to parse the data processing request based on the adaptation layer to obtain the data to be processed, so that the algorithm layer and the model layer can process the data to be processed to obtain the target processing result.
[0170] Optionally, in a possible implementation manner of the present application, the data to be processed is a base64 visible character code obtained after the user encodes the image or audio file.
[0171] Optionally, in a possible implementation manner of the present application, the data parsing submodule includes:
[0172] The data parsing unit is used to parse the data processing request based on the adaptation layer to obtain the identification of the data to be processed and the processing type, so that the model layer can call the corresponding data processing model based on the identification of the processing type.
[0173] Optionally, in a possible implementation manner of the present application, after the step of receiving the data processing request provided by the client, the device further includes:
[0174] A process configuration module is used to configure multiple processes for the multiple data processing requests if there are multiple data processing requests, wherein each process performs the following operations: inputs the data processing request into the corresponding preset model reasoning structure so that the corresponding preset model reasoning structure processes the data processing request.
[0175] Optionally, in a possible implementation manner of the present application, the process configuration module includes:
[0176] A process configuration submodule, configured to configure the multiple processes for the multiple data processing requests according to computing resources if there are multiple data processing requests;
[0177] Wherein, the process configuration submodule includes:
[0178] The process allocation unit is used to evenly allocate the multiple processes in the CPU resources based on the number of the multiple processes and the number of GPU servers.
[0179] The specific implementation of the data processing device based on model calling in the present application is basically the same as the various embodiments of the data processing method based on model calling mentioned above, and will not be repeated here.
[0180] The present application also provides a storage medium, on which a model-based data processing program is stored. When the model-based data processing program is executed by a processor, the steps of the model-based data processing method as described in any one of the above items are implemented.
[0181] The specific implementation method of the storage medium of the present application is basically the same as the above-mentioned embodiments of the data processing method based on model calling, and will not be repeated here.
[0182] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0183] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0184] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0185] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A data processing method based on model calling, characterized in that: Applied to a cloud server, wherein a plurality of models are pre-deployed in the cloud server, the data processing method based on model calling comprises the following steps: Receive data processing requests provided by the client; Inputting the data processing request into a preset model reasoning structure, and processing the data processing request based on the preset model reasoning structure to obtain a target processing result; The preset model reasoning structure includes a model layer, and the model layer is used to call a data processing model from the pre-deployed multiple models, and process the data processing request based on the data processing model; The target processing result is returned to the client.
2. The data processing method based on model calling according to claim 1, characterized in that: The preset model reasoning structure further includes an algorithm layer and an adaptation layer. The step of processing the data processing request based on the preset model reasoning structure to obtain a target processing result includes: Processing the data processing request based on the data processing model called by the model layer from the pre-deployed multiple models to obtain a first processing result; Based on the algorithm layer, analyzing and integrating the first processing result to obtain a second processing result; Based on the adaptation layer, the second processing result is format converted to obtain a target processing result.
3. The data processing method based on model calling according to claim 2, characterized in that: The step of processing the data processing request based on the data processing model called by the model layer from the pre-deployed multiple models to obtain a first processing result includes: Based on the model layer, a data processing model is called from a GPU server deployed with NVIDIA Triton server, and the data processing request is processed in the GPU server based on the data processing model to obtain a first processing result.
4. The data processing method based on model calling according to claim 2, wherein the data processing algorithm comprises an integration algorithm, characterized in that: The step of analyzing and integrating the first processing result based on the algorithm layer to obtain the second processing result includes: Selecting a corresponding data processing algorithm based on the processing type of the data processing request; Based on the integration algorithm in the data processing algorithm, the first processing result is analyzed and integrated to obtain a second processing result.
5. The data processing method based on model calling according to claim 4, characterized in that: The step of selecting a corresponding data processing algorithm based on the processing type of the data processing request comprises: Based on the processing type of the data processing request, calling at least one corresponding data processing algorithm from outside the preset model reasoning structure; The step of analyzing and integrating the first processing result based on the integration algorithm in the data processing algorithm to obtain the second processing result includes: Based on the integration algorithm in the at least one data processing algorithm, the first processing result is analyzed and integrated to obtain at least one second processing result.
6. The data processing method based on model calling according to claim 4, wherein the data processing algorithm further comprises a model processing algorithm, characterized in that: Before the step of analyzing and integrating the first processing result based on the integration algorithm in the data processing algorithm to obtain the second processing result, the method further includes: If there are multiple data processing algorithms, then based on the model algorithms among the multiple data processing algorithms, the data processing models are tested respectively using preset test data sets; Determine the model algorithm corresponding to the data processing model with the highest accuracy, so that the algorithm layer can analyze and integrate the first processing result based on the corresponding model algorithm to obtain the second processing result.
7. The data processing method based on model calling according to claim 1, characterized in that: After the step of receiving the data processing request provided by the client, the method further includes: If there are multiple data processing requests, multiple processes are configured for the multiple data processing requests; Each process performs the following operations respectively: inputting a data processing request into a corresponding preset model reasoning structure, so that the corresponding preset model reasoning structure processes the data processing request.
8. A data processing device based on model calling, characterized in that: Applied to a cloud server, where a plurality of models are pre-deployed, the device comprises: A request receiving module, used for receiving a data processing request provided by a client; A data processing module, used for inputting the data processing request into a preset model reasoning structure, processing the data processing request based on the preset model reasoning structure, and obtaining a target processing result, wherein the preset model reasoning structure includes a model layer, the model layer is used for calling a data processing model from the pre-deployed multiple models, and processing the data processing request based on the data processing model; The result returning module is used to return the target processing result to the client.
9. A data processing device based on model calling, characterized in that: The device comprises: a memory, a processor, and a model-based data processing program stored in the memory and executable on the processor, wherein the model-based data processing program is configured to implement the steps of the model-based data processing method according to any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium stores a data processing program based on model calling, and when the data processing program based on model calling is executed by the processor, the steps of the data processing method based on model calling according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Data processing method and related equipment
CN120434293A
