Machine learning model management method and device, management platform, and storage medium

By automating the import and deployment of machine learning models, the complexity of adding and updating models is solved, data synchronization and sharing are achieved, and the workload of developers is reduced.

CN115293365BActive Publication Date: 2026-03-17PURPLE MOUNTAIN LAB
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-23
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

In existing technologies, adding and updating machine learning models is complex, error-prone, and makes it difficult to synchronize and share data across different cluster servers.

Method used

The system receives and verifies compressed files via the model import page, stores configuration description information in the database, creates a model file directory, and generates enable configuration items via the model list page, automatically deploying the target model and achieving automated model management and data synchronization.

Benefits of technology

It simplifies the process of adding and updating machine learning models, reduces the workload for developers, and enables data synchronization and sharing across different cluster servers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115293365B_ABST
    Figure CN115293365B_ABST
Patent Text Reader

Abstract

The application discloses a management method and device of a machine learning model, a management platform and a storage medium. A file compression package of a target model is received through a model import page, and configuration description information is stored in a database after it is determined that decompressed content passes verification; a model file directory is established under an identification directory of a TensorFlow service according to a file storage identifier returned by the database for the target model, and a decompressed folder is stored in the model file directory; an enabling instruction is received through a model list page, configuration description information is acquired from the database, and an enabling configuration item is generated; and the enabling configuration item is added to put the target model online in the model management platform. The technical scheme of the application solves the problems of complex modification operation, non-visualization, and non-synchronization and sharing of data caused by adding or updating a machine learning model, realizes automatic import and online operation of the machine learning model, and reduces the work difficulty of a developer.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method, apparatus, management platform, and storage medium for managing machine learning models. Background Technology

[0002] With the rapid development of artificial intelligence technology, modeling and analyzing business data through machine learning and deep learning models has become a crucial requirement across various industries. TensorFlow, an open-source end-to-end machine learning platform provided by Google, boasts a comprehensive and healthy ecosystem and rich resource libraries, helping developers easily build machine learning-powered applications. The Kubernetes platform allows the creation of multiple container instances of an application. Through its built-in load balancing strategies, it achieves load-balanced access to this group of applications, while the platform cluster ensures application availability even when some machines fail. Kubernetes supports persistent volume storage and persistent volume declarations, providing mounting capabilities for application containers to achieve persistent storage and synchronized data sharing across cluster nodes.

[0003] In the process of developing this invention, the inventors discovered the following drawbacks in the existing technology: When adding a new machine learning model, it is necessary to manually copy the solidified file of the new model to a path recognizable by the service, modify the model configuration file, and then restart the service before the newly added model can be started. Adding and modifying models is complex and prone to errors. If the business scenario requires frequent model updates, this will significantly increase the workload of staff and make it difficult to synchronize and share data between containers on different cluster servers. Summary of the Invention

[0004] This invention provides a method, apparatus, management platform, and storage medium for managing machine learning models, enabling automated online / offline and deletion operations of machine learning models, thereby reducing the workload for developers.

[0005] According to one aspect of the present invention, a method for managing TensorFlow models is provided, executed by a model management platform, comprising:

[0006] The target model's compressed file package is received through the model import page, and after verifying that the decompressed contents of the compressed file package are valid, the configuration description information of the target model is stored in the database.

[0007] Based on the file storage identifier returned by the database for the target model, a model file directory is created in the identification directory of the TensorFlow service, and the decompressed folder corresponding to the file archive is stored in the model file directory.

[0008] The system receives the activation command for the target model through the model list page, retrieves the configuration description information of the target model from the database, and generates the activation configuration item for the target model based on the configuration description information; the model list displayed on the model list page matches the models stored in the database.

[0009] Add an enable configuration item for the target model to the model configuration file of the TensorFlow service to deploy the target model in the model management platform.

[0010] According to another aspect of the present invention, a TensorFlow model management apparatus is provided, comprising:

[0011] The configuration description information storage module is used to receive the target model's compressed file package through the model import page, and after verifying that the decompressed contents of the compressed file package have passed the verification, store the target model's configuration description information in the database;

[0012] The decompression folder storage module is used to create a model file directory in the identification directory of the TensorFlow service based on the file storage identifier returned by the database for the target model, and store the decompression folder corresponding to the file archive in the model file directory;

[0013] The configuration item generation module is used to receive the activation command for the target model through the model list page, retrieve the configuration description information of the target model from the database, and generate the activation configuration items for the target model based on the configuration description information; the model list displayed on the model list page matches the models stored in the database.

[0014] The Enable Configuration Items module is used to add enable configuration items for the target model in the model configuration file of the TensorFlow service, so that the target model can be launched in the model management platform.

[0015] According to another aspect of the present invention, a model management platform is provided, wherein the model management platform includes a Kubernetes cluster, and multiple Kubernetes nodes in the Kubernetes cluster respectively deploy TensorFlow service containers; each TensorFlow service container has a preset refresh time; each TensorFlow service container and each model maintenance service container respectively mount a pre-created shared storage volume; wherein each TensorFlow service container is used to execute the TensorFlow model management method described in any embodiment of the present invention.

[0016] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the TensorFlow model management method according to any embodiment of the present invention.

[0017] The technical solution of this invention receives the compressed file package of the target model through the model import page, and after confirming that the decompressed content passes verification, stores the configuration description information in the database; based on the file storage identifier returned by the database for the target model, a model file directory is created under the identification directory of the TensorFlow service, and the decompressed folder is stored in the model file directory; an activation command is received through the model list page, the configuration description information is obtained from the database, and an activation configuration item is generated; the activation configuration item is added to launch the target model in the model management platform. This invention solves the problems of complex modification operations, lack of visualization, and inability to synchronize and share data caused by adding or updating machine learning models. It achieves automated import and deployment of machine learning models, reduces the workload of developers, and enables data synchronization and sharing across different cluster servers.

[0018] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1a This is a flowchart of a TensorFlow model management method provided in Embodiment 1 of the present invention;

[0021] Figure 1b This is a schematic diagram of the structure for enabling the target model in the method provided in Embodiment 1 of the present invention;

[0022] Figure 2a This is a flowchart of another TensorFlow model management method provided in Embodiment 2 of the present invention;

[0023] Figure 2b This is a schematic diagram of the structure for deleting the target model in the method provided in Embodiment 2 of the present invention;

[0024] Figure 3 This is a schematic diagram of the structure of a TensorFlow model management device according to Embodiment 3 of the present invention;

[0025] Figure 4 This is a schematic diagram of the structure of the management platform for implementing the TensorFlow model management method of this invention. Detailed Implementation

[0026] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0027] It should be noted that the terms "target," "current," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0028] Example 1

[0029] Figure 1a The flowchart of a TensorFlow model management method provided in Embodiment 1 of the present invention is applicable to the situation of updating or adding machine learning models. The method can be executed by a TensorFlow model management device, which can be implemented in hardware and / or software.

[0030] Correspondingly, such as Figure 1a As shown, the method includes:

[0031] S110. Receive the target model's compressed file package through the model import page, and after verifying that the decompressed contents of the compressed file package have passed the verification, store the target model's configuration description information in the database.

[0032] The model import page can be a page on the model management platform where models can be imported. The target model can be a model to be added or updated on the model management platform. The configuration description information can describe the basic configuration information of the target model; specifically, the configuration description information can include the model's unique identifier and model type. The database can be a MySQL database.

[0033] Understandably, the model management platform imports the compressed file package associated with the target model trained offline by the algorithm engineer through the model import page. After the business service of the model management platform completes the basic verification of the decompressed contents of the imported compressed file package, it parses the agreed model configuration information file in the model package, extracts the configuration description information, and stores the configuration description information in the MySQL database.

[0034] Specifically, the preparation of the model management platform deployment environment includes: preparing a Kubernetes cluster environment, installing the nfs-utils tool, creating an NFS format PV (Persistent Volume), setting the access model to ReadWriteMany so that it can be mounted by multiple nodes, and creating the corresponding PVC (Persistent Volume Claim).

[0035] Considering the load balancing and high availability performance of the model management platform, Kubernetes was chosen as the deployment platform, with TensorFlow service containers deployed on multiple nodes. To ensure persistent storage of container data and data sharing among different containers, Kubernetes-supported PV and PVC storage resource objects were selected. Storage PVs were created with a ReadWriteMany access mode, allowing multiple nodes and service containers to mount them, and corresponding PVCs were also created.

[0036] Furthermore, based on the multi-node deployment of TensorFlow service containers on Kubernetes, the refresh time is set to 30 seconds by using "--model_config_file_poll_wait_seconds=30". All TensorFlow service containers on all nodes will mount the configured model-recognizable directory, which contains the configuration file models.config. For example, the directory path can be / models / . The newly created PVC (named PVC_NAME) will be selected for mounting. The model configuration file and configuration description information record file models.config in all TensorFlow service containers will be persistently stored and data will be synchronized and shared.

[0037] The configuration description information record file can be an information record file consisting of basic configuration information describing the target model, while the model configuration file can be an information file describing the configuration of the target model.

[0038] By selecting PVC_NAME to mount on the Kubernetes multi-node deployment management platform, the synchronous sharing of two types of data, model configuration files and configuration description information records file models.config, can be achieved among the TensorFlow service containers.

[0039] In addition, the TensorFlow service container can be used to import, enable, and disable models. A model maintenance service container can also be mounted on each Kubernetes node. Specifically, the model maintenance service container can organize and manage the models in the database.

[0040] Optionally, after verifying that the decompressed contents of the compressed file package pass the verification, the configuration description information of the target model is stored in the database, including: decompressing the compressed file package to obtain a decompressed folder corresponding to the compressed file package; parsing the directory structure of the decompressed folder and reading the configuration description information record file in the decompressed folder; if it is determined that the directory structure meets the preset structure requirements and the configuration description information record file contains the attribute values ​​of the model's essential attributes, then the decompressed contents of the compressed file package are determined to have passed the verification; the configuration description information of the target model recorded in the configuration description information record file is stored in the database.

[0041] In this embodiment, the preset structural requirements can be a directory preset structure on the model management platform. Specifically, the preset structural requirements can include a model file directory, and corresponding subdirectories exist under the model file directory. If the current directory structure does not match the preset structural requirements, the verification fails. If the current directory structure matches the preset structural requirements, it is necessary to further determine whether the configuration description information record file contains the attribute values ​​of the model's required attributes. If so, the verification passes; otherwise, the verification fails.

[0042] Among them, the attribute values ​​of the essential attributes of the model include parameters such as the model type and unique identifier.

[0043] Understandably, the model management platform first needs to decompress the compressed file package to obtain the decompressed folder. Further, by parsing the directory structure of the decompressed files and obtaining the configuration description information record file, it can be determined how many levels of directory structure it consists of.

[0044] Accordingly, the system checks whether the directory structure meets the preset requirements. If not, it directly reports a verification failure. If it does meet the requirements, the decompressed contents of the compressed file are deemed to have passed verification. Furthermore, the model management platform can store the configuration description information of the target model recorded in the configuration description information log file into the database, that is, store parameters such as the model type and unique identifier into the database.

[0045] S120. Based on the file storage identifier returned by the database for the target model, create a model file directory under the identification directory of the TensorFlow service, and store the decompressed folder corresponding to the file archive in the model file directory.

[0046] The file storage identifier can be an identifier sent by the database to the model management platform when the target model is stored in the database. The file storage identifier corresponding to each target model stored in the database is unique, and the model management platform can determine the relevant target model based on the file storage identifier.

[0047] Specifically, the model file directory can be a list directory that allows for file retrieval. Specifically, the model file directory is located on the model management platform and can store corresponding unzipped folders within the relevant model file directory.

[0048] Optionally, based on the file storage identifier returned by the database for the target model, a model file directory is created in the identification directory of the TensorFlow service, including: creating a new model file directory in the identification directory of the TensorFlow service with the file storage identifier as the directory name and the type of the target model as the subdirectory.

[0049] The directory name folder can be a folder whose files are named after the directory name. A subdirectory can be a subdirectory that exists at the next level under the model file directory. In other words, a model file directory has a corresponding subdirectory, and a directory name folder can be created under the model file directory, with the file storage identifier used as the folder name.

[0050] Understandably, algorithm engineers train the target model based on the sampled data using the TensorFlow platform, and then package the model configuration file containing the model configuration information and the configuration description file according to a pre-defined configuration file format. Specifically, the trained model is saved as a pb file (i.e., saved_model.pb) and a variables folder, while the target model package is located in the model file directory, containing a config.json file with the model configuration information.

[0051] Furthermore, the operations team imports the target model package provided by the algorithm engineer into the system via the web page of the model management platform. Specifically, the target model's compressed file package is imported into the model management platform. The platform then decompresses the target model's compressed file package and verifies whether its directory structure meets the preset structure requirements and whether the required attributes in the configuration description information are not empty. If these requirements are met, the decompressed contents of the compressed file package have passed verification.

[0052] Accordingly, the model management platform extracts the basic information and configuration information of the target model and stores them in the database. It then uses the auto-incrementing primary key of the database table to generate a unique identifier KEY for the model record. In the recognizable directory configured by the TensorFlow service, a new folder named KEY is created, with the target model type TYPE as the subdirectory, to store the target model files. For example, if the configured TensorFlow model file directory is models, the directory for storing model files is / models / KEY / TYPE.

[0053] The advantage of this setup is that by creating a new folder named after the file storage identifier and a subfolder named after the target model type within the TensorFlow service's identification directory, the relevant model file directories for the target model can be more clearly and explicitly constructed on the model management platform, allowing for more accurate and faster searching.

[0054] S130. Receive the activation command for the target model through the model list page, retrieve the configuration description information of the target model from the database, and generate the activation configuration item for the target model based on the configuration description information.

[0055] The model list displayed on the model list page matches the models stored in the database.

[0056] The model list page is a page on the model management platform that displays the target model. The enable command is a command that allows the use of the target model. The enable command is a command used on the model management platform to enable the model. The enable configuration items are configuration descriptions based on database feedback, representing the content that needs to be configured for the target model.

[0057] Optionally, receiving an activation command for the target model through the model list page, retrieving the configuration description information of the target model from the database, and generating an activation configuration item for the target model based on the configuration description information includes: receiving an activation command for the target model through the model list page, and retrieving the configuration description information of the target model from the database based on the file storage identifier of the target model included in the activation command; extracting the type of the target model from the configuration description information, and constructing a unique name and storage path corresponding to the target model based on the file storage identifier and type of the target model; and filling the unique name and storage path into a preset activation configuration item generation template to generate the activation configuration item for the target model.

[0058] The enabled configuration item generation template can be a template used to configure enabled configuration items.

[0059] For example, on the model management platform, you can view the basic information and detailed configuration description of the target model, such as the number of training sessions and standardized parameters. These values ​​help you understand the training scenario of the model and are helpful in analyzing the model's strengths and weaknesses.

[0060] The model management platform can send a request to the TensorFlow service to deploy the model. The model management platform can automatically write the configuration description information of the target model to the TensorFlow service's configuration description information log file models.config.

[0061] Next, the system receives the activation command for the target model through the model list page. Based on the target model's file storage identifier (KEY) included in the activation command, it retrieves the target model's configuration description information from the database. From the configuration description information, it extracts the target model's type (TYPE). Based on the target model's file storage identifier and type, it constructs a unique name and storage path corresponding to the target model. The unique name and storage path are then filled into a preset activation configuration item generation template to generate the target model's activation configuration item. Specifically, assuming the preset activation configuration item generation template is: config:{name:,base_path:,model_platform:"TensorFlow"}, the target model's unique name in models.config can be defined as "model type_KEY", i.e., TYPE_KEY. Therefore, the required format for the activation configuration item in models.config is: config:{name:"TYPE_KEY",base_path:" / models / KEY / TYPE",model_platform:"TensorFlow"}.

[0062] The advantage of this setup is that by extracting the target model type from the configuration description information and constructing a unique name and storage path corresponding to the target model based on its file storage identifier and type, an enable configuration item for the target model is generated. This allows for the generation of a corresponding enable configuration item for each target model, enabling more accurate deployment of target models on the model management platform. Determining the unique name and storage path based on the target model's type and file storage identifier reduces the workload for staff.

[0063] S140. In the model configuration file of the TensorFlow service, add the target model enable configuration item to launch the target model in the model management platform.

[0064] The model configuration file can be an information file describing the configuration of the target model. The model management platform can be a platform capable of managing multiple target models; specifically, it can manage the descriptive management information of the target models, model configuration files, and other information.

[0065] Continuing from the previous example, in the model configuration file of the TensorFlow service, add the enable configuration item for the target model, that is, add config:{name:"TYPE_KEY",base_path:" / models / KEY / TYPE",model_platform:"TensorFlow"} to the model management platform. This will enable the target model to be launched on the model management platform.

[0066] Additionally, you can access the running target model on the model management platform. The TensorFlow service comes with RESTful and gRPC interface services, which can be used to access the running target model on the model management platform via the RESTful API and gRPC interfaces.

[0067] Both methods require specifying the model's name, input, and output first. The model name can be viewed on the model list page. After determining the model name, you can obtain the corresponding target model's input and output through TensorFlow's own metadata viewing interface URL: http: / / ${url}:${port} / v1 / models / ${MODEL_NAME} / metadata. Assemble the input parameters according to the input format, access the model interface through the RESTful API or gRPC communication protocol, obtain the data returned by the target model, and then parse the returned data according to the output format.

[0068] like Figure 1bThe diagram illustrates the structure for enabling a target model. The system receives the activation command for the target model through the model list page (web page) and queries the database interface for the target model's configuration description information via the model activation interface. The database then returns the model configuration information to the model management platform. Based on the configuration description information, the model management platform generates the target model's activation configuration items, which may specifically include obtaining the model name and storage path, and configures them in the configuration description information record file models.config. Furthermore, the target model's activation configuration items are added and updated in the TensorFlow service's model configuration file to deploy the target model on the model management platform.

[0069] Optionally, after storing the configuration description information of the target model in the database, the method further includes: receiving a detailed viewing instruction for the target model through the model list page, and retrieving the configuration description information of the target model from the database according to the file storage identifier of the target model included in the detailed viewing instruction; and feeding back the configuration description information of the target model to the model list page for user display.

[0070] The "View Details" command can be a command describing how to view detailed information about the current model. Specifically, this can be done by sending a "View Details" command to the model management platform, which includes a file storage identifier. The system can then locate the file in the relevant database using this identifier and provide the results to the user.

[0071] On the model management platform, users can view detailed configuration information about the target model, such as the number of training iterations and standardized parameters. By receiving the relevant parameter values ​​of the target model, users can gain a more accurate understanding of the model training scenario, which helps in analyzing the model's performance.

