Code migration system based on multi-system isolation

By setting up migration management, customer and service components on the SOC chip, parsing non-converted code to obtain shared hardware resources and creating virtual resources, the problem of hardware code not being universal between different operating systems is solved, and efficient code migration and hardware resource utilization is achieved.

CN120256067AActive Publication Date: 2025-07-04KYLIN CORP

Patent Information

Application Number
CN202510740122.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-05
Publication Date
2025-07-04
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 between multiple operating systems, affecting usage efficiency.

Method used

By setting up migration management components, migration customer components and migration service components, parsing non-transformed code to obtain shared hardware resources, generating shared mapping data packets, and creating virtual hardware resources in the migration customer system domain, establishing a transmissive transmission mechanism to realize code migration between different operating systems.

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 efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120256067A_ABST
    Figure CN120256067A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a code migration system based on multi-system isolation, which can determine corresponding hardware resources through analysis for codes which cannot be directly compiled, and correspondingly create virtual hardware resources in a migration client system domain. And data interaction with corresponding hardware resources in the migration service system domain is realized in a transparent transmission mode, so that data can be conveniently transmitted to the migration service system domain, and codes which cannot be converted can be conveniently operated in the migration service system domain. The code migration workload of different operating systems can be saved, and meanwhile the code migration difficulty is lowered.
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 increasing common need to run multiple operating systems on a single SOC chip, including virtualization methods such as KVM, XEN, etc., and hardware isolation methods such as jailhouse. For the shared use of hardware between different systems, it is often achieved by providing virtual shared devices. The same code can be run commonly between these isolated multi-systems through common languages such as C, Python, Java, etc.

[0003] Between multiple operating systems, the rtos system needs to dynamically migrate relevant non-real-time tasks to the Linux system, and the Linux system needs to dynamically migrate relevant real-time tasks to the rtos system. However, since migrating code between the rtos system and the Linux system often involves hardware devices, the hardware code of each other's systems cannot run without hardware devices. The rtos system has many versions such as zephyr, nuttx, free-rtos, threadx, etc. The code involving hardware between different operating systems cannot be universal, which affects the usage efficiency of multi-operating systems on the SOC chip. Summary of the Invention

[0004] Embodiments of the present invention provide a code migration system based on multi-system isolation to solve the technical problem in the prior art that the code involving hardware between multiple isolated operating systems in a single SOC chip cannot be universal.

[0005] Embodiments of the present invention provide a code migration system based on multi-system isolation, including: A migration management component, which is set in the migration service system domain and includes: a migration management module, used to extract non-converted code from the code to be migrated, parse the non-converted code, obtain the shared hardware resources required for the non-converted code to execute the system where the to-be-converted code is located, add a shared call code identifier to the non-converted code and the hardware resources, and generate a shared mapping data packet by 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, used to receive the shared mapping data packet sent by the migration management system, extract the 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 passthrough mechanism between the virtual hardware resources and the hardware resources corresponding to the system where it is located; Migration service component, which is set in the migration service system domain and includes: a migration service module for parsing hardware resources from the shared mapping data packet and locking the hardware resources; A service dynamic loading module for interacting information between the parsed hardware resources and the virtual hardware resources of the migration client module, loading and running the parsed non-converted code using the information of the hardware resources after interaction, and sending the execution result to the migration client system domain in a shared memory manner.

[0006] Furthermore, the migration management module is also used for: Extracting direct conversion code from the code to be converted; Extracting complex conversion code from the code to be converted; Correspondingly, the migration service system domain further includes: A migration code conversion library for directly converting the direct conversion code through the mapping relationship between codes, obtaining the general interface of the complex conversion code, and encapsulating the complex conversion code using the general interface.

[0007] Furthermore, 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 provide instruction temporary storage services for interrupts; The interrupt hardware resources are used to provide interrupt information for the migration client system domain.

[0008] Furthermore, the migration service system domain includes: a system code compilation environment for compiling the direct conversion code, complex conversion code, and non-direct conversion code to form migration code; The shared call code identifier includes: A call function for calling the non-converted code read by the migration service system domain and providing corresponding parameters for the non-converted code using the hardware resources; Correspondingly, the migration management module sends the migration code to the migration client module.

