Artificial intelligence model operation method and computer equipment

By detecting the business needs and environment of terminal devices and dynamically loading matching models and resources, the problem of low operating efficiency of artificial intelligence models on different terminal devices is solved, and efficient model inference performance is achieved.

CN118586499AActive Publication Date: 2024-09-03TENCENT MUSIC ENTERTAINMENT TECH (SHENZHEN) CO LTD

Patent Information

Application Number
CN202410632971.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-21
Publication Date
2024-09-03
Estimated Expiration
2044-05-21

AI Technical Summary

Technical Problem

In the existing technology, the operating efficiency of artificial intelligence models on different terminal devices is low, and the performance differences of terminal devices cannot be fully utilized, resulting in slow inference results.

Method used

By detecting the client's business requirements and model running environment, dynamically loading matching target model files and inference engine resources, and running the appropriate target artificial intelligence model to ensure the match between the model and the environment.

Benefits of technology

It improves the operating efficiency of artificial intelligence models on different terminal devices, meets a variety of reasoning needs, and improves the model reasoning performance on terminal devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118586499A
    Figure CN118586499A
Patent Text Reader

Abstract

The invention relates to an artificial intelligence model operation method and computer equipment, relates to the technical field of artificial intelligence models, and can improve the operation efficiency of an artificial intelligence model on different terminal equipment. The method comprises the steps of determining a current service demand of a client under the condition that a trigger event for calling an artificial intelligence model is detected; obtaining a target model file matched with the business demand and the model operation environment of the client from a plurality of candidate model files; the plurality of candidate model files correspond to different artificial intelligence models respectively, and inference engines on which the artificial intelligence models depend are matched with corresponding model operation environments; engine operation resources related to an inference engine corresponding to the target model file are obtained; and running a target artificial intelligence model corresponding to the target model file on the client based on the engine running resource and the target model file.
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 model technology, and in particular to an artificial intelligence model operation method, computer equipment, computer-readable storage medium, and computer program product. Background Art

[0002] With the development of computer technology, the reasoning ability of artificial intelligence models has been widely used in mobile terminal devices.

[0003] In the related technologies, developers mainly train artificial intelligence models according to actual needs and apply the same artificial intelligence models to various terminal devices. For example, the trained artificial intelligence model can be pre-packaged in the client, and the artificial intelligence model can be run for relevant reasoning during the use of the client.

[0004] However, in practice, it was found that when running artificial intelligence models on different terminal devices in the above manner, some devices obtained inference results at a slow speed, and there is still room for improvement in the operating efficiency of artificial intelligence models on terminal devices. Summary of the invention

[0005] Based on this, it is necessary to provide an artificial intelligence model operation method, computer equipment, computer-readable storage medium and computer program product that can improve the operating efficiency of artificial intelligence models on different terminal devices in response to the above-mentioned technical problems.

[0006] In a first aspect, the present application provides an artificial intelligence model operation method, comprising:

[0007] Determine the client’s current business needs when a triggering event for invoking an AI model is detected;

[0008] Obtaining a target model file that matches the business requirements and the model operating environment of the client from a plurality of candidate model files; the plurality of candidate model files respectively correspond to different artificial intelligence models, and the inference engine that each artificial intelligence model relies on is matched with a corresponding model operating environment;

[0009] Obtaining engine running resources related to the inference engine corresponding to the target model file;

[0010] Based on the engine running resources and the target model file, the target artificial intelligence model corresponding to the target model file is run on the client.

[0011] In one embodiment, obtaining a target model file that matches the business requirement and the model operating environment of the client from a plurality of candidate model files includes:

[0012] Determine the model functionality that matches the business requirements;

[0013] If the client stores a valid model list corresponding to the model function, then obtain the target model identifier in the valid model list; the inference engine on which the artificial intelligence model corresponding to the target model identifier depends matches the model operating environment of the client;

[0014] A model file query is performed on the client according to the target model identifier to obtain a target model file.

[0015] In one of the embodiments, the target model identifier is the most recently added model identifier;

[0016] After querying the model file on the client according to the target model identifier to obtain the target model file, the method further includes:

[0017] Sending a model update request to the server; the model update request is used to trigger the server to determine a recommended artificial intelligence model according to the target model identifier and the model operating environment carried in the model update request, and obtain a model comparison result between the recommended artificial intelligence model and the target artificial intelligence model;

[0018] When the model comparison result indicates that the recommended artificial intelligence model is better than the target artificial intelligence model, the model file corresponding to the recommended artificial intelligence model returned by the server is stored, and the model identifier corresponding to the recommended artificial intelligence model is added to the valid model list.

[0019] In one of the embodiments, after running the target artificial intelligence model corresponding to the target model file on the client based on the engine running resource and the target model file, the method further includes:

[0020] When acquiring the target model file again according to the valid model list, querying the historical model file of the client according to the historical model identifier in the valid model list; the historical model identifier is a model identifier whose addition time is later than the addition time of the target model identifier;

[0021] The historical model file and the historical model identifier are deleted.

[0022] In one of the embodiments, the model update request is also used to trigger the server to obtain validity information of the target artificial intelligence model;

[0023] The method further comprises:

[0024] When the validity information indicates that the target artificial intelligence model has expired, the target model identifier is added to the invalid model list, and / or the target model file stored in the client is deleted.

[0025] In one embodiment, obtaining a target model file that matches the business requirement and the model operating environment of the client from a plurality of candidate model files includes:

[0026] Determine the model functionality that matches the business requirements;

[0027] When the client does not store the model file of the model function, a model loading request carrying the model function and the model running environment information of the client is sent to the server; the model loading request is used to trigger the server to determine a target artificial intelligence model that matches the model running environment from multiple candidate artificial intelligence models under the model function, and obtain a target model file corresponding to the target artificial intelligence model;

[0028] Receive the target model file returned by the server.

[0029] In one of the embodiments, before acquiring the target model file matching the business requirement and the model operating environment of the client from the plurality of candidate model files, the method further includes:

[0030] Acquire client attribute information of the client and device attribute information of a terminal device on which the client is deployed;

[0031] Obtain the operating strategies of each candidate inference engine that can be supported locally;

[0032] The model operating environment of the client is determined according to the client attribute information, the device attribute information and the candidate inference engine operating strategy.

[0033] In one embodiment, obtaining engine running resources related to the inference engine corresponding to the target model file includes:

[0034] Determine a local target inference engine operation strategy for the target model file;

[0035] Generate a resource loading request according to the target inference engine operation strategy, and send the resource loading request to the server; the resource loading request is used to trigger the server to obtain the target resource file required when the inference engine corresponding to the target model file runs according to the target inference engine operation strategy;

[0036] The engine running resources are obtained according to the target resource file returned by the server.

[0037] In one embodiment, running the target artificial intelligence model corresponding to the target model file on the client based on the engine running resource and the target model file includes:

[0038] Obtaining engine configuration parameters of the inference engine corresponding to the target model file;

[0039] Creating an inference processor on the client according to the engine configuration parameters, the engine running resources and the target model file;

[0040] The inference processor is used to run the target artificial intelligence model corresponding to the target model file.

[0041] In a second aspect, the present application also provides another artificial intelligence model operation method, including:

[0042] Receiving a model loading request from a client; the model loading request is sent by the client when a trigger event for calling an artificial intelligence model is detected;

[0043] In response to the model loading request, obtaining a target model file that matches the current business requirements of the client and the model running environment of the client from a plurality of candidate model files;

[0044] The target model file is returned to the client to trigger the client to obtain engine running resources related to the inference engine corresponding to the target model file, and based on the engine running resources and the target model file, the target artificial intelligence model corresponding to the target model file is run on the client.

[0045] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0046] Determine the client’s current business needs when a triggering event for invoking an AI model is detected;

[0047] Obtaining a target model file that matches the business requirements and the model operating environment of the client from a plurality of candidate model files; the plurality of candidate model files respectively correspond to different artificial intelligence models, and the inference engine that each artificial intelligence model relies on is matched with a corresponding model operating environment;

[0048] Obtaining engine running resources related to the inference engine corresponding to the target model file;

[0049] Based on the engine running resources and the target model file, the target artificial intelligence model corresponding to the target model file is run on the client.

[0050] In a fourth aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0051] Receiving a model loading request from a client; the model loading request is sent by the client when a trigger event for calling an artificial intelligence model is detected;

[0052] In response to the model loading request, obtaining a target model file that matches the current business requirements of the client and the model running environment of the client from a plurality of candidate model files;

[0053] The target model file is returned to the client to trigger the client to obtain engine running resources related to the inference engine corresponding to the target model file, and based on the engine running resources and the target model file, the target artificial intelligence model corresponding to the target model file is run on the client.

[0054] In a fifth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0055] Determine the client’s current business needs when a triggering event for invoking an AI model is detected;

[0056] Obtaining a target model file that matches the business requirements and the model operating environment of the client from a plurality of candidate model files; the plurality of candidate model files respectively correspond to different artificial intelligence models, and the inference engine that each artificial intelligence model relies on is matched with a corresponding model operating environment;

[0057] Obtaining engine running resources related to the inference engine corresponding to the target model file;

[0058] Based on the engine running resources and the target model file, the target artificial intelligence model corresponding to the target model file is run on the client.

[0059] In a sixth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0060] Receiving a model loading request from a client; the model loading request is sent by the client when a trigger event for calling an artificial intelligence model is detected;

[0061] In response to the model loading request, obtaining a target model file that matches the current business requirements of the client and the model running environment of the client from a plurality of candidate model files;

[0062] The target model file is returned to the client to trigger the client to obtain engine running resources related to the inference engine corresponding to the target model file, and based on the engine running resources and the target model file, the target artificial intelligence model corresponding to the target model file is run on the client.

[0063] In a seventh aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0064] Determine the client’s current business needs when a triggering event for invoking an AI model is detected;

[0065] Obtaining a target model file that matches the business requirements and the model operating environment of the client from a plurality of candidate model files; the plurality of candidate model files respectively correspond to different artificial intelligence models, and the inference engine that each artificial intelligence model relies on is matched with a corresponding model operating environment;

[0066] Obtaining engine running resources related to the inference engine corresponding to the target model file;

[0067] Based on the engine running resources and the target model file, the target artificial intelligence model corresponding to the target model file is run on the client.

[0068] In an eighth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0069] Receiving a model loading request from a client; the model loading request is sent by the client when a trigger event for calling an artificial intelligence model is detected;

[0070] In response to the model loading request, obtaining a target model file that matches the current business requirements of the client and the model running environment of the client from a plurality of candidate model files;

[0071] The target model file is returned to the client to trigger the client to obtain engine running resources related to the inference engine corresponding to the target model file, and based on the engine running resources and the target model file, the target artificial intelligence model corresponding to the target model file is run on the client.

[0072] The above-mentioned artificial intelligence model operation method, computer device, computer-readable storage medium and computer program product can determine the current business needs of the client when a trigger event for calling the artificial intelligence model is detected, and then obtain a target model file that matches the business needs and the model operation environment of the client from multiple candidate model files, wherein the multiple candidate model files correspond to different artificial intelligence models, and the reasoning engine that each artificial intelligence model relies on matches the corresponding model operation environment, and then the engine operation resources related to the reasoning engine corresponding to the target model file can be obtained, and based on the engine operation resources and the target model file, the target artificial intelligence model corresponding to the target model file is run on the client. In this embodiment, by obtaining a target model file that matches the business needs and the model operation environment of the client from multiple candidate model files, a target artificial intelligence model that can meet the business needs and the reasoning engine that it relies on matches the model operation environment can be dynamically loaded, and subsequently by obtaining the engine operation resources related to the reasoning engine, and running the target artificial intelligence model in combination with the target model file, the operation mode of the artificial intelligence model matches the actual model operation environment, and the reasoning needs of multiple artificial intelligence models are met under the differentiated model operation environment of the terminal device, and the operation efficiency of the artificial intelligence model on different terminal devices is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0074] Figure 1 A schematic diagram of a flow chart of an artificial intelligence model operation method in one embodiment;

[0075] Figure 2 A schematic diagram of an overall framework for running an artificial intelligence model in one embodiment;

[0076] Figure 3 A schematic diagram of a valid model list and a failed model list in one embodiment;

[0077] Figure 4 A flowchart of a step of obtaining an artificial intelligence model in one embodiment;

[0078] Figure 5 A schematic diagram of a conversion of a model identifier in an embodiment;

[0079] Figure 6A schematic diagram of a server matching a target model file according to information provided by a client in an embodiment;

[0080] Figure 7 A schematic diagram of strategy classification in one embodiment;

[0081] Figure 8 A schematic diagram of a framework of a client software development toolkit in one embodiment;

[0082] Fig. 9 A schematic diagram of a process of initializing a software development tool kit in one embodiment;

[0083] Fig.10 A schematic diagram of classification of a reasoning engine resource in one embodiment;

[0084] Fig.11 A schematic diagram of a process of creating an inference processor in one embodiment;

[0085] Fig.12 A schematic diagram of a process of running an artificial intelligence model through an inference processor in one embodiment;

[0086] Fig.13 is an internal structure diagram of a computer device in one embodiment;

[0087] Fig.14 The figure is a diagram of the internal structure of another computer device in one embodiment. DETAILED DESCRIPTION

[0088] 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.

[0089] In one embodiment, Figure 1As shown, a method for running an artificial intelligence model is provided. This embodiment uses the method applied to a terminal as an example. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. Among them, the terminal can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc.; portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc.; head-mounted devices can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.

