CN111290778A - AI model packaging method, platform and electronic equipment - Google Patents

AI model packaging method, platform and electronic equipment Download PDF

Info

Publication number
CN111290778A
CN111290778A CN202010082086.2A CN202010082086A CN111290778A CN 111290778 A CN111290778 A CN 111290778A CN 202010082086 A CN202010082086 A CN 202010082086A CN 111290778 A CN111290778 A CN 111290778A
Authority
CN
China
Prior art keywords
model
packaging
packaged
programming language
framework
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010082086.2A
Other languages
Chinese (zh)
Other versions
CN111290778B (en
Inventor
冯阳
周彩冬
刘柏
胡志鹏
李仁杰
范长杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202010082086.2A priority Critical patent/CN111290778B/en
Publication of CN111290778A publication Critical patent/CN111290778A/en
Application granted granted Critical
Publication of CN111290778B publication Critical patent/CN111290778B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a packaging method and platform of an AI model and electronic equipment, and relates to the technical field of artificial intelligence. The packaging method of the AI model comprises the following steps: packaging the AI model by using a preset packaging interface according to a programming language of the AI model to be packaged; responding to a selection instruction from a user, selecting a service frame from a service frame alternative library, and determining an input/output standard matched with the AI model; embedding the packaged AI model into the service framework. The packaging method, the packaging platform and the electronic equipment of the AI model reduce the learning cost of an AI algorithm researcher and improve the commercialization speed of the AI model.

Description

AI model packaging method, platform and electronic equipment
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to a packaging method and a packaging platform for an AI model and electronic equipment.
Background
With the rapid development of science and technology, the world has gradually entered the Artificial Intelligence (AI) era. The AI is an application technology, and how to quickly convert an AI model into a product so as to realize business landing is an urgent problem to be solved in the field of artificial intelligence at present.
An AI algorithm researcher models the problem to be solved by using a deep learning framework, then carries out parameter adjustment and training on the model, and finally constructs an AI model capable of solving the actual problem. However, the AI model trained by an AI algorithm researcher generally has no way to be directly produced and cannot be directly used, and generally adopts the following two schemes to realize the production of the AI model and then provides services to the outside: 1. deploying an AI model on a physical machine, and providing a network access interface to the outside; 2. and packaging the AI model, and embedding the AI model into a host project for local calling of the host project.
An AI algorithm researcher generally does not have the engineering background of AI model productization, which is generally done by an AI engineer. An AI engineer may not have background knowledge of an AI model algorithm, is not familiar with the AI model or has no way to optimize the internal mechanism of the AI model in the production process, may spend a lot of time communicating with an AI algorithm researcher, and the work between the two needs to be closely related, which may result in slow progress of the AI model production.
Disclosure of Invention
The invention aims to provide a packaging method and a packaging platform for an AI model and electronic equipment, so as to relieve the technical problem of slow progress of commercialization of the AI model.
In a first aspect, an embodiment of the present application provides a packaging method for an AI model, including:
packaging the AI model by using a preset packaging interface according to a programming language of the AI model to be packaged;
responding to a selection instruction from a user, selecting a service frame from a service frame alternative library, and determining an input/output standard matched with the AI model;
embedding the packaged AI model into the service framework.
In one possible implementation manner, the step of embedding the packaged AI model into the service framework includes:
packaging the packaged AI model and the service framework to generate a Docker mirror image;
and storing the path parameters of the AI model into the service framework, so that the service framework calls the AI model through the path parameters.
In one possible implementation manner, after the step of embedding the packaged AI model into the service framework, the method further includes:
and providing an external access interface, so that the client calls the AI model through the access interface.
In a possible implementation manner, the step of performing packing processing on the AI model by using a preset packing interface according to a programming language of the AI model to be packed includes:
responding to a selection instruction from a user, and selecting an AI model to be packaged;
determining a programming language of the AI model;
and packaging the AI model by using a packaging interface corresponding to the programming language of the AI model.
In a possible implementation manner, when the programming language of the AI model is python, the step of performing packaging processing on the AI model by using a packaging interface corresponding to the programming language of the AI model includes:
and packaging the AI model into a python lib library based on a preset python lib library.
In a possible implementation manner, when the programming language of the AI model is a C + + language, the step of performing packaging processing on the AI model by using a packaging interface corresponding to the programming language of the AI model includes:
and compiling the AI model based on a preset compiling module to generate a dynamic link library.
In a possible implementation manner, after the step of performing packing processing on the AI model by using a preset packing interface according to the programming language of the AI model to be packed, the method further includes:
responding to a labeling instruction from a user, and labeling attribute information of the packaged AI model;
and storing the attribute information of the AI model to a management module.
In a possible implementation manner, before the step of performing packing processing on the AI model by using a preset packing interface according to the programming language of the AI model to be packed, the method further includes:
responding to an initialization instruction from a user, and providing a deep learning framework;
the deep learning framework is trained into an AI model in response to a training instruction from a user.
In one possible implementation, the service framework alternative library includes an HTTP framework, an RPC framework, or an AJAX framework.
In a second aspect, an embodiment of the present application provides a packaging platform for an AI model, including:
the packaging module is used for packaging the AI model by using a preset packaging interface according to the programming language of the AI model to be packaged;
the selection module is used for responding to a selection instruction from a user, selecting a service frame from a service frame alternative library and determining an input/output standard matched with the AI model;
an embedding module, configured to embed the packaged AI model into the service framework.
In a third aspect, an embodiment of the present application provides an electronic device, which includes a memory and a processor, where the memory stores a computer program executable on the processor, and the processor implements the steps of the packaging method for the AI model when executing the computer program.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium having stored thereon machine-executable instructions that, when invoked and executed by a processor, cause the processor to execute a wrapper method of the AI model.
In the packaging method of the AI model provided by the embodiment of the application, firstly, aiming at the programming language of the AI model, the AI model is packaged by using a corresponding packaging interface; then, the user can select a service frame from the service frame alternative library, determine the input and output standard matched with the AI model, and finally embed the packaged AI model into the service frame. Because the service frame alternative library is preset in the embodiment of the application, an AI algorithm researcher can conveniently select the service frame and determine the input and output standards as a user, and can conveniently and quickly realize the production of the AI model without much engineering and technical knowledge, thereby reducing the learning cost of the AI algorithm researcher and improving the production speed of the AI model.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of a packaging method of an AI model according to an embodiment of the present invention;
FIG. 2 is another flow chart of a packaging method for AI models provided by an embodiment of the invention;
fig. 3 is a detailed flowchart of step S203 in the packaging method of the AI model according to the embodiment of the present invention;
fig. 4 is a schematic diagram of a packaging platform of an AI model according to an embodiment of the present invention;
fig. 5 is a schematic diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the following embodiments, and it should be understood that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "comprising" and "having," and any variations thereof, as referred to in the embodiments of the present application, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements but may alternatively include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
How to quickly convert the AI model into a product is an urgent problem to be solved in the field of artificial intelligence. At present, for the commercialization of the AI model, the following operation procedures are generally adopted:
an AI algorithm researcher introduces a general deep learning framework, prepares data needing training locally, and then trains, adjusts parameters and the like on an initial model to construct an AI model capable of solving practical problems. An AI algorithm researcher defines the input and output of the model according to business requirements, completes simple input and output logic, and shares the code containing the AI model to an AI engineer. And then, the AI engineer embeds the code into the self service framework code, deploys the service on a physical machine or a cloud, and provides the service for the outside. A user (a demand side of the AI model) of the service can call an external service interface of the service framework to realize the landing of the AI product.
In addition, some AI models may not have a way to directly observe the effects of the AI model after being trained by an AI algorithm researcher, which may require configuration by an AI engineer to combine the model with existing practical problems. Taking a visual AI model as an example, an AI algorithm researcher trains an AI model such as an eyebrow expression and the like of a human and delivers the AI model to an AI engineer. And the AI engineer embeds the trained AI models into the written human face unity engineering framework, and tests the AI models in unity. If the effect is found to be poor, the AI algorithm researcher may need to adjust the parameters or retrain the AI model. And the AI algorithm researcher retrains the AI model and delivers the AI model to the AI engineer.
The above processes need to be repeated for many times to realize the landing of the AI product. Therefore, an AI algorithm researcher often needs to be tied to an AI engineer, and the AI engineer may have other urgent tasks in his hands, which may delay the progress of the AI algorithm researcher in model training.
The above operation flow has many difficulties and disadvantages, which are as follows:
1. the operation of an AI engineer for servicing an AI model is complicated, the AI engineer needs to be familiar with the AI model, various dependency packages are imported, then transcoding and encoding operations are performed on input and output data, and the test is complicated.
2. The AI models are different in service modes provided to the outside in different scenes, some AI models need RPC interfaces, and some AI models need HTTP interfaces, which undoubtedly increases the development difficulty. Moreover, the logic of the AI model may need to be adapted to different protocol interfaces, which in turn requires an AI algorithm researcher to modify the model code, and then the AI engineer encodes the new AI model according to the new model. The above steps are repeated for a plurality of times, which undoubtedly delays the project progress.
3. Data that needs to be trained is stored on the local physical machine, risks being lost in a single point, is not easy to manage and maintain, is critical for some models, and is difficult to acquire.
4. Each AI algorithm researcher may have different technical backgrounds and different styles of written logic codes, so that when an AI engineer services an AI model, the implementation difficulty is high, and the communication cost is high.
5. During the model test, iteration may be fast, if the change of the logical coding structure style of an AI algorithm researcher is large, the service framework designed by the original AI engineer is not suitable any more, so that the cost of service deployment is increased, and the progress of the model test of the AI algorithm researcher is delayed.
6. Because AI models are iterated often, but the versions before iteration are not useless models, it is also possible to apply to other business scenarios. Thus, if the AI model is code managed solely from a code copy or code management repository, the progress of model servicing can be inefficient.
7. An AI engineer needs to deploy services to a physical machine after the model codes of an AI algorithm researcher are serviced, the services are possibly deployed to a plurality of machines in consideration of load balance, the same steps can be operated on the plurality of machines, the process is complicated, and the probability of operation errors is high; in addition, on a physical machine, resources cannot be isolated, different services may be affected with each other, and great hidden danger is caused.
In order to optimize the above problem, the embodiment of the present invention provides a packaging method for an AI model, which can be applied to a packaging platform for an AI model. As shown in fig. 1, the method comprises the steps of:
s101: and packaging the AI model by using a preset packaging interface according to the programming language of the AI model to be packaged.
The packaging platform of the AI model according to the embodiment of the present invention provides a plurality of preset packaging interfaces for an AI algorithm researcher (user) to select, for example, C + +, Python, and the like. After the AI algorithm researcher selects the programming language, the corresponding packaging interface can be called to package the AI model.
S102: and responding to a selection instruction from a user, selecting a service frame from the service frame alternative library, and determining the input and output standard matched with the AI model.
The packaging platform of the AI model is provided with a service framework alternative library, wherein various general service frameworks are provided for an AI algorithm researcher to select, such as a synchronous framework, an asynchronous framework, an HTTP framework, an RPC framework and the like. The AI algorithm researcher can select the required service frame from the service frame candidate library and customize the input and output standard of the service frame to match the AI model.
S103: the packaged processed AI model is embedded in a service framework.
After the input/output standard of the service framework is configured, an AI algorithm researcher can embed the packaged AI model in the service framework in step S101, so that the AI model can serve the outside, and the AI model productization is realized.
In the packaging method of the AI model provided by the embodiment of the present invention, first, for a programming language of the AI model, a corresponding packaging interface is used to package the AI model; then, the user can select a service frame from the service frame alternative library, determine the input and output standard matched with the AI model, and finally embed the packaged AI model into the service frame. Because the service frame alternative library is preset in the embodiment of the application, an AI algorithm researcher can conveniently select the service frame and determine the input and output standards as a user, and can conveniently and quickly realize the production of the AI model without much engineering and technical knowledge, thereby reducing the learning cost of the AI algorithm researcher and improving the production speed of the AI model.
The embodiment of the invention also provides another implementation mode of the packaging method of the AI model, which can be applied to a packaging platform of the AI model. As shown in fig. 2, the method comprises the steps of:
s201: in response to an initialization instruction from a user, a deep learning framework is provided.
The packaging platform of the AI model of the embodiment of the invention provides a deep learning framework of various mainstream, such as TensorFlow, Caffe, Pythrch and the like. The packaging platform can receive an initialization instruction from an AI algorithm researcher (user) and provide a corresponding deep learning platform.
Therefore, an AI algorithm researcher can construct an exclusive working space on the packaging platform, data to be trained are led into the packaging platform, a distributed file system is built at the bottom layer of the packaging platform, the AI algorithm researcher can select the backup number of the data, the data are exclusively occupied by the AI algorithm researcher, and only the AI algorithm researcher and a user with authority can read and write the data, so that the risk of data loss is avoided.
S202: the deep learning framework is trained into an AI model in response to a training instruction from a user.
An AI algorithm researcher can input various training instructions on the packaging platform, so that the deep learning frame is trained into a required AI model by using the packaging platform, the difficulty that the AI algorithm researcher searches and embeds the deep learning frame is solved, and the AI algorithm researcher is helped to quickly train out the formed AI model.
Specific examples are as follows:
an AI algorithm researcher firstly sets parameters such as a network structure, a network depth, a network width and the like on a training interface provided by a packaging platform, and constructs a basic AI model. Then, an AI algorithm researcher can set initial values of the structure, depth and width of the AI model on the basic AI model, select training data such as imported training samples in a working space, and continuously adjust parameters.
The training of the AI model can be completed through the training process, and an AI algorithm researcher can archive the trained AI model, thereby providing a basis for subsequent productization. In addition, an AI algorithm researcher can set input and output styles on the packaging platform to customize the AI model in the archive.
S203: and packaging the AI model by using a preset packaging interface according to the programming language of the AI model to be packaged.
The packaging platform of the AI model in the embodiment of the invention provides a plurality of preset packaging interfaces for selection of an AI algorithm researcher, such as C + +, Python and the like. After the AI algorithm researcher selects the programming language, the corresponding packaging interface can be called to package the AI model. As shown in fig. 3, the method specifically includes the following steps:
s2031: and responding to a selection instruction from a user, and selecting the AI model to be packaged.
An AI algorithm researcher selects an AI model which needs to be constructed by the researcher in an exclusive working space as the AI model to be packaged by inputting a selection instruction on a packaging platform.
S2032: a programming language for the AI model is determined.
The AI algorithm researcher may also continue to select a constructed programming language, such as C + +, Python, etc., on the packaging platform.
In addition to the above self-input selections by the AI algorithm researcher, the programming language of the AI model to be packaged may also be automatically identified by the packaging platform.
S2033: and packaging the AI model by using a packaging interface corresponding to the programming language of the AI model.
When the programming language of the AI model is python, step S2033 specifically includes:
and packaging the AI model into a Python Lib library based on a preset Python Lib library. The Python has a powerful standard library, the core of the Python language only contains common types and functions such as numbers, character strings, lists, dictionaries, files and the like, and the Python standard library provides additional functions such as system management, network communication, text processing, database interfaces, a graphic system, XML processing and the like. The Python standard library naming interface is clear and easy to learn and use.
In addition, the Python community provides a large number of third party modules that are used in a manner similar to standard libraries, such as in the fields of scientific computing, Web development, database interfaces, graphics systems, and the like. The third party module may be written in Python or C language. Python can be used for glue languages between other languages and tools by having a large number of tools based on standard libraries, being able to use low level languages and C + + speech which can interface with other libraries.
When the programming language of the AI model is C + +, step S2033 specifically includes:
and compiling the AI model based on a preset compiling module to generate a dynamic link library. The library provides some content that can be called by another program, who must somehow indicate that it is to be called. A dynamically linked library may be understood as a library that is compiled from source code into object code. The object code library may be dynamically invoked by other processes when executed.
The C + + language is an inheritance of the C language, and can perform procedural programming of the C language, object-based programming characterized by abstract data types, and object-oriented programming characterized by inheritance and polymorphism. While C + + excels in object-oriented programming, process-based programming may also be performed. C + + not only has the practical characteristics of efficient operation of a computer, but also improves the programming quality of large-scale programs and the problem description capacity of programming languages.
Besides C + +, Python, the packaging platform can also package AI models in other programming languages, which are not described in detail here. Most of the current AI models are written by adopting Python or C + + and other languages, so that by using the packaging interface provided by the packaging platform, an AI algorithm researcher can package the trained AI models only by calling the corresponding packaging interface.
In a possible implementation manner of this embodiment, after step S203, the method further includes the following steps:
s204: and responding to a marking instruction from a user, and marking attribute information on the packaged AI model.
The packaging platform of the embodiment of the invention provides a version management interface based on different characteristics of the AI model. Based on the packaging design of the AI model, an AI algorithm researcher can input a marking instruction on a packaging platform, self-defining version numbers of the packaged AI model can be performed, and attribute information such as annotation and annotation can be performed on the version, so that the service of the AI model can be traced back by the AI algorithm researcher conveniently. The AI model trained by an AI algorithm researcher is stored on a packaging platform according to versions, and different versions correspond to different characteristics. Therefore, the iteration of an AI algorithm researcher on the product is facilitated, and the difficulty of messy versions of AI model management of the AI algorithm researcher can be solved.
S205: and storing the attribute information of the AI model to a management module.
After the attribute information of the AI model is stored in the management module of the packaging platform, the AI model can be managed according to version based on the attribute information such as the specified version and the functional characteristics of the AI model. Unlike code management, AI model version control aims at a subject which is an independent packaged AI model itself, and can be used as a basis for version management in the form of a Docker image.
The Docker mirror concept is similar to mirroring in a virtual machine, and is a read-only template, a separate file system, including the data needed to run a container, can be used to create a new container. For example: an image may contain a complete ubuntu operating system environment with only Mysql or other applications that the user needs installed. That is, the image is read-only, and may also be understood as a static file.
Docker's image is actually made up of a one-level file system, referred to as UnionFS. The mirror image can be constructed based on a Dockerfile, which is a description file containing several commands, each of which creates a new hierarchical structure for the base file system.
S206: and responding to a selection instruction from a user, selecting a service frame from the service frame alternative library, and determining the input and output standard matched with the AI model.
In one possible implementation, the service framework alternative library includes a synchronous framework, an asynchronous framework, an HTTP framework, an RPC framework, or an AJAX framework. An AI algorithm researcher can select a required service frame from the service frame candidate library according to an actual application scene, and customize the input and output standards of the service frame to be matched with the AI model.
S207: the packaged processed AI model is embedded in a service framework.
An AI algorithm researcher selects an AI model which needs to be produced and is packaged in an exclusive working space of the packaging platform, and then the AI algorithm researcher selects required service frames on the packaging platform, wherein the service frames are written by an AI engineer in advance and are embedded into the platform. And (4) clicking a construction button by an AI algorithm researcher, and embedding the packaged AI model into a service frame by the packaging platform.
Specifically, the AI algorithm researcher interest packing platform packs the packed AI model and the service framework to generate a Docker image, that is, packs the service framework and the AI model into one Docker image.
And storing the path parameters of the AI model into the service framework, and enabling the service framework to call the AI model through the path parameters. The path parameters may not store the path or the dependency information, and after the storage path or the dependency information of the AI model is stored as the path parameters in the service framework, the AI model may be called by the path parameters inside the service framework, and then the external service is performed. And finally, constructing the external service according to the input and output standard after the packaging processing of the AI model.
By adopting the packaging method of the AI model provided by the embodiment of the invention, an AI algorithm researcher can conveniently select the service frame and determine the input and output standards, and can conveniently and quickly realize the productization of the AI model without having much engineering and technical knowledge, thereby reducing the learning cost of the AI algorithm researcher and improving the productization speed of the AI model.
Meanwhile, an AI engineer does not need to be familiar with the AI model, so that repeated debugging between an AI algorithm researcher and the AI engineer is omitted, and the productive test process of the AI model is simplified.
In one possible implementation, the method further comprises the steps of:
s208: and providing an external access interface, so that the client calls the AI model through the access interface.
After the AI model is finished productization, the packaging platform provides an access interface of AI model service to the outside, and a customer (a user of the AI model) can call the AI model function through the access interface, so that the service application of the AI model is realized conveniently and quickly. Wherein the access interface provides both encrypted and non-encrypted network protocols, while also supporting either synchronous or asynchronous mechanisms within the AI model. The services of the AI model are managed on the packaging platform in a unified way, and the services of the AI model are monitored, so that when any abnormality, such as sudden increase of memory use and the like, occurs on the platform of the serviced AI model, the services can be self-diagnosed and self-healed according to the configured resource parameters, and the services of the AI model have the characteristics of self-healing, stability and the like.
The embodiment of the invention also provides a packaging platform of the AI model, which is used for training, packaging, managing and the like of the AI model. As shown in fig. 4, the packaging platform of the AI model includes:
and a packing module 402, configured to pack the AI model according to a programming language of the AI model to be packed, by using a preset packing interface.
And a selecting module 403, configured to select a service frame from the service frame candidate library in response to a selection instruction from a user, and determine an input/output standard matching the AI model.
An embedding module 404 for embedding the packaged AI model into a service framework.
In one embodiment, the embedding module 404 is specifically configured to:
packaging the packaged AI model and the service framework to generate a Docker mirror image; and storing the path parameters of the AI model into the service framework, and enabling the service framework to call the AI model through the path parameters.
In one embodiment, the packaging platform of the AI model further comprises:
and the interface module 406 is configured to provide an external access interface, so that the client calls the AI model through the access interface.
In one embodiment, the packing module 402 is specifically configured to:
responding to a selection instruction from a user, and selecting an AI model to be packaged; determining a programming language of the AI model; and packaging the AI model by using a packaging interface corresponding to the programming language of the AI model.
When the programming language of the AI model is the python language, the packaging module 402 packages the AI model into a python lib library based on a preset python lib library.
When the programming language of the AI model is C + +, the packing module 402 compiles the AI model based on a preset compiling module to generate a dynamic link library.
In one embodiment, the packaging platform of the AI model further comprises:
the management module 405 is configured to respond to a labeling instruction from a user, and label attribute information on the packaged AI model; and storing the attribute information of the AI model.
In one embodiment, the packaging platform of the AI model further comprises:
a training module 401, configured to provide a deep learning framework in response to an initialization instruction from a user; the deep learning framework is trained into an AI model in response to a training instruction from a user.
The packaging platform for the AI model provided by the embodiment of the present invention has the same or corresponding technical features as the packaging method for the AI model provided by the embodiment of the present invention, so that the same technical problems can be solved, and the same technical effects can be achieved.
As shown in fig. 5, an electronic device according to an embodiment of the present invention further includes a memory 501 and a processor 502, where the memory stores a computer program operable on the processor, and the processor executes the computer program to implement the steps of the AI model packing method provided in the foregoing embodiment.
Referring to fig. 5, the electronic device further includes: a bus 503 and a communication interface 504, and the processor 502, the communication interface 504 and the memory 501 are connected by the bus 503; the processor 502 is for executing executable modules, e.g. computer programs, stored in the memory 501.
The Memory 501 may include a high-speed Random Access Memory (RAM), and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The communication connection between the network element of the system and at least one other network element is realized through at least one communication interface 504 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, and the like can be used.
Bus 503 may be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 5, but this does not indicate only one bus or one type of bus.
The memory 501 is used for storing a program, and the processor 502 executes the program after receiving an execution instruction, and the method performed by the apparatus defined by the process disclosed in any of the foregoing embodiments of the present application may be applied to the processor 502, or implemented by the processor 502.
The processor 502 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 502. The Processor 502 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 501, and the processor 502 reads the information in the memory 501, and completes the steps of the method in combination with the hardware thereof.
Embodiments of the present invention further provide a computer-readable storage medium, where a machine-executable instruction is stored in the computer-readable storage medium, and when the machine-executable instruction is called and executed by a processor, the machine-executable instruction causes the processor to execute the wrapping method of the AI model.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present invention, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form. For example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus once an item is defined in one figure, it need not be further defined and explained in subsequent figures, and moreover, the terms "first", "second", "third", etc. are used merely to distinguish one description from another and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (12)

1. A method of packaging an AI model, comprising:
packaging the AI model by using a preset packaging interface according to a programming language of the AI model to be packaged;
responding to a selection instruction from a user, selecting a service frame from a service frame alternative library, and determining an input/output standard matched with the AI model;
embedding the packaged AI model into the service framework.
2. The method of claim 1, wherein the step of embedding the packaged AI model into the service framework comprises:
packaging the packaged AI model and the service framework to generate a Docker mirror image;
and storing the path parameters of the AI model into the service framework, so that the service framework calls the AI model through the path parameters.
3. The method of claim 1, further comprising, after the step of embedding the packaged AI model into the service framework:
and providing an external access interface, so that the client calls the AI model through the access interface.
4. The method according to claim 1, wherein the step of packaging the AI model by using a preset packaging interface according to the programming language of the AI model to be packaged comprises:
responding to a selection instruction from a user, and selecting an AI model to be packaged;
determining a programming language of the AI model;
and packaging the AI model by using a packaging interface corresponding to the programming language of the AI model.
5. The method according to claim 4, wherein when the programming language of the AI model is python, the step of packaging the AI model by using a packaging interface corresponding to the programming language of the AI model comprises:
and packaging the AI model into a python lib library based on a preset python lib library.
6. The method according to claim 4, wherein when the programming language of the AI model is C + +, the step of packaging the AI model using a packaging interface corresponding to the programming language of the AI model includes:
and compiling the AI model based on a preset compiling module to generate a dynamic link library.
7. The method according to claim 1, further comprising, after the step of packaging the AI model according to the programming language of the AI model to be packaged by using a preset packaging interface, the step of:
responding to a labeling instruction from a user, and labeling attribute information of the packaged AI model;
and storing the attribute information of the AI model to a management module.
8. The method according to claim 1, further comprising, before the step of packaging the AI model according to the programming language of the AI model to be packaged by using a preset packaging interface, the step of:
responding to an initialization instruction from a user, and providing a deep learning framework;
the deep learning framework is trained into an AI model in response to a training instruction from a user.
9. The method of claim 1, wherein the service framework alternative library comprises an HTTP framework, an RPC framework, or an AJAX framework.
10. A packaging platform for AI models, comprising:
the packaging module is used for packaging the AI model by using a preset packaging interface according to the programming language of the AI model to be packaged;
the selection module is used for responding to a selection instruction from a user, selecting a service frame from a service frame alternative library and determining an input/output standard matched with the AI model;
an embedding module, configured to embed the packaged AI model into the service framework.
11. An electronic device comprising a memory and a processor, wherein the memory stores a computer program operable on the processor, and wherein the processor implements the steps of the method of any of claims 1 to 9 when executing the computer program.
12. A computer readable storage medium having stored thereon machine executable instructions which, when invoked and executed by a processor, cause the processor to execute the method of any of claims 1 to 9.
CN202010082086.2A 2020-02-06 2020-02-06 AI model packaging method, platform and electronic equipment Active CN111290778B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010082086.2A CN111290778B (en) 2020-02-06 2020-02-06 AI model packaging method, platform and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010082086.2A CN111290778B (en) 2020-02-06 2020-02-06 AI model packaging method, platform and electronic equipment

Publications (2)

Publication Number Publication Date
CN111290778A true CN111290778A (en) 2020-06-16
CN111290778B CN111290778B (en) 2024-03-01

Family

ID=71024448

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010082086.2A Active CN111290778B (en) 2020-02-06 2020-02-06 AI model packaging method, platform and electronic equipment

Country Status (1)

Country Link
CN (1) CN111290778B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111897664A (en) * 2020-08-03 2020-11-06 中关村科学城城市大脑股份有限公司 Allocation system and method for AI algorithm and AI model applied to urban brain
CN112463301A (en) * 2020-11-30 2021-03-09 常州微亿智造科技有限公司 Container-based model training test tuning and deployment method and device
CN113010181A (en) * 2021-03-24 2021-06-22 北京百度网讯科技有限公司 Deployment method and device of operators in deep learning framework and electronic equipment
CN113448545A (en) * 2021-06-23 2021-09-28 北京百度网讯科技有限公司 Method, apparatus, storage medium, and program product for machine learning model servitization
US20220094760A1 (en) * 2020-09-23 2022-03-24 Electronics And Telecommunications Research Institute Apparatus and method for generating proxy for dockerized artificial intelligence library and ros distributed system based on dockerized artificial intelligence library
CN115525298A (en) * 2022-11-28 2022-12-27 长沙海信智能系统研究院有限公司 AI scene algorithm access deployment method and device and electronic equipment
WO2023125594A1 (en) * 2021-12-28 2023-07-06 维沃移动通信有限公司 Ai model transmission method and apparatus, device, and storage medium
CN117539449A (en) * 2024-01-09 2024-02-09 清华大学 Efficient and flexible collaborative learning framework and method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040168160A1 (en) * 2003-02-26 2004-08-26 Bea Systems, Inc. System and method for multi-language extensible compiler framework
US20150234651A1 (en) * 2014-02-20 2015-08-20 International Business Machines Corporation Managing deployment of application pattern based applications on runtime platforms
CN109669701A (en) * 2018-12-17 2019-04-23 深圳魔数智擎科技有限公司 Method, compiler and the server of processing are compiled to machine learning model
CN110245003A (en) * 2019-06-06 2019-09-17 中信银行股份有限公司 A kind of machine learning uniprocessor algorithm arranging system and method
CN110413294A (en) * 2019-08-06 2019-11-05 中国工商银行股份有限公司 Service delivery system, method, apparatus and equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040168160A1 (en) * 2003-02-26 2004-08-26 Bea Systems, Inc. System and method for multi-language extensible compiler framework
US20150234651A1 (en) * 2014-02-20 2015-08-20 International Business Machines Corporation Managing deployment of application pattern based applications on runtime platforms
CN109669701A (en) * 2018-12-17 2019-04-23 深圳魔数智擎科技有限公司 Method, compiler and the server of processing are compiled to machine learning model
CN110245003A (en) * 2019-06-06 2019-09-17 中信银行股份有限公司 A kind of machine learning uniprocessor algorithm arranging system and method
CN110413294A (en) * 2019-08-06 2019-11-05 中国工商银行股份有限公司 Service delivery system, method, apparatus and equipment

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111897664A (en) * 2020-08-03 2020-11-06 中关村科学城城市大脑股份有限公司 Allocation system and method for AI algorithm and AI model applied to urban brain
US20220094760A1 (en) * 2020-09-23 2022-03-24 Electronics And Telecommunications Research Institute Apparatus and method for generating proxy for dockerized artificial intelligence library and ros distributed system based on dockerized artificial intelligence library
CN112463301A (en) * 2020-11-30 2021-03-09 常州微亿智造科技有限公司 Container-based model training test tuning and deployment method and device
CN113010181A (en) * 2021-03-24 2021-06-22 北京百度网讯科技有限公司 Deployment method and device of operators in deep learning framework and electronic equipment
US11531529B2 (en) 2021-03-24 2022-12-20 Beijing Baidu Netcom Science Technology Co., Ltd. Method and electronic device for deploying operator in deep learning framework
CN113448545A (en) * 2021-06-23 2021-09-28 北京百度网讯科技有限公司 Method, apparatus, storage medium, and program product for machine learning model servitization
CN113448545B (en) * 2021-06-23 2023-08-08 北京百度网讯科技有限公司 Method, apparatus, storage medium and program product for machine learning model servitization
WO2023125594A1 (en) * 2021-12-28 2023-07-06 维沃移动通信有限公司 Ai model transmission method and apparatus, device, and storage medium
CN115525298A (en) * 2022-11-28 2022-12-27 长沙海信智能系统研究院有限公司 AI scene algorithm access deployment method and device and electronic equipment
CN117539449A (en) * 2024-01-09 2024-02-09 清华大学 Efficient and flexible collaborative learning framework and method
CN117539449B (en) * 2024-01-09 2024-03-29 清华大学 Efficient and flexible collaborative learning framework and method

Also Published As

Publication number Publication date
CN111290778B (en) 2024-03-01

Similar Documents

Publication Publication Date Title
CN111290778B (en) AI model packaging method, platform and electronic equipment
CN108279932B (en) Method and device for dynamically configuring user interface of mobile terminal
US11048885B2 (en) Cognitive translation service integrated with context-sensitive derivations for determining program-integrated information relationships
JP2011060277A (en) Integration environment generator
CN110941427B (en) Code generation method and code generator
CN110580174B (en) Application component generation method, server and terminal
US11061739B2 (en) Dynamic infrastructure management and processing
US11089000B1 (en) Automated source code log generation
US10970047B2 (en) Lossless bi-directional formatting of program source code
US10936810B2 (en) Token embedding based on target-context pairs
CN107797805B (en) Code packaging method and device and computer readable storage medium
CN112667242A (en) Method and device for packaging C code into FMU
CN110704031A (en) Software application project creating method and device and electronic equipment
CN113448678A (en) Application information generation method, deployment method, device, system and storage medium
CN109766123A (en) Application program packaging method and device
US10574517B2 (en) Adding voice commands to invoke web services
US20230099150A1 (en) Structural information preserving for graph-to-text generation
US11726778B2 (en) Translating clusters of a monolith application to microservices
US11640281B2 (en) Tool for introspection in object-oriented source code
CN112181644B (en) Method, system and device for cross-domain machine learning component Jupitter
CN115686733A (en) Service deployment method and device, electronic equipment and storage medium
CN111290757B (en) Weex-based online code compiling method, device and equipment
JP7269244B2 (en) Systems and methods for providing globalization capabilities in service management application interfaces
Larcher et al. jPackFaaS: Profiling Java Serverless Functions Deployment Package Size in Federated FaaS
CN114237615A (en) Packing method based on decision tree model and related equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant