Software migration methods, apparatus and computer equipment for heterogeneous operating systems

By using a development method based on a standard abstraction layer interface set and a unified configuration item specification, local interface and configuration item mapping results are generated, and migration adaptation code and test code are automatically generated. This solves the problems of low efficiency and poor reliability in migrating software to heterogeneous operating systems, and achieves efficient and reliable software migration.

CN123114543APending Publication Date: 2026-11-17COMMERCIAL AIRCRAFT CORP OF CHINA LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611457688.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-18
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

In existing technologies, software migration between heterogeneous operating systems is inefficient and unreliable. Furthermore, it requires large-scale adaptation when processor platforms or operating systems change, resulting in long migration cycles, high maintenance costs, and uncertainties in airworthiness compliance.

Method used

By using a standard abstraction layer interface set and a unified configuration item specification for development, local interface mapping results and configuration item mapping results are generated, and migration adaptation code and test code are automatically generated to ensure that migration is only executed after the test is passed, thereby decoupling the upper-layer business logic from the underlying operating system.

Benefits of technology

It significantly reduces the workload of manually writing adaptation code and configuration files, improves the efficiency of migration across heterogeneous operating systems, ensures the reliability and verifiability of migration results, and reduces human error and repetitive work.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123114543A_ABST
    Figure CN123114543A_ABST
Patent Text Reader

Abstract

This application relates to a software migration method, apparatus, and computer device for heterogeneous operating systems. The method includes: obtaining a target operating system for the target software to be migrated; developing the target software based on standard abstract interfaces and unified configuration items; querying local interface mapping entries and configuration item mapping entries corresponding to the target operating system based on the standard abstract interfaces and unified configuration items contained in the target software, obtaining the local interface mapping results and configuration item mapping results of the target operating system; generating a local configuration file based on the configuration item mapping results; generating migration adaptation code and test code based on the code generation template corresponding to the target operating system, the local interface mapping results, and the configuration item mapping results; and migrating the target software to the target operating system based on the migration adaptation code and the local configuration file, provided that the test results of the test code indicate that the test has passed. This method can improve the efficiency and reliability of software migration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of software development technology, and in particular to a software migration method, apparatus, and computer device for heterogeneous operating systems. Background Technology

[0002] Existing avionics operating platforms typically involve multiple operating systems, which differ significantly in areas such as partition management, task scheduling, time window control, memory management, I / O access, error handling, and configuration mechanisms. While improving the design of some software interfaces can enhance the decoupling between applications and the underlying operating platform, differences in interface implementation, configuration item organization, and development toolchains still exist between heterogeneous operating systems at the engineering implementation level. This means that software components designed for a single operating system are often not directly reusable and require re-interface, configuration, and verification adaptation. As the scale and complexity of airborne software continue to increase, the dependence of airborne application software on the underlying operating platform becomes increasingly prominent. When processor platforms, operating system versions, or system configurations change, upper-layer software often requires large-scale adaptation, resulting in long migration cycles, high maintenance costs, and a large workload for verification, further increasing the uncertainty of airworthiness compliance work.

[0003] In related technologies, the common approach is manual adaptation, which involves writing adaptation code and configuration files for each target operating system. This results in a large amount of repetitive work and is prone to introducing human error, leading to low software migration efficiency and reliability. Summary of the Invention

[0004] Therefore, it is necessary to provide a software migration method, apparatus, computer equipment, computer-readable storage medium, and computer program product for heterogeneous operating systems that can improve the efficiency and reliability of software migration and address the aforementioned technical problems.

[0005] Firstly, this application provides a software migration method for heterogeneous operating systems, including:

[0006] Obtain the target operating system for the target software to be migrated; the target software is developed based on the standard abstract interface defined in the standard abstract layer interface set and the unified configuration items defined in the unified configuration item specification;

[0007] Based on the standard abstract interface and unified configuration items contained in the target software, query the local interface mapping entries and configuration item mapping entries corresponding to the target operating system to obtain the local interface mapping results and configuration item mapping results of the target operating system;

[0008] Based on the configuration item mapping results, a local configuration file is generated;

[0009] Based on the code generation template corresponding to the target operating system, the local interface mapping result, and the configuration item mapping result, migration adaptation code and test code are generated;

[0010] If the test result of the test code indicates that the test has passed, the target software is migrated to the target operating system based on the migration adaptation code and the local configuration file.

[0011] Secondly, this application also provides a software migration device for heterogeneous operating systems, comprising:

[0012] The acquisition module is used to acquire the target operating system for the target software to be migrated; the target software is developed based on the standard abstract interface defined in the standard abstraction layer interface set and the unified configuration items defined in the unified configuration item specification.

[0013] The query module is used to query the local interface mapping entries and configuration item mapping entries corresponding to the target operating system based on the standard abstract interfaces and unified configuration items contained in the target software, and obtain the local interface mapping results and configuration item mapping results of the target operating system.

[0014] The processing module is used to generate a local configuration file based on the configuration item mapping result;

[0015] The testing module is used to generate migration adaptation code and test code based on the code generation template corresponding to the target operating system, the local interface mapping result, and the configuration item mapping result;

[0016] An execution module is used to migrate the target software to the target operating system based on the migration adaptation code and the local configuration file, provided that the test result of the test code indicates that the test has passed.

[0017] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described method.

[0018] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method.

[0019] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described method.

[0020] The aforementioned software migration methods, apparatuses, computer devices, computer-readable storage media, and computer program products for heterogeneous operating systems decouple the upper-layer business logic from the underlying operating system because the target software is pre-developed based on a standard abstraction layer interface set and unified configuration item specifications. This decouples the upper-layer business logic from the underlying operating system, eliminating the direct binding of the upper-layer business logic to a specific operating system. When software migration is required, only the target operating system to be migrated to needs to be obtained. The corresponding local interface mapping entries and configuration item mapping entries are queried based on the standard abstraction interfaces and unified configuration items contained in the target software. This transforms cross-operating system adaptation into a deterministic mapping query, yielding local interface mapping results and configuration item mapping results. Subsequently, local configuration files are automatically generated from the configuration item mapping results, transforming the cross-operating system adaptation problem into a configuration data conversion problem. Then, migration adaptation code and test code are automatically generated from the code generation template corresponding to the target operating system, the local interface mapping results, and the configuration item mapping results, ensuring that configuration generation, adaptation code generation, and test verification are related. Finally, migration is only executed after the tests are passed, ensuring that the migration results are verified. In the above-mentioned software migration process across heterogeneous operating systems, there is no need to refactor the upper-level business logic of the software, which significantly reduces the workload of manually writing adaptation code and configuration files, reduces human differences and repetitive work, and improves the efficiency of migration across heterogeneous operating systems. At the same time, the verifiability of the migration results is verified through a closed-loop test, thereby ensuring the reliability of the software migration. Attached Figure Description

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

