Instruction set conversion-based credential application compatible adaptation method and system
Through static analysis and dynamic compilation technology, instruction set conversion is carried out on information and innovation applications, which solves compatibility, performance and security issues in cross-instruction set migration, and realizes efficient portability of applications.
Patent Information
- Application Number
- CN202510290314.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-12
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2045-03-12
AI Technical Summary
During the cross-instruction set migration of information and innovation applications, there are compatibility, performance and security issues, especially the source code level incompatibility and runtime library compatibility are difficult to solve.
Static analysis tools and line-by-line analysis technology are used to identify the instruction set-related code snippets in the source code, build the instruction set mapping table, recompile the source code into the binary file of the target instruction set through dynamic compilation technology, and handle the compatibility issues of the runtime library through binary analysis tools.
It realizes comprehensive adaptation from source code to runtime library, significantly improves the portability and operation efficiency of applications, and solves compatibility, performance and security issues in cross-instruction set migration.
Smart Images

Figure CN119808081A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer compatibility adaptation technology, and specifically to a method and system for compatible adaptation of trusted computing applications based on instruction set conversion. Background Art
[0002] In the process of compatible adaptation of trusted computing applications, the first thing to face in response to technical issues of instruction set conversion is the identification and modification of incompatibilities at the source code level. There may be a large number of code snippets closely related to the original instruction set in the source code of the application software, such as function calls, macro definitions, and inline assembly of specific instruction sets. These code snippets cannot be directly run in the target trusted computing instruction set environment. Therefore, they must be analyzed one by one to identify the parts related to the original instruction set. For open source software, the source code can be modified directly to replace the functions and macro definitions of the original instruction set with implementations that adapt to the target instruction set. However, for closed source software, since the source code cannot be obtained, the binary code of the original instruction set can only be converted directly into the code of the target instruction set through binary translation tools. This process is not only complicated, but may also introduce performance loss and compatibility issues. Summary of the invention
[0003] The purpose of the present invention is to provide a method and system for compatible adaptation of trusted computing applications based on instruction set conversion, which realizes comprehensive adaptation from source code to runtime library, solves the compatibility, performance and security issues of trusted computing applications in cross-instruction set migration, and significantly improves the portability and operation efficiency of applications.
[0004] The purpose of the present invention can be achieved by the following technical solutions: This application provides a method for compatible adaptation of trusted computing applications based on instruction set conversion, including the following steps: S1. Use static analysis tools to scan the source code, identify function calls, macro definitions, and inline assembly code snippets related to the original instruction set, and analyze the source code line by line based on the identification results to extract the code logic closely related to the original instruction set; S2. According to the extracted code logic, an instruction set mapping table is constructed to map the original instruction set function to the function implementation corresponding to the target instruction set, and then the modified source code is recompiled into a binary file executable by the target instruction set through dynamic compilation technology; S3. Use binary analysis tools to scan the runtime library that the application depends on, identify the library function implementation that is incompatible with the original instruction set, and recompile or replace the incompatible library function based on the library function identification results to adapt the application and its dependent runtime library to the operating system and hardware environment of the target instruction set; S4. Deploy the modified application and runtime library in the test environment, perform functional testing, verify whether the application's operating logic in the target instruction set environment is correct, and determine the correctness status of the application in the target environment; S5. After determining the correctness status of the application in the target environment, monitor the execution efficiency of the application in the target instruction set environment to determine whether there is performance loss; then use security testing tools to detect whether the modified application and runtime library have potential security vulnerabilities to ensure that they meet the security requirements of the trusted innovation environment.
[0005] Furthermore, static analysis tools are used to scan the source code to identify function calls, macro definitions, and inline assembly code snippets related to the original instruction set, including: S11, obtain the source code and input it into the scanner, the scanner traverses the code segment and marks the function body and inline segment; S12, the analyzer performs syntax analysis on the marked code segment, and the recognizer extracts function calls and macro definitions; S13, the associator matches the identified function call and macro definition with the instruction set to determine whether there is an association, and if there is an association, the code snippet is added to the snippet set; S14. Filter the snippet set by using preset instruction set rules to obtain the final instruction set related code snippets, classify the snippet set by using a machine learning algorithm, and determine the calling modes of different instruction sets.
[0006] Furthermore, based on the recognition results, the source code is analyzed line by line to extract the code logic closely related to the original instruction set, including: using line-by-line analysis technology to obtain each line of data in the source code, making logical relationship judgments on each line of data, extracting code segments related to the instruction set, verifying the association through preset logical chain rules, obtaining closely related code logic, using concise expressions to regenerate a logical description that conforms to the thinking chain, performing word matching according to similarity rules, and finally generating a business description similar to the original.
[0007] Furthermore, according to the extracted code logic, an instruction set mapping table is constructed to map the original instruction set function to the function implementation corresponding to the target instruction set, specifically including: S21, obtaining the function definitions of the original instruction set and the target instruction set, extracting the function name and parameter list, and establishing a function feature vector; S22, using a clustering algorithm to classify the feature vectors, determine the similarity between functions, and construct a function mapping relationship table based on the similarity results; S23, generating the function implementation code corresponding to the target instruction set through the mapping relationship table, and when the function cannot be directly mapped, using the adapter mode for conversion; S24. Integrate the converted function code into the target instruction set, and after completing the instruction set mapping and conversion, output the final target instruction set code.
[0008] Furthermore, the modified source code is recompiled into a binary file executable by the target instruction set through dynamic compilation technology, specifically including: Obtain the modified source code content, analyze the grammatical structure of the source code, and determine the code fragments that need to be compiled; Dynamic compilation technology is used to generate intermediate code representations according to the characteristics of the target instruction set. Based on the intermediate code representations, the execution efficiency of the code is optimized and key instruction sequences are extracted. Convert the optimized instruction sequence into the machine code of the target instruction set, generate a binary file format, verify the integrity of the binary file, and check the compatibility of the instruction set; According to different target instruction sets, the compilation parameters are adjusted to generate multiple versions of binary files, store the generated binary files, record the configuration information during the compilation process, and establish a version management mechanism.
[0009] Furthermore, a binary analysis tool is used to scan the runtime libraries that the application depends on and identify library function implementations that are incompatible with the original instruction set, including: Get the binary file of the target application, scan the file using a binary analysis tool, and extract all dependent runtime library information; According to the extracted runtime library information, through the preset instruction set mapping table, it is determined whether the implementation of each library function is compatible with the target instruction set; When the implementation of a library function is incompatible with the target instruction set, mark the library function as an incompatible item and record its specific implementation details; Generate an incompatible library function list based on the marked incompatible items, including the name, implementation details and corresponding dependent runtime library of each incompatible library function; Use machine learning algorithms to analyze the list of incompatible library functions, predict library functions that need to be modified or replaced, and their corresponding modification plans; Through the preset instruction set optimization model, the predicted modification plan is optimized to generate the final library function modification instruction set. According to the final library function modification instruction set, the modified runtime library file is automatically generated to complete the library function implementation compatible with the original instruction set.
[0010] Furthermore, after automatically generating the modified runtime library file, it also includes: Obtain instruction set information of the target operating system and hardware environment; scan the application and its dependent runtime libraries, and identify the calling status of library functions; Based on the identified library function, its compatibility with the target instruction set is judged again. If the library function is incompatible, the source code of the library function is obtained and recompiled; When recompilation is not possible, an alternative library function compatible with the target instruction set is searched for replacement, and the recompiled or replaced library function is integrated into the application and its dependent runtime library to generate a final runtime library that is adapted to the operating system and hardware environment of the target instruction set.
[0011] Furthermore, the modified application and runtime library are deployed in the test environment, and functional testing is performed to verify whether the application's operating logic in the target instruction set environment is correct, including: In a pre-established test environment, deploy the code-modified application software and its dependent runtime libraries, execute preset functional test cases, obtain the application's running status data under the target instruction set architecture, analyze the difference between the running status data and the expected results, determine whether the application's running logic matches the target instruction set environment, and determine the correctness status of the application in the target environment. If the application's running logic does not match the target instruction set environment, obtain the compatibility data of the runtime library, analyze the degree of adaptation of the runtime library to the target instruction set, and determine the modification plan for the runtime library.
[0012] Furthermore, the execution efficiency of the application in the target instruction set environment is monitored to determine whether there is performance loss; then, security testing tools are used to detect whether there are potential security vulnerabilities in the modified application and runtime library, including: using performance testing tools to monitor the execution efficiency of the application in the target instruction set environment, obtaining performance data, and using performance data analysis algorithms to determine whether there is performance loss. When there is performance loss, an application optimization algorithm is used to modify the application.
[0013] At the same time, security testing tools are used to detect the modified applications and runtime libraries, obtain security data, and identify potential security vulnerabilities through security data analysis algorithms. When security vulnerabilities exist, security repair algorithms are used to repair the applications and runtime libraries. The repaired applications are deployed in the trusted computing environment, and performance testing tools and security testing tools are used again to monitor and detect them.
[0014] The present invention provides a system for adapting a credible innovation application compatibility based on instruction set conversion, which is used to implement a method for adapting a credible innovation application compatibility based on instruction set conversion, including: The analysis and extraction module uses static analysis tools to scan source code, identify function calls, macro definitions, and inline assembly code snippets related to the original instruction set, extracts code logic closely related to the original instruction set through line-by-line analysis technology, and uses machine learning algorithms to classify code snippets and generate adaptation strategies; The mapping and conversion module builds an instruction set mapping table based on the extracted code logic, maps the functions, macro definitions and inline assembly code snippets in the original instruction set to the implementation of the target instruction set; processes complex functions and inline assembly codes through adapter patterns and optimization algorithms, generates code logic compatible with the target instruction set, and outputs an intermediate code representation; Dynamic compilation and optimization module recompiles the modified source code into a binary file executable by the target instruction set, optimizes the execution efficiency of the code through dynamic compilation technology, extracts key instruction sequences and converts them into machine code of the target instruction set, and supports multi-version compilation and version management; The adaptation and verification module uses binary analysis tools to scan the runtime library that the application depends on, identifies the library function implementation that is incompatible with the original instruction set, automatically generates the modified runtime library file through the instruction set optimization model, and combines the recompilation or replacement mechanism to handle the library functions that cannot be automatically adapted; The testing and security assurance module deploys modified applications and runtime libraries in the test environment, performs functional testing, performance testing, and security testing, evaluates the execution efficiency of the application through performance monitoring tools, detects potential security vulnerabilities through security testing tools, and optimizes and repairs problems when they are found.
[0015] The beneficial effects of the present invention are: The present invention uses static analysis tools and line-by-line analysis technology to accurately identify function calls, macro definitions, and inline assembly code snippets related to the original instruction set in the source code, and uses machine learning algorithms to classify these snippets and generate adaptation strategies. It not only efficiently extracts the code logic closely related to the original instruction set, but also converts it into the implementation of the target instruction set through the adapter mode, solving the compatibility problem of open source and closed source software in cross-instruction set migration. At the same time, the adapted business description is generated through logical chain rules and similarity rules, ensuring the integrity and consistency of the business logic, and significantly improving the portability and operation efficiency of the code in the new environment; Use binary analysis tools to scan the runtime library that the application depends on, identify and process library functions that are incompatible with the original instruction set, automatically generate modified runtime library files through instruction set mapping tables and optimization models, and combine recompilation or replacement mechanisms to solve the adaptation problems of complex library functions. It also optimizes the execution efficiency of the code through dynamic compilation technology, extracts key instruction sequences and generates machine code for the target instruction set. It also supports multi-version compilation and version management, which not only ensures the full adaptation of the runtime library to the target instruction set, but also optimizes program performance, solves the problems of runtime library incompatibility and performance loss, and provides strong support for the stable operation of trust-based applications. By deploying modified applications and runtime libraries in a test environment, performing functional testing, performance testing, and security testing, we can comprehensively verify the application's operating logic, execution efficiency, and security in the target instruction set environment. We can use performance monitoring tools to evaluate the application's execution efficiency, identify performance bottlenecks, and optimize them. We can use security testing tools to detect potential security vulnerabilities, and make targeted improvements by repairing algorithms. Ultimately, we can ensure that the application meets both performance requirements and security standards in a trusted computing environment, solve performance and security risk issues in cross-platform migration, and ensure efficient and stable operation of trusted computing applications and data security. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] For better understanding and implementation, the technical solution of the present application is described in detail below with reference to the accompanying drawings.
[0017] Figure 1 A flowchart of the method for compatible adaptation of trusted computing applications based on instruction set conversion provided in Example 1 of the present application; Figure 2 A flow chart of the method for adapting the compatible application of the trust-based innovation based on instruction set conversion provided in Example 1 of the present application using a static analysis tool to scan the source code; Figure 3 A flow chart of constructing an instruction set mapping table for the trusted application compatible adaptation method based on instruction set conversion provided in Example 1 of the present application; Figure 4 A structural diagram of the trusted computing application compatible adaptation system based on instruction set conversion provided in Example 2 of the present application. DETAILED DESCRIPTION
[0018] In order to further explain the technical means and effects taken by the present invention to achieve the predetermined invention purpose, exemplary embodiments will be described in detail here, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of methods and systems consistent with some aspects of the present application as detailed in the attached claims.
[0019] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0020] The specific implementation methods, features and effects of the present invention are described in detail below in conjunction with the accompanying drawings and preferred embodiments.
[0021] Example 1
[0022] See also Figure 1-Figure 3 This embodiment provides a method for adapting the compatibility of trusted applications based on instruction set conversion, including the following steps: S1. Use static analysis tools to scan the source code, identify function calls, macro definitions, and inline assembly code snippets related to the original instruction set, and analyze the source code line by line based on the identification results to extract the code logic closely related to the original instruction set; Furthermore, static analysis tools are used to scan the source code to identify function calls, macro definitions, and inline assembly code snippets related to the original instruction set, including: S11, obtain the source code and input it into the scanner, the scanner traverses the code segment and marks the function body and inline segment; S12, the analyzer performs syntax analysis on the marked code segment, and the recognizer extracts function calls and macro definitions; S13, the associator matches the identified function call and macro definition with the instruction set to determine whether there is an association, and if there is an association, the code snippet is added to the snippet set; S14. Filter the snippet set by using preset instruction set rules to obtain the final instruction set related code snippets, classify the snippet set by using a machine learning algorithm, and determine the calling modes of different instruction sets.
[0023] Specifically, after identifying the code snippets related to the original instruction set, these snippets can be mapped to the implementation of the target instruction set through the adapter pattern; the adapter pattern allows the interface of a class to be converted into another interface expected by the client, so that classes that originally could not work together due to incompatible interfaces can work together. For example, for the identified inline assembly code snippet, an adapter can be designed to convert it into assembly code supported by the target instruction set, thereby achieving the adaptation of the code snippet.
[0024] At the same time, after classifying the code snippets using machine learning algorithms, specific adaptation strategies can be generated based on the classification results. For example, for a certain frequently occurring call pattern, an optimization algorithm (such as the Adam algorithm) can be used to adjust the adaptation strategy to improve the adaptation efficiency; in addition, code optimization suggestions can be combined, such as reducing function call overhead, optimizing memory access, etc., to further improve the performance of the adapted code. Not only can the identified code snippets be effectively mapped to the implementation of the target instruction set, but the classification results can also be used to generate optimized adaptation strategies, thereby ensuring the integrity and effectiveness of the entire adaptation process.
[0025] Furthermore, based on the recognition results, the source code is analyzed line by line to extract the code logic closely related to the original instruction set, including: using line-by-line analysis technology to obtain each line of data in the source code, making logical relationship judgments on each line of data, extracting code segments related to the instruction set, verifying the association through preset logical chain rules, obtaining closely related code logic, using concise expressions to regenerate a logical description that conforms to the thinking chain, performing word matching according to similarity rules, and finally generating a business description similar to the original.
[0026] Specifically, by analyzing the source code line by line and extracting the code logic closely related to the original instruction set, and combining the logic chain rules and similarity rules to generate the adapted business description, this technology can efficiently identify and convert the parts of the code related to the original instruction set while retaining the integrity and consistency of the business logic. The specific effect is to achieve accurate adaptation of the code from the original instruction set to the target instruction set, solving the problems of poor code compatibility, low adaptation efficiency, and easy loss of business logic during cross-platform migration or instruction set conversion, and significantly improving the operating efficiency and maintainability of the code in the new environment.
[0027] S2. Based on the extracted code logic, an instruction set mapping table is constructed to map the original instruction set function to the function implementation corresponding to the target instruction set. Then, through dynamic compilation technology, the modified source code is recompiled into a binary file executable by the target instruction set. This process ensures that the code is not only logically compatible with the target instruction set, but also runs correctly on the target architecture at the execution level.
[0028] Among them, the role of the instruction set mapping table is to map the functions, macro definitions and inline assembly code fragments in the original instruction set to the corresponding implementations of the target instruction set. For example, some specific functions in the original instruction set need to be replaced with equivalent functions provided by the target instruction set, or the inline assembly code needs to be rewritten to comply with the syntax and architecture requirements of the target instruction set. Through this mapping and replacement, the source code is logically adjusted to a form compatible with the target instruction set.
[0029] Furthermore, according to the extracted code logic, an instruction set mapping table is constructed to map the original instruction set function to the function implementation corresponding to the target instruction set, specifically including: S21, obtaining the function definitions of the original instruction set and the target instruction set, extracting the function name and parameter list, and establishing a function feature vector; S22, using a clustering algorithm to classify the feature vectors, determine the similarity between functions, and construct a function mapping relationship table based on the similarity results; S23, generating the function implementation code corresponding to the target instruction set through the mapping relationship table, and when the function cannot be directly mapped, using the adapter mode for conversion; S24. Integrate the converted function code into the target instruction set, and after completing the instruction set mapping and conversion, output the final target instruction set code.
[0030] Among them, when encountering complex functions that cannot be directly mapped and cannot be converted through the adapter mode, manual intervention or heuristic algorithms are used to find alternatives, such as by calling low-level system calls provided by the target instruction set or redesigning part of the logic to meet the requirements of the target architecture; at the same time, in order to ensure the correctness and completeness of the generated target instruction set code, code verification mechanisms such as unit testing and static code analysis tools are introduced to verify the converted code, and performance analysis tools are used to evaluate the performance of the target code, optimize possible performance bottlenecks, and ensure that the code is not only logically compatible, but also can run efficiently on the target architecture; the instruction set mapping and conversion process is further improved, and the reliability and efficiency of adaptation are improved.
[0031] Specifically, by extracting the function feature vector and using the clustering algorithm to determine the function similarity, the function mapping relationship table can be accurately constructed to ensure that the functions in the original instruction set can be accurately mapped to the equivalent implementation of the target instruction set; secondly, for functions that cannot be directly mapped, the adapter mode is used for conversion, which solves the adaptation problem of complex function calls and inline assembly code, and ensures the logical compatibility of the code. Finally, the modified source code is recompiled into a binary file of the target instruction set through dynamic compilation technology to ensure that the code is not only logically compatible with the target instruction set, but also runs correctly on the target architecture at the execution level; it significantly improves the efficiency and accuracy of code adaptation, solves the compatibility problem during cross-instruction set migration, reduces the adaptation cost, and provides technical support for the rapid deployment of information technology applications.
[0032] Among them, xinchuang applications refer to software applications developed based on the concept of information technology application innovation, aiming to achieve comprehensive domestic substitution from hardware to software through independent and controllable technologies and products. Such applications involve cross-platform and cross-instruction set compatibility and adaptation, and can run efficiently in different operating systems and hardware environments while meeting the requirements of security, reliability and performance optimization; the core goal of xinchuang applications is to solve the problems of poor compatibility, low adaptation efficiency and high security risks encountered by traditional applications during migration and deployment through technological innovation and adaptation optimization, thereby promoting the independent controllable and sustainable development of the information technology industry.
[0033] Furthermore, the modified source code is recompiled into a binary file executable by the target instruction set through dynamic compilation technology, specifically including: Obtain the modified source code content, analyze the grammatical structure of the source code, and determine the code fragments that need to be compiled; Dynamic compilation technology is used to generate intermediate code representations according to the characteristics of the target instruction set. Based on the intermediate code representations, the execution efficiency of the code is optimized and key instruction sequences are extracted. Convert the optimized instruction sequence into the machine code of the target instruction set, generate a binary file format, verify the integrity of the binary file, check the compatibility of the instruction set, and ensure executableness; According to different target instruction sets, the compilation parameters are adjusted to generate multiple versions of binary files, store the generated binary files, record the configuration information during the compilation process, and establish a version management mechanism.
[0034] Specifically, through dynamic compilation technology, efficient compilation and optimization of modified source code is achieved to generate executable binary files compatible with the target instruction set. This process not only improves the execution efficiency of the code, but also ensures the integrity and executableness of the generated files. At the same time, the version management mechanism meets the requirements of multi-platform deployment. It solves the compatibility issues in cross-instruction set compilation, optimizes program performance, simplifies multi-version management, and significantly improves the portability and adaptation efficiency of the code.
[0035] S3. Use binary analysis tools to scan the runtime library that the application depends on, identify the library function implementation that is incompatible with the original instruction set, and recompile or replace the incompatible library function based on the library function identification results to adapt the application and its dependent runtime library to the operating system and hardware environment of the target instruction set; Furthermore, a binary analysis tool is used to scan the runtime libraries that the application depends on and identify library function implementations that are incompatible with the original instruction set, including: Get the binary file of the target application, scan the file using a binary analysis tool, and extract all dependent runtime library information; According to the extracted runtime library information, through the preset instruction set mapping table, it is determined whether the implementation of each library function is compatible with the target instruction set; When the implementation of a library function is incompatible with the target instruction set, mark the library function as an incompatible item and record its specific implementation details; Generate an incompatible library function list based on the marked incompatible items, including the name, implementation details and corresponding dependent runtime library of each incompatible library function; Use machine learning algorithms to analyze the list of incompatible library functions, predict library functions that need to be modified or replaced, and their corresponding modification plans; Through the preset instruction set optimization model, the predicted modification plan is optimized to generate the final library function modification instruction set. According to the final library function modification instruction set, the modified runtime library file is automatically generated to complete the library function implementation compatible with the original instruction set.
[0036] Specifically, generating and modifying instruction sets and runtime library files is an automated process based on an instruction set optimization model, and the purpose is to generate library function implementations that are adapted to the target instruction set.
[0037] Furthermore, after automatically generating the modified runtime library file, it also includes: Obtain instruction set information of the target operating system and hardware environment; scan the application and its dependent runtime libraries, and identify the calling status of library functions; Based on the identified library function, its compatibility with the target instruction set is judged again. If the library function is incompatible, the source code of the library function is obtained and recompiled; When recompilation is not possible, an alternative library function compatible with the target instruction set is searched for replacement, and the recompiled or replaced library function is integrated into the application and its dependent runtime library to generate a final runtime library that is adapted to the operating system and hardware environment of the target instruction set.
[0038] Among them, recompiling or replacing incompatible library functions is a supplement to generating and modifying instruction sets and runtime files, and handles situations that cannot be solved by automated modification (such as missing source code or need for manual replacement). The modified runtime files are directly used as input for recompiling or replacing incompatible library functions to ensure the consistency of the entire process, and the final output is the adapted runtime files, ensuring that the application and its dependent runtime libraries are fully adapted to the target environment.
[0039] Specifically, through binary analysis tools and dynamic compilation technology, comprehensive adaptation of applications and their dependent runtime libraries is achieved, solving the problem of runtime library incompatibility in cross-instruction set environments. Specifically, the runtime library is scanned by binary analysis tools to accurately identify library functions that are incompatible with the original instruction set, and the instruction set mapping table and machine learning algorithm are used to generate a modified instruction set that adapts to the target instruction set. On this basis, dynamic compilation technology compiles the modified runtime library code into a binary file of the target instruction set to ensure that the generated runtime library has good compatibility and execution efficiency in the target operating system and hardware environment. In addition, by recompiling or replacing incompatible library functions, complex situations that cannot be solved by automated modifications are further handled to ensure that the application and its dependent runtime library can seamlessly adapt to the target environment. This process not only improves the adaptation efficiency, but also reduces the system operation risks caused by runtime library incompatibility, providing strong support for the migration and deployment of trusted innovation applications.
[0040] S4. Deploy the modified application and runtime library in the test environment, perform functional testing, verify whether the application's operating logic in the target instruction set environment is correct, and determine the correctness status of the application in the target environment; Furthermore, the modified application and runtime library are deployed in the test environment, and functional testing is performed to verify whether the application's operating logic in the target instruction set environment is correct, including: In a pre-established test environment, deploy the code-modified application software and its dependent runtime libraries, execute preset functional test cases, obtain the application's running status data under the target instruction set architecture, analyze the difference between the running status data and the expected results, determine whether the application's running logic matches the target instruction set environment, and determine the correctness status of the application in the target environment. If the application's running logic does not match the target instruction set environment, obtain the compatibility data of the runtime library, analyze the degree of adaptation of the runtime library to the target instruction set, and determine the modification plan for the runtime library.
[0041] Specifically, by deploying the modified application and runtime library in the test environment and performing functional testing, a comprehensive verification of the application's operating logic in the target instruction set environment is achieved; this not only ensures the correctness of the application in the target environment, but also provides a clear direction for subsequent optimization and adjustment, significantly improving the reliability and efficiency of application adaptation, and providing a strong guarantee for the stable operation of trusted computing applications.
[0042] S5. After determining the correctness status of the application in the target environment, monitor the execution efficiency of the application in the target instruction set environment to determine whether there is performance loss; then use security testing tools to detect whether the modified application and runtime library have potential security vulnerabilities to ensure that they meet the security requirements of the trusted innovation environment.
[0043] Furthermore, the execution efficiency of the application in the target instruction set environment is monitored to determine whether there is performance loss; then, security testing tools are used to detect whether there are potential security vulnerabilities in the modified application and runtime library, including: using performance testing tools to monitor the execution efficiency of the application in the target instruction set environment, obtaining performance data, and using performance data analysis algorithms to determine whether there is performance loss. When there is performance loss, an application optimization algorithm is used to modify the application.
[0044] At the same time, security testing tools are used to detect the modified applications and runtime libraries, obtain security data, and identify potential security vulnerabilities through security data analysis algorithms. When security vulnerabilities exist, security repair algorithms are used to repair the applications and runtime libraries. The repaired applications are deployed in the trusted innovation environment, and performance testing tools and security testing tools are used again to monitor and test them to ensure that they meet the security requirements of the trusted innovation environment.
[0045] Specifically, through performance monitoring and security testing, the running status of the application in the target instruction set environment is comprehensively evaluated and optimized. Specifically, performance testing tools are used to monitor the execution efficiency of the application, and performance data is analyzed to determine whether there is performance loss. When problems are found, targeted improvements are made through application optimization algorithms. At the same time, security testing tools are used to detect potential security vulnerabilities in applications and runtime libraries, and problems are identified through security data analysis algorithms, and repaired using security repair algorithms. Finally, the repaired application is redeployed and tested again to ensure that it meets both performance requirements and security standards in the trusted innovation environment, thereby ensuring efficient and stable operation of the application and data security.
[0046] Example 2
[0047] See also Figure 3 This embodiment provides a system for adapting a credible innovation application compatibility based on instruction set conversion, which is used to implement a method for adapting a credible innovation application compatibility based on instruction set conversion, including: The analysis and extraction module uses static analysis tools to scan source code, identify function calls, macro definitions, and inline assembly code snippets related to the original instruction set, extract code logic closely related to the original instruction set through line-by-line analysis technology, and classify code snippets using machine learning algorithms to generate adaptation strategies. This module provides basic data support for subsequent code adaptation.
[0048] The mapping and conversion module builds an instruction set mapping table based on the extracted code logic, maps the functions, macro definitions and inline assembly code snippets in the original instruction set to the implementation of the target instruction set; processes complex functions and inline assembly codes through adapter patterns and optimization algorithms, generates code logic compatible with the target instruction set, and outputs an intermediate code representation; Dynamic compilation and optimization module recompiles the modified source code into a binary file executable by the target instruction set, optimizes the execution efficiency of the code through dynamic compilation technology, extracts key instruction sequences and converts them into machine code of the target instruction set, and supports multi-version compilation and version management to ensure that the generated binary file runs efficiently on the target architecture; The adaptation and verification module uses binary analysis tools to scan the runtime library that the application depends on, identifies the library function implementation that is incompatible with the original instruction set, automatically generates the modified runtime library file through the instruction set optimization model, and combines the recompilation or replacement mechanism to handle the library functions that cannot be automatically adapted, ensuring that the runtime library is fully adapted to the operating system and hardware environment of the target instruction set; The testing and security assurance module deploys the modified application and runtime library in the test environment, performs functional testing, performance testing, and security testing, evaluates the execution efficiency of the application through performance monitoring tools, detects potential security vulnerabilities through security testing tools, and optimizes and repairs problems when they are found. Ultimately, it ensures that the application meets both the performance requirements in the target environment and the security standards of the trusted innovation environment.
[0049] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technical personnel in this field can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any brief modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention are still within the scope of the technical solution of the present invention.
Claims
1. A method for adapting the compatible application of a trusted computing platform based on instruction set conversion, characterized in that: The steps include: Use static analysis tools to scan the source code, identify function calls, macro definitions, and inline assembly code snippets related to the original instruction set, and analyze the source code line by line based on the identification results to extract the code logic closely related to the original instruction set; According to the extracted code logic, an instruction set mapping table is constructed to map the original instruction set function to the function implementation corresponding to the target instruction set. Then, through dynamic compilation technology, the modified source code is recompiled into a binary file executable by the target instruction set. Use binary analysis tools to scan the runtime libraries that the application depends on, identify library function implementations that are incompatible with the original instruction set, and recompile or replace incompatible library functions based on the library function identification results to make the application and its dependent runtime libraries compatible with the operating system and hardware environment of the target instruction set; Deploy the modified application and runtime library in the test environment, perform functional testing, verify whether the application's operating logic in the target instruction set environment is correct, and determine the correctness status of the application in the target environment; After determining the correctness status of the application in the target environment, monitor the execution efficiency of the application in the target instruction set environment to determine whether there is performance loss; Security testing tools are then used to detect whether the modified applications and runtime libraries have potential security vulnerabilities to ensure that they meet the security requirements of the trusted computing environment.
2. According to the method for compatible adaptation of trusted innovation applications based on instruction set conversion according to claim 1, it is characterized in that: Use static analysis tools to scan the source code and identify function calls, macro definitions, and inline assembly code snippets related to the original instruction set, including: The source code is obtained and fed into a scanner, which traverses the code segments and marks function bodies and inline segments; The analyzer performs syntax analysis on the marked code segments, and the recognizer extracts function calls and macro definitions; The associator matches the identified function calls and macro definitions with the instruction set to determine whether there is an association. If there is an association, the code snippet is added to the snippet set. The snippet set is filtered through the preset instruction set rules to obtain the final instruction set related code snippets. The snippet set is classified by machine learning algorithm to determine the calling modes of different instruction sets.
3. According to the method for compatible adaptation of trusted computing applications based on instruction set conversion according to claim 1, it is characterized in that: According to the recognition results, the source code is analyzed line by line to extract the code logic closely related to the original instruction set, including: using line-by-line analysis technology to obtain each line of data in the source code, judging the logical relationship of each line of data, extracting the code segments related to the instruction set, verifying the association through preset logical chain rules, obtaining closely related code logic, using concise expressions to regenerate logical descriptions that conform to the thinking chain, matching the number of words according to similarity rules, and finally generating a business description similar to the original text.
4. According to claim 1, the method for compatible adaptation of trusted computing applications based on instruction set conversion is characterized in that: According to the extracted code logic, an instruction set mapping table is constructed to map the original instruction set function to the function implementation corresponding to the target instruction set, including: Obtain the function definitions of the original instruction set and the target instruction set, extract the function name and parameter list, and establish the function feature vector; A clustering algorithm is used to classify feature vectors, determine the similarity between functions, and build a function mapping relationship table based on the similarity results; Generate the function implementation code corresponding to the target instruction set through the mapping relationship table. When the function cannot be directly mapped, the adapter mode is used for conversion. Integrate the converted function code into the target instruction set, complete the instruction set mapping and conversion, and output the final target instruction set code.
5. According to the method for compatible adaptation of trusted innovation applications based on instruction set conversion according to claim 1, it is characterized in that: The modified source code is recompiled into a binary file executable by the target instruction set through dynamic compilation technology, including: Obtain the modified source code content, analyze the grammatical structure of the source code, and determine the code fragments that need to be compiled; Dynamic compilation technology is used to generate intermediate code representations according to the characteristics of the target instruction set. Based on the intermediate code representations, the execution efficiency of the code is optimized and key instruction sequences are extracted. Convert the optimized instruction sequence into the machine code of the target instruction set, generate a binary file format, verify the integrity of the binary file, and check the compatibility of the instruction set; According to different target instruction sets, the compilation parameters are adjusted to generate multiple versions of binary files, store the generated binary files, record the configuration information during the compilation process, and establish a version management mechanism.
6. According to claim 1, the method for compatible adaptation of trusted computing applications based on instruction set conversion is characterized in that: Use binary analysis tools to scan the runtime libraries that the application depends on and identify library function implementations that are incompatible with the original instruction set, including: Get the binary file of the target application, scan the file using a binary analysis tool, and extract all dependent runtime library information; According to the extracted runtime library information, through the preset instruction set mapping table, it is determined whether the implementation of each library function is compatible with the target instruction set; When the implementation of a library function is incompatible with the target instruction set, mark the library function as an incompatible item and record its specific implementation details; Generate an incompatible library function list based on the marked incompatible items, including the name, implementation details and corresponding dependent runtime library of each incompatible library function; Use machine learning algorithms to analyze the list of incompatible library functions, predict library functions that need to be modified or replaced, and their corresponding modification plans; Through the preset instruction set optimization model, the predicted modification plan is optimized to generate the final library function modification instruction set. According to the final library function modification instruction set, the modified runtime library file is automatically generated to complete the library function implementation compatible with the original instruction set.
7. According to claim 6, the method for compatible adaptation of trusted innovation applications based on instruction set conversion is characterized in that: After automatically generating the modified runtime library files, it also includes: Obtain instruction set information of the target operating system and hardware environment; scan the application and its dependent runtime libraries, and identify the calling status of library functions; Based on the identified library function, its compatibility with the target instruction set is judged again. If the library function is incompatible, the source code of the library function is obtained and recompiled; When recompilation is not possible, an alternative library function compatible with the target instruction set is found for replacement, and the recompiled or replaced library function is integrated into the application and its dependent runtime library to generate a final runtime library that is adapted to the operating system and hardware environment of the target instruction set.
8. According to claim 1, the method for compatible adaptation of trusted computing applications based on instruction set conversion is characterized in that: Deploy the modified application and runtime library in the test environment and perform functional testing to verify whether the application's operating logic is correct in the target instruction set environment, including: In a pre-established test environment, deploy the code-modified application software and its dependent runtime libraries, execute preset functional test cases, obtain the application's running status data under the target instruction set architecture, analyze the difference between the running status data and the expected results, determine whether the application's running logic matches the target instruction set environment, and determine the correctness status of the application in the target environment. If the application's running logic does not match the target instruction set environment, obtain the compatibility data of the runtime library, analyze the degree of adaptation of the runtime library to the target instruction set, and determine the modification plan for the runtime library.
9. According to claim 1, the method for compatible adaptation of trusted innovation applications based on instruction set conversion is characterized in that: Monitor the execution efficiency of the application in the target instruction set environment to determine whether there is performance loss; Then, security testing tools are used to detect whether the modified applications and runtime libraries have potential security vulnerabilities, including: using performance testing tools to monitor the application execution efficiency in the target instruction set environment, obtaining performance data, and using performance data analysis algorithms to determine whether there is performance loss. If there is performance loss, the application optimization algorithm is used to modify the application; At the same time, security testing tools are used to detect the modified applications and runtime libraries, obtain security data, and identify potential security vulnerabilities through security data analysis algorithms. When security vulnerabilities exist, security repair algorithms are used to repair the applications and runtime libraries. The repaired applications are deployed in the trusted computing environment, and performance testing tools and security testing tools are used again to monitor and detect them.
10. A system for informatization application compatibility adaptation based on instruction set conversion, used to implement the informatization application compatibility adaptation method based on instruction set conversion as described in any one of claims 1 to 9, characterized in that: The analysis and extraction module uses static analysis tools to scan source code, identify function calls, macro definitions, and inline assembly code snippets related to the original instruction set, extracts code logic closely related to the original instruction set through line-by-line analysis technology, and uses machine learning algorithms to classify code snippets and generate adaptation strategies; The mapping and conversion module builds an instruction set mapping table based on the extracted code logic, maps the functions, macro definitions and inline assembly code snippets in the original instruction set to the implementation of the target instruction set; processes complex functions and inline assembly codes through adapter patterns and optimization algorithms, generates code logic compatible with the target instruction set, and outputs an intermediate code representation; Dynamic compilation and optimization module recompiles the modified source code into a binary file executable by the target instruction set, optimizes the execution efficiency of the code through dynamic compilation technology, extracts key instruction sequences and converts them into machine code of the target instruction set, and supports multi-version compilation and version management; The adaptation and verification module uses binary analysis tools to scan the runtime library that the application depends on, identifies the library function implementation that is incompatible with the original instruction set, automatically generates the modified runtime library file through the instruction set optimization model, and combines the recompilation or replacement mechanism to handle the library functions that cannot be automatically adapted; The testing and security assurance module deploys modified applications and runtime libraries in the test environment, performs functional testing, performance testing, and security testing, evaluates the execution efficiency of the application through performance monitoring tools, detects potential security vulnerabilities through security testing tools, and optimizes and repairs problems when they are found.
Citation Information
Patent Citations
Cross-platform and efficient visual workflow engine
CN105740324A
Extensible framework for program cross-framework migration and program cross-framework migration method
CN115794123A
Source code credential migration system and method
CN116450213A
Instruction conversion method of cross-chip platform
CN119292671A
User mode binary program instruction set compatible method, system and equipment
CN119473395A
Cited By
Application compatibility dynamic adaptation method and system of cross-domestic CPU architecture
CN121364886A
An application compatibility dynamic adaptation method and system across CPU architectures of different manufacturers
CN121364886B