[0072] The technical solution of this invention receives the compressed file package of the target model through the model import page, and after confirming that the decompressed content passes verification, stores the configuration description information in the database; based on the file storage identifier returned by the database for the target model, a model file directory is created under the identification directory of the TensorFlow service, and the decompressed folder is stored in the model file directory; an activation command is received through the model list page, the configuration description information is obtained from the database, and an activation configuration item is generated; the activation configuration item is added to launch the target model in the model management platform. This invention solves the problems of complex modification operations, lack of visualization, and inability to synchronize and share data caused by adding or updating machine learning models. It achieves automated import and deployment of machine learning models, reduces the workload of developers, and enables data synchronization and sharing across different cluster servers.

[0073] Example 2

[0074] Figure 2a This is a flowchart of another TensorFlow model management method provided in Embodiment 2 of the present invention. This embodiment is a refinement based on the above embodiments. In this embodiment, the operation of dynamically allocating the target reused resource to the target device driver when the allocation conditions of the target reused resource are met is further refined. Figure 2a As shown, the method includes:

[0075] S210. Receive the target model's compressed file package through the model import page, and after confirming that the decompressed contents of the compressed file package have passed verification, store the target model's configuration description information into the database.

[0076] S220. Based on the file storage identifier returned by the database for the target model, create a model file directory under the identification directory of the TensorFlow service, and store the decompressed folder corresponding to the file archive in the model file directory.

[0077] S230. Receive the activation command for the target model through the model list page, retrieve the configuration description information of the target model from the database, and generate the activation configuration item for the target model based on the configuration description information.

[0078] S240. In the model configuration file of the TensorFlow service, add the target model enable configuration item to launch the target model in the model management platform.

[0079] S250. Receive a deactivation command for the target model through the model list page, and obtain the configuration description information of the target model from the database according to the file storage identifier of the target model included in the deactivation command.

[0080] The deactivation command can be a command to deactivate a model on the model management platform.

[0081] S260. Extract the type of the target model from the configuration description information, and construct a unique name corresponding to the target model based on the file storage identifier and type of the target model.

[0082] S270. In the model configuration file of the TensorFlow service, delete the enable configuration item that matches the unique name to take the target model offline in the model management platform.

[0083] For example, on a model management platform, upon receiving a deactivation command for a target model, the platform can obtain the target model's file storage identifier (KEY) and configuration description information. Furthermore, it can obtain the target model's type (TYPE) and construct a unique name (TYPE_KEY).

[0084] Correspondingly, a request can be sent to take the target model offline by the TensorFlow service. The model management platform will delete the enabled configuration item module with "TYPE_KEY" as the model name in the model configuration file models.config according to the agreed unique target model name, i.e., TYPE_KEY. After the TensorFlow service automatically refreshes, the target model with the name TYPE_KEY will be taken offline on the model management platform.

[0085] Optionally, after deleting the enabled configuration item matching the unique name in the model configuration file of the TensorFlow service, the method further includes: receiving a deletion instruction for the target model through the model list page, and obtaining the configuration description information of the target model from the database according to the file storage identifier of the target model included in the deactivation instruction; extracting the type of the target model from the configuration description information, and determining the model file directory of the target model under the identification directory of the TensorFlow service according to the file storage identifier and type of the target model; deleting the model file directory, and deleting the configuration description information of the target model from the database, so as to delete the target model in the model management platform.

[0086] The deletion command can be a command used to delete a model on the model management platform.

[0087] Understandably, a model can only be deleted from the model management platform when its status is disabled, allowing unnecessary models to be removed. Furthermore, on the model management platform, deleting the target model's related model file directory and also removing the relevant description and configuration information from the database are required to successfully delete the target model.

[0088] like Figure 2b The diagram illustrates the process of deleting a target model. The system receives a deletion command for the target model via the model list page (web page) and queries the database interface for the target model's configuration description information. The database then returns this configuration description information to the model management platform. Based on the configuration description information, the model management platform determines the model file directory under the TensorFlow service's identification directory; deletes the model file directory; and removes the target model's configuration description information from the database. Furthermore, after confirming the deletion of the target model's configuration description information, the system needs to delete the corresponding folder based on the model's storage path to remove the target model from the model management platform.

[0089] For example, on the model management platform, upon receiving a deletion command for a target model, the file storage identifier KEY and configuration description information of the target model can be obtained. Furthermore, the target model type TYPE can be obtained, determining the model file directory under the identification directory of the TensorFlow service, which is the directory named after the KEY.

[0090] Correspondingly, a request can be sent to the TensorFlow service to delete the target model. The model management platform will delete the KEY directory based on the parent directory path, i.e., / models / KEY, and delete the record of the target model in the database to delete the target model.