[0022] Figure 1 This is an application environment diagram of a software migration method for heterogeneous operating systems in one embodiment;

[0023] Figure 2 This is a flowchart illustrating a software migration method for heterogeneous operating systems in one embodiment.

[0024] Figure 3 This is a schematic diagram illustrating the construction process of local interface mapping entries in one embodiment;

[0025] Figure 4 This is a schematic diagram of the system architecture of a software migration system for heterogeneous operating systems in one embodiment;

[0026] Figure 5This is an application flowchart of a software migration method to a heterogeneous operating system in one embodiment.

[0027] Figure 6 This is a flowchart illustrating the configuration item mapping process in one embodiment;

[0028] Figure 7 This is a flowchart illustrating the execution of the test code involved in one embodiment;

[0029] Figure 8 This is a structural block diagram of a software migration device for heterogeneous operating systems in one embodiment;

[0030] Figure 9 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0031] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0032] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.

[0033] The software migration method for heterogeneous operating systems provided in this application can be applied to, for example... Figure 1 The application environment shown is illustrated. Terminal 101 communicates with server 102 via a network. A data storage system can store the data that server 102 needs to process. The data storage system can be integrated onto server 102, or it can be located in the cloud or on another network server.

[0034] Software engineers can initiate a migration request for target software through terminal 101. Server 102 responds to the migration request by obtaining the target operating system for the target software. The target software is developed based on the standard abstract interfaces defined in the standard abstraction layer interface set and the unified configuration items defined in the unified configuration item specification. Based on the standard abstract interfaces and unified configuration items contained in the target software, the local interface mapping entries and configuration item mapping entries corresponding to the target operating system are queried to obtain the local interface mapping results and configuration item mapping results of the target operating system. Based on the configuration item mapping results, a local configuration file is generated. Based on the code generation template corresponding to the target operating system, the local interface mapping results, and the configuration item mapping results, migration adaptation code and test code are generated. If the test result of the test code indicates that the test is passed, the target software is migrated to the target operating system based on the migration adaptation code and the local configuration file. Finally, server 102 can report the migration result of the target software to terminal 101.

[0035] Terminal 101 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, drones, low-altitude aircraft, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, and projection equipment. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted displays. Head-mounted displays can be virtual reality (VR) devices, augmented reality (AR) devices, and smart glasses. Server 102 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0036] In one exemplary embodiment, such as Figure 2 As shown, a software migration method for heterogeneous operating systems is provided, which is applied to... Figure 1 Taking the server in the example, the explanation includes the following steps 201 to 205. Wherein:

[0037] Step 201: Obtain the target operating system for the target software to be migrated; the target software is developed based on the standard abstract interface defined in the standard abstract layer interface set and the unified configuration items defined in the unified configuration item specification.

[0038] The target software refers to the software to be migrated and that needs to run on the new operating system, such as onboard application software or upper-layer middleware.

[0039] The target operating system refers to the operating system on which the target software will be migrated. Taking the onboard operating system as an example, it can include a variety of heterogeneous operating systems, such as the Tianmai 653 operating system, the VxWorks 653 operating system, etc. The target operating system can be any of the various heterogeneous operating systems that need to run the target software.

[0040] The standard abstraction layer interface set refers to a collection of standard abstraction interfaces that cover the common capabilities of multiple heterogeneous operating systems; among them, the standard abstraction interface refers to a unified service call interface that hides the differences in local implementation.

[0041] In some embodiments, each standard abstract interface may have a unified semantic definition, such as standard interface identifier, parameter direction, data type, unit, valid range, return value, and call sequence.

[0042] The unified configuration item specification refers to a set of rules that define the naming, hierarchy, data type, unit, value range, default value, and reference relationship of unified configuration items; among them, the unified configuration items defined in the unified configuration item specification refer to configuration items that express configuration data according to the same data organization and naming method.

[0043] In some embodiments, unified configuration items may include operating system configuration items and application configuration items. Operating system configuration items include kernel configuration items, hardware configuration items, I / O configuration items, memory configuration items, etc.; application configuration items include port configuration items, partition configuration items, scheduling configuration items, and connection configuration items, etc. Each unified configuration item may have a unified configuration item identifier, hierarchical path, data type, unit, value range, default value, and reference relationship, etc.

[0044] Understandably, the target software expresses its dependency on the runtime environment using standard abstract interfaces and unified configuration items during the development phase, rather than expressing that dependency using local interfaces and local configuration items of a specific operating system, thereby decoupling the target software from the specific operating system at the source code level.

[0045] In some embodiments, the target operating system used for migrating the target software can be determined by receiving the target operating system identifier entered by the user through the configuration interface; for example, if the user selects "Tianmai 653 operating system" in the code generation tool, the target operating system is determined to be "Tianmai 653 operating system".

[0046] Step 202: Based on the standard abstract interfaces and unified configuration items contained in the target software, query the local interface mapping entries and configuration item mapping entries corresponding to the target operating system to obtain the local interface mapping results and configuration item mapping results of the target operating system.

[0047] Among them, the local interface refers to the native service interface provided by a specific operating system; further, the local interface mapping entry refers to a record used to record the correspondence between the standard interface and the local interface of the operating system.

[0048] For example, a local interface mapping entry may include at least one of the following: standard interface identifier, target local interface identifier, parameter direction and order, data type and structure field conversion, error code conversion, resource handle relationship, call preconditions, and call sequence.

[0049] For example, a local interface mapping entry can record the correspondence between standard interface 1 and the target operating system's local interface 1, and specify how the input / output parameters, return values, and error codes of standard interface 1 are converted into the native parameters, return values, and error codes of local interface 1.

[0050] The local interface mapping result refers to the set of results obtained after querying the mapping entries for the standard abstract interface actually used by the target software. For example, if the target software actually uses standard interface 1 and standard interface 2, the local interface mapping result includes the local interface 1 corresponding to standard interface 1 and its parameters, structure, and error code conversion relationship, as well as the local interface 2 corresponding to standard interface 2 and its parameters, structure, and error code conversion relationship. The result set can then be used to generate migration adaptation code and test code.

[0051] A configuration item mapping entry is a record used to record the correspondence between unified configuration items and local configuration items of the operating system. Furthermore, a configuration item mapping result is the set of results obtained after querying the mapping entry for the unified configuration items actually used by the target software.

[0052] In some embodiments, each record in the configuration item mapping result may include a unified configuration item identifier, target path, converted value, data type, unit, default value, verification status, and the identifier of the mapping rule used.

[0053] In some embodiments, the server may first perform a file scan on the target software, extract the set of standard abstract interface identifiers and the set of unified configuration item identifiers actually referenced by the target software from the source code or intermediate files of the target software, and then use the set as the query key to perform a table lookup in the mapping table corresponding to the target operating system, thereby obtaining the mapping result.