[0009] Furthermore, the migration client system domain further includes: A client dynamic loading module for loading and running the migration code received by the migration client module, loading and running non-running code using shared memory, and using the call function to run the non-running code using the service dynamic loading module and receiving the running result of the service dynamic loading module.

[0010] Furthermore, the migration management module is also used for: Mark the shared hardware resource information as being in use, where the shared hardware resource information includes: shared register resources, shared interrupt resources, and the migration service system domain where they are located; When a preset recycling condition is met, send a resource recycling confirmation request to the migration client module using the shared hardware resource; Receive the resource recycling confirmation information returned by the migration client module, and mark the shared hardware resource information as being pending recycling; Send resource recycling information to the migration service module, and receive the returned shared hardware resource release information, then delete the shared hardware resource information mark.

[0011] Furthermore, the migration management module is also used for: Obtain a code distribution plan, where the code distribution plan includes: 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 according to the current tasks in the migration service system domain; Determine the idle hardware resources according to the required hardware resources, and generate a segmentation plan for the idle hardware resources based on the hardware resources; Send a hardware resource segmentation request to the migration service system domain according to the segmentation plan, and segment the hardware resources according to the returned response; Send the segmentation result to the corresponding migration client system domain, so that the migration client components in the migration client system domain can complete the creation of virtual hardware resources and the establishment of a passthrough mechanism according to the segmentation result, and establish a segmentation usage mark for the segmented hardware resources.

[0012] Furthermore, the migration management module is also used for: Obtain the migration identifier of each code block, where the migration identifier includes: a type identifier and an order identifier; Calculate the loading priority of each code block according to the type identifier and the order identifier; Send the corresponding loading priority to each migration client system domain.

[0013] Even further, the migration code conversion library is also used for: Detect the functions in the code block. When there are device-related function functions, mark the code block of the device-related function function as real-time type; When there are related arithmetic functions, mark the code block of the related arithmetic functions as computational type; When there are specific functions, mark the code block of the specific function as real-time type; When there are code blocks related to a specific function library, mark the related code blocks as dependent type; Determine and mark the order tags for specific devices, specific function libraries, and code blocks in sequence.

[0014] The code migration system based on multi-system isolation provided by the embodiments of the present invention, 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, which is used to extract non-converted code from the code to be migrated, parse the non-converted code, obtain the shared hardware resources required for the non-converted code to execute the code in the system 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 by using the non-converted code and the hardware resources after adding the identifier; a migration client component, which is set in the migration client system domain and includes: a migration client module, which is used to receive the shared mapping data packet sent by the migration management system, extract the 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 passthrough mechanism for the virtual hardware resources and the hardware resources corresponding to the system where they are located; a migration service component, which is set in the migration service system domain and includes: a migration service module, which is used to parse and obtain the hardware resources from the shared mapping data packet and lock the hardware resources; a service dynamic loading module, which is used to interact with the virtual hardware resources of the migration client module by using the parsed hardware resources, load and run the parsed non-converted code by using the information of the hardware resources after the interaction, and send the execution result to the migration client system domain in a shared memory manner. It is possible to analyze and determine the corresponding hardware resources for the code that cannot be directly compiled, create corresponding virtual hardware resources in the migration client system domain, and realize data interaction with the corresponding hardware resources in the migration service system domain in a passthrough manner, so as to facilitate the transfer 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. It can save the workload of code migration between different operating systems and reduce the difficulty of code migration at the same time. Description of the Drawings

[0015] By reading the detailed description of the non-restrictive embodiments with reference to the following drawings, other features, purposes, and advantages of the present invention will become more obvious: Figure 1 is a schematic structural diagram of the code migration system based on multi-system isolation provided by the embodiments of the present invention; Figure 2 is a schematic diagram of the migration code conversion library of the code migration system based on multi-system isolation provided by the embodiments of the present invention. Detailed Embodiments

[0016] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only for explaining the present invention, rather than limiting the present invention. In addition, it should be noted that for the convenience of description, only the parts related to the present invention rather than all the structures are shown in the drawings.

