Multi-process application migration method, device, storage medium and electronic device

By transmitting data information and handle identifiers of multi-process applications between the source and destination ends, the problem of multi-process application sharing relationships and execution order in GPU live migration is solved, and stable migration and resource sharing of multi-process applications are achieved.

CN117971423BActive Publication Date: 2024-10-11VIRTAI TECH BEIJING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410064442.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-16
Publication Date
2024-10-11
Estimated Expiration
2044-01-16

AI Technical Summary

Technical Problem

Existing GPU live migration technology is difficult to restore the sharing relationship and execution order of multi-process applications on the destination GPU, especially in scenarios where inter-process resource sharing is achieved through handles, resulting in unstable multi-process application execution order after migration.

Method used

By sending the data information of the multi-process application, including execution context and unique source identification, to the application layer at the source end, and updating it by the destination end to restore the multi-process application, use the target data information to restore the multi-process application, and package it through the shared handle Update handle identifiers to ensure correct data recovery and execution order during migration.

Benefits of technology

It achieves the correct data recovery and maintenance of execution order of multi-process applications during the migration process, ensuring resource sharing and application layer stability during cross-process migration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117971423B_ABST
    Figure CN117971423B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the field of computer technology, and in particular to a migration method, device, storage medium and electronic device for a multi-process application. The method includes: in the case of triggering process migration, sending data information corresponding to the multi-process application to the application layer through the source end, so that the application layer forwards the data information to the destination end, wherein the multi-process application is an application of multiple processes in the application layer that occupies shared resources in the source end, and the data information includes the execution context of each process and a unique source identifier, and the source identifier includes a source process identifier and a shared handle; updating the data information through the destination end to obtain the target data information, and restoring the multi-process application in the destination end according to the target data information, wherein the target data information includes the execution context and the unique destination identifier of each process, and the destination identifier includes the target process identifier and the target handle.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a migration method, device, storage medium and electronic device for a multi-process application. Background Art

[0002] Multi-process video memory applications will share video memory between processes to achieve data sharing, but the unique video memory management method of video memory applications will result in the video memory allocated by some interfaces (such as mempool, etc.) cannot be directly shared using traditional inter-process communication methods.

[0003] The existing GPU (Graphics Processing Unit) hot migration method has no problem for single-process applications, but for multi-process applications that use handles to share resources between processes, how to restore the sharing relationship on the destination GPU (dst) and ensure the execution order of the multi-process applications after migration are both problems faced by multi-process application migration. Summary of the invention

[0004] The purpose of the present disclosure is to provide a method, device, storage medium and electronic device for migrating a multi-process application, which can realize the migration of the multi-process application.

[0005] In order to achieve the above objectives, in a first aspect, the present disclosure provides a method for migrating a multi-process application, the method comprising:

[0006] In the case of triggering process migration, data information corresponding to the multi-process application is sent to the application layer through the source end, so that the application layer forwards the data information to the destination end, wherein the multi-process application is an application of multiple processes in the application layer occupying shared resources in the source end, and the data information includes an execution context and a unique source identifier of each process, and the source identifier includes a source process identifier and a shared handle;

[0007] The data information is updated through the destination end to obtain target data information, and the multi-process application is restored in the destination end according to the target data information, wherein the target data information includes the execution context and a unique destination identifier of each process, and the destination identifier includes a target process identifier and a target handle.

[0008] Optionally, the method further comprises:

[0009] In the case where the application layer acquires the shared resource, the source end determines the source identifier corresponding to the process according to the source process identifier and the shared handle of each process;

[0010] An execution context of each of the processes is determined, and data information is determined according to the execution context and the plurality of source identifiers.

[0011] Optionally, the updating the data information through the destination end to obtain target data information includes:

[0012] Each source identifier in the data information is updated by the destination end to obtain a corresponding destination identifier, and a plurality of the destination identifiers and the execution context are used as target data information.

[0013] Optionally, the method further comprises:

[0014] The destination end monitors the migration status of the multi-process application according to the data information and the target data information.