[0054] Step 203: Generate a local configuration file based on the configuration item mapping results.

[0055] The local configuration file refers to a configuration file generated based on the configuration item mapping result that can be directly recognized by the target operating system. For example, the local configuration file can be an XML configuration file or an integrated configuration file in a format required by the target operating system.

[0056] In some embodiments, the server can organize and serialize each record in the configuration item mapping result according to the configuration structure of the target operating system to obtain a local configuration file; for example, the server organizes the information such as the unified configuration item identifier, target path, converted value, data type, unit and default value in the configuration item mapping result into a tree structure according to the preset configuration hierarchy of the target operating system, and then serializes it into a configuration file that can be loaded by the target operating system.

[0057] In other embodiments, before generating the local configuration file, constraint validation can be performed on the configuration item mapping results. Constraint validation includes one or more of the following: mandatory item validation, value range validation, identifier uniqueness validation, message length validation, port connection relationship validation, memory size and alignment validation, and partition window and scheduling relationship validation. If the validation is successful, the local configuration file is generated based on the configuration item mapping results. If the validation fails, a validation prompt message containing the failed configuration item identifier, failure type, and correction suggestions is output. Afterward, constraint validation can be re-executed after external correction to improve the effectiveness and consistency of the generated configuration.

[0058] Step 204: Generate migration adaptation code and test code based on the code generation template corresponding to the target operating system, the local interface mapping result, and the configuration item mapping result.

[0059] Among them, the code generation template is a template or generation rule pre-configured for the target operating system for generating code.

[0060] In some embodiments, the code generation template may include at least one of the following: target interface call skeleton, header file and link library dependencies, parameter and structure conversion, type and enumeration conversion, error code conversion, resource handle management, call preconditions and test code generation rules, and is bound to the operating system.

[0061] Migration adaptation code is the adaptation implementation code used to convert standard abstract interface calls into native interface calls of the target operating system; test code is the automatically generated code used to verify whether the migration adaptation code meets expectations on the target operating system.

[0062] In some embodiments, during the process of generating migration adaptation code, the server can also obtain the target local interface call requirements of the target operating system, thereby injecting the standard abstract interface semantics, configuration item mapping results and target local interface call requirements into the code generation template to generate migration adaptation code for the target operating system.

[0063] Among them, the operating system's local interface call requirements are used to describe the basic requirements such as the calling method, parameter passing, return value processing, resource handle management, call preconditions, and call sequence of the local interface.

[0064] For example, local interface call requirements can stipulate that a local interface needs to obtain a resource handle before calling, pass parameters in a specific order during the call, and check the native return code and convert it into a unified return code after the call.

[0065] In some embodiments, the local interface call requirements of the operating system can be determined by parsing at least one of the target operating system's interface manual, SDK header files, link libraries, configuration specifications, and target platform verification results.

[0066] In some embodiments, during the process of generating test code, the server can also inject a preset test target, local interface mapping result, and configuration item mapping result into the code generation template to generate test code for the test target. For example, the test target may include an interface compliance test target and a performance test target, and based on this, interface compliance test code and performance test code can be generated respectively.

[0067] Step 205: If the test results of the test code indicate that the test has passed, migrate the target software to the target operating system based on the migration adaptation code and local configuration files.

[0068] In some embodiments, if the test results of the test code indicate that the test has passed, the migration adaptation code, local configuration files, and other resource files required by the project are exported to the target development environment, compiled, linked, and deployed to the target hardware platform, thereby completing the migration of the target software to the target operating system.

[0069] In other embodiments, if the test result of the test code indicates that the test has failed, exception information can be generated, and exception location and repair can also be performed.

[0070] In some embodiments, the server can build a test environment on the target hardware platform, run test code in the test environment, and obtain the code execution results.

[0071] In the aforementioned software migration method for heterogeneous operating systems, because the target software is pre-developed based on a standard abstraction layer interface set and unified configuration item specifications, the upper-layer business logic is no longer directly bound to a specific operating system, thus achieving decoupling between the upper-layer business logic and the underlying operating system. When software migration is required, it is only necessary to obtain the target operating system to be migrated to, and query the corresponding local interface mapping entries and configuration item mapping entries based on the standard abstraction interfaces and unified configuration items contained in the target software. This transforms cross-operating system adaptation into a deterministic mapping query, obtaining local interface mapping results and configuration item mapping results. Then, the configuration item mapping results automatically generate local configuration files, transforming the cross-operating system adaptation problem into a configuration data conversion problem. Subsequently, the code generation template corresponding to the target operating system, the local interface mapping results, and the configuration item mapping results automatically generate migration adaptation code and test code, making configuration generation, adaptation code generation, and test verification related from the same source. Finally, migration is only executed after the tests are passed, ensuring that the migration results are verified. In the above-mentioned software migration process across heterogeneous operating systems, there is no need to refactor the upper-level business logic of the software, which significantly reduces the workload of manually writing adaptation code and configuration files, reduces human differences and repetitive work, and improves the efficiency of migration across heterogeneous operating systems. At the same time, the verifiability of the migration results is verified through a closed-loop test, thereby ensuring the reliability of the software migration.

[0072] In one exemplary embodiment, such as Figure 3 As shown, Figure 3 The diagram illustrates the construction process of local interface mapping entries. The software migration method for heterogeneous operating systems further includes steps 301 to 304. Wherein:

[0073] Step 301: Obtain the local interface description information corresponding to each of the multiple heterogeneous operating systems.

[0074] Among them, local interface description information refers to information used to describe the local interface of a certain operating system, such as interface manuals, SDK header files, data type definitions, error code definitions, and calling constraints.

[0075] It is understandable that the original interface information of the local interfaces in various heterogeneous operating systems can be obtained through the local interface description information, thereby providing a basis for subsequent semantic analysis and mapping entry establishment.

[0076] Step 302: Perform semantic analysis on the local interface description information of multiple heterogeneous operating systems to obtain the local interface semantics of each heterogeneous operating system, and determine the common interface semantics that are adapted to multiple heterogeneous operating systems from the local interface semantics.

[0077] Among them, local interface semantics is used to describe the service functions and input / output meanings expressed by the local interface of a certain operating system.

[0078] Based on this, public interface semantics refers to the service functions and input / output meanings that can be adapted to multiple heterogeneous operating systems and are covered by multiple local interface semantics.

[0079] For example, if the Tianmai 653 operating system and the VxWorks 653 operating system provide local interfaces for querying partition status, although their local interface identifiers, function prototypes, partition status structures, and return code definitions are different, semantic analysis can determine that both express the common service function and input / output meaning of "querying the running status of a specified partition and returning the partition identifier, running status, period, and duration". This meaning can then be determined as the common interface semantics.

[0080] Step 303: Construct a standard abstraction layer interface set containing multiple standard interfaces based on public interface semantics.