[0017] Figure 1 is a schematic structural diagram of a code migration system based on multi-system isolation provided by an embodiment of the present invention. Refer to Figure 1 , the code migration system based on multi-system isolation may include: a migration management component, which is set in the migration service system domain and includes: a migration management module, which is used to extract non-converted code from the code to be migrated, parse the non-converted code, obtain the shared hardware resources required for the non-converted code to execute the system where the code to be converted is located, add a shared call code identifier to the non-converted code and the hardware resources, and generate a shared mapping data packet by using the non-converted code and the hardware resources after adding the identifier; a migration client component, which is set in the migration client system domain and includes: a migration client module, which is used to receive the shared mapping data packet sent by the migration management system, extract the 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 passthrough mechanism for 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, which is used to parse and obtain the hardware resources from the shared mapping data packet and lock the hardware resources; a service dynamic loading module, which is used to perform information interaction between the parsed hardware resources and the virtual hardware resources of the migration client module, load and run the parsed non-converted code by using the information of the hardware resources after the interaction, and send the execution result to the migration client system domain in a shared memory manner.

[0018] In this embodiment, the isolation system may be to isolate different hardware resources on the same multi-core CPU to run multiple different operating systems. Among them, it includes: a main system and slave systems, and there may be multiple slave systems. In this embodiment, the main system may be a Linux system, and the slave systems may adopt RTOS systems. Exemplarily, versions such as zephyr, nuttx, free-rtos, and threadx can be adopted.

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

[0020] Figure 2It is a schematic diagram of the migration code conversion library of the code migration system based on multi-system isolation provided by the embodiments of the present invention. Refer to Figure 2 , the migration code conversion library establishes corresponding migration code conversion libraries between systems of different types. For example, the migration code conversion libraries 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 libraries corresponding to different types of rtos systems, such as the migration code conversion library between Nuttx and Zephyr.

[0021] Among them, the migration code conversion library obtains the code to be migrated. Various conversion rules can be set in the migration code conversion library to facilitate the conversion of the code of different operating systems. The migration code conversion library can receive the code to be converted and divide the code to be converted into directly convertible code, complex convertible code, and non-convertible code. Among them, the non-convertible code can be the part of the code that requires hardware support to be implemented. For example: the code that needs to handle hardware interrupts, and the parameters therein need the hardware to provide interrupt signals to be implemented. This kind of code can be regarded as non-convertible code. Or a certain specific register is required to transfer various parameters required for code operation and save various addresses, etc.

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

[0023] In this embodiment, the migration management system may further include: a migration management module. The migration management module is used to parse the non-convertible code, obtain various hardware resources required for the non-convertible code to run in the migration service system domain, and at the same time add a shared call code identifier to the non-convertible code and various required hardware resources, and generate a shared mapping data packet by using the non-convertible code with the added identifier and various required hardware resources.

[0024] The migration management system can send the shared mapping data packet to the migration client system domain and the migration service system domain. After receiving the shared mapping data packet, the migration client system domain extracts the non-convertible code and hardware resources therein, registers the corresponding virtual hardware resources in the migration client system domain according to the hardware resources, and binds the virtual hardware resources and the hardware resources of the migration service system domain to establish a pass-through mechanism. So as to facilitate the interaction of data between the migration client system domain and the migration service system domain.

[0025] After receiving the shared mapping data packet, the migration service system domain extracts the hardware resources therein and binds the hardware resources to the virtual hardware resources to facilitate the establishment of a passthrough mechanism. In addition, the shared memory set in the SOC chip can be utilized to send the loading and running results of the non-converted code to the migration client system domain via the shared memory.

[0026] Correspondingly, the migration code conversion library can also extract direct conversion codes from the code to be converted. The direct conversion codes can be codes that are directly converted with each other through a code mapping relationship. For example, the interrupt registration function of the linux system is converted into the interrupt registration function of zephyr, as well as the operating system printing and delay functions. The direct conversion codes can be directly converted using the code mapping method.

[0027] The migration code conversion library can also extract complex conversion codes from the code to be converted. The complex conversion codes can be codes that cannot be directly mapped and converted due to differences in the code languages of different operating systems. For complex conversion codes, they can also be encapsulated according to the mapping relationship. For example, for operation codes such as interrupts and clocks, they are uniformly encapsulated using posix.

