Data processing method, device, computer equipment and storage medium
Through a unified data processing method, business data is converted into standard format data and a neural network layer is generated, which solves the problem of parsing AI model information files in different formats, reduces development and maintenance costs, and achieves efficient processing of model information files in different formats. infer.
Patent Information
- Application Number
- CN202110788024.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-13
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2041-07-13
AI Technical Summary
In the field of machine learning, the format of the AI model information file for mobile deployment is different from that of the AI model information file for server deployment, which results in the need to develop multiple sets of parsing tools and increases development and maintenance costs.
Through a unified data processing method, business data is converted into standard format data, and a neural network layer is generated based on the model information file format and target platform identification to realize the analysis and inference of model information files in different formats, reducing development and maintenance costs.
It realizes the unified parsing of model information files in different formats through a set of parsing tools, reduces the development and maintenance costs in the process of developing AI, and reduces the number of codes for data conversion that need to be developed and maintained.
Smart Images

Figure CN113641337B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of machine learning, and in particular to a data processing method, apparatus, computer device and storage medium. Background Art
[0002] In the industrial application of machine learning, more and more open source frameworks are developed by Pytorch, which has far more advantages than Tensorflow in model definition, training and readability. However, when deploying on mobile terminals, some projects still need to use Tflite (a lightweight inference library mainly used for mobile terminals). At this time, the format of the model information file of AI (Artificial Intelligence) deployed on mobile terminals is different from that of the model information file of AI deployed on the server. In order to be able to use model information files in different formats for inference, it is necessary to develop multiple sets of parsing tools to parse model information files in different formats, which will increase development and maintenance costs. Summary of the invention
[0003] In view of the above-mentioned deficiencies or shortcomings, the present invention provides a data processing method, apparatus, computer equipment and storage medium. The embodiments of the present invention can parse model information files of different formats and perform inference through a unified parsing tool, thereby reducing development costs and maintenance costs.
[0004] According to a first aspect, the present invention provides a data processing method. In one embodiment, the method includes:
[0005] Convert the acquired business data into standard format data;
[0006] Obtain a model information file corresponding to the business type of the business data, parse the model information file to obtain a model file format, a target platform identifier, and a data conversion method, and convert the standard format data into model input data according to the model file format, the target platform identifier, and the data conversion method;
[0007] Load the model information file and generate the neural network layer according to the model information file;
[0008] Use the neural network layer to infer the model input data to obtain the model inference result.
[0009] In one embodiment, the step of converting the obtained business data into standard format data includes:
[0010] Determine the business type of the business data;
[0011] A first data conversion function corresponding to the business type of the business data is called to perform data type conversion on the business data to obtain standard format data.
[0012] In one embodiment, the step of converting the standard format data into model input data according to the model file format, the target platform identifier and the data conversion method includes:
[0013] The corresponding second data conversion function is called according to the model file format, the target platform identifier and the data conversion method to convert the standard format data into the model input data.
[0014] In one embodiment, the method further comprises:
[0015] Calling a third data conversion function corresponding to the data conversion method to convert the data type of the model inference result to obtain model output data;
[0016] Return the model output data to the sender of the business data.
[0017] In one embodiment, before the step of obtaining the model information file corresponding to the business type of the business data, the method further includes:
[0018] Convert the acquired business training data into standard format data;
[0019] Convert standard format data into model input data that meets the requirements of the target model training framework;
[0020] Train the target model using the model input data in the target model training framework;
[0021] When the training is completed, the training results of the target model are saved as a model information file;
[0022] The target platform identifier of the target model training framework, the model file format of the target model, and the data conversion method determined according to the target platform identifier and / or the model file format are recorded in the model information file.
[0023] In one embodiment, the method is applied to a computing device; the method is implemented by the computing device calling a local general model parsing library; the general model parsing library is a function dependency library.
[0024] In one embodiment, the general model parsing library includes a plurality of first data conversion functions for converting business data into standard format data, a plurality of second data conversion functions for converting standard format data into model input data, and a plurality of third data conversion functions for converting model inference results into model output data;
[0025] Different first data conversion functions are used to convert business data of different business types into standard format data;
[0026] Different second data conversion functions are used to convert standard format data into model input data that meets different model input requirements;
[0027] Different third data conversion functions are used to convert model inference results of different models into model output data.
[0028] According to a second aspect, the present invention provides a data processing device. In one embodiment, the device comprises:
[0029] A first conversion module, used to convert the obtained business data into standard format data;
[0030] A second conversion module is used to obtain a model information file corresponding to the business type of the business data, parse the model information file to obtain a model file format, a target platform identifier and a data conversion method, and convert the standard format data into model input data according to the model file format, the target platform identifier and the data conversion method;
[0031] A network generation module is used to load the model information file and generate a neural network layer according to the model information file;
[0032] The inference module is used to use the neural network layer to infer the model input data to obtain the model inference result.
[0033] According to a third aspect, the present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the above method embodiments when executing the computer program.
[0034] According to a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of any of the above method embodiments are implemented.
[0035] In an embodiment of the present invention, when obtaining business data, the obtained business data is first converted into standard format data, and then a model information file corresponding to the business type of the business data is obtained, the model information file is parsed to obtain the model file format, the target platform identifier and the data conversion method, and the standard format data is converted into model input data according to the model file format, the target platform identifier and the data conversion method, and then the model information file is loaded into the memory, and a neural network layer is generated according to the model information file, and the model input data is inferred using the neural network layer to obtain a model inference result, which can achieve unified parsing of model information files of different formats through a set of parsing tools, and inference through the model information file, thereby reducing the development cost and maintenance cost in the process of developing AI. In addition, when processing the obtained business data into model input data, the business data is first converted into standard format data, and then the standard format data is converted into model input data of the corresponding model, which can reduce the number of codes for data conversion that need to be developed and maintained. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 is a flow chart of a data processing method in one embodiment;
[0037] Figure 2 A schematic diagram of a process for training AI in one embodiment;
[0038] Figure 3 is a structural block diagram of a data processing device in one embodiment;
[0039] Figure 4 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0040] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. 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.
[0041] The present invention provides a data processing method. In one embodiment, the data processing method can be applied to a computing device deployed with AI, and the computing device can use the AI to process business data to obtain inference data, and the inference data can be used to indicate the data for the target object to perform the next action. Taking the game scene as an example, the game AI can be deployed in a game logic server (game server), a game inference server (AI server) or a game client. Assuming that the game AI is deployed in the game client, after starting the game in the game client, the environmental parameters in the game can be collected, and then the game AI is used to process the environmental parameters to obtain action parameters, and finally the target object (Agent) in the game is instructed to perform the next action according to the action parameters. For example, the player selects the human-computer battle mode in a certain Go game. Whenever the player makes a move, the game program collects the current chess game information (i.e., business data), and then processes the current chess game information through the game AI, thereby calculating the next move information (i.e., action parameters, used to indicate where to make a move) of the computer side (i.e., the target object). Among them, the game client may include but is not limited to various personal computers, laptops, smart phones, tablet computers and desktop computers, etc. The game logic server and the game inference server can be implemented with an independent server or a server cluster consisting of multiple servers. In some scenarios, the game logic server and the game inference server can be deployed in the same physical server.
[0042] The following is a detailed introduction to the data processing method. Figure 1 As shown, the method includes steps S110 to S140.
[0043] S110: Convert the acquired business data into standard format data.
[0044] In this embodiment, when the deployment location of AI is different, the way of obtaining business data will also be different. For example, in the above-mentioned Go game example, when AI is deployed on the client, the business data can come from the client itself, and when AI is deployed on the server, the business data comes from the client. For example, after the player makes a move, the Go game program uploads the collected chess game information to the server, and the server uses AI to calculate the next move position of the computer side and returns it to the Go game program. In addition, in different application scenarios, the content of business data (such as the number of parameters, the type of parameters, etc.) will also be different.
[0045] The data structure of standard format data is predefined and implemented in the code as a struct, which contains specific defined data. For example, in a game scene, it can contain information such as basic environment configuration parameters, object information, vector information, and image information. The content in this data structure can be continuously iterated according to business needs to support more businesses, model types, training frameworks, etc.
[0046] S120: Obtain a model information file corresponding to the business type of the business data, parse the model information file to obtain a model file format, a target platform identifier and a data conversion method, and convert the standard format data into model input data according to the model file format, the target platform identifier and the data conversion method.
[0047] When processing the obtained business data into model input data, this embodiment first converts the business data into standard format data, and then converts the standard format data into model input data of the corresponding model. This can reduce the amount of code that needs to be developed and maintained for data conversion.
[0048] For example, suppose that the only factors to be considered when converting data are the type of business function and the model type. If there are X types of business and Y types of model, if standard format data is pre-defined, the business data is first converted to standard format data, and then the standard format data is converted to model input data of the corresponding model. At this time, the developer only needs to implement X+Y copies of code for converting data. In the absence of standard format data, the developer needs to implement X*Y copies of code for converting data. Among the X+Y copies of code, X copies are used to convert business data to standard format data, and different codes are used to convert business data of different business types to standard format data; Y copies are used to convert standard format data to model input data, and different codes are used to convert standard format data to model input data that meets the requirements corresponding to different model types. In the X*Y copies of code, each code is used to convert business data of the Xth business type into model input data that meets the requirements corresponding to the Yth model type.
[0049] The next move of different target objects can be calculated by different AIs, and each AI corresponds to a model information file. When the AI needs to be run to calculate the next move of the target object, the model information file corresponding to the AI is parsed. Taking the above-mentioned Go game as an example, players can choose to play against computers of different Go levels (for example, there can be computers of level, intermediate level, and ordinary level, etc.). The next move position of computers of different Go levels is inferred by different game AIs. For example, if the player chooses to play against a level computer, the game program will collect game information after the player completes the move, and then use the model information file corresponding to the level computer stored locally to infer the next move position.
[0050] Model file formats, such as ".onnx", ".pth", ".ckpt", etc. The target platform is the training framework used to train AI. It can be self-developed or commonly used in the industry, such as Pytorch, Tensorflow, ML-Agents, etc. The target platform identifier is used to determine which target platform the AI is trained on.
[0051] The number of data conversion methods can be determined based on the number of target platforms that can be supported, the functional complexity during training, and the number of model types. The purpose is to allow developers to focus on the business and ignore the differences brought about by different target platforms and training modes. In other words, different model types and target platforms will correspond to different pre-defined data conversion methods. For example, when ML-Agents is used to train AI, the model information file of the AI will mark that the model file is in ML-Agents mode, then the data type of the input data will be converted from ISensor to float, and when the model inference result is calculated, the data type of the model inference result will be converted from float to ActionBuffers, and then fed back to the sender of the business data for use; for another example, when the frame skipping parameter is set when training AI, assuming it is set to 5 frames, the standard format data obtained by converting every 5 business data will be synthesized into an array, and then it will be input into the neural network layer for inference.
[0052] S130: Load the model information file, and generate a neural network layer according to the model information file.
[0053] S140: Use the neural network layer to infer the model input data to obtain a model inference result.
[0054] Among them, loading the model information file refers to loading the model information file into the memory, and then generating a neural network layer according to the model information file, and then inputting the model input data obtained by step S120 into the neural network layer, and performing a series of calculations on the model input information through the neural network layer to obtain the model inference result.
[0055] This embodiment can achieve the unified use of a set of parsing tools to parse model information files of different formats, and to make inferences through the model information files, thereby reducing the development cost and maintenance cost in the process of developing AI. In addition, when processing the obtained business data as model input data, the business data is first converted into standard format data, and then the standard format data is converted into model input data of the corresponding model, which can reduce the amount of code for data conversion that needs to be developed and maintained.
[0056] In one embodiment, the data processing method is implemented by the computing device calling the local general model parsing library. Among them, the general model parsing library is a function dependency library. The general model parsing library includes code implementations of model input standard interface, model output standard format, input model data standard processing and conversion, etc., which is used to provide code framework libraries in different languages, such as C#, Java and Python, etc., which can standardize the data input and output uniformly during the training process and analytical inference process of AI. Exemplarily, taking the game scene as an example, the general model parsing library is SDK (Software Development Kit) for the game logic server, game inference server and game client, that is, the function dependency library, which is equivalent to the dependency when the function is running, such as a third-party library, the training model of AI, can be configured by the function, and the dependency library can be mounted in the execution directory of the function, and the function can be loaded into the third-party dependency when it is running. Therefore, the computing device can realize the corresponding function by calling the function in the function dependency library without network communication.
[0057] The general model parsing library includes a plurality of first data conversion functions for converting business data into standard format data, a plurality of second data conversion functions for converting standard format data into model input data, and a plurality of third data conversion functions for converting model inference results into model output data; wherein different first data conversion functions are used to convert business data of different business types into standard format data; different second data conversion functions are used to convert standard format data into model input data that meets different model input requirements; and different third data conversion functions are used to convert model inference results of different models into model output data.
[0058] In one embodiment, the step of converting the obtained business data into standard format data includes: determining the business type of the business data; calling a first data conversion function corresponding to the business type of the business data to perform data type conversion on the business data to obtain standard format data.
[0059] When converting business data into standard format data, the specific process is to convert special data types in a specific platform into basic types (such as converting Unity's Vector3 into float) and to reorganize and combine business data so that key data can be extracted from it and converted into model input data.
[0060] For example, in Unity (a professional game development engine), suppose there is a sphere and a plate in the game, and the game goal is to make the ball stay on the plate as long as possible. At this time, the environmental parameters that the game business layer needs to collect are the Position (Vector3) of the sphere (that is, the ball) and the plate, the rotation (Quaternion) of the plate, and the game score reward (float). At this time, the Position and rotation will be parsed into a float array and then stored in the float[]VectorArray in the standard format data, and the reward will also be stored in the float reward in the standard format data; there are also the Behavior Name (string) and Space Size (int) of the game object... Because there are too many environmental parameters that need to be collected, they are not explained one by one.
[0061] In one embodiment, the step of converting the standard format data into model input data according to the model file format, the target platform identifier and the data conversion method includes:
[0062] The corresponding second data conversion function is called according to the model file format, the target platform identifier and the data conversion method to convert the standard format data into the model input data.
[0063] For example, ML-Agents is used when training AI, and the frame skipping parameter is set to 5 frames during training. At this time, the standard format data converted from every 5 business data will be synthesized into an ISensor array, and then input into the neural network layer for inference.
[0064] In one embodiment, the method further includes: calling a third data conversion function corresponding to the data conversion method to convert the data type of the model inference result to obtain model output data; and returning the model output data to the sender of the business data.
[0065] For example, when ML-Agents is used to train AI, the model information file of the AI will be marked as being in ML-Agents mode. In this case, the data type of the input data will be converted from ISensor to float. When the model inference result is calculated, the data type of the model inference result will be converted from float to ActionBuffers, which will then be fed back to the sender of the business data for use.
[0066] In one embodiment, when the computing device is a server, the model information file therein can be trained in other servers and then deployed, or trained in the server. The following describes the process of training AI in the server to obtain the model information file. Figure 2 As shown, the process includes the following steps:
[0067] S210: Converting the obtained business training data into standard format data;
[0068] S220: converting the standard format data into model input data that meets the requirements of the target model training framework;
[0069] S230: training the target model using the model input data in the target model training framework;
[0070] S240: When the training is completed, the training result of the target model is saved as a model information file;
[0071] S250: Record the target platform identifier of the target model training framework, the model file format of the target model, and the data conversion method determined according to the target platform identifier and / or the model file format into the model information file.
[0072] The business training data refers to the business data in the training process. The relevant process of converting the business training data into standard format data can refer to the above content, which will not be repeated here.
[0073] The model training framework is the aforementioned artificial intelligence training framework, and the target model training framework refers to the artificial intelligence training framework used in the training process. When training AI, the corresponding neural network can be selected according to business needs. This embodiment does not limit the selection of which neural network. Different artificial intelligence training frameworks have different requirements for input data, so it is necessary to process the standard format data into data that meets the requirements of the target model training framework. When training AI, i.e., the target model, through the target model training framework, some relevant information in the training process, such as training methods, training settings, etc., is cached. When AI completes training, the training results of AI are saved as a model information file, and the target platform identifier of the target model training framework, the model file format of AI, and the data conversion method determined according to the target platform identifier and / or model file format are recorded in the model information file.
[0074] When saving AI training results, they can be saved in formats commonly used in various businesses, such as ".onnx", ".pth", ".ckpt", etc., or they can be saved in a certain format, such as ".onnx". This can be flexibly adjusted according to actual needs.
[0075] Model information files with different file formats have different specifications for saving content, while model information files of different AIs with the same file format have basically the same specifications for saving content. For example, in the ".onnx" format, the specifications for saving information are basically inputs (input parameter format), outputs (output parameter format), layers (neural network layer), constants (constant parameters), etc., but the parameters saved in the model information files of different AIs are different.
[0076] Model information files in different file formats can be converted to each other. Therefore, when it is necessary to generate a neural network layer based on the model information file, the model information file can be directly parsed to generate the neural network layer, or based on actual scenario requirements, the model information file in a certain file format can be first converted into a model information file in a specified file format, and then the converted model information file can be parsed to generate the neural network layer.
[0077] Figure 1 , Figure 2 FIG. 1 is a flow chart of a data processing method in one embodiment. It should be understood that although Figure 1 , Figure 2 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 , Figure 2 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0078] Based on the same inventive concept, the present invention also provides a data processing device. In this embodiment, Figure 3 As shown, the data processing device includes the following modules:
[0079] A first conversion module 110, configured to convert the acquired business data into standard format data;
[0080] The second conversion module 120 is used to obtain a model information file corresponding to the business type of the business data, parse the model information file to obtain a model file format, a target platform identifier and a data conversion method, and convert the standard format data into model input data according to the model file format, the target platform identifier and the data conversion method;
[0081] A network generation module 130, used to load a model information file and generate a neural network layer according to the model information file;
[0082] The inference module 140 is used to use the neural network layer to infer the model input data to obtain the model inference result.
[0083] In one embodiment, the first conversion module is specifically used to determine the service type of the service data, call the first data conversion function corresponding to the service type of the service data to perform data type conversion on the service data, and obtain standard format data.
[0084] In one embodiment, when the second conversion module is used to convert standard format data into model input data according to the model file format, target platform identifier and data conversion method, it is specifically used to call the corresponding second data conversion function according to the model file format, target platform identifier and data conversion method to convert the standard format data into model input data.
[0085] In one embodiment, the data processing device further includes a third conversion module and a data feedback module.
[0086] A third conversion module, used for calling a third data conversion function corresponding to the data conversion method to convert the data type of the model inference result to obtain model output data;
[0087] The data feedback module is used to return the model output data to the sender of the business data.
[0088] In one embodiment, the first conversion module is further used to convert the obtained business training data into standard format data;
[0089] The second conversion module is also used to convert the standard format data into model input data that meets the requirements of the target model training framework;
[0090] A training module, used to train a target model using model input data in a target model training framework;
[0091] The model saving module is used to save the training results of the target model as a model information file when the training is completed;
[0092] The recording module is used to record the target platform identifier of the target model training framework, the model file format of the target model, and the data conversion method determined according to the target platform identifier and / or the model file format into the model information file.
[0093] In one embodiment, the steps implemented by the data processing device are implemented by calling a local general model parsing library; the general model parsing library is a function dependency library.
[0094] In one embodiment, the general model parsing library includes a plurality of first data conversion functions for converting business data into standard format data, a plurality of second data conversion functions for converting standard format data into model input data, and a plurality of third data conversion functions for converting model inference results into model output data;
[0095] Different first data conversion functions are used to convert business data of different business types into standard format data;
[0096] Different second data conversion functions are used to convert standard format data into model input data that meets different model input requirements;
[0097] Different third data conversion functions are used to convert model inference results of different models into model output data.
[0098] The specific definition of the data processing device can refer to the definition of the data processing method above, which will not be repeated here. The above modules can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0099] In one embodiment, a computer device is provided, whose internal structure diagram can be as follows: Figure 4 shown.
[0100] The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as model information files, and the specific stored data can also refer to the definition in the above method embodiment. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data processing method is implemented.
[0101] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0102] This embodiment further provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented:
[0103] Convert the obtained business data into standard format data; obtain the model information file corresponding to the business type of the business data, parse the model information file to obtain the model file format, target platform identifier and data conversion method, and convert the standard format data into model input data according to the model file format, target platform identifier and data conversion method; load the model information file, and generate a neural network layer according to the model information file; use the neural network layer to infer the model input data to obtain the model inference result.
[0104] In one embodiment, when the processor executes the computer program to convert the obtained business data into standard format data, the processor also implements the following steps:
[0105] Determine the business type of the business data; call the first data conversion function corresponding to the business type of the business data to perform data type conversion on the business data to obtain standard format data.
[0106] In one embodiment, when the processor executes the computer program to convert the standard format data into the model input data according to the model file format, the target platform identifier and the data conversion method, the processor further implements the following steps:
[0107] The corresponding second data conversion function is called according to the model file format, the target platform identifier and the data conversion method to convert the standard format data into the model input data.
[0108] In one embodiment, the processor executes the computer program to further implement the following steps:
[0109] The third data conversion function corresponding to the data conversion method is called to convert the data type of the model inference result to obtain the model output data; and the model output data is returned to the sender of the business data.
[0110] In one embodiment, before the processor executes the computer program to implement the step of obtaining the model information file corresponding to the business type of the business data, the processor further implements the following steps:
[0111] Convert the obtained business training data into standard format data; convert the standard format data into model input data that meets the requirements of the target model training framework; use the model input data to train the target model in the target model training framework; when the training is completed, save the training results of the target model as a model information file; record the target platform identifier of the target model training framework, the model file format of the target model, and the data conversion method determined according to the target platform identifier and / or the model file format in the model information file.
[0112] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0113] Convert the obtained business data into standard format data; obtain the model information file corresponding to the business type of the business data, parse the model information file to obtain the model file format, target platform identifier and data conversion method, and convert the standard format data into model input data according to the model file format, target platform identifier and data conversion method; load the model information file, and generate a neural network layer according to the model information file; use the neural network layer to infer the model input data to obtain the model inference result.
[0114] In one embodiment, when the computer program is executed by a processor to convert the obtained business data into standard format data, the following steps are also implemented:
[0115] Determine the business type of the business data; call the first data conversion function corresponding to the business type of the business data to perform data type conversion on the business data to obtain standard format data.
[0116] In one embodiment, the computer program is executed by a processor, and when converting the standard format data into model input data according to the model file format, the target platform identifier and the data conversion method, the following steps are also implemented:
[0117] The corresponding second data conversion function is called according to the model file format, the target platform identifier and the data conversion method to convert the standard format data into the model input data.
[0118] In one embodiment, the computer program is executed by a processor to further implement the following steps:
[0119] The third data conversion function corresponding to the data conversion method is called to convert the data type of the model inference result to obtain the model output data; and the model output data is returned to the sender of the business data.
[0120] In one embodiment, the computer program is executed by a processor, and before the step of obtaining the model information file corresponding to the business type of the business data, the following steps are further implemented:
[0121] Convert the obtained business training data into standard format data; convert the standard format data into model input data that meets the requirements of the target model training framework; use the model input data to train the target model in the target model training framework; when the training is completed, save the training results of the target model as a model information file; record the target platform identifier of the target model training framework, the model file format of the target model, and the data conversion method determined according to the target platform identifier and / or the model file format in the model information file.
[0122] Those skilled in the art can understand that all or part of the processes in the above method embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external speed buffer memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0123] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0124] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A data processing method, It is characterized in that The method is applied to a computing device deployed with multiple AI models, where the formats of the model information files of the multiple AI models are not completely the same; the computing device is used to process business data from a client using a pre-deployed AI model, and to feed back data for instructing a target object to perform a next action to the client; the method includes: Convert the acquired business data into standard format data; Obtain a model information file corresponding to the business type of the business data, parse the model information file to obtain a model file format, a target platform identifier, and a data conversion method, and convert the standard format data into model input data according to the model file format, the target platform identifier, and the data conversion method; the target platform identifier is used to determine which target platform the AI model is trained on, and the target platform refers to a training framework used to train the AI model; Loading the model information file, and generating a neural network layer according to the model information file; The neural network layer is used to infer the model input data to obtain a model inference result.
2. The method according to claim 1, It is characterized in that The step of converting the obtained business data into standard format data includes: Determining a business type of the business data; A first data conversion function corresponding to the business type of the business data is called to perform data type conversion on the business data to obtain standard format data.
3. The method according to claim 1, It is characterized in that The step of converting the standard format data into model input data according to the model file format, the target platform identifier and the data conversion method comprises: The corresponding second data conversion function is called according to the model file format, the target platform identifier and the data conversion method to convert the standard format data into model input data.
4. The method according to claim 1, It is characterized in that The method further comprises: Calling a third data conversion function corresponding to the data conversion method to convert the data type of the model inference result to obtain model output data; The model output data is returned to the sender of the business data.
5. The method according to claim 1, It is characterized in that Before the step of obtaining the model information file corresponding to the business type of the business data, the method further includes: Convert the acquired business training data into standard format data; Converting the standard format data into model input data that meets the requirements of the target model training framework; Using the model input data to train the target model in the target model training framework; When the training is completed, the training result of the target model is saved as a model information file; The target platform identifier of the target model training framework, the model file format of the target model, and the data conversion method determined according to the target platform identifier and / or the model file format are recorded in the model information file.
6. The method according to any one of claims 1 to 5, It is characterized in that The method is implemented by the computing device calling a local general model parsing library; the general model parsing library is a function dependency library.
7. The method according to claim 6, It is characterized in that The general model parsing library includes a plurality of first data conversion functions for converting business data into standard format data, a plurality of second data conversion functions for converting standard format data into model input data, and a plurality of third data conversion functions for converting model inference results into model output data; Different first data conversion functions are used to convert business data of different business types into standard format data; Different second data conversion functions are used to convert standard format data into model input data that meets different model input requirements; Different third data conversion functions are used to convert model inference results of different models into model output data.
8. A data processing device, It is characterized in that The device is applied to a computing device deployed with multiple AI models, and the formats of the model information files of the multiple AI models are not completely the same; the computing device is used to use the pre-deployed AI model to process business data from a client, and feed back data for instructing the target object to perform the next action to the client; the device includes: A first conversion module, used to convert the obtained business data into standard format data; A second conversion module is used to obtain a model information file corresponding to the business type of the business data, parse the model information file to obtain a model file format, a target platform identifier and a data conversion method, and convert the standard format data into model input data according to the model file format, the target platform identifier and the data conversion method; the target platform identifier is used to determine which target platform the AI model is trained on, and the target platform refers to a training framework used to train the AI model; A network generation module, used to load the model information file and generate a neural network layer according to the model information file; An inference module is used to use the neural network layer to infer the model input data to obtain a model inference result.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
