Code migration system based on multi-system isolation

By establishing a shared hardware resource mapping and transmissive transmission mechanism in a multi-system isolated code migration system, the problem of hardware code not universal between different operating systems is solved, and efficient utilization of hardware resources and simplification of code migration is achieved.

CN120256067BActive Publication Date: 2025-08-19KYLIN CORP
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

When running multiple operating systems on SOC chips, the hardware code between different operating systems cannot be universal, resulting in hardware devices not being able to run in each other's systems, affecting the efficiency of multiple operating systems.

Method used

By establishing a shared hardware resource mapping and transmission mechanism between the migration management components, the migration customer components and the migration service components, generating shared mapped data packets, parsing hardware resources and creating virtual hardware resources in the migration customer system domain, code migration between different operating systems is realized.

Benefits of technology

It saves the workload of code migration in different operating systems, reduces the difficulty of code migration, and improves the efficiency of hardware resources and code migration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120256067B_ABST
    Figure CN120256067B_ABST
Patent Text Reader

Abstract

The present invention discloses a code migration system based on multi-system isolation. This system analyzes and determines the corresponding hardware resources for code that cannot be directly compiled, creates corresponding virtual hardware resources in the migration client system domain, and transparently transmits data to the corresponding hardware resources in the migration service system domain, facilitating data transfer to the migration service system domain, allowing the unconverted code to run in the migration service system domain. This system reduces the workload of migrating code between different operating systems and reduces the difficulty of code migration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of code migration, and in particular to a code migration system based on multi-system isolation. Background Art

[0002] To meet the need to run multiple operating systems on a single SoC, technologies are becoming increasingly common. These include virtualization methods such as KVM and XEN, and hardware isolation methods like jailhouses. Sharing hardware between different systems is often achieved by providing virtual shared devices. These isolated systems can run the same code across multiple systems using common languages like C, Python, and Java.

[0003] Between multiple operating systems, the RTOS system needs to dynamically migrate related non-real-time tasks to the Linux system, and vice versa. However, since the migration code between the RTOS and Linux systems often involves hardware devices, the hardware code of each system cannot be run without the hardware devices. There are many versions of RTOS systems, such as Zephyr, Nuttx, Free-RTOS, and ThreadX. The hardware-related code between different operating systems is not universal, which affects the efficiency of multiple operating systems on SoC chips. Summary of the Invention

[0004] The embodiment of the present invention provides a code migration system based on multi-system isolation to solve the technical problem in the prior art that hardware-related codes cannot be universally used between multiple isolated operating systems in a SOC chip.

[0005] An embodiment of the present invention provides a code migration system based on multi-system isolation, including:

[0006] A migration management component, disposed in the migration service system domain, comprising: a migration management module configured to extract non-converted code from the code to be migrated, parse the non-converted code, obtain shared hardware resources required by the non-converted code to execute the system containing the code to be converted, add a shared call code identifier to the non-converted code and the hardware resources, and generate a shared mapping data packet using the non-converted code and the hardware resources with the identifier added;

[0007] A migration client component, the migration client component being disposed in the migration client system domain, comprising: a migration client module configured to receive a shared mapping data packet sent by the migration management system, extract shared hardware resources from the shared mapping data packet, add corresponding virtual hardware resources in the migration client system domain based on the shared hardware resource information, and establish a transparent transmission mechanism between the virtual hardware resources and the hardware resources corresponding to the system;

[0008] A migration service component, the migration service component being arranged in the migration service system domain, comprising: a migration service module, configured to parse the shared mapping data packet to obtain hardware resources and lock the hardware resources;

[0009] The service dynamic loading module is used to use the hardware resources obtained by analysis to interact with the virtual hardware resources of the migration client module, use the information of the hardware resources after interaction to load and run the non-converted code obtained by analysis, and send the execution result to the migration client system domain using shared memory.

[0010] Furthermore, the migration management module is further configured to:

[0011] Extracting direct conversion code from the code to be converted;

[0012] Extracting complex conversion code from the code to be converted;

[0013] Accordingly, the migration service system domain further includes:

[0014] The migration code conversion library is used to directly convert the direct conversion code through the mapping relationship between codes, obtain the common interface of the complex conversion code, and encapsulate the complex conversion code using the common interface.