[0028] Using the above three methods, the code to be migrated can be converted according to three types. Correspondingly, the migration management system includes: a system code compilation environment for compiling the direct conversion codes, complex conversion codes, and non-direct conversion codes to form migration codes.

[0029] In this embodiment, the shared call code identifier includes: a call function. The call function 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 directly converted and complex-converted compiled codes can be directly run. When running to the non-converted code, the code in the migration service system domain is called through the call function, and the parameters or interrupt and other information required by the code are obtained from the virtual hardware resources of the migration client system domain in a passthrough manner to implement the running of the code, and the running result is sent to the migration client system domain via the shared memory method.

[0030] Furthermore, 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 provide instruction temporary storage services for interrupts. The interrupt hardware resources are used to provide interrupt information for the migration client system domain. Through the above method, the non-converted code can implement its functions with hardware support.

[0031] The working process of the code migration system based on multi-system isolation provided in this embodiment is further described below.

[0032] The code migration system based on multi-system isolation provided in this embodiment is configured by separately setting up a migration management system, a migration client system domain, and a migration service system domain. The migration management system is set in the main system domain and includes: a migration management module for parsing non-converted code, obtaining the hardware resources required for the non-converted code to execute the code to be converted in the target system, 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; the migration client system domain, which is set 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 non-converted code and the hardware resources with the added identifier from the shared mapping data packet, registering corresponding virtual hardware resources in the domain according to the hardware resources, and establishing a passthrough mechanism between the virtual hardware resources and the hardware resources corresponding to the target system to facilitate data interaction with the corresponding hardware resources, and reading the execution result of the non-converted code from the shared memory; the migration service system domain, which 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 running the parsed non-converted code using the parsed hardware resources, and sending the execution result to the migration client system domain in a shared memory manner. For code that cannot be directly compiled, through analysis, the corresponding hardware resources can be determined, and virtual hardware resources can be created correspondingly in the migration client system domain, and data interaction with the corresponding hardware resources in the migration service system domain can be achieved through the passthrough method, facilitating the transfer 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 code migration between different operating systems and reduce the difficulty of code migration.

[0033] Furthermore, in order to improve the utilization efficiency of hardware resources and thus enhance the efficiency of code migration, in this embodiment, the already allocated hardware resources can be recycled to facilitate other non-converted codes to continue using these hardware resources.

[0034] In this embodiment, the migration management module can also be used to: mark the shared hardware resource information as in-use status, where the shared hardware resource information includes: shared register resources, shared interrupt resources, and the migration service system domain where they are located; when the preset recycling condition is met, send 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, mark the shared hardware resource information as to-be-recycled status; send the 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.

[0035] Exemplarily, a shared hardware resource usage status table can be provided in the migration management module to record the usage of the allocated hardware resources. Optionally, it can record the mark of the migration service domain where the allocated hardware resources are located, the type and mark of the hardware resources, and the mark of the migration client system domain that currently uses these hardware resources, and can update them according to the changes in usage.

[0036] The migration management module can send a resource recycling confirmation request to the migration client module according to the preset recycling condition, such as: a preset duration, or when generating a new shared mapping data packet, and mark the shared hardware resource information as to-be-recycled status. If the migration client module has received the corresponding calculation result, it can return the resource recycling confirmation information to the migration management module and delete the corresponding shared hardware resource information mark. The migration management module acts according to the returned resource recycling confirmation information. Otherwise, the migration client module returns a resource occupancy confirmation information, and the migration management module repeats sending the resource recycling confirmation request in the next cycle according to the to-be-recycled status until the hardware resources are recycled.

[0037] In this embodiment, in order to improve the efficiency of code conversion and loading and running, and at the same time make full use of the hardware performance of the SOC. Therefore, the conversion code can be segmented, and the segmented code can be handed over to multiple migration client system domains respectively to jointly complete the loading and running work of the code to be converted. To cooperate with the above tasks, it is necessary to segment the overall hardware resources. Optionally, the hardware resources can also include: GPU resources. GPU resources can effectively enhance the computing power and improve the code running efficiency.

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