[0015] Optionally, the data information includes a first number, and the target data information includes a second number;

[0016] The monitoring, by the destination end according to the data information and the target data information, the migration status of the multi-process application includes:

[0017] The destination end determines that the multi-process application migration is completed based on the second number and the first number, wherein the first number is obtained by the source end counting the source identifier in the data information, and the second number is obtained by the destination end counting the destination identifier in the target data information.

[0018] Optionally, the method further comprises:

[0019] After the multi-process application is migrated from the source end to the destination end, the source identifier in the handle packet is updated to the destination identifier through the application layer, wherein the handle packet is used to store the handle and process identifier of the multi-process application during the migration process.

[0020] Optionally, the source end and the destination end run in an execution layer, and the execution layer is a location where the multi-process application actually runs.

[0021] In a second aspect, the present disclosure provides a migration device for a multi-process application, the device comprising:

[0022] The source end is configured to send data information corresponding to the multi-process application to the application layer when the process migration is triggered, so that the application layer forwards the data information to the destination end, wherein the multi-process application is an application of multiple processes in the application layer occupying shared resources in the source end, and the data information includes an execution context of each process and a unique source identifier, and the source identifier includes a source process identifier and a shared handle;

[0023] The destination end is configured to update the data information, obtain target data information, and restore the multi-process application according to the target data information, wherein the target data information includes the execution context and a unique destination identifier of each process, and the destination identifier includes a target process identifier and a target handle.

[0024] In a third aspect, the present disclosure provides a non-temporary computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in the first aspect.

[0025] In a fourth aspect, the present disclosure provides an electronic device, including:

[0026] a memory having a computer program stored thereon;

[0027] A processor is used to execute the computer program in the memory to implement the steps of the method described in the first aspect.

[0028] Through the above technical solution, when the source end triggers process migration, it sends the data information of multiple processes to the application layer, so that the application layer forwards the data information to the destination end, and the destination end updates the data information, obtains the target data information, and restores the multiple processes according to the target data information, thereby realizing the migration of multiple processes from the source end to the destination end. On the basis of not affecting the execution of the application layer, the shared handle of the source end is shared with the destination end through the data information, which ensures that the data of the cross-process migration process can be correctly restored and executed.

[0029] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the present disclosure but do not constitute a limitation of the present disclosure. In the accompanying drawings:

[0031] Figure 1 The invention is a block diagram showing a migration principle of a multi-process application according to an exemplary embodiment of the present invention.

[0032] Figure 2a The figure is a synchronization timeout flow chart according to an exemplary embodiment of the present disclosure.

[0033] Figure 2b is another flowchart of a synchronization timeout according to an exemplary embodiment of the present disclosure.

[0034] Figure 3 The diagram is a migration interaction diagram of a multi-process application according to an exemplary embodiment of the present disclosure.

[0035] Figure 4 The figure is a block diagram of a migration device for a multi-process application according to an exemplary embodiment of the present disclosure.

[0036] Figure 5 is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0037] The specific implementation of the present disclosure is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described herein is only used to illustrate and explain the present disclosure, and is not used to limit the present disclosure.

[0038] It should be noted that all actions of acquiring signals, information or data in the present disclosure are carried out in compliance with the relevant data protection laws and policies of the country where the device is located and with the authorization given by the owner of the corresponding device.

[0039] As mentioned in the background technology, most multi-process NVIDIA applications share video memory between processes to achieve data sharing. However, NVIDIA's unique video memory management method will cause the video memory (such as mempool, etc.) allocated by some APIs (Application Programming Interface) to be unable to be directly shared using traditional inter-process communication methods. NVIDIA has also disclosed a new mechanism for inter-process communication using operating system-specific handles: multi-process applications use export shared handles to obtain operating system-specific handles corresponding to the allocation, and the obtained handles can be transmitted using the OS (Operating System) local mechanism to perform inter-process communication. The receiving process uses the import shared handle to import the allocated shared resources, and the export and import operations are used to complete the easy, efficient and secure sharing of GPU (Graphics Processing Unit, GPU) memory between processes.