[0015] Furthermore, the hardware resources include:

[0016] Interrupt hardware resources and register resources;

[0017] The register resources are used to provide parameters for the non-converted code loaded and run by the migration service system domain, or to provide instruction temporary storage services for interrupts;

[0018] The interrupt hardware resource is used to provide interrupt information for migrating the client system domain.

[0019] Furthermore, the migration service system domain includes: a system code compilation environment for compiling the direct conversion code, the complex conversion code, and the indirect conversion code to form a migration code;

[0020] The shared calling code identifier includes:

[0021] A calling function, wherein the calling function is used to call the non-conversion code read by the migration service system domain and provide corresponding parameters for the non-conversion code by using the hardware resources;

[0022] Correspondingly, the migration management module sends the migration code to the migration client module.

[0023] Furthermore, the migration client system domain also includes:

[0024] The client dynamic loading module is used to load and run the migration code received by the migration client module, use shared memory to load and run the non-conversion code, use the service dynamic loading module to run the non-conversion code using the calling function, and receive the running results of the service dynamic loading module.

[0025] Furthermore, the migration management module is further configured to:

[0026] Marking shared hardware resource information as in use, the shared hardware resource information including: shared register resources and shared interrupt resources and the migration service system domain in which they are located;

[0027] When a preset recycling condition is met, a resource recycling confirmation request is sent to the migration client module using the shared hardware resource;

[0028] receiving resource recycling confirmation information returned by the migration client module, and marking the shared hardware resource information as a to-be-recycled state;

[0029] Send resource recovery information to the migration service module, receive returned shared hardware resource release information, and delete the shared hardware resource information mark.

[0030] Furthermore, the migration management module is further configured to:

[0031] Obtaining a code distribution plan, the code distribution plan including: each migration client system domain and a corresponding distributed code block;

[0032] Determine the hardware resources required for each code block;

[0033] Obtain hardware resources from the migration service system domain and determine the hardware resources required for the task based on the current task of the migration service system domain;

[0034] Determining idle hardware resources based on the required hardware resources, and generating a partitioning plan for the idle hardware resources based on the hardware resources;

[0035] Send a hardware resource split request to the migration service system domain according to the split plan, and split the hardware resources according to the returned response;

[0036] The segmentation result is sent to the corresponding migration client system domain, so that the migration client component in the migration client system domain completes the creation of virtual hardware resources and the establishment of a transparent transmission mechanism according to the segmentation result, and establishes a segmentation use mark for the segmented hardware resources.

[0037] Furthermore, the migration management module is further configured to:

[0038] Obtaining a migration identifier for each code block, wherein the migration identifier includes: a type identifier and a sequence identifier;

[0039] Calculate the loading priority of each code block according to the type identifier and the sequence identifier;

[0040] The corresponding loading priority is issued to each migration customer system domain.

[0041] Furthermore, the migration code conversion library is also used to:

[0042] Detect functions in a code block, and if there are device-related function functions, mark the device-related function code block as real-time type;

[0043] When there are related operation functions, mark the related operation function code blocks as calculation type;

[0044] When a specific function exists, the code block of the specific function is marked as real-time type;

[0045] When there are code blocks related to a specific function library, mark the related code blocks as dependent;

[0046] Device-specific, library-specific, and code block-specific sequence determination and tagging.