[0091] The technical solution of this invention involves receiving a compressed file package of the target model through the model import page, and storing the configuration description information in the database after verifying that the decompressed content has passed verification. Based on the file storage identifier returned by the database for the target model, a model file directory is created under the identification directory of the TensorFlow service, and the decompressed folder is stored in the model file directory. An activation command is received through the model list page, and configuration description information is retrieved from the database to generate an activation configuration item. An activation configuration item is added to deploy the target model on the model management platform. A deactivation command for the target model is received through the model list page, and configuration description information of the target model is retrieved from the database based on the file storage identifier of the target model included in the deactivation command. The type of the target model is extracted from the configuration description information, and a unique name corresponding to the target model is constructed based on the file storage identifier and type of the target model. In the model configuration file of the TensorFlow service, the activation configuration item matching the unique name is deleted to deactivate the target model on the model management platform. This achieves automated deactivation and deletion of machine learning models, thereby simplifying model operation steps and reducing the workload of developers.

[0092] Example 3

[0093] Figure 3 This is a schematic diagram of a TensorFlow model management device provided in Embodiment 3 of the present invention. The TensorFlow model management device provided in this embodiment can be implemented by software and / or hardware, and can be configured in a server or terminal device to implement a TensorFlow model management method according to an embodiment of the present invention. Figure 3 As shown, the device includes: a configuration description information storage module 310, an unzipped folder storage module 320, an enabled configuration item generation module 330, and an enabled configuration item addition module 340.

[0094] The configuration description information storage module 310 is used to receive the file package of the target model through the model import page, and after confirming that the decompressed contents of the file package have passed the verification, store the configuration description information of the target model in the database.

[0095] The decompression folder storage module 320 is used to create a model file directory in the identification directory of the TensorFlow service according to the file storage identifier returned by the database for the target model, and store the decompression folder corresponding to the file compressed package in the model file directory;

[0096] The configuration item generation module 330 is used to receive the activation command for the target model through the model list page, obtain the configuration description information of the target model from the database, and generate the activation configuration items of the target model based on the configuration description information; the model list displayed on the model list page matches the models stored in the database.

[0097] The Enable Configuration Items module 340 is added to the TensorFlow service's model configuration file to add enable configuration items for the target model, so that the target model can be deployed in the model management platform.

[0098] The technical solution of this invention receives the compressed file package of the target model through the model import page, and after confirming that the decompressed content passes verification, stores the configuration description information in the database; based on the file storage identifier returned by the database for the target model, a model file directory is created under the identification directory of the TensorFlow service, and the decompressed folder is stored in the model file directory; an activation command is received through the model list page, the configuration description information is obtained from the database, and an activation configuration item is generated; the activation configuration item is added to launch the target model in the model management platform. This invention solves the problems of complex modification operations, lack of visualization, and inability to synchronize and share data caused by adding or updating machine learning models. It achieves automated import and deployment of machine learning models, reduces the workload of developers, and enables data synchronization and sharing across different cluster servers.

[0099] Optionally, the configuration description information storage module 310 is specifically used for: decompressing the file compressed package to obtain a decompressed folder corresponding to the file compressed package; parsing the directory structure of the decompressed folder and reading the configuration description information record file in the decompressed folder; if it is determined that the directory structure meets the preset structure requirements and the configuration description information record file contains the attribute values ​​of the model's essential attributes, then it is determined that the decompressed content of the file compressed package has passed the verification; and storing the configuration description information of the target model recorded in the configuration description information record file into the database.

[0100] Optionally, the decompression folder storage module 320 is specifically used to: create a new model file directory under the identification directory of the TensorFlow service, with the file storage identifier as the directory name and the type of the target model as the subdirectory.

[0101] Optionally, the configuration item generation module 330 is specifically configured to: receive an activation instruction for a target model through the model list page, and obtain the configuration description information of the target model from the database according to the file storage identifier of the target model included in the activation instruction; extract the type of the target model from the configuration description information, and construct a unique name and storage path corresponding to the target model according to the file storage identifier and type of the target model; and fill the unique name and storage path into a preset activation configuration item generation template to generate the activation configuration item for the target model.

[0102] Optionally, it also includes a configuration description information feedback module, specifically used for: after storing the configuration description information of the target model in the database, receiving a detailed viewing instruction for the target model through the model list page, and retrieving the configuration description information of the target model from the database according to the file storage identifier of the target model included in the detailed viewing instruction; and feeding back the configuration description information of the target model to the model list page for user display.

[0103] Optionally, it also includes enabling the configuration item removal module. This involves adding the enable configuration item for the target model to the model configuration file in the TensorFlow service, specifically including:

[0104] The configuration description information acquisition unit is used to receive a deactivation instruction for the target model through the model list page, and to obtain the configuration description information of the target model from the database according to the file storage identifier of the target model included in the deactivation instruction;

[0105] A unique name construction unit is used to extract the type of the target model from the configuration description information, and construct a unique name corresponding to the target model based on the file storage identifier and type of the target model;

[0106] The Enable Configuration Item Deletion Unit is used to delete the Enable configuration item that matches the unique name in the model configuration file of the TensorFlow service, so as to take the target model offline in the model management platform.