[0090] In this embodiment, the method includes the following steps:

[0091] S101, when a triggering event for calling an artificial intelligence model is detected, determining the current business needs of the client.

[0092] In actual applications, the client can detect whether there is a trigger event for calling the artificial intelligence model. In some exemplary embodiments, it can be determined that a trigger event is detected when a related business request triggered by a user is received, or it can be determined that a trigger event is detected when it is detected that the client is performing a target task. For example, when a user uses a karaoke client, if it is detected that the user clicks the karaoke rating button, it can be considered that a trigger event is detected, or when it is identified that the user is in a karaoke state and the karaoke client is collecting the user's vocal data, it can also be considered that a trigger event is detected. Of course, in some other examples, it can also be determined that a trigger event is detected when it is detected that a component or module of the client generates information that calls an artificial intelligence model.

[0093] When a trigger event is detected, the business needs of the client to call the artificial intelligence model can be determined. For example, when the trigger event is associated with a corresponding business request, the current business needs of the client can be determined based on the business request.

[0094] Specifically, an artificial intelligence model is also called an AI (Artificial Intelligence) model, which can be understood as a mathematical model built based on artificial intelligence technology. This model can automatically process and analyze the input data and output the corresponding results. The artificial intelligence model can be composed of a large number of algorithms and programs, and continuously improve the accuracy and efficiency of the model itself through training and learning. Through pre-training, different types of artificial intelligence models can make inferences and predictions based on different types of inputs and obtain different output results. For example, a karaoke scoring model (also known as a pleasantness scoring model) can output a corresponding evaluation score based on the input singing audio. For example, the Aec (AcousticEcho Canceller) noise reduction model can perform echo cancellation on the input original collected signal and output the sound signal after echo cancellation.

[0095] In this regard, an artificial intelligence model with corresponding functions can be trained in advance for various business needs involved in the client application process. Taking the K song client as an example, the K song client can provide at least one of the following functions: play the original and / or accompaniment songs, collect the vocal data generated during the user's K song and generate the corresponding vocal audio, score the user's K song audio, and provide an online live broadcast room for online K song competitions or online concerts. For the above functions, song recommendation models, noise reduction models, K song scoring models, etc. can be trained. Moreover, in actual applications, multiple functions can be integrated in the client at the same time to meet the different business needs of the client. Based on this, when detecting the trigger event of calling the artificial intelligence model, the current business needs of the client can be obtained, thereby determining the type of artificial intelligence model to be called, and the current business needs are met by this type of artificial intelligence model.

[0096] S102, obtaining a target model file that matches the business requirements and the client's model operating environment from multiple candidate model files; the multiple candidate model files correspond to different artificial intelligence models, and the inference engine that each artificial intelligence model relies on is matched with a corresponding model operating environment.

[0097] Among them, the inference engine can be understood as the inference framework component used to run artificial intelligence models. Different inference engines, such as the TFLite inference engine and the Mnn inference engine, have different characteristics and are suitable for different usage scenarios.

[0098] In the related art, when using artificial intelligence models to perform reasoning on terminal devices, the same artificial intelligence model is mainly applied to various terminal devices. However, the inventors have found in practice that there are large performance differences between different terminal devices, and the support capabilities and effects of the same reasoning engine on different operating systems are also different, resulting in large differences in the running effects of the same artificial intelligence model on different terminal devices.

[0099] Based on this, in this embodiment, multiple artificial intelligence models for meeting the same business needs can be pre-trained based on different reasoning engines. In other words, artificial intelligence models that rely on different reasoning framework components can be trained for the same business scenario or the same business need. For example, for the pleasantness scoring model, pleasantness scoring model a corresponding to reasoning engine 1 and pleasantness scoring model b corresponding to reasoning engine 2 can be trained. Since the two models rely on different reasoning engines, there are differences in the model operating environments suitable for pleasantness scoring model 1 and pleasantness scoring model 2. Then, each pre-trained artificial intelligence model can be converted into an executable file as a model file of each artificial intelligence model, and it is stored as a candidate model file. For example, different reasoning engine frameworks can correspond to corresponding model conversion tools. After an artificial intelligence model is trained based on a certain reasoning engine framework, the model conversion tool corresponding to the reasoning engine framework can be used to convert the artificial intelligence model into an executable model file.

[0100] In an exemplary embodiment, if Figure 2 As shown, for various business scenarios such as recording and playing games, for each business demand involved in the business scenario, the data set collected by the business background service, a large amount of data information will be sent to the model production module after being marked by relevant personnel, and the model production module will be used to generate multiple artificial intelligence models under different reasoning engine frameworks (or the accelerated proxy mode of the model can also be considered) for the business demand. The model generation process involves model training, model quantization, and model tuning. Then, one or more model conversion tools can be used to convert each obtained artificial intelligence model into a corresponding model file, and the model can be managed through the server (such as the model web management platform).

[0101] Since multiple artificial intelligence models trained based on different reasoning frameworks and their corresponding candidate model files have been obtained in advance, after determining the current business needs of the client, the model files that match the business needs and the client's model operating environment can be obtained from multiple candidate model files in combination with the client's model operating environment as the target model file. Among them, the model operating environment can represent the hardware environment and / or software environment used to run the model; multiple candidate model files can be stored locally on the client or on the server, such as data stored on the model web management platform, and of course, they can also be partially stored locally on the client and partially stored on the server.

[0102] It is understandable that there are differences in the model operating environment of different clients and terminal devices running the clients. For example, if the same client is deployed on terminal devices of different models or the same model but different versions of clients are installed, the operation of the artificial intelligence model may be affected. In this embodiment, an artificial intelligence model that depends on different reasoning engines is pre-trained, and a target model file that matches the business needs and the client model operating environment is matched according to the corresponding multiple candidate model files, so that the artificial intelligence model can be run using the reasoning engine that matches the client model operating environment in the future, while optimizing the operating efficiency of the artificial intelligence model on the terminal device and meeting the client's business needs.

[0103] S103, obtaining engine running resources related to the inference engine corresponding to the target model file.

[0104] Since different model files depend on different inference engines, different inference engines require different engine running resources when used. After obtaining the target model file, the inference engine corresponding to the target model file can be determined, that is, the inference engine that the artificial intelligence model corresponding to the target model file depends on, and then the engine running resources related to the inference engine can be dynamically called.

[0105] In some exemplary examples, the engine running resources may include Native SO (Native SharedObject) library files, which may include underlying C++ library files developed and called by the Android client NDK (Native Developer Kits).

[0106] S104, based on the engine running resources and the target model file, running the target artificial intelligence model corresponding to the target model file on the client.

[0107] Since the inference engine can use the corresponding engine running resources to process data, the target model file can store the data processing logic of the artificial intelligence model. In this step, the target artificial intelligence model corresponding to the target model file can be run on the client based on the engine running resources and the target model file.