[0047] The code migration system based on multi-system isolation provided by the embodiment of the present invention is provided by respectively setting a migration management component, a migration client component and a migration service component. The migration management component is set in the migration service system domain, and includes: a migration management module for extracting non-converted code from the code to be migrated, parsing the non-converted code, obtaining the shared hardware resources required by the system where the non-converted code executes the code to be converted, adding a shared call code identifier to the non-converted code and the hardware resources, and generating a shared mapping data packet using the non-converted code and the hardware resources with the added identifier; a migration client component, which is set in the migration client system domain, and includes: a migration client module for receiving the shared mapping data packet sent by the migration management system, and Extracting shared hardware resources from a shared mapping data packet, adding corresponding virtual hardware resources to the migration client system domain based on the shared hardware resource information, and establishing a transparent transmission mechanism between the virtual hardware resources and the hardware resources corresponding to the system; a migration service component, which is set in the migration service system domain and includes: a migration service module for parsing the hardware resources from the shared mapping data packet and locking the hardware resources; a service dynamic loading module for using the parsed hardware resources to exchange information with the virtual hardware resources of the migration client module, using the information of the exchanged hardware resources to load and run the parsed non-converted code, and sending the execution results to the migration client system domain using shared memory. For code that cannot be directly compiled, the corresponding hardware resources can be determined through analysis, and virtual hardware resources can be created in the migration client system domain. Data can be exchanged with the corresponding hardware resources in the migration service system domain using a transparent transmission method, facilitating the transmission of data to the migration service system domain, so that the code that cannot be converted can be run in the migration service system domain. This can save the workload of migrating code from different operating systems and reduce the difficulty of code migration. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Other features, objects and advantages of the present invention will become more apparent upon reading the detailed description of non-limiting embodiments made with reference to the following drawings:

[0049] Figure 1 This is a schematic diagram of the structure of a code migration system based on multi-system isolation provided by an embodiment of the present invention;

[0050] Figure 2 Schematic diagram of a migration code conversion library of a code migration system based on multi-system isolation provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0051] The present invention will be further described in detail below with reference to the accompanying drawings and examples. It will be understood that the specific embodiments described herein are intended only to illustrate the present invention and are not intended to limit the present invention. It should also be noted that, for ease of description, the accompanying drawings only illustrate portions relevant to the present invention, not all structures.

[0052] Figure 1 This is a schematic diagram of the structure of the code migration system based on multi-system isolation provided by an embodiment of the present invention. Figure 1 The multi-system isolation-based code migration system may include: a migration management component, the migration management component being arranged in the migration service system domain, including: a migration management module for extracting non-converted code from the code to be migrated, parsing the non-converted code, obtaining shared hardware resources required by the non-converted code to execute the system where the code to be converted is located, adding a shared call code identifier to the non-converted code and the hardware resources, and generating a shared mapping data packet using the non-converted code and the hardware resources with the added identifier;

[0053] A migration client component, which is arranged in the migration client system domain, includes: a migration client module, which is used to receive a shared mapping data packet sent by the migration management system, extract shared hardware resources from the shared mapping data packet, add corresponding virtual hardware resources in the migration client system domain according to the shared hardware resource information, and establish a transparent transmission mechanism for the virtual hardware resources and the hardware resources corresponding to the system; a migration service component, which is arranged in the migration service system domain, includes: a migration service module, which is used to parse and obtain hardware resources from the shared mapping data packet and lock the hardware resources; a service dynamic loading module, which is used to use the hardware resources obtained by parsing to exchange information with the virtual hardware resources of the migration client module, use the information of the hardware resources after the interaction to load and run the non-converted code obtained by parsing, and send the execution result to the migration client system domain using shared memory.

[0054] In this embodiment, the isolation system can be used to isolate different hardware resources on the same multi-core CPU and run multiple different operating systems. This includes a master system and slave systems, and there can be multiple slave systems. In this embodiment, the master system can be a Linux system, and the slave systems can be RTOS systems. Exemplary versions of these systems include Zephyr, Nuttx, Free-RTOS, and ThreadX.

[0055] Exemplarily, a migration management component may be provided in the main system domain, and the migration management component may include: a migration management module, a migration code conversion library, and a system code compilation environment.

[0056] Figure 2This is a schematic diagram of a migration code conversion library of a code migration system based on multi-system isolation provided by an embodiment of the present invention, see Figure 2 The migration code conversion library establishes corresponding migration code conversion libraries between systems of different types, for example: the migration code conversion library corresponding to the Linux system and each RTOS system, such as the migration code conversion library between the Linux system and the Zephyr system; the migration code conversion library corresponding to different types of RTOS systems, such as the Nuttx and Zephyr migration code conversion library.