[0107] Optionally, it also includes a configuration description information deletion unit. After deleting the enabled configuration item matching the unique name in the model configuration file of the TensorFlow service, it is specifically used to: receive a deletion instruction for the target model through the model list page, and obtain the configuration description information of the target model from the database according to the file storage identifier of the target model included in the deletion instruction; extract the type of the target model from the configuration description information, and determine the model file directory of the target model under the identification directory of the TensorFlow service according to the file storage identifier and type of the target model; delete the model file directory, and delete the configuration description information of the target model in the database, so as to delete the target model in the model management platform.

[0108] The TensorFlow model management device provided in this embodiment of the invention can execute the TensorFlow model management method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0109] Example 4

[0110] Figure 4 This is a schematic diagram of the structure of a model management platform provided in Embodiment 4 of the present invention. The model management platform 410 includes a Kubernetes cluster 420, and multiple Kubernetes nodes 430 in the Kubernetes cluster 420 respectively deploy TensorFlow service containers 440; each TensorFlow service container 440 has a preset refresh time; each TensorFlow service container 440 is mounted with a pre-created shared storage volume;

[0111] Each TensorFlow service container 440 is used to execute the TensorFlow model management method described in any one of the present invention. The method includes: receiving a compressed file package of the target model through the model import page, and storing the configuration description information of the target model in the database after verifying that the decompressed content of the compressed file package has passed verification; creating a model file directory in the identification directory of the TensorFlow service according to the file storage identifier returned by the database for the target model, and storing the decompressed folder corresponding to the compressed file package in the model file directory; receiving an enable command for the target model through the model list page, obtaining the configuration description information of the target model from the database, and generating an enable configuration item for the target model according to the configuration description information; matching the model list displayed on the model list page with the models stored in the database; and adding the enable configuration item for the target model to the model configuration file of the TensorFlow service to launch the target model on the model management platform.

[0112] In addition, distributed storage generally uses a distributed file management system like NFS. Specifically, pre-created NFS-formatted shared storage volumes can be mounted on each TensorFlow service container, but this is not a limitation.

[0113] Furthermore, model maintenance service containers (not shown in the diagram) can be deployed on multiple Kubernetes nodes 430 to organize and manage the models stored in the database. Correspondingly, these model maintenance service containers can also be mounted on shared storage volumes to further expand the functionality of the model management platform.

[0114] The technical solution of this invention receives the compressed file package of the target model through the model import page, and after confirming that the decompressed content passes verification, stores the configuration description information in the database; based on the file storage identifier returned by the database for the target model, a model file directory is created under the identification directory of the TensorFlow service, and the decompressed folder is stored in the model file directory; an activation command is received through the model list page, the configuration description information is obtained from the database, and an activation configuration item is generated; the activation configuration item is added to launch the target model in the model management platform. This invention solves the problems of complex modification operations, lack of visualization, and inability to synchronize and share data caused by adding or updating machine learning models. It automates the online / offline and deletion operations of machine learning models, reduces the workload of developers, and enables data synchronization and sharing across different cluster servers.

[0115] Example 5

[0116] Embodiment 5 of the present invention also provides a computer-readable storage medium, wherein the computer-readable instructions, when executed by a computer processor, are used to execute a TensorFlow model management method. The method includes: receiving a compressed file package of a target model through a model import page, and after verifying that the decompressed content of the compressed file package passes verification, storing the configuration description information of the target model in a database; establishing a model file directory in the identification directory of the TensorFlow service according to the file storage identifier returned by the database for the target model, and storing the decompressed folder corresponding to the compressed file package in the model file directory; receiving an enable instruction for the target model through a model list page, obtaining the configuration description information of the target model from the database, and generating an enable configuration item for the target model based on the configuration description information; matching the model list displayed on the model list page with the models stored in the database; and adding the enable configuration item for the target model to the model configuration file of the TensorFlow service to launch the target model on the model management platform.

[0117] Of course, the computer-executable instructions provided in the embodiments of the present invention, which include a computer-readable storage medium, are not limited to the method operations described above, but can also perform related operations in the TensorFlow model management method provided in any embodiment of the present invention.

[0118] Based on the above description of the implementation methods, those skilled in the art can clearly understand that the present invention can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0119] It is worth noting that in the above embodiments of the TensorFlow model management device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of the present invention.

[0120] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A management method of a TensorFlow model, executed by a model management platform, characterized in that, The application relates to a model management method and device. A file compression package of a target model is received through a model import page, and configuration description information of the target model is stored in a database after it is determined that decompression content of the file compression package passes verification; A model file directory is established under an identification directory of a TensorFlow service according to a file storage identifier returned by the database for the target model, and a decompression folder corresponding to the file compression package is stored in the model file directory; An enabling instruction for the target model is received through a model list page, configuration description information of the target model is obtained from the database, and an enabling configuration item of the target model is generated according to the configuration description information; the model list displayed in the model list page matches the models stored in the database; An enabling configuration item of the target model is added in a model configuration file of the TensorFlow service, so that the target model is put online in a model management platform; The method comprises the following steps: The enabling instruction for the target model is received through the model list page, and the configuration description information of the target model is obtained from the database according to the file storage identifier of the target model included in the enabling instruction; The type of the target model is extracted from the configuration description information, and a unique name and a storage path corresponding to the target model are constructed according to the file storage identifier and the type of the target model; The unique name and the storage path are filled in a preset enabling configuration item generation template to generate the enabling configuration item of the target model.