[0040] Existing GPU hot migration refers to migrating a running program from one GPU to another GPU for execution without affecting the use of the GPU. This technology is mainly used in fields such as large-scale parallel computing and deep learning, and can improve the utilization and efficiency of GPU resources. However, the inventors found that most of the current implementations of GPU hot migration are completed by saving the execution context on the source GPU and performing playback operations on the destination GPU. This is no problem for single-process applications, but for multi-process applications that use handles (Handles, which are used by the system to record changes in data addresses) to achieve resource sharing between processes, how to restore the sharing relationship on the destination GPU and ensure the execution order of the multi-process applications after migration are all problems faced by multi-process application migration.

[0041] In view of this, the present disclosure provides a method, device, storage medium and electronic device for migrating a multi-process application, which can realize the migration of the multi-process application.

[0042] The present disclosure provides a method for migrating a multi-process application. The method for migrating a multi-process application may include:

[0043] In the case of triggering process migration, data information corresponding to the multi-process application is sent to the application layer through the source end, so that the application layer forwards the data information to the destination end, wherein the multi-process application is an application of multiple processes in the application layer occupying shared resources in the source end, and the data information includes an execution context and a unique source identifier of each process, and the source identifier includes a source process identifier and a shared handle;

[0044] The data information is updated through the destination end to obtain target data information, and the multi-process application is restored in the destination end according to the target data information, wherein the target data information includes the execution context and a unique destination identifier of each process, and the destination identifier includes a target process identifier and a target handle.

[0045] It should be understood that the source end is the location of the source GPU, the target end is the location of the target GPU, and the source GPU and the target GPU can be the same GPU in the same server, or different GPUs in the same server, or different GPUs in different servers. Therefore, the migration of multi-process applications can occur on the same GPU in the same server, or on different GPUs in the same server, or on different GPUs in different servers.

[0046] It is worth noting that the source identifier is displayed in the data information as a source identifier set, and the destination identifier is displayed in the destination information as a destination identifier set. The execution context can be the context context corresponding to the process, or it can be other data that can determine the execution order of each process. This disclosure does not limit this.

[0047] For the convenience of description, in all embodiments of the present disclosure, src refers to the source GPU, dst refers to the destination GPU, the application layer where the API hijacking is located is referred to as the application layer, item refers to the source identifier, item_map refers to the source identifier set, src_pid refers to the source process identifier (Process Identifier), sharehandle refers to the shared handle, new item refers to the destination identifier, new item_map refers to the destination identifier set, dst_pid refers to the destination process identifier, targethandle refers to the destination handle, and fakehandle refers to the fake handle.

[0048] It should be understood that the number of processes in src, dst and the application layer is exactly the same, specifically, a first number of main processes and a second number of child processes, and the first number and the second number may be the same or different.

[0049] For example, see Figure 1 It is worth noting that src, dst and the application layer all include export processes and export processes. The export processes of src and the application layer share the same export module 101, the import processes of src and the application layer share the same import module 102, the export processes and import processes of src and the application layer share the same save module 103, the import processes and export processes of the application layer and dst share a recovery module 104, the export process of dst calls the migration export module 105, the import process of dst calls the migration import module 106, and the export process and import process of dst share a synchronization module 107.

[0050] In the case of triggering process migration, the export module 101 is called to send data information such as item_map and context of each process to the export process of the application layer through rpc (Remote Procedure Call Protocol).

[0051] The export process of the application layer temporarily stores each item in item_map in the handle package fd, and returns the handle package fd as a fakehandle to the multi-process application. The import process of the application layer synchronizes data with the export process of the application layer according to the synchronization protocol of the application layer itself. The export process of the application layer forwards item_map to the export process of dst, and forwards context to the import process of dst.

[0052] The export process and import process of dst call the recovery module 104 to restore all data required for the context, such as video memory, application and release of various sharehandles and loaded modules, etc., and the export process of dst calls the migration export module 105 to update the sharehandle to the targethandle, obtain the new_item, and send the new_item to the export process of the application layer.