[0108] In the above-mentioned artificial intelligence model operation method, when a trigger event for calling an artificial intelligence model is detected, the current business needs of the client can be determined, and then a target model file matching the business needs and the model operation environment of the client can be obtained from multiple candidate model files, wherein the multiple candidate model files correspond to different artificial intelligence models, and the reasoning engine on which each artificial intelligence model depends matches the corresponding model operation environment, and then the engine operation resources related to the reasoning engine corresponding to the target model file can be obtained, and based on the engine operation resources and the target model file, the target artificial intelligence model corresponding to the target model file can be run on the client. In this embodiment, by obtaining a target model file matching the business needs and the model operation environment of the client from multiple candidate model files, a target artificial intelligence model that can meet the business needs and the reasoning engine it relies on matches the model operation environment can be dynamically loaded, and subsequently, by obtaining the engine operation resources related to the reasoning engine, and running the target artificial intelligence model in combination with the target model file, the operation mode of the artificial intelligence model matches the actual model operation environment, and the reasoning needs of multiple artificial intelligence models are met under the differentiated model operation environment of the terminal device, and the operation efficiency of the artificial intelligence model on different terminal devices is improved.

[0109] In one embodiment, S102, obtaining a target model file that matches the business requirements and the model operating environment of the client from multiple candidate model files may include the following steps:

[0110] S301, determine the model functions that match the business requirements.

[0111] In practical applications, for each trained artificial intelligence model and its corresponding model file, model classification can be performed according to the model functions that the artificial intelligence model can provide, so that multiple artificial intelligence models can be divided into artificial intelligence models belonging to different model functions.

[0112] After obtaining the current business needs of the client, the model function that meets the business needs can be used as the model function matching the business needs. For example, for the business need of obtaining karaoke rating results, the matching model function can be the pleasantness rating.

[0113] S302: If the client stores a valid model list corresponding to the model function, obtain the target model identifier in the valid model list; the inference engine on which the artificial intelligence model corresponding to the target model identifier depends matches the model operating environment of the client.

[0114] In actual applications, after determining the model functions that match the business requirements, you can first query whether the client has relevant model files stored locally.

[0115] Specifically, if Figure 3 As shown, a valid model list (EffectModelDB) and an invalid model list (InvalidModelDB) can be set. In one example, the client can set a model file management module to manage the valid model list and the invalid model list. Among them, the valid model list is used to store the model identification (ModelUnique) of all valid models issued by the server under each model function, that is, the unique identification information corresponding to each artificial intelligence model. The identification information in the valid model list can be sorted according to the data by insertion time.

[0116] In this step, after the model function is determined, the corresponding valid model list can be queried on the client according to the model function identifier (ModelMainKey) corresponding to the model function. When the query obtains the valid model list, such as Figure 4 As shown, you can first determine whether the valid model list is empty. If so, it can be determined that the acquisition of the local valid model has failed. Subsequently, you can send a model loading request to the server to obtain the target model file.

[0117] If the valid model list is not empty, the target model identifier in the valid model list can be obtained. The inference engine on which the artificial intelligence model corresponding to the target model identifier relies matches the model operating environment of the client, and the model file of the artificial intelligence model has been pre-loaded locally on the client. In some examples, the model file obtained from the server request in the past can be stored locally on the client, and the corresponding model identifier can be added to the valid model list.

[0118] S303: perform a model file query on the client according to the target model identifier to obtain the target model file.

[0119] After obtaining the target model identifier, you can try to use the target file identifier to perform a file query on the client locally to verify whether the model file mapped by the target model identifier exists. If the target model file is not obtained according to the target model identifier, it can be determined that the local valid model file has failed to be obtained, and the target model identifier is deleted from the valid model list. If the corresponding model file is obtained according to the target model identifier, the model file can be used as the target model file.

[0120] In some exemplary embodiments, the model identifier may include information representing the model function (ModelMainKey or mainkey), the model acceleration proxy mode (subkey), the inference engine type (enginetype), and the model version number (version). Exemplarily, the organizational structure of the model identifier may be "mainkey_subkey_enginetype_version", such as the model identifier of a pleasantness scoring model may be "aiRecordScore_Normal_tfliteEngine_0.tflite", where only the mainkey needs to be paid attention to when accessing the upper-layer service. The subkey may represent the specific model identifier of the same mainkey in the specified acceleration proxy mode. When the operators supported by the acceleration proxy mode are different, the corresponding model files may also be different. When the model has no acceleration proxy mode distinction, the subkey may default to "Normal".

[0121] like Figure 5 As shown, the model identifier (ModelUnique), the model identifier data class (AiModelIdentifier) ​​and the model file local storage path (ModelLocalFilePath) correspond one to one and can be converted to each other. Based on this, after obtaining the model identifier, the storage path corresponding to the model identifier can be determined, and the model file query can be performed in the storage space corresponding to the storage path. In addition, AiModelIdentifier can be used to parse the inference engine configuration parameters (AiInterpretCommonEngineConfig) required for model operation, as well as the extended SO library (ExtendNativeLibsType) required for the inference engine operation.

[0122] In this embodiment, by obtaining the target model identifier in the valid model list and performing a model file query on the client according to the target model identifier, the target model file can be obtained quickly based on the previously loaded cached model files in the local resources, thereby effectively improving the model loading efficiency of the artificial intelligence model corresponding to the business needs.

[0123] In one embodiment, the target file identifier is the most recently added file identifier. After step S303, the method may further include the following steps:

[0124] Send a model update request to the server; the model update request can be used to trigger the server to determine the recommended artificial intelligence model based on the target model identifier and model operating environment carried in the model update request, and obtain the model comparison result between the recommended artificial intelligence model and the target artificial intelligence model; when the model comparison result indicates that the recommended artificial intelligence model is better than the target artificial intelligence model, the service server returns the model file corresponding to the recommended artificial intelligence model, and adds the model identifier corresponding to the recommended artificial intelligence model to the valid model list.

[0125] In practical applications, after obtaining the target model file, it is possible to check whether the target artificial intelligence model has been updated. Specifically, a model update request can be sent to the server, which carries the target model identifier and the model operating environment. The server can determine the recommended artificial intelligence model based on the target model identifier and the model operating environment carried in the model update request. For example, the client's model function (mainkey) can be obtained by reading from the target model identifier. Of course, in another example, the model update request can also carry the model function alone, and then the server can determine the artificial intelligence model that matches the business needs and the client's model operating environment from multiple candidate artificial intelligence models. For ease of distinction, this artificial intelligence model is also called a recommended artificial intelligence model.