[0057] The migration code conversion library obtains the code that needs to be migrated, and various conversion rules can be set in the migration code conversion library to facilitate the conversion of codes of different operating systems. The migration code conversion library can receive the code to be converted and divide the code to be converted into direct conversion code, complex conversion code and non-conversion code, wherein the non-conversion code can be the code part that requires hardware support to be implemented. For example, the code that needs to process the hardware interrupt and the parameters in it require the hardware to provide an interrupt signal to be implemented can be regarded as non-conversion code. Or a specific register is required to pass the various parameters required for the code to run, and to save various addresses, etc.

[0058] Since the non-converted code cannot be transplanted to the migration client system domain, the migration client system domain is provided with a migration client component. In order to enable the migrated code to run normally, the migration service system domain can be used to load and run the above code.

[0059] In this embodiment, the migration management system may also include: a migration management module, which is used to parse non-conversion code, obtain various hardware resources required for the non-conversion code when running in the migration service system domain, and at the same time add a shared call code identifier to the non-conversion code and the various required hardware resources, and use the non-conversion code with the added identifier and the various required hardware resources to generate a shared mapping data packet.

[0060] The migration management system can send a shared mapping data packet to the migration client system domain and the migration service system domain. Upon receiving the shared mapping data packet, the migration client system domain extracts the non-converted code and hardware resources contained therein, registers the corresponding virtual hardware resources in the migration client system domain based on the hardware resources, and binds the virtual hardware resources with the hardware resources of the migration service system domain, establishing a transparent transmission mechanism. This facilitates data exchange between the migration client system domain and the migration service system domain.

[0061] After receiving the shared mapping data packet, the migration service system domain extracts the hardware resources and binds them to the virtual hardware resources to establish a transparent transmission mechanism. Furthermore, the shared memory provided in the SOC chip can be used to send the results of loading and running non-translated code to the migration client system domain via shared memory.

[0062] Correspondingly, the migration code conversion library can also extract direct conversion code from the code to be converted. This direct conversion code can be directly converted to one another through code mapping. For example, a Linux system interrupt registration function can be converted to a Zephyr interrupt registration function, as well as operating system print and delay functions. Using code mapping, direct conversion code can be directly converted.

[0063] The migration code conversion library can also extract complex conversion code from the code to be converted. This complex conversion code may be code that cannot be directly mapped due to differences in the code language of different operating systems. For example, the complex conversion code can be encapsulated according to the mapping relationship. For example, the operation code for interrupts and clocks can be encapsulated using the POSIX unified encapsulation.

[0064] Using the above three methods, the code to be migrated can be converted into three types. The corresponding migration management system includes: a system code compilation environment for compiling the direct conversion code, complex conversion code and indirect conversion code to form migration code.

[0065] In this embodiment, the shared calling code identifier includes: a calling function, which is used to call the non-converted code read by the migration service system domain and provide corresponding parameters for the non-converted code. The migration management system sends the migration code to the migration client system domain. The migration client system domain uses its own dynamic loading module to load and run the migration code. The compiled code for direct conversion and complex conversion can be run directly. When running to the non-converted code, the code in the migration service system domain is called by calling the function, and the parameters or interrupt information required by the code are obtained from the virtual hardware resources of the migration client system domain through transparent transmission. The code is executed, and the execution results are sent to the migration client system domain via shared memory.

[0066] Furthermore, the hardware resources include interrupt hardware resources and register resources. The register resources are used to provide parameters for the non-translated code loaded and executed by the migration service system domain, or to provide instruction buffering services for interrupts. The interrupt hardware resources are used to provide interrupt information to the migration client system domain. This allows the non-translated code to implement its functionality with hardware support.

[0067] The following further describes the working process of the code migration system based on multi-system isolation provided in this embodiment.

