Model conversion method, apparatus, and related device

By using computing devices to acquire multiple conversion methods to convert models, generating multiple second models and selecting the target model, the limitations and low efficiency of model format conversion in existing technologies are solved, and automated and efficient model conversion is achieved.

CN115238895BActive Publication Date: 2026-01-16HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110438440.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-22
Publication Date
2026-01-16
Estimated Expiration
2041-04-22

AI Technical Summary

Technical Problem

Existing technologies only support a limited number of model format conversions and require users to write code manually, resulting in low conversion efficiency.

Method used

The computing device acquires multiple conversion methods, converts the first model, generates multiple second models, selects the target model from them for loading, and automatically performs model conversion using SDKs of multiple inference engines.

Benefits of technology

It solves the problem of limited model format conversion, improves the efficiency of model conversion, and reduces the need for manual operation by users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115238895B_ABST
    Figure CN115238895B_ABST
Patent Text Reader

Abstract

The present application provides a model conversion method, device and related equipment, wherein the method comprises: when the computing device does not exist an inference engine matched with the first model in a plurality of inference engines of the computing device, obtaining a plurality of conversion modes matched with the plurality of inference engines, then converting the first model according to the plurality of conversion modes to obtain a plurality of second models, after obtaining the plurality of second models, determining a target model from the plurality of second models, and finally using an inference engine matched with the target model in the plurality of inference engines to load the target model to identify the first business data, and realize business processing. The method can solve the problems of limited convertible model formats and low model conversion efficiency in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of artificial intelligence (AI), and in particular to a model conversion method and device and related equipment. BACKGROUND

[0002] With the rise and continuous development of AI technology, more and more training and inference frameworks (such as TensorFlow, MindSpore, etc.) appear in people's field of vision. Each training and inference framework has a model format (i.e., the format of the model file obtained by saving the trained model), and the model format of each training and inference framework is different from the model format of other frameworks, which makes each training and inference framework unable to directly use the model trained by other training and inference frameworks to process business.

[0003] In order to improve the compatibility of training and inference frameworks, some inference engines in training and inference frameworks (such as the engine in the MindSpore framework (hereinafter referred to as the MindSpore engine)) already have model conversion functions, which can convert models with formats different from their own into models with the same format as their own. In addition, there are also many third-party inference engines (such as ONNX Runtime, TensorRT, etc.) with model conversion functions, which also have model formats, and they can also convert the format of the model to obtain a model with the same format as their own, and then load the converted model to process business. Users can download third-party inference engines to computing devices, and the third-party inference engines implement model conversion and model use.

[0004] However, the inventors have found that the above model conversion method has at least the following problems: (1) only supports conversion of other model formats to one model format supported by each inference engine, does not support conversion to other specified model formats, and has the problem of limited convertible model formats, (2) requires users to manually write a large amount of code to operate the inference engine to convert the model, and has the problem of low model conversion efficiency. SUMMARY

[0005] The present application provides a model conversion method, device and related equipment, which can solve the problems of limited convertible model formats and low model conversion efficiency in the prior art.

[0006] In a first aspect, a model conversion method is provided, the method comprising:

[0007] When the computing device does not have an inference engine that matches the first model in a plurality of inference engines of the computing device, obtaining a plurality of conversion modes that match the plurality of inference engines;

[0008] The computing device converts the first model according to the plurality of conversion manners to obtain a plurality of second models;

[0009] The computing device determines a target model from the plurality of second models;

[0010] The computing device loads the target model using an inference engine matched with the target model in the plurality of inference engines to identify first business data.

[0011] In the above scheme, the computing device can obtain a plurality of conversion manners matched with a plurality of inference engines of the computing device, and then convert the first model according to the plurality of conversion manners to obtain a plurality of second models, which can solve the problem of limited convertible model formats in the prior art. In addition, the steps in the above scheme can be executed by the computing device without the participation of the user, which can solve the problem of low model conversion efficiency in the prior art.

[0012] In a possible implementation, the computing device obtains a plurality of conversion manners matched with the plurality of inference engines, including:

[0013] The computing device obtains a plurality of conversion manners matched with the plurality of inference engines and the first model.

[0014] In a possible implementation, the computing device determines a target model from the plurality of second models, including:

[0015] The computing device obtains index data for evaluating each of the second models;

[0016] The computing device selects a target model from the plurality of second models based on the plurality of index data.

[0017] In a possible implementation, the index data includes one or more combinations of the following:

[0018] Conversion time of the first model to obtain the second model;

[0019] Memory consumed by the first model to obtain the second model;

[0020] Duration of using the second model to identify second business data;

[0021] Accuracy of using the second model to identify second business data.

[0022] In a possible implementation, the computing device selects a target model from the plurality of second models based on the plurality of index data, including:

[0023] The computing device selects an optimal second model or a suboptimal second model or other second model from the plurality of second models as the target model based on the plurality of index data.

[0024] In the above solution, the target model selected by the computing device from the plurality of second models can be an optimal second model, a suboptimal second model or other second model, which has higher flexibility.

[0025] In a possible implementation, the first service data or the second service data comprises one or more combinations of the following:

[0026] image data;

[0027] audio data;

[0028] text data.

[0029] In a possible implementation, the method further comprises:

[0030] The computing device acquires SDKs of a plurality of inference engines of the computing device, and the SDKs of the inference engines are used to operate the inference engines;

[0031] The computing device installs the acquired SDKs of the plurality of inference engines;

[0032] The computing device converts the first model in the plurality of conversion manners, comprising:

[0033] The computing device converts the first model in the plurality of conversion manners using the SDKs of the plurality of inference engines.

[0034] In the above solution, the computing device acquires the SDKs of the plurality of inference engines, and then uses the SDKs of the plurality of inference engines to operate the plurality of inference engines to convert the model, without the need for the user to manually operate the inference engines to convert the model, which can improve the efficiency of model conversion.

[0035] In a possible implementation, the computing device acquires the SDKs of the plurality of inference engines of the computing device, comprising:

[0036] The computing device acquires the SDKs of the plurality of inference engines of the computing device from an SDK library, and the SDK library is located in the cloud or locally on the computing device.

[0037] In a second aspect, a model conversion apparatus is provided, and the apparatus comprises:

[0038] obtaining, when there is no inference engine matching the first model in a plurality of inference engines of the computing device, a plurality of conversion manners matching the plurality of inference engines;