[0039] Exemplarily, the migration management module is further configured to: obtain a code distribution plan, where the code distribution plan includes: 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 according to the current tasks in the migration service system domain; determine the idle hardware resources according to the required hardware resources, generate a segmentation plan for the idle hardware resources according to the hardware resources; send a hardware resource segmentation request to the migration service system domain according to the segmentation plan, and segment the hardware resources according to the returned response; send the segmentation result to the corresponding migration client system domain, so that the migration client components in the migration client system domain complete the creation of virtual hardware resources and the establishment of a passthrough mechanism according to the segmentation result, and establish a segmentation usage mark for the segmented hardware resources.

[0040] In this embodiment, the code to be migrated can be distributed in multiple migration client system domains to form a code distribution plan. Exemplarily, an available data table for migration can be formed according to the requirements, the idle status of the migration client system domains, the corresponding computing resources, the available hardware resources, and the computing resources and hardware resources required for the divided code blocks, and each combination of migration client system domains can be traversed according to the available data table for migration, and the usage rate scores of the computing resources and hardware resources can be set, and the code distribution plan can be determined based on the total score of each combination.

[0041] The migration management module generates and obtains a code distribution plan, where the code distribution plan includes: each migration client system domain and the corresponding distributed code blocks; determines 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 the migration service system domain.

[0042] Exemplarily, hardware resources can be obtained from the migration service system domain, and the task-required hardware resources can be determined according to the current tasks in the migration service system domain; the idle hardware resources can be determined according to the required hardware resources, and a segmentation plan for the idle hardware resources can be generated according to the hardware resources; a hardware resource segmentation request can be sent to the migration service system domain according to the segmentation plan, and the hardware resources can be segmented according to the returned response; the segmentation result can be sent to the corresponding migration client system domain, so that the migration client components in the migration client system domain complete the creation of virtual hardware resources and the establishment of a passthrough mechanism according to the segmentation result, and establish a segmentation usage mark for the segmented hardware resources. By using the above method, the hardware resources of one migration service system domain can be segmented into multiple partial hardware resources and provided for multiple migration client system domains to use when migrating code. By using the above method, the hardware resources of the migration service system domain can be used fully and reasonably, and the efficiency of code migration can be further improved.

[0043] Since the content between different code blocks is different, if they are loaded and run simultaneously, the relevance between different code blocks will be ignored, resulting in long-term occupation of the hardware resources in the migration service system domain. Therefore, in this embodiment, the migration management module is further configured to: obtain the migration identifier of each code block, where the migration identifier includes: a type identifier and an order identifier; calculate the loading priority of each code block according to the type identifier and the order identifier; and send the corresponding loading priority to each migration client system domain. Further, the migration code conversion library is further configured to: detect the functions in the code block, and when there are device-related function codes, mark the code block with device-related function codes as real-time type; when there are related operation function codes, mark the code block with related operation function codes as calculation type; when there are specific function codes, mark the code block with specific function codes as real-time type; when there are code blocks related to a specific function library, mark the related code blocks as dependent type; determine and mark the order identifier for a specific device, a specific function library, and the order of code blocks. Exemplarily, the calculation type is a code block that requires a large amount of computing resources, such as a code block running on a Linux system and 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 a high requirement for latency. The migration code conversion library can determine the order identifier of each code block according to the specific device in the code block, where the specific device can be the device most relevant to the overall code function, such as: temperature sensors, water flow sensors, etc. devices. And the functions and the order of code blocks in the aforementioned specific function library before transplantation to determine the order identifier of each code block and mark it. The migration management module calculates the loading priority of each code block according to the type identifier and the order identifier. Exemplarily, the order identifier can be preset as different priority numbers, and the priority numbers corresponding to the priority number types are added up to determine the loading priority of each code block, and the calculated loading priority of the code block is sent to the corresponding migration client system domain, so that each migration client system domain loads and runs in order, and the waiting migration client system domain can perform other tasks, avoiding waste of resources of the entire system.