[0068] The code migration system based on multi-system isolation provided by this embodiment is provided by respectively setting up a migration management system, a migration client system domain and a migration service system domain. The migration management system is provided in the master system domain and includes: a migration management module for parsing non-converted code, obtaining hardware resources required by the system where the non-converted code executes the to-be-converted code, adding a shared call code identifier to the non-converted code and the hardware resources, and generating a shared mapping data packet using the non-converted code and the hardware resources with the added identifier; a migration client system domain, which is provided in the slave system domain and includes: a migration client module for receiving the shared mapping data packet sent by the migration management system, extracting the shared mapping data packet with the added identifier from the shared mapping data packet, and Non-converted code and hardware resources are registered in the domain based on the hardware resources, and a transparent transmission mechanism is established between the virtual hardware resources and the hardware resources corresponding to the system in which they are located, facilitating data exchange with the corresponding hardware resources and reading the execution results of the non-converted code from the shared memory. A migration service system domain is set in a slave system domain different from the migration client system domain, and includes: a migration service module for parsing the hardware resources from the shared mapping data packet; a dynamic loading module for loading and executing the parsed non-converted code using the parsed hardware resources, and sending the execution results to the migration client system domain via shared memory. For code that cannot be directly compiled, the corresponding hardware resources can be determined through analysis, and virtual hardware resources can be created in the migration client system domain. Data exchange with the corresponding hardware resources in the migration service system domain is achieved via transparent transmission, facilitating data transmission to the migration service system domain, so that the non-converted code can be executed in the migration service system domain. This can save the workload of migrating code between different operating systems and reduce the difficulty of code migration.

[0069] Furthermore, in order to improve the efficiency of hardware resource usage and thus enhance the efficiency of code migration, in this embodiment, the allocated hardware resources may be recycled so that other non-conversion codes can continue to use these hardware resources.

[0070] In this embodiment, the migration management module can also be used to: mark shared hardware resource information as in use, the shared hardware resource information including: shared register resources and shared interrupt resources and the migration service system domain in which they are located; when the preset recycling conditions are met, issue a resource recycling confirmation request to the migration client module that uses the shared hardware resources; receive the resource recycling confirmation information returned by the migration client module, and mark the shared hardware resource information as to be recycled; send resource recycling information to the migration service module, and receive the returned shared hardware resource release information, and delete the shared hardware resource information mark.

[0071] Exemplarily, the migration management module may include a shared hardware resource usage status table for recording the usage of allocated hardware resources. Optionally, the table may record the identifier of the migration service domain where the allocated hardware resources are located, the type and identifier of the hardware resources, and the identifier of the migration client system domain currently using the hardware resources. This table may be updated based on changes in usage.

[0072] The migration management module can send a resource recovery confirmation request to the migration client module according to preset recovery conditions, such as a preset duration, or when generating a new shared mapping data packet, and mark the shared hardware resource information as a pending recovery state. If the migration client module has received the corresponding calculation results, it can return resource recovery confirmation information to the migration management module and delete the corresponding shared hardware resource information mark. The migration management module is based on the returned resource recovery confirmation information. Otherwise, the migration client module returns resource occupation confirmation information, and the migration management module repeats sending the resource recovery confirmation request in the next cycle according to the pending recovery state until the hardware resources are recovered.

[0073] In this embodiment, to improve the efficiency of code conversion and loading and execution while fully utilizing the hardware performance of the SOC, the converted code can be segmented and then handed off to multiple migration client system domains to jointly complete the loading and execution of the converted code. To facilitate these tasks, the overall hardware resources need to be segmented. Optionally, the hardware resources may also include GPU resources. GPU resources can effectively enhance computing power and improve code execution efficiency.

[0074] In this embodiment, the migration service system domain and the migration service system domain may be the same system or different systems.

[0075] Exemplarily, the migration management module is also used to: obtain a code distribution plan, the code distribution plan including: each migration client system domain and the corresponding distributed code blocks; determine the hardware resources required for each code block; obtain hardware resources from the migration service system domain, and determine the task required hardware resources based on the current tasks of the migration service system domain; determine idle hardware resources based on the required hardware resources, and generate a partitioning plan for the idle hardware resources based on the hardware resources; send a hardware resource partitioning request to the migration service system domain according to the partitioning plan, and partition the hardware resources based on the returned response; send the partitioning result to the corresponding migration client system domain, so that the migration client component in the migration client system domain completes the creation of virtual hardware resources and the establishment of a transparent transmission mechanism according to the partitioning result, and establishes a partitioning usage mark for the partitioned hardware resources.

[0076] In this embodiment, the code to be migrated can be distributed across multiple migration client system domains to form a code distribution plan. For example, a table of available data to be migrated can be formed based on the requirements and idle status of the migration client system domains, the corresponding computing resources and available hardware resources, and the computing resources and hardware resources required by the divided code blocks. Based on the table of available migration data, each combination of the migration client system domains is traversed, and a usage score of the computing resources and hardware resources is set. Finally, a code distribution plan is determined based on the total score of each combination.