[0039] converting the first model according to the plurality of conversion manners to obtain a plurality of second models;

[0040] determining a target model from the plurality of second models;

[0041] loading the target model to identify first business data using an inference engine matching the target model in the plurality of inference engines.

[0042] In a possible implementation, the obtaining module is specifically configured to:

[0043] obtain a plurality of conversion manners matching the plurality of inference engines and the first model.

[0044] In a possible implementation, the determining module is specifically configured to:

[0045] obtain index data for evaluating each of the second models;

[0046] select a target model from the plurality of second models based on the plurality of index data.

[0047] In a possible implementation, the index data includes one or more combinations of:

[0048] conversion time of the first model to the second model;

[0049] memory consumed by the first model to the second model;

[0050] time length of identifying second business data using the second model;

[0051] accuracy of identifying second business data using the second model.

[0052] In a possible implementation, the determining module is specifically configured to:

[0053] select an optimal second model or a suboptimal second model or another second model from the plurality of second models based on the plurality of index data, and the selected second model is the target model.

[0054] In a possible implementation, the first business data or the second business data includes one or more combinations of:

[0055] image data;

[0056] audio data;

[0057] text data.

[0058] In a possible implementation, the apparatus further includes an installation module;

[0059] The acquisition module is further configured to acquire SDKs of a plurality of inference engines of the computing device, the SDKs of the inference engines being used to operate the inference engines.

[0060] The installation module is configured to install the acquired SDKs of the plurality of inference engines.

[0061] The conversion module is specifically configured to:

[0062] convert the first model in the plurality of conversion manners using the SDKs of the plurality of inference engines.

[0063] In a possible implementation, the acquisition module is specifically configured to:

[0064] acquire the SDKs of the plurality of inference engines of the computing device from an SDK library, the SDK library being located in the cloud or locally on the computing device.

[0065] In a third aspect, a computing device is provided, the computing device including a processor and a memory; the processor is configured to execute instructions stored in the memory, so that the computing device implements the method provided in the first aspect or any possible implementation of the first aspect.

[0066] In a fourth aspect, a non-transitory computer-readable storage medium is provided, the non-transitory computer-readable medium storing instructions for implementing the method provided in the first aspect or any possible implementation of the first aspect.

[0067] In a fifth aspect, a computer program product is provided, including a computer program, when the computer program is read and executed by a computing device, causing the computing device to execute the method provided in the first aspect or any possible implementation of the first aspect. BRIEF DESCRIPTION OF DRAWINGS

[0068] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced.

[0069] Figure 1 is a schematic diagram of an application scenario related to the embodiments of the present application;

[0070] Figure 2is a relationship diagram of an SDK of n inference engines and n inference engines provided by an embodiment of the present application.

[0071] Figure 3 is a flow diagram of a model conversion method provided by an embodiment of the present application.

[0072] Figure 4 is a flow diagram of determining a target model from a plurality of second models provided by an embodiment of the present application.

[0073] Figure 5 is a flow diagram of determining a target model from a plurality of second models provided by another embodiment of the present application.

[0074] Figure 6 is a structural diagram of a model conversion device provided by an embodiment of the present application.

[0075] Figure 7 is a structural diagram of a computing device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0076] The embodiments of the present application will be described below with reference to the accompanying drawings.

[0077] The terms "first", "second" in the embodiments of the present application are only for the purpose of description, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined with "first", "second" can explicitly or implicitly include one or more of the features.

[0078] In the embodiments of the present application, "at least one" means one or more, and "a plurality of" means two or more. "And / or" describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which can represent the following cases: A exists alone, A and B exist together, and B exists alone, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after it. "At least one of the following" or the like means any combination of these items, including any combination of single item or multiple items. For example, at least one of a, b or c can represent a, b, c, a-b, a-c, b-c or a-b-c, where a, b and c can be single or multiple.

[0079] The application scenarios related to the embodiments of the present application will be briefly described below.

[0080] With the rapid development of AI technology, various training and inference frameworks have emerged. Because different training and inference frameworks are developed by different companies, their built-in model formats are usually different. When two training and inference frameworks have different model formats, the inference engine in one framework cannot directly load the model trained by the other to process business logic. To allow the inference engine in one framework to load the model trained by the other, the model trained by the other framework needs to be converted into a model compatible with the inference engine in the first framework.

[0081] Inference engine matching means that the format of the model provided by the inference engine matches the format of the model to be loaded. In other words, the format of the model provided by the inference engine is the same as the format of the model to be loaded. When the inference engine and the model to be loaded match, the inference engine can directly load the model to be loaded to process the business logic. When the inference engine and the model to be loaded do not match, the model to be loaded needs to be converted to match the inference engine, so that the inference engine can load the model to be loaded to process the business logic.

[0082] For example, such as Figure 1 As shown, assume that a training inference framework A is deployed on computing device 10, and a training framework B is deployed on computing device 20. After training, framework A saves the model as model 1 with format a, and framework B saves the model as model 2 with format b. Since the format a of model 1 and the format b of model 2 are different model formats, the inference engine A' in framework A cannot directly load model 2 trained by framework B to process business, and the inference engine B' in framework B cannot directly load model 1 trained by framework A to process business.

[0083] If a user wants to use model 2 trained with framework B to process business logic on computing device 10 (which includes framework A but not framework B), and if inference engine A' already has model conversion capabilities, inference engine A' can convert model 2 into a model 2 that matches inference engine A'. A' Model 2 was obtained after the transformation. A' Afterwards, inference engine A' can load model 2. A' To process business logic, users can either download a third-party inference engine C with model conversion capabilities to computing device 10, whereby inference engine C will convert model 2 into a model that matches inference engine C. C Then, Model 2 is loaded by the inference engine C. C To handle business.

[0084] However, the model conversion method supports conversion from other model formats to only one model format of each inference engine, and does not support conversion to other specified model formats, which limits the model formats that can be converted. In addition, the model conversion method requires users to manually write a large amount of code to operate the engine to convert the model, which reduces the model conversion efficiency.

[0085] To solve the above problems, embodiments of the present application provide a model conversion method, device and related equipment. In order to facilitate understanding of the model conversion method, device and related equipment provided by the embodiments of the present application, the following first describes the concepts of the first model, the conversion mode matched with the inference engine, the second model, the software development kit (SDK) library and the like related to the embodiments of the present application.