[0081] In some embodiments, for each public interface semantics, the developer can define a corresponding standard interface and specify at least one of the following: name, parameter direction, data type, unit, effective range, return value, resource lifecycle, and call sequence, thereby forming a standard abstraction layer interface set.

[0082] Step 304: Establish a local interface mapping entry from each standard interface in the standard abstraction layer interface set to the local interface of each heterogeneous operating system.

[0083] For example, for the standard interface RTE_GET_PARTITION_STATUS, two sets of mapping entries can be established to the Tianmai 653 local interface and the VxWorks653 local interface, respectively. The two sets of mapping entries specify the conversion relationship from parameter order, structure fields, enumeration values ​​and native return codes to unified semantics.

[0084] In this embodiment, semantic analysis is performed on the local interface description information of multiple heterogeneous operating systems to extract the semantics of common interfaces. The semantic analysis determines the semantics of common interfaces and constructs a standard abstraction layer interface set accordingly. This ensures that the division of standard interfaces is based on the actual common capabilities, avoiding semantic distortion caused by excessive abstraction. Subsequently, the standard abstraction layer interface set is constructed and its mapping entries to each local interface are established. This can converge the interface differences of heterogeneous operating systems to the mapping entries, so that when a new heterogeneous operating system is added, only the corresponding mapping entries need to be added, without modifying the standard interfaces and upper-layer software.

[0085] In some embodiments, the software migration method for heterogeneous operating systems further includes:

[0086] Based on the software configuration baseline of the target software and the basic configuration requirements of multiple heterogeneous operating systems, a unified configuration item specification containing multiple unified configuration items is determined; for each unified configuration item in the unified configuration item specification, a configuration item mapping entry is established from the unified configuration item to the local configuration items contained in the multiple heterogeneous operating systems.

[0087] Among them, the software configuration baseline refers to the set of software configuration data of the target software that has been reviewed by experts and included in version control, such as partition deployment design, scheduling table, port connection table, memory allocation table, application configuration, hardware resource list and target platform constraints.

[0088] The basic configuration requirements of heterogeneous operating systems refer to the minimum constraints required by each heterogeneous operating system in terms of the completeness and value range of configuration items, such as mandatory field constraints, upper limit constraints of values, and alignment constraints.

[0089] In some embodiments, the unified configuration items include at least two categories: operating system configuration items and application configuration items. Operating system configuration items may include kernel configuration, hardware configuration, core I / O configuration, shared I / O configuration, memory load configuration, and memory size configuration, etc.; application configuration items may include application memory size configuration, port configuration, queue port configuration, sampling port configuration, partition configuration, pseudo-partition configuration, scheduling configuration, partition window configuration, and connection configuration, etc.

[0090] In some embodiments, a configuration item mapping entry may include configuration item mapping relationships, data conversion logic, and constraint verification logic. The mapping relationship refers to the correspondence between a unified configuration item and a target operating system's local configuration item in terms of name, hierarchical path, and resource identifier, used to determine the corresponding local configuration item in the target operating system. The data conversion logic refers to the conversion rules used to convert the value of a unified configuration item into a value acceptable to the target operating system's local configuration item. This may include hierarchical path conversion, data type and bit width conversion, unit or time scale conversion, enumeration value conversion, default value completion, reference relationship conversion, and target resource identifier conversion. The constraint verification logic refers to the rules used to check the legality, completeness, and consistency of the configuration item mapping result. This may include mandatory field verification, value range verification, identifier uniqueness verification, message length verification, port connection relationship verification, memory size and alignment verification, partition window and scheduling relationship verification, and target operating system-specific constraint verification.

[0091] In this embodiment, a unified configuration item specification is determined by the software configuration baseline of the target software and the basic configuration requirements of each operating system, so that the unified configuration item is consistent with the actual engineering baseline, avoiding mapping errors caused by the disconnect between configuration semantics and actual engineering. At the same time, by establishing a corresponding configuration item mapping entry for each unified configuration item, the cross-operating system adaptation problem is transformed into a configuration data conversion problem, thereby improving configuration reuse capability and adaptation efficiency.

[0092] In some embodiments, migration adaptation code and test code are generated based on the code generation template corresponding to the target operating system, the local interface mapping result, and the configuration item mapping result, including:

[0093] The target operating system's local interface call requirements, local interface mapping results, and configuration item mapping results are injected into the code generation template corresponding to the target operating system to generate migration adaptation code that meets the local interface call requirements; the preset test target, local interface mapping results, and configuration item mapping results are injected into the code generation template corresponding to the target operating system to generate test code for the test target.

[0094] Among them, the local interface call requirements refer to the requirements of the target operating system for local interface calls, such as header file and link library dependencies, parameter value range, call preconditions, call sequence, and the method of obtaining and releasing resource handles.

[0095] For example, a first migration adaptation code set and a second migration adaptation code set are generated for the Tianmai 653 operating system and the VxWorks 653 operating system, respectively. Both code sets follow the same standard abstraction layer interface set, but are consistent with the corresponding target operating system in terms of underlying interface calls, configuration loading methods and target project integration methods.

[0096] In some embodiments, the generated migration adaptation code can be modularized, for example, by splitting the migration adaptation code into a resource management module, a communication management module, a time management module, and an error handling module, in order to improve code maintainability and subsequent scalability.

[0097] In some embodiments, the preset test objectives may include interface compliance test objectives and performance test objectives; further, the interface compliance test objectives may specifically include normal function test objectives, abnormal function test objectives, robustness test objectives, and boundary condition test objectives.

[0098] In the above embodiments, by injecting local interface call requirements, local interface mapping results, and configuration item mapping results into the code generation template bound to the target operating system, the migration adaptation code can automatically adapt to the interface call conventions and configuration loading methods of the target operating system. At the same time, by introducing preset test targets, the migration adaptation code can be verified under preset dimensions to ensure the feasibility of the migration adaptation code.

[0099] In some embodiments, when the test results of the test code indicate that the test has passed, before migrating the target software to the target operating system based on the migration adaptation code and local configuration files, the software migration method for heterogeneous operating systems further includes:

[0100] Set up a test environment on the target hardware platform; run the test code in the test environment and obtain the code execution results; perform data analysis on the code execution results to obtain the test results of the test code; the data analysis includes interface compliance analysis, performance analysis, and adaptation effect analysis.

[0101] The target hardware platform refers to the actual hardware platform on which the target operating system runs, such as the P2020 development board.

[0102] Interface conformance analysis refers to the analysis of whether the interface behavior is consistent with the definition of the standard abstraction layer interface set; performance analysis refers to the analysis of the performance loss caused by the abstraction layer transformation and the possible bottleneck location; adaptation effect analysis refers to the analysis of whether there are deviations between the configuration mapping rules and the code generation rules.

