Method, device and equipment for implementing customized online launch of machine learning models
By obtaining and saving the code content of the custom operator, the machine learning model produced by the custom operator can be launched online, solving the problem that the existing technology cannot support the custom operator model format and improving the flexibility of model launch.
Patent Information
- Application Number
- CN202011232052.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-06
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2040-11-06
AI Technical Summary
The existing machine learning framework cannot directly support the model format produced by custom operators, resulting in the inability to launch the model.
A method and device are provided, which obtain the code content of the customized online method of the custom operator uploaded by the user and the machine learning model it produces, save it to the model file, and launch the model based on this method, supporting the launch of models in non-standard formats.
It enables the successful launch of models produced by custom operators, supports the deployment of machine learning models in non-standard formats, and improves the flexibility and adaptability of model launch.
Smart Images

Figure CN114529006B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence, and more specifically, to a method for implementing customized online operation of a machine learning model, an apparatus for implementing customized online operation of a machine learning model, a device including at least one computing device and at least one storage device, and a computer-readable storage medium. Background Art
[0002] Existing machine learning frameworks all have their own model formats. For example, TensorFlow uses the SavedModel format, and Kera uses the H5 format. These model formats are open source, so models can be directly deployed using open source custom deployment methods. However, with the rapid development of machine learning technology, there is a natural demand for machine learning platforms to develop custom operators to generate models and then deploy them online. However, the model formats generated by custom operators are not in the open source model formats described above, resulting in the inability to deploy models online. Summary of the Invention
[0003] One purpose of the embodiments of the present disclosure is to provide a technical solution for implementing customized launch of machine learning models.
[0004] According to a first aspect of the present disclosure, a method for implementing a customized launch of a machine learning model is provided, comprising:
[0005] Obtain user-uploaded custom operators that can generate models;
[0006] Obtain the code content of the customized online method for the customized operator to produce the machine learning model uploaded by the user;
[0007] Running the custom operator to generate a machine learning model, and saving the generated machine learning model and the code content of the custom launch method into a model file;
[0008] The machine learning model is launched based on the customized launch method in the model file.
[0009] Optionally, the code content of the custom operator includes at least model information about the machine learning model.
[0010] The model information of the machine learning model includes at least: the name of the machine learning model, the storage path of the machine learning model and the name of the customized online method.
[0011] Optionally, the code content of the custom operator includes the name of the custom online method;
[0012] Saving the generated machine learning model and the customized online method to a model file includes:
[0013] Based on the name of the custom online method, searching for code content of the custom online method;
[0014] The generated machine learning model and the found code content of the customized online method are saved in the model file in the target storage format.
[0015] Optionally, the target storage format is a format that includes an environment list node on which the machine learning model depends during runtime, a first storage location node of the machine learning model, a second storage location node of the code content of the custom online method, and an executable file node.
[0016] Optionally, the model file also includes: various environments on which the machine learning model depends during operation, the machine learning model stored in the first storage location, the code content of the custom online method stored in the second storage location, and the executable file displayed based on the executable file node.
[0017] The executable file at least includes an operation command for calling the customized online mode.
[0018] Optionally, putting the machine learning model online based on the customized online method in the model file includes:
[0019] Provides a configuration interface for launching machine learning models;
[0020] Packaging the machine learning model according to the configuration information input through the configuration interface;
[0021] Searching for the customized online method from the model file;
[0022] Based on the customized online method, the packaged machine learning model is deployed to complete the online launch of the machine learning model.
[0023] Optionally, searching the model file for the customized online method includes:
[0024] Searching for an operation command for calling the custom online mode from the model file;
[0025] Based on the operation command, obtain the code content of the customized online method;
[0026] Run the code content of the custom online method to obtain the custom online method.
[0027] Optionally, the configuration information involves at least one of the following items: a configuration item for selecting the custom operator, a configuration item for selecting the machine learning model, and a configuration item for resources required when putting the machine learning model online.
[0028] Optionally, the code content of the custom operator is written based on at least one of a programming language and a scripting language; and
[0029] The code content of the customized online mode is written based on at least one of the programming language and the scripting language.
[0030] Optionally, the scripting language includes at least one of a custom scripting language and a mainstream scripting language.
[0031] Optionally, the code content of the customized online method also includes content of operation commands for performing data preprocessing on the prediction data.
[0032] Optionally, obtaining a user-uploaded custom operator capable of generating a model includes:
[0033] According to the operation of editing the custom operator, an editing interface is provided;
[0034] Obtaining code content input through the editing interface, wherein the code content includes an operation command for performing data preprocessing on the input training data, an operation command for performing feature engineering on the training data after the data preprocessing, an operation command for performing model training based on the result of the feature engineering, and model information of the machine learning model;
[0035] Encapsulate the code content to obtain the custom operator.
[0036] Optionally, obtaining the code content of the customized online method for generating the machine learning model using the customized operator uploaded by the user includes:
[0037] Provide an editing interface based on the operation of editing the customized online method;
[0038] Obtain code content input through the editing interface, wherein the code content includes operation commands for performing data preprocessing on the input prediction data, and an implementation function for a customized online method of the machine learning model.
[0039] Optionally, after launching the machine learning model based on the customized launch method, the method further includes:
[0040] Check the online status of the machine learning model in the Application Management Center.
[0041] According to a second aspect of the present disclosure, there is also provided an apparatus for implementing customized launch of a machine learning model, comprising:
[0042] The first acquisition module is used to obtain the custom operators uploaded by users that can produce models;
[0043] The second acquisition module acquires the code content of the customized online method for the customized operator to generate the machine learning model uploaded by the user;
[0044] A running module, used to run the custom operator to generate a machine learning model module;
[0045] A saving module, configured to save the generated machine learning model and the code content of the customized online method into a model file; and
[0046] An online module is used to bring the machine learning model online based on the customized online method in the model file.
[0047] Optionally, the code content of the custom operator includes at least model information about the machine learning model.
[0048] The model information of the machine learning model includes at least: the name of the machine learning model, the storage path of the machine learning model and the name of the customized online method.
[0049] Optionally, the storage module is specifically used to:
[0050] Saving the generated machine learning model and the customized online method to a model file includes:
[0051] Based on the name of the custom online method, searching for code content of the custom online method;
[0052] The generated machine learning model and the found code content of the customized online method are saved in the model file in the target storage format.
[0053] Optionally, the target storage format is a format that includes an environment list node on which the machine learning model depends during runtime, a first storage location node of the machine learning model, a second storage location node of the code content of the custom online method, and an executable file node.
[0054] Optionally, the model file also includes: various environments on which the machine learning model depends during operation, the machine learning model stored in the first storage location, the code content of the custom online method stored in the second storage location, and the executable file displayed based on the executable file node.
[0055] The executable file at least includes an operation command for calling the customized online mode.
[0056] Optionally, the online module is specifically configured to:
[0057] Provides a configuration interface for launching machine learning models;
[0058] Packaging the machine learning model according to the configuration information input through the configuration interface;
[0059] Searching for the customized online method from the model file;
[0060] Based on the customized online method, the packaged machine learning model is deployed to complete the online launch of the machine learning model.
[0061] Optionally, the online module is specifically configured to:
[0062] Searching for an operation command for calling the custom online mode from the model file;
[0063] Based on the operation command, obtain the code content of the customized online method;
[0064] Run the code content of the custom online method to obtain the custom online method.
[0065] Optionally, the configuration information involves at least one of the following items: a configuration item for selecting the custom operator, a configuration item for selecting the machine learning model, and a configuration item for resources required when putting the machine learning model online.
[0066] Optionally, the code content of the custom operator is written based on at least one of a programming language and a scripting language; and
[0067] The code content of the customized online mode is written based on at least one of the programming language and the scripting language.
[0068] Optionally, the scripting language includes at least one of a custom scripting language and a mainstream scripting language.
[0069] Optionally, the code content of the customized online method also includes content of operation commands for performing data preprocessing on the prediction data.
[0070] Optionally, the first acquisition module is specifically configured to:
[0071] According to the operation of editing the custom operator, an editing interface is provided;
[0072] Obtaining code content input through the editing interface, wherein the code content includes an operation command for performing data preprocessing on the input training data, an operation command for performing feature engineering on the training data after the data preprocessing, an operation command for performing model training based on the result of the feature engineering, and model information of the machine learning model;
[0073] Encapsulate the code content to obtain the custom operator.
[0074] Optionally, the second acquisition module is specifically configured to:
[0075] Provide an editing interface based on the operation of editing the customized online method;
[0076] Obtain code content input through the editing interface, wherein the code content includes operation commands for performing data preprocessing on the input prediction data, and an implementation function for a customized online method of the machine learning model.
[0077] Optionally, the online module is further configured to:
[0078] Check the online status of the machine learning model in the Application Management Center.
[0079] According to a third aspect of the present disclosure, there is also provided an apparatus comprising at least one computing device and at least one storage device, wherein the at least one storage device is used to store instructions, and the instructions are used to control the at least one computing device to execute the method according to the first aspect above.
[0080] According to a fourth aspect of the present disclosure, a computer-readable storage medium is further provided, wherein a computer program is stored thereon, and when the computer program is executed by a processor, the method described in the first aspect above is implemented.
[0081] According to the method of the embodiment of the present disclosure, it not only supports users to upload custom operators that can produce models, but also provides a corresponding custom online method for the model produced by the custom operator. After running the custom operator to produce the machine learning model, the code content of the machine learning model and the custom online method is saved to the model file, and then the machine learning model is put online based on the custom online method in the model file, thereby realizing the online launch of the model in a non-standard format. BRIEF DESCRIPTION OF THE DRAWINGS
[0082] Further features and advantages of the present invention will become apparent from the following detailed description of exemplary embodiments of the present invention with reference to the accompanying drawings.
[0083] Figure 1 is a block diagram showing an example of a hardware configuration of an electronic device that can be used to implement an embodiment of the present disclosure;
[0084] Figure 2 A flowchart of a method for implementing customized launch of a machine learning model according to an embodiment of the present disclosure is shown;
[0085] Figures 3 to 7 A schematic diagram showing a display interface of an embodiment of the present disclosure is shown;
[0086] Figure 8 A functional block diagram of an apparatus for implementing customized online operation of a machine learning model according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0087] Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that unless otherwise specifically stated, the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention.
[0088] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
[0089] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered part of the specification.
[0090] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.
[0091] It should be noted that like reference numerals and letters refer to like items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0092] Hereinafter, various embodiments and examples according to embodiments of the present invention will be described with reference to the accompanying drawings.
[0093] <Hardware Configuration>
[0094] The method of the embodiment of the present disclosure may be implemented by at least one electronic device, that is, the apparatus 8000 for implementing the method may be disposed on the at least one electronic device. Figure 1 The hardware structure of any electronic device is shown. Figure 1 The electronic device shown may be a portable computer, a desktop computer, a workstation, a server, etc., or any other device having a computing device such as a processor and a storage device such as a memory, and is not limited here.
[0095] like Figure 1As shown, the electronic device 1000 may include a processor 1100, a memory 1200, an interface device 1300, a communication device 1400, a display device 1500, an input device 1600, a speaker 1700, a microphone 1800, and the like. The processor 1100 is configured to execute a computer program. The computer program may be written using an instruction set such as an x86, Arm, RISC, MIPS, or SSE architecture. The memory 1200 may include, for example, ROM (read-only memory), RAM (random access memory), or a non-volatile memory such as a hard disk. The interface device 1300 may include, for example, a USB interface or a headphone jack. The communication device 1400 may be capable of wired or wireless communication, and may specifically include Wi-Fi communication, Bluetooth communication, 2G / 3G / 4G / 5G communication, and the like. The display device 1500 may be, for example, an LCD display or a touch screen display. The input device 1600 may include, for example, a touch screen, a keyboard, or somatosensory input. The electronic device 1000 can output voice information through the speaker 1700 and can collect voice information through the microphone 1800.
[0096] Figure 1 The electronic device shown is merely illustrative and in no way implies any limitation on the present invention, its application, or use. In the embodiments of the present disclosure, the memory 1200 of the electronic device 1000 is used to store instructions, which are used to control the processor 1100 to operate to execute the method for implementing a customized on-line implementation of a machine learning model according to the embodiments of the present disclosure. A skilled person can design instructions based on the disclosed solution. How instructions control the processor to operate is well known in the art and will not be described in detail here.
[0097] In one embodiment, a device is provided, including at least one computing device and at least one storage device. The at least one storage device is used to store instructions for controlling the at least one computing device to execute a method according to any embodiment of the present disclosure.
[0098] The device may include at least one Figure 1 The electronic device 1000 shown provides at least one computing device such as a processor and at least one storage device such as a memory, which are not limited herein.
[0099] <Method Example>
[0100] In this embodiment, a method for implementing a customized online machine learning model is provided. The method for implementing a customized online machine learning model can be implemented by an electronic device, which can be such as Figure 1 The electronic device 1000 is shown.
[0101] according to Figure 2As shown, the method for implementing customized online operation of a machine learning model in this embodiment may include the following steps S2100 to S2400:
[0102] Step S2100: Obtain the custom operator uploaded by the user that can produce the model.
[0103] The custom operator can be a model training operator, which is a tool for preprocessing input training data, performing feature engineering on the preprocessed training data, and performing model training based on the results of the feature engineering to obtain a machine learning model. Of course, the custom operator can also be other user-defined operators, which are not detailed in this embodiment.
[0104] In this embodiment, a graphical user interface may be provided, and a "custom operator" node may be provided in the operator node of the graphical user interface. Figure 3 As shown in the figure, the custom operator is the model training operator "sklearn-predictor". When you need to train the model on the training data, you can drag "sklearn-predictor" to the graphical user interface for executing the automatic machine learning process to obtain the "sklearn-predictor" node. Figure 3 The "multiClass_UIAut" in the example can be a training data node.
[0105] In this embodiment, a human-computer interaction interface may be provided to support modeling personnel in performing operations, thereby obtaining a custom operator. Here, obtaining the custom operator that can generate a model uploaded by the user in step S2100 may further include the following steps S2110 to S2130:
[0106] Step S2110: providing an editing interface according to the operation of editing the custom operator.
[0107] In this embodiment, the electronic device may provide an editing interface in response to an operation of editing a custom operator.
[0108] The editing interface may include an editing entry, which may be an input box, a drop-down list, voice input, etc.
[0109] Step S2120: Obtain the code content input through the editing interface.
[0110] The code content includes operation commands for data preprocessing of input training data, operation commands for feature engineering of the training data after data preprocessing, operation commands for model training based on the results of feature engineering, and model information of the machine learning model.
[0111] The above code content can be written in at least one of a programming language and a scripting language, including at least one of a custom scripting language and a mainstream scripting language. The programming language may include Java, C++, C, etc. Mainstream scripting languages may include, for example, Perl, Python, and Ruby. The custom scripting language may be a mixture of the above mainstream scripting languages, such as a mixture of Perl and Python.
[0112] In this step S2120, the modeler can input the code content through the editing entry provided by the editing interface, so that the electronic device can obtain the code content.
[0113] The model information of the above machine learning model includes at least the name of the machine learning model, the storage path of the machine learning model, and the name of the online method. For example, part of the code content of the custom operator is "sage_logger.model("sgd_model",model_loc,predictor="sklearn-predict")", where sgd_model represents the model name of the machine learning model, model_loc represents the model storage path of the machine learning model, and predictor="sklearn-predict" indicates that the name of the custom online method predictor of the machine learning model is "sklearn-predict", that is, the predictor to be used when the machine learning model is online is sklearn-predict. Therefore, when storing the machine learning model according to subsequent steps, the machine learning model and the implementation code of the custom predictor will be saved together in the model file.
[0114] Step S2130: encapsulate the code content to obtain a custom operator.
[0115] In this step S2130, the custom operator can be obtained by encapsulating the operation command for performing data preprocessing on the input training data, the operation command for performing feature engineering on the training data after data preprocessing, the operation command for performing model training based on the results of feature engineering, and the model information of the machine learning model.
[0116] After obtaining the custom operator that can produce the model uploaded by the user, enter:
[0117] Step S2200: Obtain the code content of the customized online method for the customized operator to produce the machine learning model uploaded by the user.
[0118] In this embodiment, it implements the predictor specified when the custom operator outputs the machine learning model for storage, so that the operator can be managed and launched in the platform application center. When it goes online, the custom sklearn-predictor code saved in the model will be called to start the model service.
[0119] In this embodiment, it can provide a human-computer interaction interface to support modelers to operate and obtain custom operators. Here, the code content of the custom online method for obtaining the custom operator uploaded by the user to output the machine learning model in step S2200 can further include the following steps S2210 to S2220:
[0120] Step S2210: providing an editing interface according to the operation of editing the customized online mode.
[0121] In this embodiment, the electronic device may provide an editing interface in response to an operation of editing a custom operator.
[0122] The editing interface may include an editing entry, which may be an input box, a drop-down list, voice input, etc.
[0123] Step S2120: Obtain the code content input through the editing interface.
[0124] The code content includes at least operational commands for preprocessing the input prediction data and functions for implementing a custom launch method for the machine learning model. The above code content can also be written in at least one of a programming language and a scripting language. Detailed explanations of writing in scripting and programming languages can be found in the above steps and are not detailed here in this embodiment.
[0125] Prediction data can be data related to predictions that a user (e.g., an information service provider recommending information) desires to obtain. For example, when a user wishes to obtain a prediction of whether information they wish to recommend to their customers (e.g., end consumers) will be accepted (i.e., whether the consumer will click on or read it), the prediction data is attribute information about the information they wish to recommend.
[0126] For example, the code content of the customized launch method, "@operator("sklearn-predictor", runner="default_http_server")", may be the implementation function of the launch method, and "def predict(self, data, query_args):..." may be the operation command for preprocessing the predicted data. It is understood that this code content may also include parameters and other information related to the customized implementation function, which is not detailed in this embodiment.
[0127] In this step S2120, the modeler can input the code content through the editing entry provided by the editing interface, so that the electronic device can obtain the code content.
[0128] After obtaining the code content of the customized online method for the custom operator output machine learning model uploaded by the user, enter:
[0129] Step S2300: Run the custom operator to generate a machine learning model, and save the generated machine learning model and the code content of the custom online method into a model file.
[0130] In this embodiment, different training data is provided for different machine learning problems, and then the training data is trained using custom operators to produce a machine learning model. For example, training data sets corresponding to various application scenarios may be pre-stored in a designated location of an electronic device implementing the embodiments of the present disclosure. The training data may be, for example, annotated image data, one or more annotated text data tables, or annotated voice data.
[0131] like Figure 3 As shown, the custom operator is the model training operator "sklearn-predictor". When model training is required for training data, "sklearn-predictor" can be dragged to the graphical user interface for executing the automatic machine learning process to obtain the "sklearn-predictor" node, and the training data "multiClass_UIAut" can be dragged to the graphical user interface for executing the automatic machine learning process to obtain the "multiClass_UIAut" node. The "multiClass_UIAut" node is connected to the "sklearn-predictor" node, and run is selected to use the model training operator to train the machine learning model based on the training data.
[0132] In this embodiment, saving the generated machine learning model and the code content of the customized online method to the model file in step S2300 may further include the following steps S2310 to S2320:
[0133] Step S2310: Based on the name of the custom online method, search for the code content of the custom online method.
[0134] In step S2310, the custom operator code includes the name of the custom launch method. For example, the custom operator code is "sage_logger.model("sgd_model", model_loc, predictor = "sklearn-predict")", where the name of the launch method predictor defined in the code is "sklearn-predictor". Here, you can search for the code for the custom launch method named "sklearn-predictor".
[0135] Step S2320: Save the generated machine learning model and the found code content of the customized online method into the model file in the target storage format.
[0136] The target storage format includes an environment list node that the machine learning model depends on during runtime, a first storage location node for the machine learning model, a second storage location node for the code content of the customized online method, and an executable file node.
[0137] For example, the target storage format can be:
[0138]
[0139] The model storage folder above indicates the storage location of the machine learning model, and the Predictor code storage folder indicates the storage location of the code content of the custom launch method.
[0140] The model file includes the various environments that the machine learning model depends on during operation, the machine learning model stored based on the first storage location, the code content of the custom online method stored based on the second storage location, and the executable file displayed based on the executable file node. The executable file includes at least the operation command for calling the custom online method.
[0141] After running the custom operator to generate the machine learning model and saving the generated machine learning model and the code content of the custom launch method to the model file, enter:
[0142] Step S2400: Launch the machine learning model based on the customized launch method in the model file.
[0143] In this embodiment, after the machine learning model is generated according to the above step S2300, the machine learning model can be put online according to the customized online method in the model file in this step.
[0144] In this embodiment, in step S2400, putting the machine learning model online based on the customized online method in the model file may further include the following steps S2410 to S2440:
[0145] Step S2410, providing a configuration interface for launching the machine learning model.
[0146] In this embodiment, the electronic device can provide an editing interface in response to the online operation of the machine learning model.
[0147] The editing interface may include an editing entry, which may be an input box, a drop-down list, voice input, etc.
[0148] Step S2420: Package the machine learning model according to the configuration information input through the configuration interface.
[0149] The configuration information involves at least one of the following items: a configuration item for selecting a custom operator, a configuration item for selecting a machine learning model, and a configuration item for resources required when launching a machine learning model.
[0150] like Figure 4 As shown, for example, you can customize the operator estimate. The custom operator is the custom operator that can produce the model uploaded by the above user. After selecting the custom operator estimate, as shown Figure 5 As shown, select the machine learning model to be launched. The machine learning model is the machine learning model produced by the above custom operator. After selecting the machine learning model, further select the resources required for the machine learning model to be launched and click Save. Figure 6 Then package the application.
[0151] Step S2430: Search the model file for a customized online method.
[0152] In step S2430, searching for a custom online method from the model file may further include the following steps S2431 to S2432:
[0153] Step S2431: Search the model file for an operation command for calling a custom online method.
[0154] For example, the operation command for calling the custom online method can be searched from the executable file in the model file.
[0155] Step S2432: Based on the operation command, obtain the code content of the customized online method.
[0156] For example, if the name of the obtained custom launch method is "sklearn-predictor", that is, the code content of the custom launch method named "sklearn-predictor" is obtained.
[0157] Step S2433: Run the code content of the customized online method to obtain the customized online method.
[0158] Step S2440: Based on the customized online method, the packaged machine learning model is deployed to complete the online launch of the machine learning model.
[0159] For example, when you start the service, you will find the code call for the predictor implementation "sklearn-predictor" under the model file.
[0160] After the machine learning model is put online based on the customized online method in the model file according to the above step S2400, it also includes checking the online status of the machine learning model in the application management center.
[0161] like Figure 7 As shown, after deployment, you can view the status, logs, monitoring information, etc. of the online service on the service page.
[0162] According to the method of the embodiment of the present disclosure, it not only supports users to upload custom operators that can produce models, but also provides corresponding custom online method code content for the model produced by the custom operator. After running the custom operator to produce the machine learning model, the machine learning model and the code content of the custom online method are saved to the model file, and then the machine learning model is put online based on the custom online method in the model file, thereby realizing the online launch of the model in a non-standard format.
[0163] <Device Example>
[0164] In this embodiment, a device 8000 for implementing customized online machine learning models is provided, such as Figure 8 As shown, it includes a first acquisition module 8100, a second acquisition module 8200, an operation module 8300 and a storage module 8400.
[0165] The first acquisition module 8100 is used to obtain the custom operator uploaded by the user that can produce the model.
[0166] The second acquisition module 8200 is used to obtain the code content of the customized online method of the customized operator output machine learning model uploaded by the user.
[0167] The running module 8300 is used to run the custom operator to produce a machine learning model.
[0168] The saving module 8400 is used to save the generated machine learning model and the code content of the customized online method into a model file.
[0169] The online module 8500 is used to bring the machine learning model online based on the customized online method in the model file.
[0170] In one embodiment, the code content of the custom operator includes at least model information about the machine learning model.
[0171] The model information of the machine learning model includes at least: the name of the machine learning model, the storage path of the machine learning model and the name of the customized online method.
[0172] In one embodiment, the saving module 8400 is specifically used to:
[0173] Saving the generated machine learning model and the customized online method to a model file includes:
[0174] Based on the name of the custom online method, searching for code content of the custom online method;
[0175] The generated machine learning model and the found code content of the customized online method are saved in the model file in the target storage format.
[0176] In one embodiment, the target storage format is a format that includes an environment list node on which the machine learning model depends during operation, a first storage location node of the machine learning model, a second storage location node of the code content of the custom online method, and an executable file node.
[0177] In one embodiment, the model file also includes: various environments on which the machine learning model depends during operation, the machine learning model stored in the first storage location, the code content of the customized online method stored in the second storage location, and the executable file displayed based on the executable file node.
[0178] The executable file at least includes an operation command for calling the customized online mode.
[0179] In one embodiment, the online module 8500 is specifically configured to:
[0180] Provides a configuration interface for launching machine learning models;
[0181] Packaging the machine learning model according to the configuration information input through the configuration interface;
[0182] Searching for the customized online method from the model file;
[0183] Based on the customized online method, the packaged machine learning model is deployed to complete the online launch of the machine learning model.
[0184] In one embodiment, the online module 8500 is specifically configured to:
[0185] Searching for an operation command for calling the custom online mode from the model file;
[0186] Based on the operation command, obtain the code content of the customized online method;
[0187] Run the code content of the custom online method to obtain the custom online method.
[0188] In one embodiment, the configuration information involves at least one of the following items: a configuration item for selecting the custom operator, a configuration item for selecting the machine learning model, and a configuration item for resources required when putting the machine learning model online.
[0189] In one embodiment, the code content of the custom operator is written based on at least one of a programming language and a scripting language; and
[0190] The code content of the customized online mode is written based on at least one of the programming language and the scripting language.
[0191] In one embodiment, the scripting language includes at least one of a custom scripting language and a mainstream scripting language.
[0192] In one embodiment, the code content of the customized online method also includes content related to operation commands for preprocessing the prediction data.
[0193] In one embodiment, the first acquisition module 8100 is specifically configured to:
[0194] According to the operation of editing the custom operator, an editing interface is provided;
[0195] Obtaining code content input through the editing interface, wherein the code content includes an operation command for performing data preprocessing on the input training data, an operation command for performing feature engineering on the training data after the data preprocessing, an operation command for performing model training based on the result of the feature engineering, and model information of the machine learning model;
[0196] Encapsulate the code content to obtain the custom operator.
[0197] In one embodiment, the second obtaining module 8200 is specifically configured to:
[0198] Provide an editing interface based on the operation of editing the customized online method;
[0199] Obtain code content input through the editing interface, wherein the code content includes operation commands for performing data preprocessing on the input prediction data, and an implementation function for a customized online method of the machine learning model.
[0200] In one embodiment, the online module 8500 is further configured to:
[0201] Check the online status of the machine learning model in the Application Management Center.
[0202] <Storage Medium Embodiment>
[0203] This embodiment provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method according to any one of the above method embodiments is implemented.
[0204] The present invention may be a device, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present invention.
[0205] A computer-readable storage medium can be a tangible device that can hold and store instructions for use by an instruction execution device. A computer-readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination thereof. As used herein, a computer-readable storage medium is not to be construed as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through an electrical wire.
[0206] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions to be stored in the computer-readable storage medium in each computing / processing device.
[0207] The computer program instructions for performing the operation of the present invention can be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, and conventional procedural programming languages such as "C" language or similar programming languages. The computer readable program instructions can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), is personalized by utilizing the state information of the computer readable program instructions, and the electronic circuit can execute the computer readable program instructions, thereby realizing various aspects of the present invention.
[0208] Various aspects of the present invention are described herein with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present invention. It should be understood that each block of the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer-readable program instructions.
[0209] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device is generated that implements the functions / actions specified in one or more blocks in the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, where these instructions cause the computer, programmable data processing device, and / or other device to operate in a specific manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing various aspects of the functions / actions specified in one or more blocks in the flowchart and / or block diagram.
[0210] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more blocks in the flowchart and / or block diagram.
[0211] The flowcharts and block diagrams in the accompanying drawings show the possible implementation architecture, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, program segment or part of an instruction, and the module, program segment or part of the instruction contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, implementation by software, and implementation by a combination of software and hardware are all equivalent.
[0212] While various embodiments of the present invention have been described above, the foregoing description is intended to be illustrative, non-exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is selected to best explain the principles of the embodiments, their practical applications, or technological improvements in the marketplace, or to enable others skilled in the art to understand the embodiments disclosed herein. The scope of the present invention is defined by the appended claims.
Claims
1. A method for implementing a customized launch of a machine learning model, comprising: Obtain user-uploaded custom operators that can generate models; Obtain the code content of the customized online method for the customized operator to produce the machine learning model uploaded by the user; Running the custom operator to generate a machine learning model, and saving the generated machine learning model and the code content of the custom launch method into a model file; The machine learning model is put online based on the code content of the customized online method in the model file.
2. The method according to claim 1, wherein The code content of the custom operator at least includes model information about the machine learning model. The model information of the machine learning model includes at least: the name of the machine learning model, the storage path of the machine learning model and the name of the customized online method.
3. The method according to claim 1, wherein The code content of the custom operator includes the name of the custom online method; Saving the generated machine learning model and the code content of the customized online method to a model file includes: Based on the name of the custom online method, searching for code content of the custom online method; The generated machine learning model and the found code content of the customized online method are saved in the model file in the target storage format.
4. The method according to claim 3, wherein: The target storage format is a format that includes an environment list node on which the machine learning model depends during runtime, a first storage location node of the machine learning model, a second storage location node of the code content of the custom online method, and an executable file node.
5. The method according to claim 4, wherein The model file includes: various environments that the machine learning model depends on when running, the machine learning model stored in the first storage location, the code content of the customized online method stored in the second storage location, and the executable file displayed based on the executable file node. The executable file at least includes an operation command for calling the customized online mode.
6. The method according to claim 1, wherein Putting the machine learning model online based on the customized online method in the model file includes: Provides a configuration interface for launching machine learning models; Packaging the machine learning model according to the configuration information input through the configuration interface; Searching for the customized online method from the model file; Based on the customized online method, the packaged machine learning model is deployed to complete the online launch of the machine learning model.
7. The method according to claim 6, wherein: The searching the customized online method from the model file includes: Searching for an operation command for calling the custom online mode from the model file; Based on the operation command, obtain the code content of the customized online method; Run the code content of the custom online method to obtain the custom online method.
8. The method according to claim 6, wherein: The configuration information involves at least one of the following items: a configuration item for selecting the custom operator, a configuration item for selecting the machine learning model, and a configuration item for resources required when putting the machine learning model online.
9. The method according to claim 2, wherein: The code content of the custom operator is written based on at least one of a programming language and a scripting language; and The code content of the customized online mode is written based on at least one of the programming language and the scripting language.
10. The method according to claim 9, wherein: The scripting language includes at least one of a custom scripting language and a mainstream scripting language.
11. The method according to claim 1, wherein The code content of the customized online method also includes content related to operation commands for preprocessing the predicted data.
12. The method according to claim 1, wherein The step of obtaining the user-uploaded custom operator capable of generating a model includes: According to the operation of editing the custom operator, an editing interface is provided; Obtaining code content input through the editing interface, wherein the code content includes operation commands for performing data preprocessing on the input training data, operation commands for performing feature engineering on the training data after the data preprocessing, operation commands for performing model training based on the result of the feature engineering, and model information of the machine learning model; Encapsulate the code content to obtain the custom operator.
13. The method according to claim 1, wherein The code content of obtaining the customized online method of the customized operator output machine learning model uploaded by the user includes: Provide an editing interface based on the operation of editing the customized online method; Obtain code content input through the editing interface, wherein the code content includes operation commands for performing data preprocessing on the input prediction data, and an implementation function for a customized online method of the machine learning model.
14. The method according to claim 1, wherein After the machine learning model is launched online based on the customized launch method, the method further includes: Check the online status of the machine learning model in the Application Management Center.
15. A device for implementing customized online implementation of a machine learning model, comprising: The first acquisition module is used to obtain the custom operators uploaded by users that can produce models; The second acquisition module acquires the code content of the customized online method for the customized operator to generate the machine learning model uploaded by the user; A running module, used to run the custom operator to generate a machine learning model; A saving module, used to save the generated machine learning model and the code content of the customized online method into a model file; as well as, An online module is used to bring the machine learning model online based on the code content of the customized online method in the model file.
16. The device according to claim 15, wherein The code content of the custom operator at least includes model information about the machine learning model. The model information of the machine learning model includes at least: the name of the machine learning model, the storage path of the machine learning model and the name of the customized online method.
17. The device according to claim 15, wherein The code content of the custom operator includes the name of the custom online method; the saving module is specifically used to: Based on the name of the custom online method, searching for code content of the custom online method; The generated machine learning model and the found code content of the customized online method are saved in the model file in the target storage format.
18. The device according to claim 17, wherein The target storage format is a format that includes an environment list node on which the machine learning model depends during runtime, a first storage location node of the machine learning model, a second storage location node of the code content of the custom online method, and an executable file node.
19. The device according to claim 18, wherein The model file also includes: various environments that the machine learning model depends on when running, the machine learning model stored in the first storage location, the code content of the customized online method stored in the second storage location, and the executable file displayed based on the executable file node. The executable file at least includes an operation command for calling the customized online mode.
20. The apparatus according to claim 15, wherein The online module is specifically used for: Provides a configuration interface for launching machine learning models; Packaging the machine learning model according to the configuration information input through the configuration interface; Searching for the customized online method from the model file; Based on the customized online method, the packaged machine learning model is deployed to complete the online launch of the machine learning model.
21. The device according to claim 20, wherein The online module is specifically used for: Searching for an operation command for calling the custom online mode from the model file; Based on the operation command, obtain the code content of the customized online method; Run the code content of the custom online method to obtain the custom online method.
22. The device according to claim 20, wherein The configuration information involves at least one of the following items: a configuration item for selecting the custom operator, a configuration item for selecting the machine learning model, and a configuration item for resources required when putting the machine learning model online.
23. The apparatus according to claim 16, wherein The code content of the custom operator is written based on at least one of a programming language and a scripting language; and The code content of the customized online mode is written based on at least one of the programming language and the scripting language.
24. The device according to claim 23, wherein The scripting language includes at least one of a custom scripting language and a mainstream scripting language.
25. The apparatus according to claim 15, wherein The code content of the customized online method also includes content related to operation commands for preprocessing the predicted data.
26. The apparatus according to claim 15, wherein The first acquisition module is specifically configured to: According to the operation of editing the custom operator, an editing interface is provided; Obtaining code content input through the editing interface, wherein the code content includes operation commands for performing data preprocessing on the input training data, operation commands for performing feature engineering on the training data after the data preprocessing, operation commands for performing model training based on the result of the feature engineering, and model information of the machine learning model; Encapsulate the code content to obtain the custom operator.
27. The apparatus according to claim 15, wherein The second acquisition module is specifically used for: Provide an editing interface based on the operation of editing the customized online method; Obtain code content input through the editing interface, wherein the code content includes operation commands for performing data preprocessing on the input prediction data, and an implementation function for a customized online method of the machine learning model.
28. The apparatus according to claim 15, wherein The online module is also used for: Check the online status of the machine learning model in the Application Management Center.
29. An apparatus comprising at least one computing device and at least one storage device, wherein: The at least one storage device is configured to store instructions for controlling the at least one computing device to execute the method according to any one of claims 1 to 14.
30. A computer-readable storage medium, wherein: A computer program is stored thereon, which implements the method according to any one of claims 1 to 14 when executed by a processor.
Citation Information
Patent Citations
Method, device and equipment for executing automatic machine learning process
CN111611240A
Universal model management method and device supporting multiple machine learning frameworks
CN111813814A