[0126] Then, the recommended artificial intelligence model can be compared with the target artificial intelligence model corresponding to the target model identifier to obtain a model comparison result. Figure 2 As shown, in the model production process, the model evaluation tool can be used to obtain the indicator evaluation results of the model under each evaluation indicator, and then the model evaluation results can be determined based on the indicator evaluation results. For example, each trained artificial intelligence model can be given its own scoring priority after being evaluated by the model Benchmark tool, and whether to continue model optimization can be determined based on the scoring priority. Among them, the model Benchmark refers to the model benchmark performance evaluation, including the evaluation of indicators such as the time consumption and memory usage of the model operation. Then, when comparing the recommended artificial intelligence model and the target model identification, the model comparison result can be determined based on the model evaluation results of the two.

[0127] When the model comparison result indicates that the recommended artificial intelligence model is inferior to the target artificial intelligence model, the server may not return a new model file. When the model comparison result indicates that the recommended artificial intelligence model is better than the target artificial intelligence model, the model file corresponding to the recommended artificial intelligence model returned by the service client may be stored, and the model file corresponding to the recommended artificial intelligence model may be added to the valid model list. Thus, on the one hand, the version of the local model file of the matching artificial intelligence model can be updated in time, and when the artificial intelligence model is obtained again based on the valid model list, the latest artificial intelligence model can be obtained based on the most recently added model identifier. On the other hand, by triggering the model update after determining the target model file, the normal operation of the current target artificial intelligence model can be avoided from being affected.

[0128] In one embodiment, after running the target artificial intelligence model corresponding to the target model file on the client based on the engine running resource and the target model file, it also includes:

[0129] When the target model file is obtained again according to the valid model list, the historical model file of the client is queried according to the historical model identifier in the valid model list; and the historical model file and the historical model identifier are deleted.

[0130] Among them, the historical model identifier is a model identifier that is added to the valid model list later than the target model identifier. The model file corresponding to the historical model identifier is the historical model file. The historical model file can be understood as a model file stored before the model is updated in the same model function, and its loading time or update time is earlier than the target model file.

[0131] In the specific implementation, after the model is updated, in order to prevent irrelevant historical model files from continuing to occupy the limited local storage resources of the client, the historical model files can be deleted. However, in some cases, when the latest standard model file is loaded locally on the client, the client is running the artificial intelligence model based on the previously acquired historical model file. For example, while the client is running the corresponding artificial intelligence model based on the latest locally acquired model file 1, a model update may be triggered, and model file 2 may be obtained from the server. That is, the latest local model file will be replaced from model file 1 to model file 2. If model file 1 is directly deleted at this time, it will affect the normal operation of the corresponding artificial intelligence model and interfere with the normal business processing of the client.

[0132] In this regard, when the target model file is obtained again according to the valid model list in the future, the historical model identifier in the valid model list can be determined, the historical model file of the client can be queried according to the historical model identifier, and then the historical model file can be deleted, and the historical model identifier can be removed from the valid model list. In this way, the operation of the current artificial intelligence model can be avoided, and the redundant historical model files on the client side can be deleted in time to avoid occupying limited storage resources.

[0133] In one embodiment, the model update request may also trigger the server to obtain the validity information of the target artificial intelligence model, and the validity information may indicate whether the target artificial intelligence model is invalid. After obtaining the validity information, the method may also include the following steps:

[0134] When the validity information indicates that the target artificial intelligence model has expired, the target model identifier is added to the invalid model list, and / or the target model file stored on the client is deleted.

[0135] In a specific implementation, the server may remove the artificial intelligence model from the background, making the artificial intelligence model in an invalid state. Accordingly, the model file corresponding to the artificial intelligence model in the client will no longer be used. In this embodiment, when the client has stored the target model file, it can also trigger the server to provide the validity information of the corresponding target artificial intelligence model through a model update request, so that when the server receives the update trigger request, it can query the validity information of the corresponding target artificial intelligence model according to the target model identifier carried in the request, and then feedback to the client.

[0136] If the validity information indicates that the target artificial intelligence model is valid, the target model file and the corresponding target model identifier can continue to be stored locally. If the validity information indicates that the target artificial intelligence model has expired, the client can add the target model identifier to the invalid model list to record that the corresponding target artificial intelligence model has expired. The invalid model list can be used to store the model identifiers of the invalid models notified by the global background, such as Figure 3 As shown in , for multiple artificial intelligence models notified by the server that they are invalid, their corresponding model identifiers can be added to the invalid model list. When the model file matching the current business needs is queried locally again, such as Figure 4 As shown, the MainKey can be used to first search in the invalid model list, and when the corresponding model file is found, the corresponding model identification entry is deleted, and then the corresponding model identification entry is removed from the local invalid model list.

[0137] In some other embodiments, if the validity information indicates that the target artificial intelligence model has expired, the client may also delete the corresponding local target model file, so that the next time the target artificial intelligence model is used, it can trigger the server to provide the model file corresponding to the valid artificial intelligence model again.

[0138] In this embodiment, the validity information provided by the server is obtained through a model update request. On the one hand, the background server can dynamically remove the artificial intelligence model from the shelves. On the other hand, the client can promptly know the validity of the model. By adding the target model identifier to the invalid model list or deleting the target model file stored on the client, the invalid model that has been removed from the client's local shelves can be removed in time, avoiding errors in the process of responding to business needs due to the use of models that have been removed from the background.

[0139] In one embodiment, S102 obtains a target model file that matches the business requirements and the model operating environment of the client from multiple candidate model files, which may include the following steps:

[0140] Determine the model function that matches the business needs; when the client does not store the model file of the model function, send a model loading request carrying the model function and the client's model operating environment information to the server; the model loading request is used to trigger the server to determine the target artificial intelligence model that matches the model operating environment from multiple candidate artificial intelligence models under the model function, and obtain the target model file corresponding to the target artificial intelligence model; receive the target model file returned by the server.

[0141] In a specific implementation, after determining the business requirements of the client, the model function matching the business requirements can be determined. Then, the client can be queried whether there is a relevant model file stored locally according to the required model function. If a relevant model file is found, the target model file can be obtained according to the method mentioned in one or more of the above embodiments.

[0142] If the client does not store the model file of the model function, the client can send a model loading request carrying the model function and the client's model operating environment information to the server. After receiving the request, the server can determine the target artificial intelligence model that matches the model operating environment from multiple candidate artificial intelligence models with the model function, obtain the target model file corresponding to the target artificial intelligence model, and then return the target model file to the client.

[0143] In this embodiment, by sending a model loading request to the server and receiving the target model file returned by the server, with the help of the server's computing resources, it is possible to flexibly and quickly obtain the target model file that matches the client's business needs and the model running environment, which helps clients on different terminal devices to efficiently meet their business needs by running different artificial intelligence models in a diversified manner.