[0103] In some embodiments, interface compliance test code may cover one or more of normal function tests, abnormal function tests, robustness tests, and boundary condition tests; performance test code may cover one or more of resource lookup time, task switching time, memory operation time, time jitter time, interface execution time, and partition switching time.

[0104] In some embodiments, the code execution results can be analyzed by the server calling the data analysis module to obtain test results; for example, the actual test results of performance analysis can be compared with preset performance thresholds to determine whether each performance indicator meets the preset threshold.

[0105] In this embodiment, by building a test environment on the target hardware platform and executing automatically generated test code, the migration results can be quantitatively verified in the real target environment. By analyzing the test data through three dimensions—interface compliance analysis, performance analysis, and adaptation effect analysis—interface semantic deviation, performance loss, and rule deviation can be located separately, thereby improving the credibility of the verification results.

[0106] In some embodiments, the software migration method for heterogeneous operating systems further includes:

[0107] If the test result in the test code indicates that the test failed, a test exception record is generated. The test exception record includes at least the exception object, exception type, expected value, and measured value. For parameter exceptions in the test exception record, the parameters are updated based on preset update rules to obtain the updated parameters. For non-parameter exceptions in the test exception record, exception confirmation information is generated, and update information returned in response to the exception confirmation information is received. Based on the updated parameters and / or update information, execution is performed based on the standard abstract interfaces and unified configuration items contained in the target software. Mapping is performed in the local interface mapping entries and configuration item mapping entries corresponding to the target operating system to obtain the local interface mapping results and configuration item mapping results of the target operating system and subsequent steps.

[0108] Among them, parameter anomalies refer to anomalies that can be eliminated by adjusting parameter values, such as threshold deviation, enumeration correspondence deviation, default value deviation, and unit conversion deviation.

[0109] Non-parametric anomalies are those that cannot be eliminated simply by adjusting parameter values, such as inconsistent interface semantics, inconsistent call timing, or failure to meet specific constraints of the target system.

[0110] In some embodiments, for parameterized problems, the server can call the test data analysis module to automatically generate candidate parameters, that is, automatically calculate the conversion relationship or correspondence between the expected value and the measured value, and update the mapping entries accordingly. For example, if the performance test shows that the execution time of a certain standard interface on the target operating system is the measured value of 8 microseconds, while the preset threshold is 5 microseconds, the generated test exception record can be "the exception object is the standard interface, the exception type is performance over-limit, the expected value is 5 microseconds, and the measured value is 8 microseconds". Since this exception is a parameter exception, the server can call the test data analysis module to automatically generate candidate parameters, such as adjusting the threshold and providing the basis.

[0111] For issues related to interface semantics, call timing, or target system-specific constraints, the test data analysis module can generate exception confirmation information. After confirmation by the developers, the mapping rules or code generation parameters can be updated. Once the update is complete, the target configuration file, migration adaptation code, and test code can be regenerated, and regression verification can be performed.

[0112] In this embodiment, by feeding back the test results to the configuration item mapping stage and the abstract layer code generation stage, the testing stage can inversely constrain the mapping and generation stages. At the same time, exceptions are distinguished into parameter exceptions and non-parameter exceptions and different correction paths are adopted. Problems that can be handled automatically do not require manual intervention, while semantic and security issues are still confirmed by developers. This improves the efficiency of closed-loop correction while ensuring the reliability of the correction results.

[0113] For easier understanding, please refer to Figure 4 , Figure 4 The diagram illustrates the system architecture of a software migration system for heterogeneous operating systems according to an embodiment of this application. The software migration system includes an application calling layer, a unified runtime environment abstraction layer, a target operating system adaptation layer, a target operating system layer, and a target hardware platform layer.

[0114] The application call layer is located at the top of the system architecture and is used to carry the upper-level business logic of the target software. During the development phase, the target software is developed based on the standard abstract interfaces defined in the standard abstraction layer interface set and the unified configuration items defined in the unified configuration item specification. Therefore, the business logic in the application call layer does not directly call the local interfaces of a specific operating system, nor does it directly read the native configuration items of a specific operating system. Instead, it accesses runtime environment services through the standard abstract interfaces provided by the unified runtime environment abstraction layer, thereby decoupling the upper-level business logic from the specific operating system.

[0115] The unified runtime environment abstraction layer is located between the application call layer and the target operating system adaptation layer. It is used to carry the standard abstraction layer interface set, unified error handling mechanism and cross-platform common logic.

[0116] The standard abstraction layer interface set defines standard abstraction interfaces that cover common capabilities of multiple heterogeneous operating systems; the unified error handling mechanism is used to convert the native error codes returned by different target operating systems into standard return codes, enabling upper-layer business logic to identify and handle errors in a unified manner; and the cross-platform common logic is used to carry common processing logic shared by multiple heterogeneous operating systems, such as parameter validation, resource lifecycle management, and call timing control.

[0117] During the migration process, the unified runtime environment abstraction layer queries the local interface mapping entries and configuration item mapping entries corresponding to the target operating system based on the standard abstract interface and unified configuration items actually used by the target software, obtains the local interface mapping results and configuration item mapping results, and triggers the generation of local configuration files, migration adaptation code and test code accordingly.

[0118] The target operating system adaptation layer is located between the unified runtime environment abstraction layer and the target operating system layer, and is used to carry out the implementation of local interface calls related to the specific target operating system.

[0119] For example, the target operating system adaptation layer may include a first system adaptation unit and a second system adaptation unit, each corresponding to a different heterogeneous operating system. For instance, the first system adaptation unit may correspond to the Tianmai 653 operating system, and the second system adaptation unit may correspond to the VxWorks 653 operating system.

[0120] Each system adaptation unit, based on pre-established local interface mapping entries, converts the standard abstract interface calls issued by the unified runtime environment abstraction layer into local interface calls corresponding to the target operating system. It also performs parameter direction and order conversion, data type and structure field conversion, enumeration value conversion, error code conversion, resource handle relationship conversion, and adaptation of call preconditions and call timing. When the target software needs to migrate from the first operating system to the second operating system, it only needs to switch to the second system adaptation unit without modifying the business logic in the application call layer.

[0121] The target operating system layer is located below the target operating system adaptation layer and is used to provide the actual running environment for the migrated target software.

[0122] For example, the target operating system layer can be the Tianmai 653 operating system, the VxWorks 653 operating system, or other 653-class operating systems.

[0123] The target hardware platform layer sits below the target operating system layer and provides the hardware foundation for the migrated target software. For example, the target hardware platform layer may include a P2020 development board, and the target operating system layer may include the Tianmai 653 operating system or the VxWorks 653 operating system running on that development board.

[0124] Through the aforementioned software migration system, the upper-layer business logic of the target software calls the standard abstract interface through the application call layer. The unified runtime environment abstraction layer queries the local interface mapping entries and configuration item mapping entries corresponding to the target operating system based on the standard abstract interfaces and unified configuration items actually contained in the target software, and obtains the local interface mapping results and configuration item mapping results. A local configuration file is generated based on the configuration item mapping results, and migration adaptation code and test code are generated based on the code generation template corresponding to the target operating system, the local interface mapping results, and the configuration item mapping results. A test environment is built on the target hardware platform layer and tests are executed. After the tests pass, the migration adaptation code is integrated with the upper-layer business logic, and the conversion from the standard abstract interface to the target operating system's local interface is completed through the corresponding system adaptation unit in the target operating system adaptation layer. Finally, it runs on the target operating system layer and the target hardware platform layer, thereby completing the migration of the target software to the target operating system without refactoring the upper-layer business logic.

[0125] Please see Figure 5 , Figure 5 The application flowchart of the software migration method for heterogeneous operating systems involved in this application is shown, including steps S1 to S12, wherein:

[0126] Step S1: Define the standard abstraction layer interface set.

[0127] Taking the airborne 653 operating system as an example, the process of defining the standard abstraction layer interface set includes: forming a target interface list based on the ARINC 653 interface definition, as well as the corresponding versions of the interface manuals, SDK header files, data type definitions, error code definitions, and calling constraints of the Tianmai 653 operating system and VxWorks 653 operating system; classifying the target interfaces according to service functions, input / output semantics, and calling preconditions, and extracting common semantics and differences; defining a standard interface for each common semantic, specifying at least one of the following: name, parameter direction, data type, unit, effective range, return value, resource lifecycle, and calling sequence; establishing a mapping entry for each standard interface to the local interface of each target system, and freezing the interface model and its version through review, thereby decoupling the upper-layer runtime environment calling logic from the underlying target 653 operating system through a unified interface naming method, parameter organization method, error code expression method, and data structure constraints.

[0128] In some embodiments, the import and difference extraction of the original interface information can be done automatically by the tool, while the selection of common semantics and security-related constraints can be confirmed by the developers.

[0129] In some embodiments, the standard abstraction layer interface set may cover one or more basic services among partition management, process management, time management, memory management, partition communication, intra-partition communication, and health monitoring, and may be extended to support one or more of the following interfaces: file system, logging system, name service, interrupt service, memory block service, and C library and math library interfaces with explicit security attributes.

[0130] Step S2, construct a layered runtime architecture. Specifically, construct as follows: Figure 6 The layered operation architecture corresponding to the software migration system.

[0131] Step S3: Obtain the unified configuration items. Specifically, configure according to the unified configuration item specification to obtain the unified configuration items; the unified configuration item specification defines the naming, hierarchy, data type, unit, value range, default value, and reference relationship of the unified configuration items.

[0132] Among them, the unified configuration item refers to the configuration data required for the unified runtime environment abstraction layer to run; the unified configuration item may include at least one of the following: partition deployment design, scheduling table, port connection table, memory allocation table, application configuration, hardware resource list and target platform constraints.

[0133] Step S4: Establish configuration item mapping relationships. Specifically, configuration item mapping relationships include configuration item name mapping relationships, data conversion logic, and constraint verification logic.

[0134] In some embodiments, the corresponding configuration item mapping entries can be invoked according to the target operating system type to establish a semantic correspondence between unified configuration items and local configuration items of the target operating system. For example, for the Tianmai 653 operating system, the first configuration item mapping entry set can be invoked to convert the unified configuration items into XML configuration descriptions corresponding to the Tianmai 653 operating system; for the VxWorks653 operating system, the second configuration item mapping entry can be invoked to convert unified configuration items with the same semantics into XML configuration descriptions corresponding to the VxWorks653 operating system.

[0135] Step S5: Generate the target configuration description. Specifically, based on the constructed configuration item mapping relationship, the unified configuration items contained in the target software are mapped and transformed to obtain the target configuration description of the target software.

[0136] The target configuration description is an intermediate target configuration description before generating the final configuration file, which is the configuration item mapping result in this application. It includes at least one of the following: unified configuration item identifier, target path, converted value, data type, unit, default value, verification status, and the mapping rule identifier used. The target configuration description is used to generate the local configuration file and abstraction layer code.

[0137] Step S6: Generate abstraction layer code. Specifically, based on the standard abstraction layer interface set, the target configuration description, and the code generation template or rules corresponding to the target operating system, generate abstraction layer code adapted to the target operating system.

[0138] The abstraction layer code is used to translate standard abstraction layer interface calls into native interface calls of the target operating system.

[0139] For example, a first abstraction layer code set and a second abstraction layer code set are generated for the Tianmai 653 operating system and the VxWorks 653 operating system, respectively. Both follow the same standard abstraction layer interface set, but are consistent with the corresponding target operating system in terms of underlying interface calls, configuration loading methods and target project integration methods.

[0140] Step S7: Generate the system integration configuration file. Specifically, based on the target configuration description, generate the system integration configuration file according to the configuration format required by the target operating system.

[0141] For example, the server is based on a target configuration description, and the configuration file is an XML configuration file or an integrated configuration file in a format required by the target operating system.

[0142] In some embodiments, during the generation process, the range of values ​​for configuration items, related dependencies, and constraint conflicts can also be checked, and correction prompts can be output when errors are found, so as to improve the effectiveness and consistency of the generated configuration.

[0143] Step S8: Generate interface compliance / performance test code. Specifically, based on the standard abstraction layer interface set and the target configuration description, at least one of interface compliance test code and performance test code is automatically generated to verify the interface compliance and performance of the abstraction layer code on the target operating system.

[0144] In some embodiments, the interface compliance test code covers at least one of normal function testing, abnormal function testing, robustness testing, and boundary condition testing; the performance test code covers at least one of resource lookup time, task switching time, memory operation time, time jitter time, interface execution time, and partition switching time.

[0145] Step S9: Execute tests on the target hardware platform. Specifically, a test environment is set up on the target hardware platform, the generated test code is deployed to the test environment, and the test program is loaded and executed uniformly through a batch execution entry point.

[0146] For example, the target hardware platform includes the P2020 development board, and the target operating system includes at least one of the Tianmai 653 operating system and the VxWorks 653 operating system.

[0147] Step S10: Collect test data. Specifically, during test execution, test data is collected via a serial port or other communication bus. The test data includes at least one of interface compliance test data and performance test data.

[0148] For example, performance test data may include task switching time, time jitter, and partition switching time.

[0149] Step S11: Identify inconsistencies / exceedances. Specifically, the collected test data is compared with preset interface behaviors, configuration constraints, and performance thresholds to identify inconsistencies in interface behaviors and / or performance exceeding limits, and the mapping rules or abstraction layer code that caused the inconsistencies or exceeding limits are located.

[0150] In some embodiments, an exception record containing the object to be revised, failure type, expected value, and measured value can be generated; further, for parameterization issues such as thresholds, enumeration correspondences, default values, and unit conversions, candidate parameters are automatically generated; for interface semantics, call sequence, or target system-specific constraints, updates are made after confirmation by the developers.

[0151] Step S12: Output the updated mapping results and verification report. Specifically, after updating the mapping rules or code generation parameters, regenerate the target configuration file, abstraction layer code, and test code, and perform regression verification. Finally, output the updated mapping results and verification report. The verification report includes at least one of the following: interface compliance analysis results, performance analysis results, adaptation effect analysis results, and the handling status of inconsistencies and performance metric exceedances.

[0152] Through the above application process, a complete closed-loop verification process is formed, which includes unified configuration, mapping conversion, code generation, test execution, result analysis, and iterative correction. This allows the migration of the target software to the target operating system to be completed without refactoring the upper-level business logic, and improves the consistency, verifiability, and airworthiness compliance of the migration results.

[0153] Please see Figure 6 , Figure 6 The flowchart of the configuration item mapping process involved in this application is shown. This process is used to convert unified configuration data into a target configuration description that can be recognized by the target operating system, and output configuration files and code generation inputs respectively.

[0154] Obtain unified configuration data, which includes at least one of operating system configuration items and application configuration items.

[0155] After obtaining the unified configuration data, the corresponding configuration item mapping rule (i.e. configuration item mapping entry) is called according to the target operating system type. The configuration item mapping rule includes at least one of name mapping, data format conversion and constraint verification.

[0156] After processing by the configuration item mapping rules, the target configuration description is obtained. The target configuration description is an intermediate target configuration description before generating the final file, and includes at least one of the following: unified configuration item identifier, target path, converted value, data type, unit, default value, verification status, and the identifier of the mapping rule used.

[0157] The target configuration description is serialized into a configuration file that can be loaded by the target operating system, such as an XML configuration file or an integrated configuration file in a format required by the target operating system. On the other hand, it serves as input for code generation, used to subsequently generate abstraction layer code adapted to the target operating system.

[0158] Through the above configuration item mapping process, the same unified configuration data can generate corresponding configuration files and code generation inputs for different target operating systems without redefining the upper-level configuration structure.

[0159] Please see Figure 7 , Figure 7The flowchart of the test code involved in this application is shown, including steps S21 to S30, wherein:

[0160] Step S21: Generate interface compliance test code. Specifically, based on the standard abstraction layer interface set and the target configuration description, generate interface compliance test code to verify whether the transformation behavior of the migration adaptation code to the standard abstraction interface conforms to the semantic definition of the standard abstraction layer interface set.

[0161] Step S22: Generate performance test code. Specifically, based on the standard abstraction layer interface set and the target configuration description, generate performance test code to verify whether the migration adaptation code meets the preset requirements on the target operating system.

[0162] Step S23: Deploy the target project. Specifically, integrate the generated migration adaptation code, local configuration files, and other resource files required by the project to obtain the target project, and deploy the target project to the target hardware platform; for example, the target hardware platform includes the P2020 development board.

[0163] Step S24: Execute the test. Specifically, a test environment is set up on the target hardware platform, and the test program is loaded uniformly through a batch execution entry point to execute at least one of the following: interface compliance test and performance test.

[0164] Step S25: Collect task switching / jitter / partition switching data. Specifically, test data is collected via a serial port or other communication bus; for example, the test data includes at least one of task switching time, time jitter, and partition switching time.

[0165] Step S26: Perform interface compliance analysis. Specifically, compare the actual test results of the interface compliance test with the preset interface behaviors to identify whether the interface behaviors are consistent with the definition of the standard abstraction layer interface set, thereby determining whether there are any inconsistencies in interface behaviors.

[0166] Step S27: Perform performance analysis. Specifically, compare the actual performance test results with preset performance thresholds to identify the performance overhead introduced by the abstraction layer transformation, possible bottleneck locations, and whether each performance indicator meets the preset thresholds, thereby determining whether there are any performance indicators exceeding the limits. Subsequently, determine whether there are any inconsistencies or exceeding the limits. If there are any inconsistencies or exceeding the limits, proceed to steps S28 and S29; if there are no inconsistencies or exceeding the limits, proceed to step S30.

[0167] Step S28: Revise the mapping relationship or code generation parameters. Specifically, locate the specific mapping rule or code generation parameter based on the inconsistency or over-limit item, and revise it. For parameterization issues such as thresholds, enumeration correspondences, default values, and unit conversions, candidate parameters can be automatically generated; for interface semantics, call sequence, or target system-specific constraints, they can be updated after confirmation by the developers.

[0168] Step S29: Regenerate and verify again. Specifically, based on the revised mapping relationship or code generation parameters, regenerate the target configuration file, migration adaptation code, and test code, and perform verification again until inconsistencies or out-of-limit items are eliminated, or until the preset verification pass conditions are met.

[0169] Step S30: Generate a verification report. Specifically, a verification report is generated if there are no inconsistencies or exceedances, or if the verification passes again after revision. The verification report includes at least one of the following: interface compliance analysis results, performance analysis results, adaptation effect analysis results, and the handling status of inconsistencies and performance index exceedances.

[0170] The above process realizes a closed-loop process of test code generation, target project deployment, test execution, data collection, interface compliance analysis, performance analysis, mapping relationship or code generation parameter revision, and verification report output, thereby improving the verifiability of the target software migration results to the target operating system.

[0171] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.

[0172] Based on the same inventive concept, this application also provides a software migration apparatus for heterogeneous operating systems for implementing the software migration method for heterogeneous operating systems described above. The solution provided by this apparatus is similar to the implementation described in the above method. Therefore, the specific limitations in one or more embodiments of the software migration apparatus for heterogeneous operating systems provided below can be found in the limitations of the software migration method for heterogeneous operating systems described above, and will not be repeated here.

[0173] In one exemplary embodiment, such as Figure 8 As shown, a software migration device 800 for heterogeneous operating systems is provided, comprising:

[0174] The acquisition module 801 is used to acquire the target operating system for the target software to be migrated; the target software is developed based on the standard abstract interface defined in the standard abstract layer interface set and the unified configuration items defined in the unified configuration item specification.

[0175] The query module 802 is used to query the local interface mapping entries and configuration item mapping entries corresponding to the target operating system based on the standard abstract interfaces and unified configuration items contained in the target software, and obtain the local interface mapping results and configuration item mapping results of the target operating system.

[0176] Processing module 803 is used to generate a local configuration file based on the configuration item mapping results.

[0177] Test module 804 is used to generate migration adaptation code and test code based on the code generation template corresponding to the target operating system, the local interface mapping result, and the configuration item mapping result.

[0178] Execution module 805 is used to migrate the target software to the target operating system based on the migration adaptation code and local configuration files, provided that the test results of the test code indicate that the test has passed.

[0179] In some embodiments, the software migration apparatus 800 further includes a construction module, configured to acquire local interface description information corresponding to each of the multiple heterogeneous operating systems; perform semantic analysis on the local interface description information of the multiple heterogeneous operating systems to obtain the local interface semantics of each heterogeneous operating system; determine the common interface semantics adapted to the multiple heterogeneous operating systems from the local interface semantics; construct a standard abstraction layer interface set containing multiple standard interfaces based on the common interface semantics; and establish a local interface mapping entry from each standard interface in the standard abstraction layer interface set to the local interface of each heterogeneous operating system.

[0180] In some embodiments, the building module is further configured to determine a unified configuration item specification containing multiple unified configuration items based on the software configuration baseline of the target software and the basic configuration requirements of multiple heterogeneous operating systems; and for each unified configuration item in the unified configuration item specification, establish a configuration item mapping entry from the unified configuration item to the local configuration items contained in the multiple heterogeneous operating systems.

[0181] In some embodiments, the test module 804 is used to inject the local interface call requirements, local interface mapping results, and configuration item mapping results of the target operating system into the code generation template corresponding to the target operating system to generate migration adaptation code that meets the local interface call requirements; and to inject the preset test target, local interface mapping results, and configuration item mapping results into the code generation template corresponding to the target operating system to generate test code for the test target.

[0182] In some embodiments, the test module 804 is used to build a test environment on the target hardware platform; run test code in the test environment to obtain code execution results; perform data analysis on the code execution results to obtain test results of the test code; the data analysis includes interface compliance analysis, performance analysis, and adaptation effect analysis.

[0183] In some embodiments, the software migration apparatus 800 further includes a feedback module, configured to generate a test exception record when the test result of the test code indicates that the test has failed. The test exception record includes at least an exception object, an exception type, an expected value, and a measured value. For parameter exceptions in the test exception record, the module updates the parameters based on a preset update rule to obtain the updated parameters. For non-parameter exceptions in the test exception record, the module generates exception confirmation information and receives update information returned in response to the exception confirmation information. Based on the updated parameters and / or the updated information, the module returns an execution method that maps the target software based on the standard abstract interface and unified configuration items in the local interface mapping entries and configuration item mapping entries corresponding to the target operating system to obtain the target operating system's local interface mapping results and configuration item mapping results, as well as subsequent steps.

[0184] The modules in the aforementioned software migration device for heterogeneous operating systems can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of the computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0185] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 9As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data related to software migration for heterogeneous operating systems. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a software migration method for heterogeneous operating systems.

[0186] Those skilled in the art will understand that Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0187] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described above.

[0188] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method.

[0189] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the method described above.

[0190] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0191] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0192] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0193] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A software migration method for heterogeneous operating systems, characterized in that, The method includes: Obtain the target operating system for the target software to be migrated; the target software is developed based on the standard abstract interface defined in the standard abstract layer interface set and the unified configuration items defined in the unified configuration item specification; Based on the standard abstract interface and unified configuration items contained in the target software, query the local interface mapping entries and configuration item mapping entries corresponding to the target operating system to obtain the local interface mapping results and configuration item mapping results of the target operating system; Based on the configuration item mapping results, a local configuration file is generated; Based on the code generation template corresponding to the target operating system, the local interface mapping result, and the configuration item mapping result, migration adaptation code and test code are generated; If the test result of the test code indicates that the test has passed, the target software is migrated to the target operating system based on the migration adaptation code and the local configuration file.

2. The method according to claim 1, characterized in that, The method further includes: Obtain the local interface description information corresponding to each of the multiple heterogeneous operating systems; Semantic analysis is performed on the local interface description information of multiple heterogeneous operating systems to obtain the local interface semantics of each heterogeneous operating system, and the common interface semantics that are adapted to multiple heterogeneous operating systems are determined from the local interface semantics. Based on the semantics of the public interface, a standard abstraction layer interface set containing multiple standard interfaces is constructed; Establish a local interface mapping entry from each standard interface in the standard abstraction layer interface set to the local interface of each heterogeneous operating system.

3. The method according to claim 1, characterized in that, The method further includes: Based on the software configuration baseline of the target software and the basic configuration requirements of multiple heterogeneous operating systems, a unified configuration item specification containing multiple unified configuration items is determined. For each unified configuration item in the unified configuration item specification, a configuration item mapping entry is established from the unified configuration item to the local configuration items contained in the multiple heterogeneous operating systems.

4. The method according to claim 1, characterized in that, The process of generating migration adaptation code and test code based on the code generation template corresponding to the target operating system, the local interface mapping result, and the configuration item mapping result includes: The local interface call requirements of the target operating system, the local interface mapping results, and the configuration item mapping results are injected into the code generation template corresponding to the target operating system to generate migration adaptation code that meets the local interface call requirements. The preset test target, the local interface mapping result, and the configuration item mapping result are injected into the code generation template corresponding to the target operating system to generate test code for the test target.

5. The method according to claim 1, characterized in that, Before migrating the target software to the target operating system based on the migration adaptation code and the local configuration file, if the test result of the test code indicates that the test has passed, the method further includes: Set up a test environment on the target hardware platform; Run the test code in the test environment and obtain the code execution results; Data analysis is performed on the execution results of the code to obtain the test results of the test code; the data analysis includes interface compliance analysis, performance analysis, and adaptation effect analysis.

6. The method according to claim 1, characterized in that, The method further includes: If the test result of the test code indicates that the test fails, a test exception record is generated. The test exception record includes at least the exception object, exception type, expected value, and actual value. For the abnormal parameters in the test anomaly record, the parameters are updated based on the preset update rules to obtain the updated parameters; For non-parametric anomalies in the test anomaly record, generate anomaly confirmation information and receive update information returned in response to the anomaly confirmation information; Based on the updated parameters and / or the updated information, the process returns to the standard abstract interface and unified configuration items contained in the target software, and maps them in the local interface mapping entries and configuration item mapping entries corresponding to the target operating system to obtain the local interface mapping results and configuration item mapping results of the target operating system and subsequent steps.

7. A software migration device for heterogeneous operating systems, characterized in that, The device includes: The acquisition module is used to acquire the target operating system for the target software to be migrated; the target software is developed based on the standard abstract interface defined in the standard abstraction layer interface set and the unified configuration items defined in the unified configuration item specification. The query module is used to query the local interface mapping entries and configuration item mapping entries corresponding to the target operating system based on the standard abstract interfaces and unified configuration items contained in the target software, and obtain the local interface mapping results and configuration item mapping results of the target operating system. The processing module is used to generate a local configuration file based on the configuration item mapping result; The testing module is used to generate migration adaptation code and test code based on the code generation template corresponding to the target operating system, the local interface mapping result, and the configuration item mapping result; An execution module is used to migrate the target software to the target operating system based on the migration adaptation code and the local configuration file, provided that the test result of the test code indicates that the test has passed.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.