[0086] The first model, also referred to as a to-be-loaded model, is a model to be used by the computing device to implement a business process. It can be understood that the specific type of the first model depends on the business to be implemented by the computing device. For example, if the business to be implemented by the computing device is to identify whether a driving vehicle is in violation, the first model is a model that can identify whether a driving vehicle is in violation. If the business to be implemented by the computing device is to identify whether a courier sorting personnel is violently sorting express, the first model is a model that can identify whether a courier sorting personnel is violently sorting express. In specific implementation, according to different businesses to be implemented by the computing device, the first model can also be a model for identifying audio data, a model for identifying a face image, and the like, which are not limited here.

[0087] The first model can be a convolutional neural network (CNN) or a recurrent neural network (RNN) and various deep learning models. The CNN can include VGGNet, ResNet, GoogleNet, EfficientNet, and the like. The RNN can include a long short-term memory (LSTM) model, a bi-directional long short-term memory (BiLSTM) model, and the like. The format of the first model can be a model format of a TensorFlow framework or a model format of a MindSpore framework and various formats.

[0088] The conversion manner matched with the inference engine, which can also be referred to as a conversion manner matched with the inference engine and the model or a conversion path matched with the inference engine, refers to a manner in which the inference engine converts the model into a model matched with the inference engine when the inference engine and the model are not matched.

[0089] Continuing with the inference engine A' converting the model 2 shown in FIG. 1B into a model 2 matched with the inference engine A' as shown in FIG. 1C, the inference engine A' converts the model 2 from the format b into the format a to obtain the model 2 matched with the inference engine A'. Figure 1 A' For example, the inference engine A' converts the format of the model 2 from b into a to obtain the model 2 matched with the inference engine A'. A' This manner, i.e., the conversion manner matched with the inference engine A', can also be referred to as a conversion manner matched with the inference engine A' and the model 2.

[0090] The second model refers to a model obtained by converting a first model from one format into another format, and continuing with the inference engine A' converting the model 2 shown in FIG. 1B into a model 2 matched with the inference engine A' as shown in FIG. 1C, the inference engine A' converts the model 2 from the format b into the format a to obtain the model 2 matched with the inference engine A'. Figure 1 A' For example, the model 2 can be referred to as the first model, and the model 2 A' can be referred to as the second model.

[0091] It can be understood that the second model is a model obtained by converting the first model from one format into another format, which indicates that the difference between the second model and the first model is only in the format of the model, and the attribute of the model (such as a business scenario to which the model can be applied) does not change, and therefore, the attribute of the second model and the attribute of the first model are the same. For example, when the first model is a model for identifying whether a driving vehicle violates a rule, the second model obtained by converting the first model is still a model for identifying whether a driving vehicle violates a rule, and when the first model is a model for identifying whether a courier sorting personnel violently sorts a courier, the second model obtained by converting the first model is still a model for identifying whether a courier sorting personnel violently sorts a courier.

[0092] The SDK library includes SDKs of n inference engines, n being a natural number greater than 1, wherein,

[0093] The SDK of the inference engine is used to operate (for example, call) the inference engine, and specifically, the SDK of the inference engine can be used to automatically operate the inference engine by the computing device, such as the computing device automatically operating the inference engine to perform a model conversion operation or load a model to process a business, etc.

[0094] For example, the SDK of the inference engine A' is used to automatically operate the inference engine A' to perform a model conversion operation or load a model to process a business, etc. Figure 2 ​​As shown, it is assumed that the n inference engines are: a MindSpore engine, a TensorRT engine, an ACL (ascend computing language) engine of an Ascend processor (hereinafter referred to as an ACL engine), and the like. The SDKs of the n inference engines included in the SDK library are: a MindSpore SDK, a TensorRT SDK, an ACL SDK, and the like. The MindSpore SDK indicates an SDK for operating the MindSpore engine. The TensorRT SDK indicates an SDK for operating the TensorRT engine. The ACL SDK indicates an SDK for operating the ACL engine.

[0095] From Figure 2 It can be seen that the SDKs of the n inference engines have a one-to-one matching relationship (which can also be referred to as a corresponding relationship or a mapping relationship) with the n inference engines. For example, the MindSpore SDK has a matching relationship with the MindSpore engine. The TensorRT SDK has a matching relationship with the TensorRT engine. The ACL SDK has a matching relationship with the ACL engine. And the like.

[0096] It can be understood that, in the case that the SDKs of the n inference engines have a one-to-one matching relationship with the n inference engines, if the computing device includes one or more inference engines of the n inference engines, the computing device can match one or more SDKs having a matching relationship with the one or more inference engines from the SDKs of the n inference engines included in the SDK library according to the one or more inference engines.

[0097] Continuing to take the example shown in Figure 2 As an example, if the computing device includes the MindSpore engine, the computing device can match the MindSpore SDK from the SDKs of the n inference engines included in the SDK library according to the MindSpore engine.

[0098] In a specific implementation, the SDK of the inference engine in the SDK library is used to operate an inference engine, which can be not only the MindSpore engine, the TensorRT engine, and the ACL engine shown in Figure 2 but also an Onnx Runtime engine or a TensorFlow engine.

[0099] The model conversion method, device and related equipment provided in the embodiments of the present application are described in detail below. In the model conversion method, device and related equipment provided in the embodiments of the present application, the computing device can obtain a plurality of conversion manners matched with a plurality of inference engines in the computing device in the case that there is no inference engine matched with the first model in the plurality of inference engines, and then convert the first model according to the plurality of conversion manners to obtain a plurality of second models. After obtaining the plurality of second models, the computing device can determine a target model from the plurality of second models, so that the computing device can use an inference engine matched with the target model in the plurality of inference engines to load the target model to process a service.

[0100] The model conversion method provided in the embodiments of the present application is described in more detail below in combination with the flowchart shown in Figure 3 Figure 3 The method provided in the embodiments of the present application includes but is not limited to the following steps:

[0101] S101, the computing device obtains a first model.

[0102] The computing device can be a cloud server, a personal computer or a terminal device, which is not limited here.

[0103] In the specific embodiments of the present application, the computing device can obtain the first model through the following possible implementation manners:

[0104] Possible implementation manner one: the first model is a model pre-stored in the local of the computing device, and the computing device can directly obtain the first model from the local.

[0105] Specifically, the computing device can receive a first model identifier input by a user, and then scan the local according to the first model identifier to find the first model from the local. The first model identifier can be a file name of the first model, a storage path of the first model, etc.

[0106] Possible implementation manner two: the first model is a model stored in a cloud or other computing device, and the computing device can send a request for obtaining the first model to the cloud or other computing device through a network to request to obtain the first model.

[0107] Specifically, the computing device can receive a first model identifier input by a user, and then send a request for obtaining the first model including the first model identifier to the cloud or other computing device, so that the cloud or other computing device can find the first model according to the request for obtaining the first model, and then send the found first model to the computing device.

[0108] ​It should be noted that the above two ways of the computing device obtaining the first model are merely examples, and in specific implementation, the computing device can also obtain the first model in other ways. For example, the first model can be a model stored in a U disk, and the computing device can receive the first model input by a user through a communication interface on the computing device for connecting the U disk.

[0109] S102, the computing device determines whether there is an inference engine matching the first model in the plurality of inference engines of the computing device, and in a case where it is determined that there is no inference engine matching the first model, S103-S106 are executed, and in a case where it is determined that there is an inference engine matching the first model, S107 is executed.

[0110] From the above introduction of the concept of matching between the inference engine and the model, it can be seen that the inference engine matches the first model, which means that the model format carried by the inference engine matches the format of the first model. Therefore, the computing device can determine whether there is an inference engine matching the first model in the plurality of inference engines of the computing device through steps S1021 and S1022.

[0111] S1021, the computing device obtains the format of the first model and the model format carried by the plurality of inference engines.

[0112] Specifically, the computing device can scan the file storing the first model to obtain the format of the first model.

[0113] In specific embodiments of the present application, the computing device can obtain the model format carried by the plurality of inference engines in the following possible implementation manners:

[0114] Possible implementation manner one, the computing device scans the configuration files (such as header files, library files, etc.) of the plurality of inference engines stored locally to obtain the model format carried by the plurality of inference engines.

[0115] Possible implementation manner two, a data table including a large number of corresponding relationships between inference engines and model formats carried by the inference engines is pre-stored in the computing device, and the computing device can obtain the model format carried by the plurality of inference engines from the pre-stored data table according to the plurality of inference engines included in the computing device.

[0116] It should be noted that the above two ways of the computing device obtaining the model format carried by the plurality of inference engines are merely examples, and in specific implementation, the computing device can also obtain the model format carried by the plurality of inference engines in other ways. For example, the data table including a large number of corresponding relationships between inference engines and model formats carried by the inference engines can be located in the cloud, and the computing device can send a request for obtaining the model format carried by the plurality of inference engines to the cloud through the network to request to obtain the model format carried by the plurality of inference engines.

[0117] S1022、The computing device matches the format of the first model with the model format self-brought by each inference engine in the plurality of inference engines, and determines whether there is an inference engine matching the first model in the plurality of inference engines.

[0118] It can be understood that, in the case that there is an inference engine in the plurality of inference engines whose self-brought model format is the same as the format of the first model, the inference engine is the inference engine matching the first model, otherwise, the computing device can determine that there is no inference engine matching the first model in the plurality of inference engines.

[0119] For example, it is assumed that the first model is a convolutional architecture for fast feature embedding (Caffe) model, and the plurality of inference engines are MindSpore engine, TensorRT engine, ACL engine and Caffe engine, wherein the Caffe model represents a model in Caffe format (representing the model format self-brought by the Caffe engine), and for ease of description, in the following embodiments, the model format self-brought by the MindSpore engine is represented by MindSpore format, the model format self-brought by the TensorRT engine is represented by TensorRT format, and the model format self-brought by the ACL engine is represented by OM format.

[0120] After the computing device matches the format of the Caffe model with the model format self-brought by each inference engine in the MindSpore engine, the TensorRT engine, the ACL engine and the Caffe engine, it finds that the format of the Caffe model is the same as the model format self-brought by the Caffe engine, and then the computing device determines that there is an inference engine matching the Caffe model in the plurality of inference engines, i.e., the Caffe engine.

[0121] S103、The computing device obtains a plurality of conversion manners matching the plurality of inference engines.

[0122] From the above description of the conversion manner matching the inference engine, it can be known that the plurality of conversion manners matching the plurality of inference engines are the plurality of conversion manners matching the plurality of inference engines and the first model.

[0123] In a possible implementation, the computing device has a preset data table pre-stored therein, and the preset data table includes conversion manners between a large number of inference engines and a large number of models, and the computing device can obtain the plurality of conversion manners matching the plurality of inference engines from the preset data table.

[0124] Referring to Table 1, Table 1 is an exemplary preset data table provided by the embodiments of the present application.

[0125] Table 1: Preset data table

[0126]

[0127] In Table 1, the ONNX model represents a model in the ONNX format, the OM model represents a model in the OM format, and so on. “Matching” means that the model matches the engine, that is, the model does not need to be converted, and the engine can load the model for business processing. “→” means that there is a conversion method that matches the inference engine. The character before “→” represents the format before conversion, and the character after “→” represents the format after conversion. “None” means that there is no conversion method that matches the inference engine.

[0128] Continuing to take the preset data table shown in Table 1 as an example, assuming that the first model is a Caffe model and the multiple inference engines of the computing device are the MindSpore engine, the TensorRT engine, and the ACL engine, it can be known from the example in S1022 that there is no inference engine in the MindSpore engine, the TensorRT engine, and the ACL engine that matches the Caffe model.

[0129] In the case where there is no inference engine in the MindSpore engine, the TensorRT engine, and the ACL engine that matches the Caffe model, the multiple conversion methods that match the MindSpore engine, the TensorRT engine, and the ACL engine obtained by the computing device from Table 1 are: (1) Caffe→ONNX→MindSpore, (2) Caffe→TensorRT, and (3) Caffe→OM.

[0130] S104, the computing device converts the first model according to the multiple conversion methods to obtain multiple second models.