[0144] In some embodiments, Figure 4 As shown, when obtaining a valid model file, the business side only needs to pass in the MainKey identifier, and the relevant SDK (Software Development Kit) inside the client will find the latest local model. When there is no model available locally and the model update check is performed, the creation of the model download task AiModelDownloadTask can be triggered. When requesting the background, the model identifier of the latest local target artificial intelligence model and information about the model running environment will be carried, including machine environment information and locally supported reasoning engine strategies. The data results returned by the background server can include two parts: whether the latest target artificial intelligence model of the client is valid, and whether there is a new available model NewModelParam. If there is a new available model, after successfully downloading the NewModelParam file, it will check whether HitUseStrategy (locally available reasoning engine strategy) already supports the operation of this model. If not, it will start the download of the required engine running resources (such as ExtendNativeLibsType, extension library file, a type of target resource file).

[0145] In one embodiment, before obtaining a target model file that matches the business requirements and the model operating environment of the client from multiple candidate model files, the model operating environment information of the client may also be obtained by the following steps:

[0146] Obtain the client attribute information of the client and the device attribute information of the terminal device on which the client is deployed; obtain the locally supported candidate inference engine operation strategies; determine the client's model operation environment based on the client attribute information, the device attribute information and the candidate inference engine operation strategies.

[0147] In actual applications, different versions of clients may affect the operating efficiency of the artificial intelligence model. In this step, the client attribute information of the client can be obtained. The client attribute information can reflect the performance of the client or characterize the client software operating environment. In some examples, such as Figure 6As shown, the client attribute information includes at least one of the following information: client version, client instruction set architecture (AppBits, such as 32-bit or 64-bit), and the underlying C++ library for running client AI model reasoning.

[0148] On the other hand, the device performance of the terminal device where the client is deployed will also affect the operation of the model. This embodiment can also obtain device attribute information of the terminal device where the client is deployed. In some examples, such as Figure 6 As shown, the device attribute information can reflect the machine environment of the terminal device, which includes at least one of the following: device platform type (such as iOS or Android), device model, development manufacturer, system version, chip model or chip type, and an evaluation score that characterizes the performance of the device (such as device ladder score).

[0149] In addition, the inference engine can be run on different hardware on the terminal device, so the same inference engine can have different inference engine operation strategies, which can also be called inference strategies. For example, inference engine 1 can be run on the CPU (Central Processing Unit) or GPU (Graphics Processing Unit) of the terminal device, while inference engine 2 only runs on the CPU. In some embodiments, when there are multiple inference operation strategies for the inference engine, the corresponding artificial intelligence model can be trained for different inference operation strategies and the corresponding model file can be generated. At the same time, different terminal devices with clients are deployed, and the inference engine operation strategies that the terminal devices can actually support are also different due to the differences in the resources or configurations that can be called. For the convenience of distinction, the inference engine operation strategy actually applied by the terminal is called the candidate inference engine operation strategy (also called the native supportable inference engine operation strategy (NativeSupportStrategy)). The candidate inference engine strategy can be understood as the inherent attribute of the device, which is mainly determined by the version of the relevant configuration in the client and the machine environment of the terminal device. It is determined when the global initialization (such as the global initialization of the software development kit) is performed after the client is started, and remains unchanged during the use of the client.

[0150] In this regard, in this embodiment, the various candidate inference engine operation strategies that can be supported locally by the terminal device can also be obtained, and then the model operation environment of the client can be determined based on the client attribute information, device attribute information and the candidate inference engine operation strategy. Figure 6As shown, the acquired client attribute information, device attribute information, and candidate inference engine operation strategies can be sent to the Web model configuration platform (i.e., the server). The Web model configuration platform can determine the target artificial intelligence model from multiple artificial intelligence models with different model functions based on the above information provided by the client and the configuration information of each model under the corresponding model function. For example, the platform can pre-train corresponding artificial intelligence models for pleasant listening scoring and AEC noise reduction. Taking the pleasant listening scoring model as an example, the models under the inference engine framework 1 and the inference engine framework 2 are trained respectively. For the inference engine framework 1, it can be further subdivided into the cases of running on the CPU and running on the GPU. In some examples, if there are multiple artificial intelligence models that match the business needs and the model operation environment, the target artificial intelligence model can be selected according to the usage priority of the model in the model collection (such as the priority determined by the model evaluation results).

[0151] In this embodiment, by determining the model operating environment of the client based on the client attribute information, device attribute information and the candidate inference engine operating strategy, the recognition accuracy of the model operating environment can be improved, making it easier to subsequently determine the target artificial intelligence model that matches the specific environment of the terminal device more accurately and meticulously.

[0152] In one embodiment, S103 obtains the engine running resources related to the inference engine corresponding to the target model file, which may include the following steps:

[0153] Determine the local target inference engine operation strategy for the target model file; generate a resource loading request based on the target inference engine operation strategy, and send the resource loading request to the server; the resource loading request is used to trigger the server to obtain the target resource file required when the inference engine corresponding to the target model file runs according to the target inference engine operation strategy; obtain the engine operation resources based on the target resource file returned by the server.

[0154] After obtaining the target model file, the target inference engine operation strategy of the target model file in the local client can be determined. The target inference engine operation strategy is the inference engine operation strategy actually implemented locally by the inference engine corresponding to the target model file, also known as the local usable inference engine strategy (HitUseStrategy).

[0155] like Figure 7 As shown, the inference engine operation strategy can be divided into locally supported inference strategies and locally usable inference strategies, where the inference strategies that can be used this time are a subset of the locally supported inference strategies. Figure 7In the example shown, the locally supported inference strategies include running the TFLite inference engine or the Mnn inference engine on the CPU or GPU, and running the Onnx inference engine on the CPU; the locally available inference strategies are dynamically expanded on demand during operation, and the relevant resources are loaded when a specific model requires the corresponding strategy.

[0156] Then, a resource loading request can be generated according to the determined target inference engine operation strategy and sent to the server. In response to the received resource loading request, the server can obtain the target resource file, which is the resource file required by the inference engine corresponding to the target model file when running according to the target inference engine operation strategy.

[0157] In some embodiments, the artificial intelligence model operation method provided in this application can be encapsulated as a client software development kit SDK, and the SDK framework (AiInterpretSdk) can be as follows: Figure 8 shown.

[0158] In this example, the C++ library is the underlying C++ library used in the client AI model reasoning process, providing the lowest-level reasoning engine capabilities. It can encapsulate multiple engines and available acceleration proxy logic internally, and provide a unified reasoning capability interface to the outside. The client Java layer reasoning framework AiInterpretSdk can provide a general upper-level reasoning encapsulation interface (such as audio, pictures, videos, etc.), and the business access party can obtain the model reasoning results by calling the SDK's simple interface. The SDK consists of multiple core modules, including the AiInterpretCommonEngine module, the ModelFileDownloadManger module, the ModelOperateStrategyManger module, the NativeLibsDynamicLoad module, the InterpretProcessor module, and the TechniqueReporter module.