[0077] The migration management module generates and obtains a code distribution plan, which includes: each migration client system domain and the corresponding distributed code blocks; determining the hardware resources required for each code block; when the corresponding migration client system domain does not have the required hardware resources, the required hardware resources can be obtained from other migration client system domains and / or migration service system domains.

[0078] Exemplarily, hardware resources can be obtained from the migration service system domain, and task-required hardware resources can be determined based on the current tasks of the migration service system domain; idle hardware resources can be determined based on the required hardware resources, and a partitioning plan can be generated for the idle hardware resources based on the hardware resources; a hardware resource partitioning request can be sent to the migration service system domain based on the partitioning plan, and the hardware resources can be partitioned based on the returned response; the partitioning result can be sent to the corresponding migration client system domain, so that the migration client component in the migration client system domain can complete the creation of virtual hardware resources and the establishment of a transparent transmission mechanism based on the partitioning result, and a partitioning usage mark can be established for the partitioned hardware resources. Using the above method, the hardware resources of a migration service system domain can be partitioned into multiple hardware resources and provided to multiple migration client system domains for use when migrating code. Using the above method, the hardware resources of the migration service system domain can be fully and reasonably used, further improving the efficiency of code migration.

[0079] Since the contents of different code blocks are different, if they are loaded and run at the same time, the correlation between different code blocks will be ignored, which will cause the hardware resources of the migration service system domain to be occupied for a long time. Therefore, in this embodiment, the migration management module is also used to: obtain the migration identifier of each code block, and the migration identifier includes: type identifier and sequence identifier; calculate the loading priority of each code block according to the type identifier and sequence identifier; and send the corresponding loading priority to each migration client system domain. Further, the migration code conversion library is also used to: detect the functions in the code block, and when there is a device-related function function, mark the device-related function function code block as real-time type; when there is a related operation function, mark the related operation function code block as computing type; when there is a specific function, mark the characteristic function code block as real-time type; when there is a code block related to a specific function library, mark the related code block as dependent type; determine and mark the order of specific devices, specific function libraries and code blocks. Exemplarily, the computing type is a code block that requires a large amount of computing resources, such as a code block that runs on a Linux system and is accelerated by a GPU. The dependent type is a code block that requires related dependent resources, and the dependent resources include software resources and hardware resources. The real-time type is a code block that requires real-time response and has high requirements for delay. The migration code conversion library can determine the sequence mark of each code block based on the specific device in the code block. The specific device can be the device that is most relevant to the overall code function, such as temperature sensors, water flow sensors and other devices. And the functions and code blocks in the aforementioned specific function library determine the sequence mark of each code block and mark them according to the code block order before transplantation. The migration management module calculates the loading priority of each code block based on the type identifier and sequence identifier. For example, the sequence mark can be preset to different priority numbers, and the priority numbers corresponding to the priority number type are superimposed to determine the loading priority of each code block, and the loading priority of the code block calculated above is sent to the corresponding migration client system domain, so that each migration client system domain can be loaded and run in sequence, and the waiting migration client system domain can perform other tasks to avoid waste of resources of the entire system.

[0080] Note that the above are only preferred embodiments of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments and may include many other equivalent embodiments without departing from the concept of the present invention. The scope of the present invention is determined by the scope of the appended claims.

Claims

1. A code migration system based on multi-system isolation, characterized in that: include: A migration management component, disposed in the migration management system domain, comprising: a migration management module configured to extract non-converted code from the code to be migrated, parse the non-converted code, obtain shared hardware resources required by the non-converted code in the migration service system domain, add shared call code identifiers to the non-converted code and hardware resources, and generate a shared mapping data packet using the identified non-converted code and hardware resources; the non-converted code being the portion of code that requires hardware support to be implemented; A migration client component, the migration client component being disposed in the migration client system domain, comprising: a migration client module configured to receive a shared mapping data packet sent by the migration management system, extract shared hardware resources from the shared mapping data packet, add corresponding virtual hardware resources in the migration client system domain based on the shared hardware resource information, and establish a transparent transmission mechanism between the virtual hardware resources and the corresponding hardware resources of the system; A migration service component, the migration service component being arranged in the migration service system domain, comprising: a migration service module, configured to parse the shared mapping data packet to obtain hardware resources and lock the hardware resources; The service dynamic loading module is used to use the hardware resources obtained by analysis to interact with the virtual hardware resources of the migration client module, use the information of the hardware resources after interaction to load and run the non-converted code obtained by analysis, and send the execution result to the migration client system domain using shared memory.