[0131] Taking the conversion manners obtained by the computing device in S103 as examples: (1) Caffe→ONNX→MindSpore, (2) Caffe→TensorRT, and (3) Caffe→OM, the computing device can convert the Caffe model according to the three conversion manners respectively, wherein the second model obtained by converting according to the Caffe→ONNX→MindSpore conversion manner is a model in the MindSpore format, the second model obtained by converting according to the Caffe→TensorRT conversion manner is a model in the TensorRT format, and the second model obtained by converting according to the Caffe→OM conversion manner is a model in the OM format. In order to distinguish and describe the three second models, in the following embodiments, the second model A represents the second model in the MindSpore format, the second model B represents the second model in the TensorRT format, and the second model C represents the second model in the OM format.

[0132] S105, the computing device determines a target model from the plurality of second models.

[0133] In specific embodiments of the present application, the computing device can determine the target model from the plurality of second models through steps S1051 and S1052.

[0134] S1051, the computing device obtains index data for evaluating each second model in the plurality of second models.

[0135] In specific embodiments, the index data for evaluating each second model includes one or more combinations of the following four parameters: the conversion time of each second model obtained by converting the first model (hereinafter referred to as the conversion time corresponding to the second model), the memory consumed by converting the first model to obtain each second model (hereinafter referred to as the conversion memory corresponding to the second model), the duration of identifying the second business data using each second model (hereinafter referred to as the identification duration corresponding to the second model), and the accuracy rate of identifying the second business data using each second model (hereinafter referred to as the identification accuracy rate corresponding to the second model).

[0136] The conversion time corresponding to the second model refers to the duration experienced by the first model from the start of conversion to the end of conversion to obtain the second model. For example, assuming that the first model starts converting at 18:48 on April 19, 2021, and the first model converts to obtain the second model at 18:59 on April 19, 2021, the conversion time of the first model to obtain the second model is 11 minutes.

[0137] The conversion memory corresponding to the second model refers to the total memory of the computing device consumed by the first model from the beginning of the conversion to the end of the conversion to obtain the second model. For example, it is assumed that the remaining memory of the computing device is 100G when the first model starts conversion, and the remaining memory of the computing device is 90G when the conversion ends to obtain the second model. The memory consumed by the first model to obtain the second model is 10G.

[0138] The identification duration corresponding to the second model refers to the duration experienced by the second model from the beginning of identifying the second business data to the end of identifying the second business data. For example, it is assumed that the time when the second model starts identifying the second business data is 18:48:20.100 on April 19, 2021, and the time when the second model finishes identifying the second business data is 18:48:20.101 on April 19, 2021. The duration of identifying the second business data using the second model is 1 millisecond.

[0139] The identification accuracy corresponding to the second model refers to the accuracy of the identification result obtained by the second model identifying the second business data. For example, it is assumed that the second business data includes 10,000 data, and the second model is used to identify the 10,000 data included in the second business data. If 9,000 of the 10,000 results obtained by identification are accurate, the accuracy of identifying the second business data using the second model is 90%.

[0140] The second model can identify the second business data, in other words, the second business data is data that can be identified by the second model. Therefore, the computing device can determine the second business data according to the second model.

[0141] For example, when the second model is a model for identifying whether a vehicle violates a rule, the second business data can be image data captured on a traffic road. When the second model is a model for identifying whether a courier sorting personnel violently sorts a courier, the second business data can be image data captured on a courier sorting scene. When the second model is a model for identifying audio data, the second business data can be audio data.

[0142] It should be noted that the above examples of the second business data, i.e., image data captured on a traffic road, image data captured on a courier sorting scene, and audio data, are only examples and should not be considered as specific limitations. In specific implementations, the second business data can be one or a combination of image data, audio data, or text data.

[0143] In a possible implementation, the second service data is real data provided by the user. For example, when the second model is a model for identifying whether a running vehicle violates a rule, the second service data is real image data of a traffic road captured by the user.

[0144] In another possible implementation, the second service data is fake data constructed by the computing device. For example, when the second model is a model for identifying whether a running vehicle violates a rule, the second service data is not real image data provided by the user, but data constructed by the computing device according to the real image data, and the type (such as float type or integer type), channel, and dimension of the constructed data correspond to the type, channel, and dimension of the real image data.

[0145] It should be further noted that the index data described above includes one or more combinations of the four parameters: the conversion time corresponding to the second model, the conversion memory corresponding to the second model, the identification duration corresponding to the second model, and the identification accuracy corresponding to the second model, which is only an example and should not be regarded as a limitation on the index data. In specific implementations, the index data can also include other parameters or more parameters.

[0146] S1052. The computing device selects a target model from the plurality of second models based on the plurality of index data.

[0147] In specific embodiments of the present application, the target model selected by the computing device from the plurality of second models can be the optimal model in the plurality of second models, or a suboptimal second model or other second model, which is not limited here.

[0148] The following are several possible ways in which the computing device selects a target model from the plurality of second models:

[0149] In a possible implementation, the index data used to evaluate each second model is the accuracy of each second model. In this case, the computing device can determine the second model with the highest accuracy in the plurality of second models as the target model.

[0150] In a possible implementation, the index data used to evaluate each second model includes the conversion time and conversion memory corresponding to each second model. In this case, the computing device can determine the target model by Figure 4

[0151] S11. The computing device divides the conversion time corresponding to each second model by the standard conversion time to obtain a first result.

[0152] S12. The computing device divides the conversion memory corresponding to each second model by the standard conversion memory to obtain a second result. ​

[0153] S13, the computing device superimposes the first result and the second result to obtain a superimposed result corresponding to each second model.

[0154] S14, the computing device determines a second model with the minimum superimposed result among the second models as the target model.

[0155] Continuing with the example of the second models in step S104, assuming that the second model A, the second model B and the second model C are three models, the conversion time corresponding to the model A is 15 minutes, the conversion memory corresponding to the model A is 8G, the conversion time corresponding to the model B is 10 minutes, the conversion memory corresponding to the model B is 10G, the conversion time corresponding to the model C is 7 minutes, the conversion memory corresponding to the model C is 18G, the standard conversion time is 10 minutes, the standard conversion memory is 12G, the weight corresponding to the conversion time is 0.5, and the weight corresponding to the conversion memory is 0.5, the computing device can calculate the superimposed result A' corresponding to the model A as 0.5*(15 / 10)+0.5*(8 / 12)=1.0833, the superimposed result B' corresponding to the model B as 0.5*(10 / 10)+0.5*(10 / 12)=0.9167, and the superimposed result C' corresponding to the model C as 0.5*(7 / 10)+0.5*(18 / 12)=1.1000. Since B'<A'<C', the computing device determines the model B as the target model.