[0159] Among them, AiInterpretCommonEngine connects to the underlying unified engine module through JNI (Java Native Interface) and encapsulates the processing of model data; ModelFileDownloadManger module (model file management module) can be used to manage the download, update, cache, etc. of model files; ModelOperateStrategyManger is a model operation strategy module, which can make decisions based on the local model operation environment and the background model configuration to determine the target artificial intelligence model available under specific business scenarios or business needs. In other words, in some embodiments, the client can determine the target artificial intelligence model from multiple candidate artificial intelligence models based on the model operation environment and business demand information. The NativeLibsDynamicLoad module can realize the dynamic loading management of library files. Since various frameworks support multiple reasoning capabilities, there are many SO library files involved. Through this module, dynamic loading can be achieved before use on demand. InterpretProcessor is an inference processor that can provide an interface for business layer calls. TechniqueReporter is a technical reporting module that can report model-related loading success rate, reasoning time, etc.

[0160] Since multiple inference engines involve multiple engine running resources, they are generally not all loaded when the terminal device has limited storage resources. In some examples, the default inference engine running strategy that needs to be supported can be set according to the client's needs, and the relevant engine running resources can be carried by default when the SDK underlying library is generated. Fig. 9 As shown, the SDK can be globally initialized after the APP is started. When initializing the model running strategy module, the locally supported candidate inference engine running strategies can be determined based on the underlying C++ library version and the machine environment. At the same time, the core engine running resources and the engine running resources required by the default supported inference engine running strategies can be loaded during the initialization process. Among them, the core engine running resources can include the common core basic library CommonCoreLibrary, which contains the most core public basic logic code, which can be carried or dynamically downloaded when the client is compressed and packaged, and then pre-loaded during the global initialization of the SDK. For other specific inference engine reasoning capability extension libraries, for example, Fig.10 As shown, since different terminal devices and business scenarios require different capabilities, they can be dynamically loaded on demand to maximize operating efficiency.

[0161] Since some engine running resources have been pre-loaded locally, the client can generate a resource loading request for other missing engine running resources, thereby obtaining other missing resource files from the server in a targeted manner and feeding them back to the client as target resource files.

[0162] In this embodiment, by generating a resource loading request according to the target inference engine operation strategy and sending the resource loading request to the server, the relevant resources required for the inference engine to run according to the target inference engine operation strategy can be dynamically loaded. Therefore, the artificial intelligence model can be flexibly run on different terminal devices through different inference engines and engine operation strategies to meet the client's business needs, which greatly increases the adaptability of the artificial intelligence model operation mode and the client model operation environment.

[0163] In one embodiment, step S104 may include the following steps:

[0164] Obtain the engine configuration parameters of the inference engine corresponding to the target model file; create an inference processor on the client according to the engine configuration parameters, engine running resources and the target model file; and use the inference processor to run the target artificial intelligence model corresponding to the target model file.

[0165] In this step, after obtaining the target model file, the engine configuration parameters (AiInterpretCommonEngineConfig) of the inference engine corresponding to the target model file can be determined first. The engine configuration parameters can characterize the inference engine configuration required for the model to run, and then the inference processor (InterpretProcessor) can be created on the client in combination with the engine configuration parameters, the engine running resources obtained in advance, and the target model file. Exemplarily, the inference processor may include at least one of an audio inference processor, an image inference processor, and a video inference processor. The inference processor may encapsulate a process used by a general business processing model. Taking the audio processing model as an example, the inference processor may set the streaming input source data pcm, and the model operation adopts a single input and single output mode, which can be quickly accessed and used. When the inference processor is created, the model can be obtained from the cache, and then the download and update model can be checked synchronously or asynchronously, thereby avoiding blocking the current model call, and having the characteristic of delayed processing of the model file.

[0166] like Fig.11As shown, after obtaining the target artificial intelligence model (EffectModel), you can load the library file (ExtendNativeLib) required for model operation, initialize the underlying related modules of the C++ library, and dynamically update HitUseStrategy as needed. Then, determine whether HitUseStrategy meets the operating requirements of the target artificial intelligence model. In some cases, the incomplete download or loading failure of the library file will cause the inference processor to fail to create.

[0167] After creating an inference processor, you can use it to run the target AI model. For example, Fig.12 As shown, the inference processor InterpretProcessor will contain the file content EffectModelData of the target model file, the process parameters InterpretProcessConfig (such as audio data format, DataInterceptor data processing plug-in, etc.) used by the business processing model, and the engine configuration parameters AiInterpretCommonEngineConfig. The inference processor can transfer the engine configuration parameters to the underlying C++ library for engine initialization, then load the model to parse the model-related data information, and then initialize the data processing Buffer module and DataInterceptor module. Then, when performing relevant inferences for business scenarios, the source data can be input into the model to trigger the inference task after being processed by DataInterceptor and standardized.

[0168] In this embodiment, by creating an inference processor on the client according to the engine configuration parameters, engine operating resources and target model files, the artificial intelligence model can be dynamically run in different ways on the same terminal device, thereby improving the flexibility of different artificial intelligence model operation modes and the adaptability to the client model operation environment, and effectively improving the model operation efficiency.

[0169] In one embodiment, a method for running an artificial intelligence model is provided. This embodiment uses the method applied to a server as an example. In this embodiment, the following steps are included:

[0170] S401, receiving a model loading request from a client; the model loading request is sent by the client when a trigger event for calling an artificial intelligence model is detected.

[0171] In a specific implementation, after detecting a trigger event for calling an artificial intelligence model, the client can send a model loading request to the server to obtain the model file of the corresponding artificial intelligence model. In some embodiments, the client can send a model loading request to the server each time it obtains an artificial intelligence model, or it can send a model loading request when it is determined that the client lacks the corresponding model file locally.

[0172] S402, in response to the model loading request, obtaining a target model file that matches the current business requirements of the client and the model running environment of the client from multiple candidate model files.

[0173] In some embodiments, after receiving the model loading request, the server can match the target model file from multiple candidate model files according to the current business needs of the client and the model operating environment. In other embodiments, the client can also match the configuration information corresponding to multiple artificial intelligence models according to its own business needs and model operating environment, determine the target artificial intelligence model, and add the model identifier of the target artificial intelligence model to the model loading request, thereby specifying the server to obtain the target model file corresponding to the model identifier from multiple candidate model files.

[0174] S403, returns the target model file to the client to trigger the client to obtain the engine running resources related to the inference engine corresponding to the target model file, and runs the target artificial intelligence model corresponding to the target model file on the client based on the engine running resources and the target model file.

[0175] After obtaining the target model file, the server can send the target model file to the client, and then the client can obtain the relevant engine running resources and run the corresponding target artificial intelligence model on the client based on the engine running resources and the target model file.

