Application migration method and device, equipment, readable storage medium and program product

Create custom resources through custom controllers, and automate model file format conversion, application mirror environment adaptation and data migration, solving the inefficiency and business stability problems of inference applications during the migration process across heterogeneous resource pools, realizing an efficient and automated migration process.

CN120104289AActive Publication Date: 2025-06-06JINAN INSPUR DATA TECH CO LTD

Patent Information

Application Number
CN202510592757.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-09
Publication Date
2025-06-06
Estimated Expiration
2045-05-09

AI Technical Summary

Technical Problem

In the prior art, inference applications rely on manual operations during the migration process across heterogeneous resource pools, resulting in inefficiency, high cost, and prone to data loss and configuration errors, affecting business continuity and stability.

Method used

Create custom resources through a custom controller, including file conversion resources, image conversion resources and application migration resources, and automatically complete model file format conversion, application mirror environment adaptation and data migration, and realize efficient migration of inference applications between different environments.

Benefits of technology

It realizes automated migration of inference applications, reduces dependence on labor, improves migration efficiency, and ensures business continuity and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120104289A_ABST
    Figure CN120104289A_ABST
Patent Text Reader

Abstract

The invention discloses an application migration method and device, equipment, a readable storage medium and a program product, and relates to the technical field of artificial intelligence, and the application migration method comprises the steps that self-defined resources corresponding to reasoning applications are managed through a self-defined controller, so that automatic execution of a driving migration task is achieved. Specifically, on the basis of file conversion resources, an original model file is transformed; transforming an application mirror image based on the mirror image conversion resource; and migrating the reasoning application to a target resource pool corresponding to the target environment based on the application program migration resource. Namely, the migration process of the whole reasoning application is driven by a user-defined controller, and model transformation, mirror image adaptation, data migration and application deployment are automatically completed, so that efficient migration of the reasoning application among different environments is ensured. Therefore, the technical problem of cross-heterogeneous resource pool migration of the inference application can be solved, and the technical effects of getting rid of the dependence of cross-heterogeneous resource pool migration on manpower and guaranteeing the continuity and stability of services are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to an application migration method, device, equipment, readable storage medium, and program product. Background Art

[0002] As artificial intelligence (AI) and cloud-native technologies flourish, more and more AI reasoning applications are moving towards cloud-native deployment. This trend has significantly improved the operational efficiency, resource utilization, and management flexibility of AI reasoning applications. However, in the process of upgrading container resource pools, hardware replacement of computing nodes is often difficult to avoid. Different types of computing devices differ in architecture, computing power, and video memory, which makes migrating AI reasoning applications across heterogeneous (using different types of computing devices) container resource pools a complex and challenging task.

[0003] Currently, AI inference application migration across heterogeneous resource pools still relies on manual migration. This migration method requires operation and maintenance personnel to manually complete a series of tedious operations including application shutdown, data backup, redeployment in the new environment, and configuration parameters. The entire migration process not only consumes a lot of manpower and time costs, but is also extremely inefficient. In addition, during manual operations, it is very easy to cause errors such as data loss and application failure to start normally due to configuration errors due to negligence or operational errors. These problems seriously affect business continuity and stability.

[0004] In summary, how to solve the problem of migrating reasoning applications across heterogeneous resource pools is a technical problem that technical personnel in this field urgently need to solve. Summary of the invention

[0005] The present application provides an application migration method, apparatus, device, readable storage medium and program product to at least solve the problem of migration of reasoning applications across heterogeneous resource pools in the related art.

[0006] The present application provides an application migration method, including: using a custom controller to create custom resources corresponding to an inference application; the custom resources include file conversion resources, image conversion resources and application migration resources; using the file conversion resources to perform format conversion on the original model file of the inference application to obtain a target model file in an open file format; using the image conversion resources to perform environment conversion on the application image of the inference application to obtain a target application image adapted to a target environment; using the application migration resources to migrate the target model file, the target application image, the metadata of the inference application and the business data of the inference application to a target resource pool corresponding to the target environment.

[0007] The present application also provides an application migration device, including: a task management module, used to use a custom controller to create custom resources corresponding to the reasoning application; the custom resources include file conversion resources, image conversion resources and application migration resources; a model transformation module, used to use the file conversion resources to convert the format of the original model file of the reasoning application to obtain a target model file in an open file format; an image transformation module, used to use the image conversion resources to perform environment conversion on the application image of the reasoning application to obtain a target application image adapted to the target environment; an application migration module, used to use the application migration resources to migrate the target model file, the target application image, the metadata of the reasoning application and the business data of the reasoning application to the target resource pool corresponding to the target environment.

[0008] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned application migration methods when executing the computer program.

[0009] The present application also provides a computer-readable storage medium, in which a computer program is stored, wherein when the computer program is executed by a processor, the steps of any of the above-mentioned application migration methods are implemented.

[0010] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned application migration methods when executed by a processor.

[0011] In this application, the custom controller (K8s Operator) can implement lifecycle management, configuration management, upgrade management and other functions for specific applications or services through custom resource definitions (CustomResource Definitions, CRDs) and controllers. Specifically, the custom controller can monitor changes in custom resources and automatically adjust the status of related resources to meet expectations. For example, when a custom resource meets specific conditions, it automatically triggers the creation or update of other resources. The migration of reasoning applications mainly includes the migration of metadata, business data, model files, and application images. Before migrating the original model file, it needs to be transformed into an open file format; before applying the image, it needs to be transformed to match the target environment. Therefore, in this application, custom resources corresponding to the reasoning application can be created through a custom controller; custom resources include file conversion resources, image conversion resources, and application migration resources. Then, based on the file conversion resources, the format conversion of the original model file of the reasoning application can be realized to obtain the target model file in an open file format; based on the image conversion resources, the environment adaptation of the application image of the reasoning application can be realized to obtain the target application image adapted to the target environment; based on the application migration resources, the migration of the target model file, the target application image, the metadata of the reasoning application, and the business data of the reasoning application to the target resource pool corresponding to the target environment can be realized. In other words, the entire process can drive the tasks defined by CRD through a custom controller, and automatically complete model transformation, image adaptation, data migration and application deployment, thereby ensuring the efficient migration of reasoning applications between different environments. Therefore, this application can solve the technical problem of migration of reasoning applications across heterogeneous resource pools, get rid of the dependence on manual migration across heterogeneous resource pools, and ensure the continuity and stability of the business. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0013] Figure 1 This is a flowchart of an implementation method of an application migration method in an embodiment of the present application; Figure 2 This is a specific implementation flow chart of an application migration method in an embodiment of the present application; Figure 3 A schematic diagram of an application migration device in an embodiment of the present application; Figure 4 This is a schematic diagram of the structure of an electronic device in an embodiment of the present application; Figure 5 This is a schematic diagram of the specific structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION

[0014] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0015] It should be noted that, in the description of this application, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in this application are used to distinguish similar objects, and are not used to describe a specific order or sequence.

[0016] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0017] In this application, in order to realize the automatic migration of reasoning applications across heterogeneous resource pools, a custom controller is mainly used to drive related tools to perform related tasks.

[0018] Among them, the custom controller can be specifically K8s Operator. k8s-operator: A Kubernetes-based extension mechanism for automating the management and operation of complex applications and stateful services in Kubernetes clusters. Operator implements functions such as lifecycle management, configuration management, and upgrade management for specific applications or services through custom resource definitions (CRDs) and controllers. Kubernetes (K8s, using 8 to replace the 8 characters between the first letter K and the last letter s in Kubernetes, the corresponding abbreviation of Kubernetes) is an open source containerized orchestration tool for managing containerized applications on multiple hosts in a cloud platform with advantages such as high availability and elastic scaling.

[0019] For tasks driven by custom resources, you can refer to the supervision and management solutions of custom resources by custom controllers. The following is a brief description of the process of how custom controllers drive tasks: First, define custom resources: Use Kubernetes Resource Definition Language (YAML) or other related frameworks to define custom resources. For example, in Kubernetes, you can create custom resource types by defining CustomResourceDefinition (CRD) to clarify the resource architecture, field meanings, etc. For example, define a custom resource named "TaskResource" that contains fields such as task name, description, and execution parameters.

[0020] Then, create a custom resource instance: Create a specific resource instance based on the defined custom resource type. Taking Kubernetes as an example, you can create an instance by writing a YAML file and using the kubectlapply -f command, such as creating a specific task instance, specifying the task name as a data processing task, describing it as cleaning and analyzing a batch of data, and setting the corresponding execution parameters.

[0021] Writing controllers: Controllers are components used to monitor and manage custom resources. Taking Kubernetes as an example, controller frameworks (such as Kubebuilder or Operator SDK) can be used to write controller code. The controller will continuously monitor the status changes of custom resources. When a new task instance is created or the status of an existing task instance changes, the controller will perform corresponding operations according to the preset logic, such as starting a specific task container based on the parameters in the task instance.

[0022] Associate task execution components: Associate the controller with the actual task execution component. For example, in a containerized environment, the controller can call container orchestration tools (such as Docker and Kubernetes) to create and start containers containing task codes based on the task definition in the custom resources, so that the task can be executed in the container.

[0023] Finally, monitoring and feedback: During the task execution process, the status and execution results of the task are continuously monitored. By adding log output, status reporting and other functions in the task execution component, the running status of the task can be fed back to the controller, and the controller will update the status of the custom resource based on the feedback information to facilitate subsequent management and decision-making.

[0024] Please refer to Figure 1 , Figure 1This is an implementation flow chart of an application migration method in an embodiment of the present application, the method comprising: S101, using a custom controller to create custom resources corresponding to the inference application.

[0025] Custom resources include file conversion resources, image conversion resources, and application migration resources.

[0026] Among them, the reasoning application can be specifically an AI reasoning application, which can be specifically the application of application-related knowledge and reasoning algorithms in different scenarios such as medical diagnosis, financial risk assessment, intelligent customer service, industrial fault diagnosis and prediction, smart home control and smart transportation. Among them, the reasoning application corresponding to medical diagnosis: by analyzing the patient's symptoms, medical records, test results and other data, using medical knowledge and reasoning algorithms to help doctors make more accurate diagnoses; the reasoning application corresponding to financial risk assessment: based on the customer's personal information, financial status, credit record and other data obtained legally, using risk assessment models and reasoning methods to assess the customer's credit risk, fraud risk, etc., to help financial institutions make decisions; the reasoning application corresponding to intelligent customer service: based on natural language processing technology, understand the user's questions, and extract relevant answers from the existing knowledge base through knowledge reasoning to provide users with accurate services and support; the reasoning application corresponding to industrial fault diagnosis and prediction: for Real-time monitoring and analysis of the operating data of industrial equipment, the use of fault diagnosis models and reasoning algorithms, timely discovery of equipment failure hazards, and prediction of equipment failure time, so as to take appropriate maintenance measures to reduce equipment downtime and production losses; Reasoning applications corresponding to smart home control: based on user habits, environmental sensor data and other data, use reasoning technology to automatically adjust the operating status of home appliances to achieve intelligent home control; Reasoning applications corresponding to smart transportation: by analyzing traffic flow data, road condition information, vehicle sensor data, etc., use reasoning algorithms to perform traffic flow prediction, road condition analysis, intelligent traffic light control, etc., to improve traffic efficiency and reduce congestion and traffic accidents.

[0027] When you need to migrate an inference application across heterogeneous resource pools, you can use a custom controller to create custom resources corresponding to the inference application.

[0028] In a specific implementation of the present application, before executing step S101, it also includes: monitoring the device status of the resource pool running the reasoning application; shutting down the reasoning application when a faulty device is detected and the faulty device affects the operation of the reasoning application; backing up the metadata, business data, original model files and application images of the reasoning application; after completing the backup, obtaining the configuration information of the destination resource pool; accordingly, using a custom controller and combining the configuration information of the destination resources to create custom resources corresponding to the reasoning application.

[0029] In this way, by monitoring the device status of the resource pool running the reasoning application, the faulty device that affects the operation of the reasoning application can be discovered in the first place, so that the reasoning application can be shut down in time and the relevant data content can be backed up in time. Backing up the data can reduce the probability of data loss during the migration process to the restart of the business. After the backup is completed, the configuration information of the destination resource pool can be obtained. In this way, based on the configuration information of the destination resource pool, the custom resources adapted to the migration to the destination resource pool can be defined, thereby reducing the probability of migration failure and minimizing the interruption time of the business.

[0030] Since the reasoning application is being migrated, its metadata, business data, original model files, and application images need to be migrated. Moreover, for the original model file, the format conversion needs to be performed before migration, and the application image needs to be modified to adapt to the target environment. Therefore, in this embodiment, the custom resources include file conversion resources, image conversion resources, and application migration resources. Among them, the file conversion resources are used to drive the file conversion task, the image conversion resources are used to drive the image conversion task, and the application migration resources are used to drive the application migration task.

[0031] That is to say, Figure 2 As shown, in this embodiment, custom resources are created using a custom controller, which can then drive the tasks defined by the CRD to automatically complete model transformation, image adaptation, data migration, and application deployment, thereby ensuring efficient migration of reasoning applications between different environments.

[0032] In a specific implementation of the present application, a custom controller is used to create custom resources corresponding to the reasoning application, including: defining file conversion resources according to the model conversion resource type corresponding to the custom controller; obtaining the format information of the original model file before and after migration; and configuring the file conversion resources using the format information.

[0033] For ease of description, the above steps are combined for explanation below.

[0034] By defining a CRD (Custom Resource Definition) of the OnnxConversion (model conversion resource) type, you can define a file conversion resource (such as my-onnx-conversion).

[0035] After defining the file conversion resource, you need to configure it. The configuration content includes but is not limited to the format information of the original model file before and after migration.

[0036] Specifically, you can configure the source model path (sourceModel.fileLocation), model format (pytorch, etc.), target model save path (targetModel.fileLocation), ONNX operation set version (opsetVersion) and input shape (inputShape). Based on this file conversion resource, you can trigger the transformation task of the original model file from the original format (such as PyTorch) to ONNX (open file) format.

[0037] Among them, the onnx format is an open file format designed for machine learning. It is used to store trained models, allowing different deep learning frameworks to easily interact and share models. It provides a unified standard representation for models trained in different frameworks and solves the problem of model compatibility between different frameworks.

[0038] For example, for a model file transformation task, you can define a file conversion resource (an OnnxConversion named my-onnx-conversion) based on the following definition code: apiVersion: example.com / v1; kind:OnnxConversion; metadata: name: my-onnx-conversion; namespace: default; spec:sourceModel:fileLocation: " / path / to / source / model.pth"; format: "pytorch"; targetModel:fileLocation: " / path / to / target / model.onnx"; conversionOptions:opsetVersion: 13; inputShape: [1, 3, 224, 224].

[0039] The configuration instructions for the above definitions are as follows.

[0040] The metadata part includes: name: the name specified for this ONNX conversion task, here is my-onnx-conversion, which can be modified according to actual conditions.

[0041] namespace: specifies the namespace to which this custom resource belongs. Here it is set to default.

[0042] The specification part (spec) includes: source model information (sourceModel).

[0043] fileLocation: The specific path of the original model file. In the example, it is / path / to / source / model.pth. It needs to be replaced with the actual source model file path.

[0044] format: The format of the original model file, which is specified as pytorch here. If you use a model in another format, you need to modify it accordingly, such as tensorflow, caffe, etc.

[0045] Target model information (targetModel), including: fileLocation: the path where the converted ONNX model is to be saved. The example is / path / to / target / model.onnx. It should be changed to the actual path you want to save.

[0046] Conversion options (conversionOptions), including: opsetVersion: specifies the version of the ONNX operation set, which is set to 13 here and can be adjusted according to needs.

[0047] inputShape: The input shape of the model, here [1, 3, 224, 224], which means the input has a batch size of 1, 3 channels, and a height and width of 224. It should be modified according to the actual input requirements of the model.

[0048] In a specific implementation of the present application, a custom controller is used to create custom resources corresponding to an inference application, including: defining image conversion resources according to the processor conversion resource type corresponding to the custom controller; obtaining environmental information of the application image; and configuring the image conversion resources using the environmental information.

[0049] For ease of description, the above steps are combined for explanation below.

[0050] Through the custom controller, define the image conversion resource to create the application image ONNX transformation task, so as to achieve the application image video target environment transformation. Specifically. Through the MufsyGPUConversion (processor conversion resource type) type, define a CRD, that is, define an image conversion resource (such as my-mufsy-gpu-conversion).

[0051] Then, configure the environment information of the image conversion resource, including but not limited to the source image location (sourceImage.location), format (docker), target image storage location (targetImage.location), GPU type (NVIDIA, etc.) and target architecture (x86_64), and start the transformation of the application image to adapt it to the target GPU and architecture.

[0052] For example: To apply an image transformation task, you can define an image conversion resource (a MufsyGPUConversion named my-mufsy-gpu-conversion) based on the following definition code: Application image onnx transformation task: apiVersion: example.com / v1; kind: MufsyGPUConversion; metadata: name: my-mufsy-gpu-conversion; namespace: default; spec: sourceImage: location: "docker.io / myrepo / source-image:latest"; format: "docker"; targetImage: location: "docker.io / myrepo / target-image:converted"; format: "docker"; conversionOptions: gpuType: "NVIDIA"; targetArch: "x86_64".

[0053] The configuration instructions for the above definition are as follows: Metadata part (metadata), including: name: the name specified for this cross-GPU conversion task, here is my-mufsy-gpu-conversion, which can be modified as needed.

[0054] namespace: specifies the namespace to which the custom resource belongs. Here it is set to default.

[0055] The specification part (spec) includes: Source image information (sourceImage), including: location: the location of the source image. Here, the image on Docker Hub is used as an example. When actually used, it should be replaced with the real source image address.

[0056] format: The format of the source image. Here it is docker. If you use other formats, such as singularity, you need to modify it accordingly.

[0057] Target image information (targetImage), including: location: the location where the converted image is to be saved. The Docker Hub address example is also used and can be adjusted according to needs.

[0058] format: The format expected by the target image, set to docker here.

[0059] Conversion Options (conversionOptions), including: gpuType: specifies the GPU type to which the converted image should be adapted. Here, select NVIDIA, or you can set it to AMD or Intel according to the actual situation.

[0060] targetArch: target architecture, here set to x86_64, can be changed to other architectures according to actual needs.

[0061] In a specific implementation of the present application, a custom controller is used to create custom resources corresponding to the inference application, including: defining application migration resources according to the application migration resource type corresponding to the custom controller; obtaining application basic information, image mapping relationship and model file mapping relationship of the inference application; and configuring the application migration resources using the application basic information, image mapping relationship and model file mapping relationship.

[0062] For ease of description, the above steps are combined for explanation below.

[0063] Use a custom controller to define the application migration resource type to create an inference application migration task. Specifically, define an ApplicationMigration (application migration resource type) type CRD, such as defining an application migration resource called my-app-migration. And configure the application migration resource, using information including but not limited to application basic information, image mapping relationships, and model file mapping relationships. For example, you can configure the application name (appName), version (appVersion), as well as volume data (volumeData), image mapping (imageMapping), and model file mapping (modelMapping) relationships to plan the migration task as a whole.

[0064] For example, to infer an application migration task, you can define an application migration resource (an ApplicationMigration named my-app-migration) based on the following definition code: apiVersion:example.com / v1; kind: ApplicationMigration; metadata: name: my-app-migration; namespace:default; spec: metadataInfo: appName: "my-awesome-app"; appVersion: "1.2.3"; volumeData: - sourceVolume: " / data / source-volume-1"; targetVolume: " / data / target-volume-1"; - sourceVolume: " / data / source-volume-2"; targetVolume: " / data / target-volume-2"; imageMapping: - sourceImage: "dockerhub.io / source-image:1.0"; targetImage: "dockerhub.io / target-image:1.0-migrated"; - sourceImage: "dockerhub.io / source-image- alt:1.0"; targetImage: "dockerhub.io / target - image - alt:1.0 - migrated"; modelMapping:- sourceModelFile: " / models / source- model - 1.pth"; targetModelFile: " / models / target - model -1.pth"; - sourceModelFile: " / models / source - model - 2.pth"; targetModelFile: " / models / target-model-2.pth".

[0065] The configuration instructions for the above definitions are as follows.

[0066] The metadata part includes: name: the name of the custom resource, here it is my-app-migration, which can be named according to the actual migration task.

[0067] namespace: specifies the namespace to which the resource belongs. Here, the default namespace is used.

[0068] The specification part (spec) includes: metadataInfo, metadata information, including: appName: the name of the application to be migrated, here is my-awesome-app.

[0069] appVersion: The version number of the application, for example 1.2.3.

[0070] volumeData: an array, each element of which represents the corresponding relationship of a volume data migration.

[0071] sourceVolume: The path or ID of the source volume.

[0072] targetVolume: The path or ID of the target volume.

[0073] imageMapping: An array, each element of which represents the correspondence between the source image and the target image.

[0074] sourceImage: the address of the source container image.

[0075] targetImage: the address of the target container image after migration.

[0076] modelMapping: An array, each element of which represents the correspondence between the original model file and the target model file.

[0077] sourceModelFile: The path to the original model file.

[0078] targetModelFile: The save path of the target model file.

[0079] S102: Utilize file conversion resources to convert the format of the original model file of the reasoning application to obtain a target model file in an open file format.

[0080] Since CRD can trigger tasks, in this embodiment, the original model file of the reasoning application can be converted into a format using the file resource conversion resource, thereby obtaining a target model file in an open file format. Specifically, a custom controller can be used to trigger a resource file conversion task based on the file conversion resource, thereby calling a tool that can convert the format of the original model file, completing the file format conversion of the model file, and finally obtaining a target model file in an open file format.

[0081] In a specific implementation of the present application, a file conversion resource is used to convert the format of an original model file of an inference application to obtain a target model file in an open file format, including: using the file conversion resource to drive a file conversion task; wherein executing the file conversion task includes: obtaining the original model file from a source resource pool of the inference application; converting the file format of the original model file to obtain a target model file in an open file format.

[0082] For ease of description, the above steps are combined for explanation below.

[0083] The original model file of the reasoning application can be stored in the source resource pool. When it needs to be modified, the original model file is first obtained from the source resource pool. Then, the file format of the original model file is converted to obtain the target model file in the open file format.

[0084] For example: After the original model file transformation task is triggered, the onnx transformation task is issued, and the system calls related tools to perform model format conversion and finally generates an ONNX model file.

[0085] S103: Using the image conversion resource, perform environment conversion on the application image of the inference application to obtain a target application image adapted to the target environment.

[0086] The target environment may specifically be the architecture of a computing device at a destination resource pool.

[0087] In this embodiment, the image conversion resource can be used to transform the application image, thereby obtaining a target application image that is adapted to the target environment.

[0088] In a specific implementation of the present application, an image conversion resource is used to perform an environment conversion on an application image of an inference application to obtain a target application image adapted to a target environment, including: using file conversion resources to drive an image transformation task; executing the image transformation task, including: obtaining an application image from a source image repository of the inference application; performing an environment conversion on the application image to obtain a target application image adapted to the target environment.

[0089] For ease of description, the above steps are combined for explanation below.

[0090] In this embodiment, based on the file conversion resource, the image transformation task can be driven. That is, the file conversion resource can drive the application image transformation tool to obtain the application image from the source image warehouse of the reasoning application. Then, the application image is subjected to environment conversion, and finally the target application image adapted to the target environment is obtained.

[0091] For example: After the application image transformation task is triggered, the image transformation task is issued, the image migration tool is used to obtain the source image, perform the transformation, and generate the target application image that adapts to the target environment.

[0092] After executing step S102 and step S103, step S104 may be executed. There is no need for step S102 and step S103 to be executed in any order. For example, they may be executed in parallel, or step S103 may be executed first and then step S102.

[0093] S104: Utilize the application migration resources to migrate the target model file, the target application image, the metadata of the reasoning application, and the business data of the reasoning application to the target resource pool corresponding to the target environment.

[0094] After the transformation of the original model files and application images is completed, the target model files, application images, metadata, and business data corresponding to the inference application can be migrated to the target resource pool corresponding to the target environment.

[0095] Specifically, during the migration process, different tools can be used to migrate according to the differences in the migration objects, that is, the program migration resources can drive different tools to migrate the migration objects.

[0096] In a specific implementation of the present application, using application migration resources to migrate target model files, target application images, metadata of reasoning applications, and business data of reasoning applications to a target resource pool corresponding to a target environment includes: using application migration resources to drive upload tasks, migration tasks, and pull tasks; wherein, executing the upload task includes: uploading the target model file to a source model warehouse; Upload the target application image to the source image repository; upload the metadata and business data to the source object storage repository; perform migration tasks, including: migrating the target model file from the source model repository to the destination model repository; migrating the target application image from the source image repository to the destination image repository; migrating the metadata and business data from the source object storage repository to the destination object storage repository; performing pull tasks, including: pulling the target application image from the destination image repository; pulling the target model file from the destination model repository; pulling metadata and business data from the object storage repository.

[0097] For ease of description, the above steps are combined for explanation below.

[0098] In this embodiment, different migration modules can be set to perform migration of different objects. By issuing migration tasks through application migration resources, different migration modules can be driven to perform migration. Specifically, the model file migration module, the image migration module, the application metadata migration module, and the application business data migration module are driven to perform migration.

[0099] The model file migration module obtains the transformed target model file, and the image migration module obtains the transformed image. The application metadata migration module migrates metadata, and the application business data migration module migrates business data.

[0100] Specifically, regarding data storage and uploading, it includes: uploading the transformed target model file to the model warehouse and storing it in the source model warehouse; uploading the transformed application image to the image warehouse and storing it in the source image warehouse.

[0101] Upload metadata to the object storage and store it in Minio object storage; upload business data to the object storage and also store it in Minio, realizing centralized data storage.

[0102] Then, data migration is processed with the destination resource pool. First, the transformed application image is copied to the destination image warehouse and migrated from the source image warehouse to the destination image warehouse; the transformed target model file is copied to the destination model warehouse and migrated from the source model warehouse to the destination model warehouse.

[0103] On the destination resource pool side, pull and apply, including: image and model pull: pull image files from the destination image warehouse, processed by the image migration module; pull target model files from the destination model warehouse, processed by the model file migration device; data and business recovery: pull business data and metadata from Minio object storage, and perform data recovery by the application business data migration module and the application metadata migration module respectively. Finally, all migration components complete the automatic deployment and migration of AI reasoning applications in the destination resource pool through the migration task execution device, and realize the seamless operation of applications in the new environment.

[0104] Among them, migrating metadata and business data from the source object storage warehouse to the destination object storage warehouse includes: using a cross-engine version migration tool to migrate business data from the source object storage warehouse to the destination object storage warehouse; using a backup tool to back up metadata from the source object storage warehouse to the destination object storage warehouse.

[0105] Migrating the target model file from the source model warehouse to the destination model warehouse includes: using a backup tool to back up the target model file from the source model warehouse to the destination model warehouse.

[0106] Migrating the target application image from the source image repository to the destination image repository includes: using an image synchronization tool to synchronize the target application image from the source image repository to the destination image repository.

[0107] The task migration execution module coordinates the rapid and automatic migration of AI reasoning applications across heterogeneous resource pools through a combination of various tools. Through k8s-operator, migration tasks, model file onnx format transformation tasks, and application image transformation tasks are defined respectively.

[0108] Application metadata is migrated through the existing velero tool (backup tool); application business data is migrated using the existing restic tool (cross-engine version migration tool); the image migration module migrates images through the imageSync tool (image synchronization tool); the model file migration module also uses the existing restic tool for migration.

[0109] Among them, Velero is an open source Kubernetes backup and restore tool that provides the function of automatic migration across Kubernetes versions.

[0110] Restic is an open source backup tool that can encrypt data and store it in various backend storage media.

[0111] The model file onnx transformation module automatically converts models built with frameworks such as pytorch and TensorFlow into a unified onnx format by building a model format conversion task to adapt to domestic GPUs (Graphic Processing Units).

[0112] The application image transformation and migration module automatically adapts the AI ​​inference application to the onnx format image by building the model application transformation task. This step requires GPU manufacturers to provide relevant tools, such as Musify of Moore's Threads.

[0113] Among them, Musify is Moore's GPU (computing node) migration tool. It can quickly migrate the original CUDA (Compute Unified Device Architecture, universal parallel computing architecture) code to the MUSA (Moore's MUSA unified system architecture) platform, realize automatic code conversion, and allow developers to use the code originally written based on CUDA on Moore's MUSA architecture, greatly reducing the difficulty and workload of code transplantation.

[0114] That is, the entire process drives the tasks defined by CRD through K8s Operator, automates model transformation, image adaptation, data migration, and application deployment, and ensures efficient migration of AI reasoning applications between different environments.

[0115] In a specific implementation of the present application, after using the application to migrate resources, migrate the target model file, the target application image, the metadata of the reasoning application, and the business data of the reasoning application to the target resource pool corresponding to the target environment, it also includes: using the target application image, the target model file, the metadata, and the business data to run the reasoning application in the target resource pool. That is to say, after completing the migration of the reasoning application, the reasoning application can be directly run in the target resource pool to ensure the continuity and stability of the business.

[0116] In this application, the custom controller (K8s Operator) can implement lifecycle management, configuration management, upgrade management and other functions for specific applications or services through custom resource definitions (CustomResource Definitions, CRDs) and controllers. Specifically, the custom controller can monitor changes in custom resources and automatically adjust the status of related resources to meet expectations. For example, when a custom resource meets specific conditions, it automatically triggers the creation or update of other resources. The migration of reasoning applications mainly includes the migration of metadata, business data, model files, and application images. Before migrating the original model file, it needs to be transformed into an open file format; before applying the image, it needs to be transformed to match the target environment. Therefore, in this application, custom resources corresponding to the reasoning application can be created through a custom controller; custom resources include file conversion resources, image conversion resources, and application migration resources. Then, based on the file conversion resources, the format conversion of the original model file of the reasoning application can be realized to obtain the target model file in an open file format; based on the image conversion resources, the environment adaptation of the application image of the reasoning application can be realized to obtain the target application image adapted to the target environment; based on the application migration resources, the migration of the target model file, the target application image, the metadata of the reasoning application, and the business data of the reasoning application to the target resource pool corresponding to the target environment can be realized. In other words, the entire process can drive the tasks defined by CRD through a custom controller, and automatically complete model transformation, image adaptation, data migration and application deployment, thereby ensuring the efficient migration of reasoning applications between different environments. Therefore, this application can solve the technical problem of migration of reasoning applications across heterogeneous resource pools, get rid of the dependence on manual migration across heterogeneous resource pools, and ensure the continuity and stability of the business.

[0117] In a specific implementation of the present application, the following steps are performed in the K8s operator: obtain the custom resource name, namespace and specification fields; based on the custom resource name, namespace and specification fields, process metadata information, volume data migration (such as calling storage API, etc.), image migration (such as calling container image service API, etc.) and target model file migration (such as file copy operation, etc.) in sequence; update resource status.

[0118] That is to say, in actual applications, the migration of inference applications based on the K8s operator driver can directly obtain custom resources for management, thereby triggering the migration of related content.

[0119] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method.

[0120] The embodiment of the present application also provides an application migration device, which can be cross-referenced with the above application migration method.

[0121] Please refer to Figure 3 The application migration device includes: a task management module 301, which is used to create custom resources corresponding to the reasoning application by using a custom controller; the custom resources include file conversion resources, image conversion resources and application migration resources; a model transformation module 302, which is used to use the file conversion resources to convert the format of the original model file of the reasoning application to obtain a target model file in an open file format; an image transformation module 303, which is used to use the image conversion resources to perform environment conversion on the application image of the reasoning application to obtain a target application image adapted to the target environment; an application migration module 304, which is used to use the application migration resources to migrate the target model file, the target application image, the metadata of the reasoning application and the business data of the reasoning application to the target resource pool corresponding to the target environment.

[0122] In a specific implementation of the present application, the task management module is specifically used to define file conversion resources according to the model conversion resource type corresponding to the custom controller; obtain the format information of the original model file before and after migration; and configure the file conversion resources using the format information.

[0123] In a specific implementation of the present application, the task management module is specifically used to define image conversion resources according to the processor conversion resource type corresponding to the custom controller; obtain environmental information of the application image; and configure the image conversion resources using the environmental information.

[0124] In a specific implementation of the present application, the task management module is specifically used to define application migration resources according to the application migration resource type corresponding to the custom controller; obtain application basic information, image mapping relationship and model file mapping relationship of the inference application; and configure the application migration resources using the application basic information, image mapping relationship and model file mapping relationship.

[0125] In a specific implementation of the present application, the model transformation module is specifically used to utilize file conversion resources to drive file conversion tasks; wherein, executing the file conversion task includes: obtaining the original model file from the source resource pool of the reasoning application; converting the file format of the original model file to obtain a target model file in an open file format.

[0126] In a specific implementation of the present application, the image transformation module is specifically used to utilize file conversion resources to drive image transformation tasks; execute image transformation tasks, including: obtaining an application image from a source image repository of an inference application; performing environment conversion on the application image to obtain a target application image adapted to the target environment.

[0127] In a specific implementation of the present application, an application migration module is specifically used to utilize application migration resources to drive upload tasks, migration tasks and pull tasks; wherein, executing upload tasks includes: uploading target model files to a source model repository; uploading target application images to a source image repository; uploading metadata and business data to a source object storage repository; executing migration tasks includes: migrating target model files from a source model repository to a destination model repository; migrating target application images from a source image repository to a destination image repository; migrating metadata and business data from a source object storage repository to a destination object storage repository; executing pull tasks includes: pulling target application images from a destination image repository; pulling target model files from a destination model repository; and pulling metadata and business data from an object storage repository.

[0128] In a specific implementation of the present application, an application migration module is specifically used to use a cross-engine version migration tool to migrate business data from a source object storage warehouse to a destination object storage warehouse; and to use a backup tool to back up metadata from a source object storage warehouse to a destination object storage warehouse.

[0129] In a specific implementation of the present application, the application migration module is specifically used to use a backup tool to back up the target model file from the source model warehouse to the destination model warehouse.

[0130] In a specific implementation of the present application, the application migration module is specifically used to synchronize the target application image from the source image repository to the destination image repository using an image synchronization tool.

[0131] In a specific implementation of the present application, it also includes: a business operation module, which is used to use the target application image, target model file, metadata and business data to run the reasoning application in the target resource pool after migrating the target model file, target application image, metadata and business data of the reasoning application to the target resource pool corresponding to the target environment using the application migration resources.

[0132] For the description of the features in the embodiment corresponding to the application migration device, reference can be made to the relevant description of the embodiment corresponding to the application migration method, which will not be repeated here.

[0133] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above application migration method embodiments.

[0134] See also Figure 4 As shown, the electronic device includes: A memory 332, for storing computer programs; The processor 322 is configured to implement the steps of the application migration method of the above method embodiment when executing a computer program.

[0135] For details, please refer to Figure 5 , Figure 5 A schematic diagram of the specific structure of an electronic device provided for this embodiment, which may have relatively large differences due to different configurations or performances, may include one or more processors (central processing units, CPU) (for example, one or more processors) and a memory 332, and the memory 332 stores one or more computer programs 342 or data 344. Among them, the memory 332 can be a temporary storage or a permanent storage. The program stored in the memory 332 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the data processing device. Furthermore, the processor 322 may be configured to communicate with the memory 332 to execute a series of instruction operations in the memory 332 on the electronic device.

[0136] The electronic device may further include one or more power supplies 326 , one or more wired or wireless network interfaces 350 , one or more input and output interfaces 358 , and / or one or more operating systems 341 .

[0137] The steps in the application migration method described above can be implemented by the structure of an electronic device.

[0138] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above-mentioned application migration method embodiments when running.

[0139] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0140] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any of the above-mentioned application migration method embodiments are implemented.

[0141] An embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium, the non-volatile computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the steps in any of the above-mentioned application migration method embodiments are implemented.

[0142] Those skilled in the art may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0143] The above is a detailed introduction to an application migration method, device, equipment, readable storage medium and program product provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of ​​the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the present application.

Claims

1. An application migration method, characterized in that: include: Using a custom controller, create custom resources corresponding to the inference application; the custom resources include file conversion resources, image conversion resources and application migration resources; Using the file conversion resource, converting the format of the original model file of the reasoning application to obtain a target model file in an open file format; Using the image conversion resource, performing environment conversion on the application image of the reasoning application to obtain a target application image adapted to the target environment; The target model file, the target application image, the metadata of the reasoning application, and the business data of the reasoning application are migrated to a target resource pool corresponding to the target environment by using the application migration resources.

2. The method according to claim 1, characterized in that Use the custom controller to create custom resources corresponding to the inference application, including: Define file conversion resources according to the model conversion resource type corresponding to the custom controller; Obtaining format information of the original model file before and after migration; The file conversion resource is configured using the format information.

3. The method according to claim 1, characterized in that Use the custom controller to create custom resources corresponding to the inference application, including: Defining image conversion resources according to the processor conversion resource type corresponding to the custom controller; Obtaining environment information of the application image; The image conversion resources are configured using the environment information.

4. The method according to claim 1, characterized in that: Use the custom controller to create custom resources corresponding to the inference application, including: Defining application migration resources according to the application migration resource type corresponding to the custom controller; Obtaining basic application information, image mapping relationship, and model file mapping relationship of the reasoning application; The application migration resources are configured using the application basic information, the image mapping relationship and the model file mapping relationship.

5. The method according to claim 1, characterized in that Using the file conversion resource, converting the format of the original model file of the reasoning application to obtain a target model file in an open file format, including: Using the file conversion resource to drive the file conversion task; The step of executing the file conversion task includes: Acquiring the original model file from a source resource pool of the reasoning application; The file format of the original model file is converted to obtain a target model file in an open file format.

6. The method according to claim 1, characterized in that Using the image conversion resource, performing environment conversion on the application image of the reasoning application to obtain a target application image adapted to the target environment, including: Using the file conversion resources to drive the image transformation task; Executing the image transformation task includes: Obtaining the application image from a source image repository of the inference application; Performing environment conversion on the application image to obtain a target application image adapted to the target environment.

7. The method according to claim 1, characterized in that Migrating the target model file, the target application image, the metadata of the reasoning application, and the business data of the reasoning application to a target resource pool corresponding to the target environment by using the application migration resource, including: Migrate resources using the application to drive upload tasks, migration tasks, and pull tasks; The execution of the upload task includes: Upload the target model file to the source model warehouse; Uploading the target application image to the source image warehouse; Uploading the metadata and the business data to a source object storage warehouse; Executing the migration task includes: Migrating the target model file from the source model repository to the destination model repository; Migrating the target application image from the source image repository to the destination image repository; Migrating the metadata and the business data from the source object storage warehouse to the destination object storage warehouse; Executing the pulling task includes: Pull the target application image from the target image repository; Pull the target model file from the target model warehouse; Pull the metadata and the business data from the object storage warehouse.

8. The method according to claim 7, characterized in that Migrating the metadata and the business data from the source object storage warehouse to the destination object storage warehouse includes: Migrating the business data from the source object storage warehouse to the destination object storage warehouse using a cross-engine version migration tool; The metadata is backed up from the source object storage warehouse to the destination object storage warehouse using a backup tool.

9. The method according to claim 7, characterized in that: Migrating the target model file from the source model repository to the destination model repository includes: The target model file is backed up from the source model repository to the destination model repository using a backup tool.

10. The method according to claim 7, characterized in that Migrating the target application image from the source image repository to the destination image repository includes: The target application image is synchronized from the source image repository to the destination image repository using an image synchronization tool.

11. The method according to any one of claims 1 to 10, characterized in that: After migrating the target model file, the target application image, the metadata of the reasoning application, and the business data of the reasoning application to the target resource pool corresponding to the target environment by using the application program migration resources, the method further includes: The inference application is run in the target resource pool using the target application image, the target model file, the metadata, and the business data.

12. An application migration device, characterized in that: include: A task management module, used to create custom resources corresponding to the reasoning application using a custom controller; the custom resources include file conversion resources, image conversion resources and application migration resources; A model transformation module, used to use the file conversion resource to convert the format of the original model file of the reasoning application to obtain a target model file in an open file format; An image transformation module, used to use the image conversion resource to perform environment conversion on the application image of the reasoning application to obtain a target application image adapted to the target environment; The application migration module is used to utilize the application program to migrate resources and migrate the target model file, the target application image, the metadata of the reasoning application and the business data of the reasoning application to a target resource pool corresponding to the target environment.

13. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the application migration method as claimed in any one of claims 1 to 11 when executing the computer program.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the application migration method according to any one of claims 1 to 11.

15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the application migration method according to any one of claims 1 to 11 are implemented.

Citation Information

Patent Citations

  • Service migration method and equipment

    CN110737467A

  • Machine learning model automatic production line construction method and system

    CN114115857A

  • Mirror image file synchronization method and device, storage medium and electronic equipment

    CN115510163A

  • Model conversion method, computer program product, storage medium and electronic equipment

    CN116266117A

  • Application program migration method and device, equipment and storage medium

    CN118708321A

Cited By

  • GPU reasoning rapid migration method and system based on model segmentation

    CN121683998A

  • A GPU inference fast migration method and system based on model segmentation

    CN121683998B