[0156] In a possible implementation, the index data of each second model includes the conversion time, the conversion memory, the recognition duration and the recognition accuracy corresponding to each second model. At this time, the computing device can determine the target model by Figure 5 as shown in steps S21-S26:

[0157] S21, the computing device divides the conversion time corresponding to each second model by the standard conversion time to obtain a first result.

[0158] S22, the computing device divides the conversion memory corresponding to each second model by the standard conversion memory to obtain a second result.

[0159] S23, the computing device divides the recognition duration corresponding to each second model by the standard recognition duration to obtain a third result.

[0160] S24, the computing device divides the recognition accuracy corresponding to each second model by the standard recognition accuracy to obtain a fourth result.

[0161] S25, the computing device superimposes the first result, the second result, the third result and the fourth result to obtain a superimposed result corresponding to each second model.

[0162] S26, the computing device determines the second model corresponding to the maximum superposition result as the target model.

[0163] Continuing with the example of the three second models in step S104, assume that the conversion time corresponding to model A is 15 minutes, the conversion memory corresponding to model A is 8G, the recognition duration corresponding to model A is 1ms, the recognition accuracy corresponding to model A is 95%, the conversion time corresponding to model B is 10 minutes, the conversion memory corresponding to model B is 10G, the recognition duration corresponding to model B is 0.8ms, the recognition accuracy corresponding to model B is 89%, the conversion time corresponding to model C is 7 minutes, the conversion memory corresponding to model C is 18G, the recognition duration corresponding to model C is 1.2ms, the recognition accuracy corresponding to model C is 98%, the standard conversion time is 10 minutes, the standard conversion memory is 12G, the standard recognition duration is 1ms, and the standard recognition accuracy is 90%, the conversion time corresponding weight is 0.1, the conversion memory corresponding weight is 0.2, the recognition duration corresponding weight is 0.3, and the recognition accuracy corresponding weight is 0.4. The computing device can calculate the superposition result A" corresponding to model A as 0.1*(15 / 10)+0.2*(8 / 12)+0.3*(1 / 1)+0.4*(95% / 90%) = 1.0055, the superposition result B" corresponding to model B as 0.1*(10 / 10)+0.2*(10 / 12)+0.3*(0.8 / 1)+0.4*(89% / 90%) = 0.9022, and the superposition result C" corresponding to model C as 0.1*(7 / 10)+0.2*(18 / 12)+0.3*(1.2 / 1)+0.4*(98% / 90%) = 1.1656. Since B" < A" < C", the computing device determines model C as the target model.

[0164] It can be understood that the above-mentioned several possible implementation manners are only as an example and should not be considered as specific limitation. For example, in specific implementation, the computing device can also determine the second model corresponding to the shortest conversion time as the target model, or determine the second model corresponding to the shortest recognition duration as the target model, etc.

[0165] S106, the computing device uses the inference engine matching the target model in the plurality of inference engines to load the target model to recognize the first business data.

[0166] In a possible implementation manner, the target model is a model for identifying whether a running vehicle violates rules, and the first business data is image data captured on a traffic road.

[0167] In another possible implementation, the target model is a model for identifying whether a courier sorting personnel violently sorts a courier, and the first business data is image data captured by photographing a courier sorting scene.

[0168] In yet another possible implementation, the target model is a model for identifying audio data, and the first business data is the audio data.

[0169] It should be noted that the first business data listed above, i.e., image data captured by photographing a traffic road, image data captured by photographing a courier sorting scene, and audio data, are merely examples and should not be considered as specific limitations. In specific implementations, the first business data can be one or a combination of multiple types of data such as image data, audio data, or text data.

[0170] Taking the multiple inference engines in the computing device as the MindSpore engine, the TensorRT engine, and the ACL engine, and taking the target model in the example in step S26 as the second model C as an example, it can be seen from the above that the second model C is an OM format model, and the inference engine that matches the second model C in the multiple inference engines is the ACL engine. Therefore, the computing device can use the ACL engine to load the second model C to identify the first business data and implement business processing.

[0171] S107, using the inference engine matching the first model, loading the first model to identify the first business data.

[0172] Taking the example in S1022 in which the computing device determines that the Caffe engine in the multiple inference engines matches the Caffe model as an example, the computing device can directly use the Caffe engine to load the Caffe model to identify the first business data and implement business processing when determining that the Caffe engine in the multiple inference engines matches the Caffe model.

[0173] It should be noted that in the present application, Figure 3 The steps S101 to S107 in the model conversion method shown can be automatically executed by the computing device without user participation, unlike the prior art in which a user needs to manually write a large amount of code to operate the inference engine for model conversion, which can improve the efficiency of model conversion.

[0174] The process of automatically operating the inference engine by the model conversion method provided by the embodiments of the present application will be introduced below.

[0175] As can be seen from the above introduction of the SDK of the inference engine, the SDK of the inference engine can be used by the computing device to automatically operate the inference engine. Therefore, the computing device can execute Figure 3Before the model conversion method shown, the SDKs of multiple inference engines of the computing device are obtained. Then, some or all of the SDKs of the multiple inference engines are used to call the corresponding inference engines to achieve the desired result. Figure 3 The steps requiring the involvement of the inference engine include steps S102, S103, S104, S106, and S107. Through the use of SDKs for multiple inference engines, these steps can all be executed automatically by the computing device.

[0176] In specific embodiments of this application, a computing device can obtain SDKs for multiple inference engines from the SDK library described above. For example, the SDK library can be open source. For example, the SDK library can be located in the cloud or on the local machine of the computing device. If the SDK library is located in the cloud, the computing device can send a request to the cloud via the network to obtain the SDK library. After obtaining the SDK library, the computing device can obtain SDKs for multiple inference engines from the SDK library. If the SDK library is located on the local machine of the computing device, the computing device can directly obtain SDKs for multiple inference engines from the local machine.

[0177] by Figure 2 Taking the SDK library shown as an example, if the computing device includes three inference engines: MindSpore, TensorRT, and ACL, then the SDKs for the inference engines obtained by the computing device from the SDK library are: MindSpore SDK, TensorRT SDK, and ACL SDK.