[0053] The import process of dst calls the migration import module 106 to import new_item into the corresponding shared resource in dst. At the same time, the export process and import process of dst call the synchronization module 107 to ensure that the migration export module 105 has completed resource recovery before the migration import module 106 is executed, and when the migration export module 105 executes resease to release resources, the migration import module 106 has been executed.

[0054] In the disclosed embodiment, the application layer shares fakehandles between export and import processes to ensure that the resource handles seen by multi-process applications remain unchanged before and after migration, and the actual handles are updated after migration, thereby achieving sharing of multi-process applications at the application layer. The source GPU creates an item_map for each shared resource and shares the sharehandle in a shared file memory manner, ensuring that the data in the cross-process migration process can be correctly restored and executed.

[0055] In order to help those skilled in the art to better understand the multi-process application migration method provided by the present disclosure, the steps involved in the method are described below.

[0056] In a possible implementation, the source end and the destination end run in an execution layer, and the execution layer is a location where the multi-process application actually runs.

[0057] It should be understood that the actual location where the API runs is the execution layer, that is, both the source and the destination are in the execution layer.

[0058] In the embodiment of the present disclosure, the execution layer creates a globally unique identification key (ie, item) for each shared resource, and shares the sharehandle in a shared file memory manner without affecting the execution of the application layer.

[0059] In a possible implementation, the method further includes:

[0060] After the multi-process application is migrated from the source end to the destination end, the source identifier in the handle packet is updated to the destination identifier through the application layer, wherein the handle packet is used to store the handle and process identifier of the multi-process application during the migration process.

[0061] It should be understood that the handles and process identifiers of different GPUs are different. For example, before the multi-process application is migrated, the handle package fd stores the item, and after the multi-process application is migrated, the fd stores the new item. Therefore, during the migration process, the item in the handle package fd needs to be updated to the new item.

[0062] For example, see Figure 1 , the application layer creates a handle package fd. When the process migration is triggered, the application layer temporarily stores the item in the item_map sent by the source GPU in the handle package fd. The destination GPU recovers the sharehandle according to the item, updates the sharehandle to the targethandle, obtains the new item_map and sends the new item_map to the application layer. The application layer receives the new item_map and replaces the item in the handle package fd with the new item in the new item_map.

[0063] In the disclosed embodiment, after a multi-process application is migrated from a source GPU to a destination GPU, the application layer replaces the item in the handle package fd with a new item, ensuring that the resource handle seen by the multi-process application before and after the migration remains unchanged, and the handle called by the multi-process application during the actual execution process is replaced by the new item, thereby realizing the sharing of the multi-process application at the application layer, so that changes in the handle before and after the actual execution layer migration cannot affect the execution of the application layer.

[0064] In a possible implementation, the method further includes:

[0065] In the case where the application layer acquires the shared resource, the source end determines the source identifier corresponding to the process according to the source process identifier and the shared handle of each process;

[0066] An execution context of each of the processes is determined, and data information is determined according to the execution context and the plurality of source identifiers.

[0067] It is worth noting that multi-process applications run at the application layer. After the application layer obtains shared resources, the export process of src sends the handles of each process to the export process of the application layer, and records the handles of each process to obtain a handle set, and determines the execution context of each process. When process migration is triggered, the handle set and the execution context of each process are sent to the export process of the application layer as data information.

[0068] For example, see Figure 1 When the application layer obtains shared resources, the export process of src uses src_pid, sharehandle and other information as the item information of the globally unique identifier key, and sends it to the corresponding export process of the application layer through rpc (Remote Procedure Call Protocol), and records the item. Multiple items constitute item_map, and determine the execution context of each process and save it. The item_map and the execution context of each process are sent to the export process of the application layer as data information.

[0069] In the embodiment of the present disclosure, when a multi-process application is executed on the source GPU, the source GPU records the handle when sending the handle to the application layer, obtains the handle set corresponding to the multi-process application, and stores the context of each process execution to prepare for multi-process migration.