[0044] Note that the above is only a preferred embodiment of the present invention and the applied technical principles. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein. Various obvious changes, re-adjustments, and substitutions can be made by those skilled in the art without departing from the protection scope 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. Without departing from the concept of the present invention, more other equivalent embodiments can be included, and 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 Including: A migration management component, which is set in the migration service system domain and includes: a migration management module, which is used to extract non-converted code from the code to be migrated, parse the non-converted code, obtain the shared hardware resources required for the non-converted code to execute the system where the code to be converted is located, add a shared call code identifier to the non-converted code and the hardware resources, and generate a shared mapping data packet by using the non-converted code and the hardware resources after adding the identifier; A migration client component, which is set in the migration client system domain and includes: a migration client module, which is used to receive the shared mapping data packet sent by the migration management system, extract the 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 passthrough mechanism for the virtual hardware resources and the hardware resources corresponding to the system where they are located; A migration service component, which is set in the migration service system domain and includes: a migration service module, which is used to parse and obtain the hardware resources from the shared mapping data packet and lock the hardware resources; A service dynamic loading module, which is used to interact information with the virtual hardware resources of the migration client module by using the parsed hardware resources, load and run the parsed non-converted code by using the information of the hardware resources after the interaction, and send the execution result to the migration client system domain in a shared memory manner.

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

3. The system according to claim 2, wherein 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 in the migration service system domain, or provide instruction temporary storage services for interrupts; The interrupt hardware resources are used to provide interrupt information for the migration client system domain.

4. The system according to claim 3, characterized in that, The migration service system domain includes: a system code compilation environment, which is used to compile the direct conversion code, complex conversion code and non-direct conversion code to form migration code; The shared call code identifier includes: A call 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 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 further includes: A client dynamic loading module, which is used to load and run the migration code received by the migration client module, load and run non-running code by using shared memory, use the call function to run non-running code by using the service dynamic loading module, and receive the running result of the service dynamic loading module.

6. The system according to claim 2, wherein The migration management module is further used for: Marking the shared hardware resource information as used, and the shared hardware resource information includes: shared register resources, shared interrupt resources and the migration service system domain where they are located; When the preset recycling conditions are met, send a resource recycling confirmation request to the migrated client module using the shared hardware resource; Receive the resource recycling confirmation information returned by the migrated client module, and mark the shared hardware resource information as to-be-recycled status; Send the resource recycling information to the migration service module, receive the released information of the shared hardware resource returned, and delete the mark of the shared hardware resource information.

7. The system according to claim 6, characterized in that, The migration management module is further configured to: Obtain a code distribution plan, where the code distribution plan includes: each migrated client system domain and the corresponding distributed code blocks; Determine the hardware resources required for each code block; Obtain the hardware resources from the migration service system domain, and determine the task-required hardware resources according to the current tasks in the migration service system domain; Determine the idle hardware resources according to the required hardware resources, and generate a segmentation plan for the idle hardware resources according to the hardware resources; Send a hardware resource segmentation request to the migration service system domain according to the segmentation plan, and segment the hardware resources according to the returned response; Send the segmentation result to the corresponding migrated client system domain, so that the migrated client components in the migrated client system domain can complete the creation of virtual hardware resources and the establishment of the passthrough mechanism according to the segmentation result, and establish a segmentation usage mark for the segmented hardware resources.

8. The system according to claim 7, wherein The migration management module is further configured to: Obtain the migration identifier of each code block, where the migration identifier includes: a type identifier and an order identifier; Calculate the loading priority of each code block according to the type identifier and the order identifier; Send the corresponding loading priority to each migrated client system domain.

9. The system according to claim 8, wherein The migration code conversion library is further configured to: Detect the functions in the code block. When there are device-related function functions, mark the code block of the device-related function function as real-time type; When there are related arithmetic functions, mark the code block of the related arithmetic functions as computational type; When there are specific functions, mark the code block of the specific functions as real-time type; When there are code blocks related to a specific function library, mark the related code blocks as dependent type; Determine and mark the sequence marks for a specific device, a specific function library, and the sequence of code blocks.

Citation Information

Patent Citations

  • Machine learning techniques for enhancing video conferencing applications

    CN114820995A

  • Network interface management method and device, network interface use method and device, equipment and storage medium

    CN116436787A

  • Method for monitoring executable file in source code migration process

    CN117009178A

  • Servo mechanism-oriented distributed test system and method

    CN117111573A

  • Window implementation method under multiple systems and electronic equipment

    CN117992189A

Cited By

  • Code Classification for Link-Time Code Placement

    US20250335166A1