[0178] As can be seen, the model conversion method provided in this application embodiment allows the computing device to obtain multiple conversion methods matching multiple inference engines of the computing device, and then convert the first model according to the multiple conversion methods to obtain multiple second models, which can solve the problem of limited convertible model formats in the prior art. In addition, the model conversion method provided in this application embodiment can be executed by the computing device without user intervention, which can solve the problem of low model conversion efficiency in the prior art.

[0179] It should be noted that although the above description of the model conversion method provided in the embodiments of this application uses a computing device as the execution subject, in specific implementations, the execution subject of the model conversion method can also be a computing device cluster including at least two computing devices. The at least two computing devices in the computing device cluster can work together to implement the model conversion method provided in the embodiments of this application. For example, if the computing device cluster includes computing device A and computing device B, step S101 is executed by computing device A, and steps S102 to S107 are executed by computing device B, or steps S101 to S105 are executed by computing device A, and steps S106 and S107 are jointly executed by computing device A and computing device B.

[0180] The model conversion method of the embodiments of the present application is described in detail above. Based on the same inventive concept, the model conversion device of the embodiments of the present application is further provided below. The model conversion device provided by the present application can be applied to various computing devices such as cloud servers, personal computers, terminal devices, and computing device clusters including at least two computing devices. The model conversion device provided by the embodiments of the present application is described below by taking the application to a computing device as an example.

[0181] Referring to Figure 6 , Figure 6 FIG. 1 is a structural schematic diagram of a model conversion device 100 provided by the embodiments of the present application. The device 100 includes an acquisition module 110, a conversion module 120, a determination module 130, and an identification module 140, wherein

[0182] The acquisition module 110 is configured to acquire a plurality of conversion manners matched with a plurality of inference engines when there is no inference engine matched with the first model in the plurality of inference engines of the computing device.

[0183] The conversion module 120 is configured to convert the first model according to the plurality of conversion manners to obtain a plurality of second models.

[0184] The determination module 130 is configured to determine a target model from the plurality of second models.

[0185] The identification module 140 is configured to load the target model using an inference engine matched with the target model in the plurality of inference engines to identify the first business data.

[0186] In a possible implementation, the acquisition module 110 is specifically configured to acquire a plurality of conversion manners matched with the plurality of inference engines and the first model.

[0187] In a possible implementation, the determination module 130 is specifically configured to acquire index data for evaluating each second model, and select the target model from the plurality of second models based on the plurality of index data.

[0188] In a possible implementation, the index data includes one or more combinations of the following: a conversion time of the first model to obtain the second model; a memory consumed by the first model to obtain the second model; a duration of identifying second business data using the second model; and an accuracy rate of identifying the second business data using the second model.

[0189] In a possible implementation, the determination module 130 is specifically configured to select an optimal second model, a suboptimal second model, or another second model from the plurality of second models based on the plurality of index data, and the selected second model is the target model.

[0190] In a possible implementation, the first service data or the second service data comprises one or more combinations of: image data; audio data; and text data.

[0191] In a possible implementation, the obtaining module 110 is further configured to obtain SDKs of a plurality of inference engines of the computing device, the SDKs of the inference engines being used to operate the inference engines; and the model conversion apparatus 100 further comprises an installing module 150 configured to install the obtained SDKs of the plurality of inference engines; and the conversion module 120 is specifically configured to convert the first model in the plurality of conversion manners using the SDKs of the plurality of inference engines.

[0192] In a possible implementation, the obtaining module 110 is specifically configured to obtain the SDKs of the plurality of inference engines of the computing device from an SDK library, the SDK library being located in the cloud or locally on the computing device.

[0193] Specifically, the specific implementation of the model conversion apparatus 100 performing various operations can refer to the description in the related content in the above model conversion method embodiments, and for the sake of brevity of the description, details are not described herein.

[0194] It should be understood that the model conversion apparatus 100 is only an example provided by the embodiments of the present application, and the model conversion apparatus 100 can have more or fewer components than those shown, can combine two or more components, or can have a different configuration of components. Figure 6 The model conversion apparatus 100 can have more or fewer components than those shown, can combine two or more components, or can have a different configuration of components.

[0195] The embodiments of the present application also provide a computing device 200, which is shown in Figure 7 , Figure 7 is a structural schematic diagram of a computing device 200 provided by the embodiments of the present application, and the computing device 200 comprises a processor 210, a memory 220, and a communication interface 230, wherein the processor 210, the memory 220, and the communication interface 230 can be connected to each other through a bus 240. Wherein,

[0196] The processor 210 can read the program code (including instructions) stored in the memory 220, execute the program code stored in the memory 220, so that the computing device 200 performs the steps in the model conversion method provided by the above method embodiments, or so that the computing device 200 deploys the model conversion apparatus 100.

[0197] The processor 210 can have various specific implementations. For example, the processor 210 can be a CPU, a GPU, an NPU, a Tengine, or the like. The processor 210 can also be a single-core processor or a multi-core processor. The processor 210 can be a combination of a CPU and a hardware chip. The hardware chip can be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. The processor 210 can also be implemented by a logic device with built-in processing logic, such as an FPGA or a DSP.

[0198] The memory 220 can store program codes and program data. The program codes include codes of the obtaining module 110, the conversion model 120, the determining module 130, the identifying module 140, and the installing module 150, and the like. The program data includes a plurality of conversion modes matched with a plurality of inference engines, a plurality of second models, first business data, second business data, and the like.

[0199] In actual applications, the memory 220 can be a non-volatile memory, such as a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically EPROM (EEPROM), or a flash memory. The memory 220 can also be a volatile memory, which can be a random access memory (RAM) used as an external cache.

[0200] The communication interface 230 can be a wired interface (e.g., an Ethernet interface) or a wireless interface (e.g., a cellular network interface or a wireless local area network interface) for communicating with other computing nodes or devices. When the communication interface 230 is a wired interface, the communication interface 230 can employ a family of protocols above the transmission control protocol / internet protocol (TCP / IP), such as a remote function call (RFC) protocol, a simple object access protocol (SOAP) protocol, a simple network management protocol (SNMP) protocol, a common object request broker architecture (CORBA) protocol, and a distributed protocol, among others.

[0201] The bus 240 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, among others. The bus 240 can be divided into an address bus, a data bus, a control bus, among others. For ease of representation, Figure 7 Only one thick line is used to represent the bus in the figure, but it does not mean that there is only one bus or only one type of bus.