[0176] In the above-mentioned artificial intelligence model operation method, a model loading request from a client can be received; the model loading request is sent by the client when a trigger event for calling an artificial intelligence model is detected; in response to the model loading request, a target model file matching the current business needs of the client and the model operation environment of the client is obtained from multiple candidate model files; the target model file is returned to the client to trigger the client to obtain the engine operation resources related to the inference engine corresponding to the target model file, and based on the engine operation resources and the target model file, the target artificial intelligence model corresponding to the target model file is run on the client. In this embodiment, by obtaining a target model file matching the business needs and the model operation environment of the client from multiple candidate model files, a target artificial intelligence model that can meet the business needs and the reasoning engine and model operation environment that it relies on can be dynamically loaded, and subsequently, by obtaining the engine operation resources related to the reasoning engine, and running the target artificial intelligence model in combination with the target model file, the operation mode of the artificial intelligence model matches the actual model operation environment, and the reasoning needs of multiple artificial intelligence models are met under the differentiated model operation environment of the terminal device, and the operation efficiency of artificial intelligence models on different terminal devices is improved.

[0177] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0178] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Fig.13As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. 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 model data and inference engine data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication 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, an artificial intelligence model operation method is implemented.

[0179] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Fig.14 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. 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 and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (Near Field Communication, NFC) or other technologies. When the computer program is executed by the processor, an artificial intelligence model operation method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0180] Those skilled in the art will understand that Fig.13 and Fig.14The 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.

[0181] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0182] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0183] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0184] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0185] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods 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-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0186] 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 application.

[0187] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications 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 present application shall be subject to the attached claims.

Claims

1. A method for running an artificial intelligence model, characterized in that: The method comprises: Determine the client’s current business needs when a triggering event for invoking an AI model is detected; Obtaining a target model file that matches the business requirements and the model operating environment of the client from a plurality of candidate model files; the plurality of candidate model files respectively correspond to different artificial intelligence models, and the inference engine that each artificial intelligence model relies on is matched with a corresponding model operating environment; Obtaining engine running resources related to the inference engine corresponding to the target model file; Based on the engine running resources and the target model file, the target artificial intelligence model corresponding to the target model file is run on the client.

2. The method according to claim 1, characterized in that The step of obtaining a target model file that matches the business requirement and the model operating environment of the client from a plurality of candidate model files includes: Determine the model functionality that matches the business requirements; If the client stores a valid model list corresponding to the model function, then obtain the target model identifier in the valid model list; the inference engine on which the artificial intelligence model corresponding to the target model identifier depends matches the model operating environment of the client; A model file query is performed on the client according to the target model identifier to obtain a target model file.

3. The method according to claim 2, characterized in that The target model identifier is the model identifier that is added most recently; After querying the model file on the client according to the target model identifier to obtain the target model file, the method further includes: Sending a model update request to the server; the model update request is used to trigger the server to determine a recommended artificial intelligence model according to the target model identifier and the model operating environment carried in the model update request, and obtain a model comparison result between the recommended artificial intelligence model and the target artificial intelligence model; When the model comparison result indicates that the recommended artificial intelligence model is better than the target artificial intelligence model, the model file corresponding to the recommended artificial intelligence model returned by the server is stored, and the model identifier corresponding to the recommended artificial intelligence model is added to the valid model list.

4. The method according to claim 3, characterized in that After running the target artificial intelligence model corresponding to the target model file on the client based on the engine running resource and the target model file, the method further includes: When acquiring the target model file again according to the valid model list, querying the historical model file of the client according to the historical model identifier in the valid model list; the historical model identifier is a model identifier whose addition time is later than the addition time of the target model identifier; The historical model file and the historical model identifier are deleted.

5. The method according to claim 3, characterized in that: The model update request is also used to trigger the server to obtain validity information of the target artificial intelligence model; The method further comprises: When the validity information indicates that the target artificial intelligence model has expired, the target model identifier is added to the invalid model list, and / or the target model file stored in the client is deleted.

6. The method according to claim 1, characterized in that The step of obtaining a target model file that matches the business requirement and the model operating environment of the client from a plurality of candidate model files includes: Determine the model functionality that matches the business requirements; When the client does not store the model file of the model function, a model loading request carrying the model function and the model running environment information of the client is sent to the server; the model loading request is used to trigger the server to determine a target artificial intelligence model that matches the model running environment from multiple candidate artificial intelligence models under the model function, and obtain a target model file corresponding to the target artificial intelligence model; Receive the target model file returned by the server.

7. The method according to claim 1, characterized in that Before acquiring a target model file matching the business requirement and the model operating environment of the client from a plurality of candidate model files, the method further includes: Acquire client attribute information of the client and device attribute information of a terminal device on which the client is deployed; Obtain the operating strategies of each candidate inference engine that can be supported locally; The model operating environment of the client is determined according to the client attribute information, the device attribute information and the candidate inference engine operating strategy.

8. The method according to claim 1, characterized in that The obtaining of engine operation resources related to the inference engine corresponding to the target model file includes: Determine a local target inference engine operation strategy for the target model file; Generate a resource loading request according to the target inference engine operation strategy, and send the resource loading request to the server; the resource loading request is used to trigger the server to obtain the target resource file required when the inference engine corresponding to the target model file runs according to the target inference engine operation strategy; The engine running resources are obtained according to the target resource file returned by the server.

9. The method according to any one of claims 1 to 8, characterized in that The running of the target artificial intelligence model corresponding to the target model file on the client based on the engine running resource and the target model file includes: Obtaining engine configuration parameters of the inference engine corresponding to the target model file; Creating an inference processor on the client according to the engine configuration parameters, the engine running resources and the target model file; The inference processor is used to run the target artificial intelligence model corresponding to the target model file.

10. A method for running an artificial intelligence model, characterized in that: The method comprises: Receiving a model loading request from a client; the model loading request is sent by the client when a trigger event for calling an artificial intelligence model is detected; In response to the model loading request, obtaining a target model file that matches the current business requirements of the client and the model running environment of the client from a plurality of candidate model files; The target model file is returned to the client to trigger the client to obtain engine running resources related to the inference engine corresponding to the target model file, and based on the engine running resources and the target model file, the target artificial intelligence model corresponding to the target model file is run on the client.

11. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, it implements the artificial intelligence model operation method described in any one of claims 1 to 9 or the steps of the artificial intelligence model operation method described in claim 10.

Citation Information

Patent Citations

  • Operation method of AI application and related product

    CN115237457A

  • Model deployment method and device, computer equipment and storage medium

    CN115712441A

  • Artificial intelligence model management method, device and equipment and readable storage medium

    CN117289955A

  • Dovetail stage using a belt

    KR1020250146424A

Cited By

  • End intelligent model management method and device and storage medium

    CN119271218A