[0070] In a possible implementation manner, the updating the data information by the destination end to obtain the target data information includes:

[0071] Each source identifier in the data information is updated by the destination end to obtain a corresponding destination identifier, and a plurality of the destination identifiers and the execution context are used as target data information.

[0072] It should be understood that the corresponding process identifier pid and handle handle of the same multi-process application are unique before and after migration. Therefore, the destination end needs to update the pid and handle handle after the process migration.

[0073] For example, see Figure 1 , dst restores the sharehandle corresponding to each item in the item map, updates the sharehandle to targethandle, updates src_pid to dst_pid, obtains the new item map, and uses the newitem map and the context of each execution as the target data information.

[0074] In a possible implementation, the method further includes:

[0075] The destination end monitors the migration status of the multi-process application according to the data information and the target data information.

[0076] It is worth noting that whether the multi-process application has completed migration or whether migration has been missed is determined through data information and target data information.

[0077] In a possible implementation manner, the data information includes a first number, and the target data information includes a second number;

[0078] The monitoring, by the destination end according to the data information and the target data information, the migration status of the multi-process application may include:

[0079] The destination end determines that the multi-process application migration is completed based on the second number and the first number, wherein the first number is obtained by the source end counting the source identifier in the data information, and the second number is obtained by the destination end counting the destination identifier in the target data information.

[0080] It is worth noting that the counting process at the source end is an addition count, such as +1. The counting process at the destination end can be an addition count, such as +1, or a subtraction count, such as -1.

[0081] It should be understood that when the source end is sharing resources, each time an item is imported, the count is increased by 1 to obtain the first number. When the destination end receives data information sent by the application layer, each time an item is imported, the count is increased by 1 to obtain the second number, or the first number is used as the initial number and the count is decreased to obtain the second number.

[0082] For example, Figure 1 As shown, when the counting process of dst is plus counting, when the export process of src is sharing resources, each time an item is imported, the import process of src will increase the count of the corresponding item share_time by 1, that is, record how many times sharetime is exported, to indicate how many import processes use this resource. dst receives the item map sent by the application layer, imports the item, and updates the item to a new item. The import process of dst will increase the count of the corresponding item target_time by 1 each time an item is imported, that is, record how many times the item is imported, to indicate how many resources have been restored. When the count of item share_time is equal to the count of item target_time, dst determines that the multi-process application migration is completed.

[0083] For example, Figure 1 As shown in the figure, when the counting process of dst is a down count, when the export process of src is sharing resources, each time an item is imported, the import process of src will increase the count of the corresponding item share_time by 1, that is, record how many times the sharetime is exported, which is used to indicate how many import processes use this resource. dst receives the item map sent by the application layer, imports the item, and updates the item to a new item. The import process of dst will reduce the count of the corresponding item share_time by 1 each time an item is imported, that is, record how many resources are restored. When the count of the item share_time is zero, dst determines that the multi-process application migration is completed.

[0084] In the embodiment of the present disclosure, during the multi-process migration process, the source GPU and the destination GPU are counted respectively, and whether the migration of the multi-process application is completed is determined based on the counting results of the source GPU and the destination GPU, so as to monitor the migration status of the multi-process application and avoid missed migration.

[0085] In addition, a timeout mechanism is provided in the synchronization module 107 to prevent the export process or the import process in dst from being in a waiting state due to an execution exception. When the counting process of dst is a down count, the working process of the timeout mechanism is as follows:

[0086] like Figure 2b As shown, before executing the resease to release resources, the migration export module 105 needs to determine whether the count of item share_time is 0. If so, resease is executed. If not, the count of item share_time of the import process and the export process in dst is synchronized through the synchronization module 107, and it is determined again whether the count of item share_time is 0. At the same time, it is determined that timeout has occurred and resease has failed. This ensures that when the migration export module 105 executes resease to release resources, the migration import module 106 has been executed.

[0087] like Figure 2a As shown, before executing the import of resources, the migration import module 106 needs to determine whether the item is available (i.e., whether the item is recovered). If so, the resource is imported. If not, the import process and export process in dst are synchronized through the synchronization module 107, and the item is determined again. At the same time, it is determined that the import of resources fails due to timeout. This ensures that the migration export module 105 has completed resource recovery before the migration import module 106 is executed.

[0088] For example, the entire multi-process application migration scenario is divided into four stages for explanation:

[0089] 1. Multi-process applications run normally in the src stage

[0090] 1. Multi-process applications run at the application layer. After obtaining shared resources, the export process of the application layer sends the shared handle to the export process of the src through RPC. The export process of the src uses the src_pid, sharehandle and other information as the item of the global unique identifier key, and sends the item to the export process of the application layer. At the same time, the src export process locally saves the item to item_map and maps it to the shared memory.

[0091] 2. The export process of the application layer receives the item. In order to enable the multi-process application to run normally after migration, the item information is saved in the local file fd and the file fd is returned to the multi-process application as a fakehandle.

[0092] 3. The multi-process application sends the fakehandle to the import process of the application layer through the local OS transmission mechanism.

[0093] 4. The import process of the application layer obtains the fakehandle and finds the item corresponding to the fakehandle, thereby obtaining the sharehandle and sending the sharehandle to the import process of the src to obtain the shared resource. The import process of the src records how many processes are using the shared resource corresponding to the current sharehandle, imports a sharehandle, and increases the corresponding item share_time by 1.

[0094] 2. Preservation Phase of Multi-Process Application Migration

[0095] 1. src saves the context of each process execution, and the export process of src saves item_map.

[0096] 2. The export process of src sends the context information and item_map of each process to the export process of the application layer for temporary storage.

[0097] 3. Recovery Phase of Multi-Process Application Migration

[0098] 1. The export process and import process of dst simultaneously receive the context information temporarily stored by each process of the application layer to perform recovery operations.

[0099] 2. The dst export process performs the export operation, creates a new targethandle, updates the target information field of the item with information such as dst_pid and targethandle as new_item, and sends the [item, new_item] information to the export process of the application layer to complete the update of the item information in the fakehandle of the application layer.

[0100] 3. The import process of dst performs the import operation. If the corresponding item information is not found, it means that the export process of dst has not been performed. In order to ensure the synchronization of the processes, it is necessary to wait for the export operation to be completed before performing the import operation. And each time an import operation is performed, the corresponding item share_time is reduced by 1. When the item share_time count is 0, it means that all import operations are restored.

[0101] 4. Multi-process applications run normally in the dst stage

[0102] 1. At this time, the item information corresponding to fakehandle in the application layer has been updated to targethandle corresponding to dst.

[0103] In summary, in the disclosed embodiment, the application layer creates an fd storage item or new item mechanism, shares fakehandle, realizes the sharing of execution layer handle, and ensures that the resource handle seen by multi-process applications before and after migration remains unchanged, while the actual handle is updated after migration. The source GPU creates item_map for each shared resource, shares sharehandle in the form of shared file memory, and ensures that cross-process data sharing during migration can be correctly restored and executed through a multi-process synchronization mechanism.

[0104] The present disclosure also provides a migration device for a multi-process application. Figure 4 As shown, the multi-process migration device includes a source end 401 , a destination end 402 and an application layer 403 .

[0105] The source end 401 is configured to send data information corresponding to the multi-process application to the application layer 403 when the process migration is triggered, so that the application layer 403 forwards the data information to the destination end, wherein the multi-process application is an application of multiple processes in the application layer that occupy shared resources in the source end 401, and the data information includes an execution context and a unique source identifier of each process, and the source identifier includes a source process identifier and a shared handle;

[0106] The destination end 402 is configured to update the data information, obtain target data information, and restore the multi-process application according to the target data information, wherein the target data information includes the execution context and a unique destination identifier of each process, and the destination identifier includes a target process identifier and a target handle.