[0202] The computing device 200 described above is configured to perform the method described in the above model conversion method embodiments, and belongs to the same concept as the above method embodiments. For details of the implementation process, refer to the above method embodiments, which will not be repeated here.

[0203] The computing device 200 deploys the functional modules of the model conversion apparatus 100. Refer to the apparatus embodiments.

[0204] It should be understood that the computing device 200 is only an example provided by the embodiments of the present application, and the computing device 200 can have more or fewer components than those shown, can combine two or more components, or can have a different configuration of components. Figure 7

[0205] The embodiments of the present application also provide a non-transitory computer-readable storage medium, which stores instructions. When the instructions are executed, some or all steps of the model conversion method described in the above embodiments can be implemented. ​

[0206] The embodiments of the present application further provide a computer program product, which can realize some or all steps of the model conversion method described in the method embodiments when the computer program product is read and executed by a computer.

[0207] In the above embodiments, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the relevant description of other embodiments.

[0208] In the above embodiments, all or part of the embodiments can be realized by software, hardware or any combination thereof. When realized by using software, all or part of the embodiments can be realized in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.) mode. The computer readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The available media can be magnetic media (such as floppy disk, hard disk, magnetic tape), optical media, or semiconductor media, etc.

[0209] The steps in the method embodiments of the present application can be adjusted in sequence, combined or deleted according to actual needs; the units in the device embodiments of the present application can be divided, combined or deleted according to actual needs.

[0210] The embodiments of the present application are described in detail above, and the specific examples are applied to explain the principles and implementation modes of the present application. The above description of the embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, the specific implementation mode and application range will be changed, and the above description should not be understood as the limitation of the present application.

Claims

1. A model conversion method characterized by, The method comprises: The computing device obtains a plurality of conversion modes matched with the plurality of inference engines when there is no inference engine matched with the first model in the plurality of inference engines of the computing device; The computing device converts the first model according to the plurality of conversion modes to obtain a plurality of second models, wherein the plurality of second models are models obtained after the first model is converted from a first format into a plurality of second formats; The computing device determines a target model from the plurality of second models; The computing device loads the target model using an inference engine matched with the target model in the plurality of inference engines to identify the first business data.

2. The method of claim 1, wherein, The computing device obtains a plurality of conversion modes matched with the plurality of inference engines, comprising: The computing device obtains a plurality of conversion modes matched with the plurality of inference engines and the first model.

3. The method according to claim 1 or 2, characterized in that, The computing device determines a target model from the plurality of second models, comprising: The computing device obtains index data for evaluating each second model; The computing device selects a target model from the plurality of second models based on the plurality of index data.

4. The method of claim 3, wherein, The index data comprises one or a combination of the following: Conversion time of the first model to obtain the second model; Memory consumed by the first model to obtain the second model; Duration of using the second model to identify second business data; Accuracy of using the second model to identify second business data.

5. The method of claim 3, wherein, The computing device selects a target model from the plurality of second models based on the plurality of index data, comprising: The computing device selects an optimal second model, a suboptimal second model, or another second model from the plurality of second models based on the plurality of index data, and the selected second model is the target model.

6. The method of claim 4, wherein, The first business data or the second business data comprises one or a combination of the following: Image data; Audio data; Text data.

7. The method according to claim 1 or 2, characterized in that, The method further comprises: The computing device obtains SDKs of a plurality of inference engines of the computing device, wherein the SDKs of the inference engines are used to operate the inference engines; The computing device installs the obtained SDKs of the plurality of inference engines; The computing device converts the first model according to the plurality of conversion modes, comprising: The computing device converts the first model according to the plurality of conversion modes using the SDKs of the plurality of inference engines.

8. The method of claim 7, wherein, The computing device obtains SDKs of a plurality of inference engines of the computing device, comprising: The computing device obtains the SDKs of the plurality of inference engines of the computing device from an SDK library, wherein the SDK library is located in the cloud or locally on the computing device.

9. A model conversion apparatus characterized by comprising: The apparatus comprises: An obtaining module configured to obtain a plurality of conversion modes matched with the plurality of inference engines when there is no inference engine matched with the first model in the plurality of inference engines of the computing device; A conversion module configured to convert the first model according to the plurality of conversion modes to obtain a plurality of second models, wherein the second model is a model obtained after the first model is converted from a first format into a second format; determining a target model from the plurality of second models; identifying a first service data using the target model matched with the target model from the plurality of inference engines.

10. The apparatus of claim 9, wherein, The acquisition module is specifically configured to: acquire a plurality of conversion modes matched with the plurality of inference engines and the first model.

11. The apparatus of claim 9 or 10, wherein, The determining module is specifically configured to: acquire index data for evaluating each of the second models; select a target model from the plurality of second models based on the plurality of index data.

12. The apparatus of claim 11, wherein, The index data includes one or a combination of the following: conversion time of the first model to the second model; memory consumption of the first model to the second model; time length of identifying a second service data using the second model; accuracy rate of identifying the second service data using the second model.

13. The apparatus of claim 11, wherein, The determining module is specifically configured to: select an optimal second model, a suboptimal second model, or other second models from the plurality of second models based on the plurality of index data, and the selected second model is the target model.

14. The apparatus of claim 12, wherein, The first service data or the second service data includes one or a combination of the following: image data; audio data; text data.

15. The apparatus of claim 9 or 10, wherein, The apparatus further includes an installation module. The acquisition module is further configured to acquire SDKs of a plurality of inference engines of the computing device, and the SDKs of the inference engines are used to operate the inference engines. The installation module is configured to install the acquired SDKs of the plurality of inference engines. The conversion module is specifically configured to: convert the first model according to the plurality of conversion modes using the SDKs of the plurality of inference engines.

16. The apparatus of claim 15, wherein, The acquisition module is specifically configured to: acquire the SDKs of the plurality of inference engines of the computing device from an SDK library, and the SDK library is located in the cloud or locally on the computing device.

17. A computing device, comprising: The computing device includes a processor and a memory, and the processor is configured to execute instructions stored in the memory, so that the computing device implements the method in any one of claims 1 to 8.

18. A non-transitory computer-readable storage medium, comprising: The non-transitory computer-readable medium stores instructions for implementing the method in any one of claims 1 to 8. The non-transitory computer-readable medium stores instructions for implementing the method in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Network request processing method and device, equipment and storage medium

    CN111400000A