2. The system according to claim 1, wherein: The migration management module is further configured to: Extracting direct conversion code from the code to be converted; Extracting complex conversion code from the code to be converted; Accordingly, the migration service system domain further includes: The migration code conversion library is used to directly convert the direct conversion code through the mapping relationship between codes, obtain the common interface of the complex conversion code, and encapsulate the complex conversion code using the common interface.

3. The system according to claim 2, characterized in that The hardware resources include: Interrupt hardware resources and register resources; The register resources are used to provide parameters for the non-converted code loaded and run by the migration service system domain, or to provide instruction temporary storage services for interrupts; The interrupt hardware resource is used to provide interrupt information for migrating the client system domain.

4. The system according to claim 3, characterized in that The migration management system domain includes: a system code compilation environment for compiling the direct conversion code, the complex conversion code and the indirect conversion code to form a migration code; The shared calling code identifier includes: A calling function, wherein the calling function is used to call the non-conversion code read by the migration service system domain and provide corresponding parameters for the non-conversion code by using the hardware resources; Correspondingly, the migration management module sends the migration code to the migration client module.

5. The system according to claim 4, characterized in that The migration client system domain also includes: The client dynamic loading module is used to load and run the migration code received by the migration client module, use shared memory to load and run the non-conversion code, use the service dynamic loading module to run the non-conversion code using the calling function, and receive the running results of the service dynamic loading module.

6. The system according to claim 1, wherein: The migration management module is further configured to: Marking shared hardware resource information as in use, the shared hardware resource information including: shared register resources and shared interrupt resources and the migration service system domain in which they are located; When a preset recycling condition is met, a resource recycling confirmation request is sent to the migration client module using the shared hardware resource; receiving resource recycling confirmation information returned by the migration client module, and marking the shared hardware resource information as a to-be-recycled state; Send resource recovery information to the migration service module, receive returned shared hardware resource release information, and delete the shared hardware resource information mark.

7. The system according to claim 6, characterized in that The migration management module is further configured to: Obtaining a code distribution plan, the code distribution plan including: each migration client system domain and a corresponding distributed code block; Determine the hardware resources required for each code block; Obtain hardware resources from the migration service system domain and determine the hardware resources required for the task based on the current task of the migration service system domain; Determining idle hardware resources based on the required hardware resources, and generating a partitioning plan for the idle hardware resources based on the required hardware resources; Send a hardware resource split request to the migration service system domain according to the split plan, and split the hardware resources according to the returned response; The segmentation result is sent to the corresponding migration client system domain, so that the migration client component in the migration client system domain completes the creation of virtual hardware resources and the establishment of a transparent transmission mechanism according to the segmentation result, and establishes a segmentation use mark for the segmented hardware resources.

8. The system according to claim 7, characterized in that The migration management module is further configured to: Obtaining a migration identifier for each code block, wherein the migration identifier includes: a type identifier and a sequence identifier; Calculate the loading priority of each code block according to the type identifier and the sequence identifier; The corresponding loading priority is issued to each migration customer system domain.

9. The system according to claim 8, characterized in that Migration code conversion library, also used for: Detect functions in a code block, and if there are device-related function functions, mark the device-related function code block as real-time type; When there are related operation functions, mark the related operation function code blocks as calculation type; When a specific function exists, the code block of the specific function is marked as real-time type; When there are code blocks related to a specific function library, mark the related code blocks as dependent; Device-specific, library-specific, and code block-specific sequence determination and tagging.

Citation Information

Patent Citations

  • Machine learning techniques for enhancing video conferencing applications

    CN114820995A

  • Servo mechanism-oriented distributed test system and method

    CN117111573A