[0107] In the disclosed embodiment, the application layer shares fakehandles between export and import processes to ensure that the resource handles seen by multi-process applications before and after migration remain unchanged, and the actual handles are updated after migration, thereby realizing the sharing of multi-process applications at the application layer. The source end creates an item_map for each shared resource and shares the sharehandle in the form of shared file memory, ensuring that the data in the cross-process migration process can be correctly restored and executed.

[0108] In a possible implementation, the source end 401 and the destination end 402 run in an execution layer, and the execution layer is a location where the multi-process application actually runs.

[0109] In a possible implementation, the source end 401 is configured to determine the source identifier corresponding to the process according to the source process identifier and the shared handle of each process when the application layer 403 acquires the shared resource;

[0110] An execution context of each of the processes is determined, and data information is determined according to the execution context and the plurality of source identifiers.

[0111] In a possible implementation, the destination end 402 is configured to update each source identifier in the data information to obtain a corresponding destination identifier, and use the multiple destination identifiers and the execution context as the target data information.

[0112] In a possible implementation manner, the destination end 402 is configured to monitor the migration status of the multi-process application according to the data information and the target data information.

[0113] In a possible implementation, when the data information includes a first number and the target data information includes a second number; the destination end 402 is configured to compare the second number with the first number;

[0114] When the second number is equal to the first number, it is determined that the multi-process application migration is completed, wherein the first number is obtained by the source end 401 counting the source identifier in the data information, and the second number is obtained by the destination end 402 counting the destination identifier in the target data information.

[0115] In one possible implementation, after the multi-process application is migrated from the source end 401 to the destination end 402, the source identifier in the handle package is updated to the destination identifier through the application layer 403, wherein the handle package is used to store the handle and process identifier of the multi-process application during the migration process.

[0116] Regarding the migration device for multi-process applications in the above-mentioned embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0117] The present disclosure also provides an electronic device, including:

[0118] a memory having a computer program stored thereon;

[0119] The processor is used to execute the computer program in the memory to implement the steps of the above-mentioned multi-process application migration method.

[0120] In the disclosed embodiment, the application layer shares fakehandles between export and import processes to ensure that the resource handles seen by multi-process applications remain unchanged before and after migration, and the actual handles are updated after migration, thereby achieving sharing of multi-process applications at the application layer. The source GPU creates an item_map for each shared resource and shares the sharehandle in a shared file memory manner, ensuring that the data in the cross-process migration process can be correctly restored and executed.

[0121] Figure 5 FIG. 5 is a block diagram of an electronic device 500 according to an exemplary embodiment. Figure 5 As shown, the electronic device 500 may include: a processor 501 and a memory 502. The electronic device 500 may also include one or more of a multimedia component 503, an input / output (I / O) interface 504, and a communication component 505.