2. The method of claim 1, wherein, After it is determined that the decompression content of the file compression package passes verification, the configuration description information of the target model is stored in the database, which comprises the following steps: The file compression package is decompressed to obtain a decompression folder corresponding to the file compression package; The directory structure of the decompression folder is parsed, and a configuration description information record file in the decompression folder is read; If it is determined that the directory structure meets preset structure requirements and the configuration description information record file contains attribute values of necessary attributes of the model, it is determined that the decompression content of the file compression package passes verification; The configuration description information of the target model recorded in the configuration description information record file is stored in the database.

3. The method of claim 1, wherein, The model file directory is established under the identification directory of the TensorFlow service according to the file storage identifier returned by the database for the target model, which comprises the following steps: A model file directory with a folder named with the file storage identifier and subdirectories of the type of the target model is newly created under the identification directory of the TensorFlow service.

4. The method of claim 1, wherein, After the configuration description information of the target model is stored in the database, the method further comprises the following steps: A detail viewing instruction for the target model is received through the model list page, and the configuration description information of the target model is obtained from the database according to the file storage identifier of the target model included in the detail viewing instruction; The configuration description information of the target model is fed back to the model list page for user display.

5. The method of claim 1, wherein, After adding the enable configuration item of the target model in the model configuration file of the TensorFlow service, the method further includes: Receiving, through the model list page, a disable instruction for the target model, and obtaining, from the database, configuration description information of the target model according to a file storage identifier of the target model included in the disable instruction; Extracting, in the configuration description information, a type of the target model, and constructing a unique name corresponding to the target model according to the file storage identifier and the type of the target model; In the model configuration file of the TensorFlow service, deleting the enable configuration item matched with the unique name to offline the target model in the model management platform.

6. The method of claim 5, wherein, After deleting the enable configuration item matched with the unique name in the model configuration file of the TensorFlow service, the method further includes: Receiving, through the model list page, a delete instruction for the target model, and obtaining, from the database, configuration description information of the target model according to a file storage identifier of the target model included in the delete instruction; Extracting, in the configuration description information, a type of the target model, and determining a model file directory of the target model under a recognition directory of the TensorFlow service according to the file storage identifier and the type of the target model; Deleting the model file directory and deleting, in the database, the configuration description information of the target model to delete the target model in the model management platform.

7. An apparatus for managing a TensorFlow model, the apparatus comprising: The method includes: A configuration description information storage module is configured to receive, through a model import page, a file compression package of a target model, and store configuration description information of the target model to a database after determining that decompression contents of the file compression package pass verification; A decompression folder storage module is configured to establish a model file directory under a recognition directory of the TensorFlow service according to a file storage identifier returned by the database for the target model, and store a decompression folder corresponding to the file compression package in the model file directory; An enable configuration item generation module is configured to receive, through a model list page, an enable instruction for the target model, obtain configuration description information of the target model from the database, and generate an enable configuration item of the target model according to the configuration description information; the model list displayed in the model list page matches the models stored in the database; An enable configuration item addition module is configured to add, in a model configuration file of the TensorFlow service, an enable configuration item of the target model to online the target model in the model management platform; The enable configuration item generation module is configured to receive, through the model list page, the enable instruction for the target model, and obtain the configuration description information of the target model from the database according to the file storage identifier of the target model included in the enable instruction; extract, in the configuration description information, the type of the target model, and construct a unique name and a storage path corresponding to the target model according to the file storage identifier and the type of the target model; fill the unique name and the storage path in a preset enable configuration item generation template to generate the enable configuration item of the target model.

8. A model management platform, characterized in that, The method includes: A Kubernetes cluster, a plurality of Kubernetes nodes in the Kubernetes cluster respectively deploying TensorFlow service containers; each TensorFlow service container having a preset refresh time; each TensorFlow service container respectively mounting a pre-created shared storage volume; Each TensorFlow service container is configured to execute the management method of the TensorFlow model according to any one of claims 1-6.

9. A computer readable storage medium, characterized in that, The computer readable storage medium stores computer instructions for causing the processor to implement the management method of the TensorFlow model according to any one of claims 1-6 when executed.

Citation Information

Patent Citations

  • A resource management system and method for in-depth learning

    CN109508238A

  • Method and system for uniformly managing AI models based on distributed file system

    CN110765077A