[0122] The processor 501 is used to control the overall operation of the electronic device 500 to complete all or part of the steps in the above-mentioned multi-process application migration method. The memory 502 is used to store various types of data to support the operation of the electronic device 500, and these data may include, for example, instructions for any application or method used to operate on the electronic device 500, and application-related data, such as contact data, sent and received messages, pictures, audio, video, etc. The memory 502 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, referred to as EPROM), programmable read-only memory (Programmable Read-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic memory, flash memory, magnetic disk or optical disk. The multimedia component 503 may include a screen and an audio component. The screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may be further stored in the memory 502 or sent through the communication component 505. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 504 provides an interface between the processor 501 and other interface modules, and the above-mentioned other interface modules may be keyboards, mice, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 505 is used for wired or wireless communication between the electronic device 500 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, etc., or a combination of one or more of them, is not limited here. Therefore, the corresponding communication component 505 may include: Wi-Fi module, Bluetooth module, NFC module, etc.

[0123] In an exemplary embodiment, the electronic device 500 can be implemented by one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned multi-process application migration method.

[0124] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, and when the program instructions are executed by a processor, the steps of the above-mentioned multi-process application migration method are implemented. For example, the computer-readable storage medium can be the above-mentioned memory 502 including program instructions, and the above-mentioned program instructions can be executed by the processor 501 of the electronic device 500 to complete the above-mentioned multi-process application migration method.

[0125] In another exemplary embodiment, a computer program product is further provided. The computer program product includes a computer program executable by a programmable device. The computer program has a code portion for executing the above-mentioned migration method of the multi-process application when executed by the programmable device.

[0126] The preferred embodiments of the present disclosure are described in detail above in conjunction with the accompanying drawings; however, the present disclosure is not limited to the specific details in the above embodiments. Within the technical concept of the present disclosure, a variety of simple modifications can be made to the technical solution of the present disclosure, and these simple modifications all fall within the protection scope of the present disclosure.

[0127] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present disclosure will not further describe various possible combinations.

[0128] In addition, various embodiments of the present disclosure may be arbitrarily combined, and as long as they do not violate the concept of the present disclosure, they should also be regarded as the contents disclosed by the present disclosure.

Claims

1. A migration method for a multi-process application, characterized in that: The method comprises: In the case of triggering process migration, data information corresponding to the multi-process application is sent to the application layer through the source end, so that the application layer forwards the data information to the destination end, wherein the multi-process application is an application of multiple processes in the application layer occupying shared resources in the source end, and the data information includes an execution context and a unique source identifier of each process, and the source identifier includes a source process identifier and a shared handle; The data information is updated through the destination end to obtain target data information, and the multi-process application is restored in the destination end according to the target data information, wherein the target data information includes the execution context and a unique destination identifier of each process, and the destination identifier includes a target process identifier and a target handle. After the multi-process application is migrated from the source end to the destination end, the source identifier in the handle package is updated to the destination identifier through the application layer, wherein the handle package is used to store the handle and process identifier of the multi-process application during the migration process.

2. The method for migrating a multi-process application according to claim 1, characterized in that: The method further comprises: In the case where the application layer acquires the shared resource, the source end determines the source identifier corresponding to the process according to the source process identifier and the shared handle of each process; An execution context of each of the processes is determined, and data information is determined according to the execution context and the plurality of source identifiers.

3. The method for migrating a multi-process application according to claim 1, characterized in that: The step of updating the data information through the destination end to obtain target data information includes: Each source identifier in the data information is updated by the destination end to obtain a corresponding destination identifier, and a plurality of the destination identifiers and the execution context are used as target data information.

4. The method for migrating a multi-process application according to any one of claims 1 to 3, characterized in that: The method further comprises: The destination end monitors the migration status of the multi-process application according to the data information and the target data information.

5. The method for migrating a multi-process application according to claim 4, characterized in that: The data information includes a first number, and the target data information includes a second number; The monitoring, by the destination end according to the data information and the target data information, the migration status of the multi-process application includes: The destination end determines that the multi-process application migration is completed based on the second number and the first number, wherein the first number is obtained by the source end counting the source identifier in the data information, and the second number is obtained by the destination end counting the destination identifier in the target data information.

6. The method for migrating a multi-process application according to any one of claims 1 to 3, characterized in that: The source end and the destination end run in an execution layer, and the execution layer is where the multi-process application actually runs.

7. A migration device for a multi-process application, characterized in that: The device comprises: The source end is configured to send data information corresponding to the multi-process application to the application layer when the process migration is triggered, so that the application layer forwards the data information to the destination end, wherein the multi-process application is an application of multiple processes in the application layer occupying shared resources in the source end, and the data information includes an execution context of each process and a unique source identifier, and the source identifier includes a source process identifier and a shared handle; The destination end is configured to update the data information, obtain target data information, and restore the multi-process application according to the target data information, wherein the target data information includes the execution context and a unique destination identifier of each process, and the destination identifier includes a target process identifier and a target handle. After the multi-process application is migrated from the source end to the destination end, the source identifier in the handle package is updated to the destination identifier through the application layer, wherein the handle package is used to store the handle and process identifier of the multi-process application during the migration process.

8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method described in any one of claims 1 to 6 are implemented.

9. An electronic device, characterized in that: include: a memory having a computer program stored thereon; A processor, configured to execute the computer program in the memory to implement the steps of the method according to any one of claims 1 to 6.