Application migration method and system based on SW processor
By designing a scanning algorithm on the Shenwei processor, generating modification suggestions and providing a visual report, the problem of low application migration efficiency of the Shenwei processor in the existing technology is solved, and more efficient software migration and automation are achieved.
Patent Information
- Application Number
- CN202511651298.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-12
- Publication Date
- 2026-02-17
AI Technical Summary
Existing application migration platforms are not compatible with Shenwei processors and cannot provide modification suggestions for assembly and embedded assembly code, resulting in low software migration efficiency and a lack of unified standards.
The design of the architecture-related code scanning algorithm generates modification suggestions and provides a visual evaluation report by scanning the embedded assembly and full assembly code in key files, guiding the application migration of Shenwei processors.
It improved application migration efficiency, reduced migration time, achieved a higher degree of automation, and enhanced the market competitiveness of Shenwei processors.
Smart Images

Figure CN121541924A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to an application migration method and system based on the Shenwei processor, belonging to the field of application migration technology. Background Technology
[0002] Currently, many domestic operating systems attempt to be compatible with multiple domestic processor architectures. However, the influence of each processor ecosystem is not the same, resulting in inconsistent application migration standards and varying amounts of code modifications. A unified standard has not yet been formed. Furthermore, the experience and knowledge of software developers have a significant impact on the efficiency of application migration.
[0003] Currently, domestic technology companies have developed supporting application migration platforms for the domestic processor architectures they use, in order to promote the porting of application software from various industries to their operating systems, which has greatly promoted the localization of application software. However, at present, none of the application migration platforms are applicable to Shenwei processors, and they cannot provide modification suggestions for Shenwei's self-developed instruction set for assembly, embedded assembly, and other code. Summary of the Invention
[0004] The purpose of this invention is to provide an application migration method and system based on the Shenwei processor. Addressing the challenges of complex software porting processes and high levels of expertise required by the Shenwei platform, this invention designs an algorithm for scanning architecture-related code based on coding rules, locates code blocks, analyzes code functions, generates modification suggestion reports, and finally visualizes the scanned data through a web page.
[0005] To achieve the above objectives, the present invention is implemented using the following technical solution.
[0006] On one hand, the present invention provides an application migration method based on the Shenwei processor, comprising: The source code package is initialized, the configuration file is parsed, the software dependencies of the source code package are determined, and the portability of the dependent software is determined by the software whitelist. Establish an assembly dictionary for the processor architecture, and design conditional compilation, embedded assembly, and vector extension keyword regular expressions based on the built-in macro definitions of the processor architecture; Scan the key files of the processor architecture, and scan the embedded assembly and full assembly code in the key files according to the assembly dictionary, and save the scan information to the evaluation report; The scan information is analyzed, and modification suggestions for the Shenwei processor architecture are obtained based on the correspondence between the processor architecture and the Shenwei processor architecture. The workload of application migration is evaluated based on the modification suggestions, and the analysis results are saved to the evaluation report. The evaluation report is rendered into HTML by a web server and returned to the client for user reference.
[0007] Optionally, the configuration file includes Makefile, spec, and control files.
[0008] Optionally, the processor architecture includes x86 and ARM architectures.
[0009] Optionally, the key files of the processor architecture include .c, .cpp, .h, .hpp and .S architecture-related files.
[0010] Optionally, the scanning information includes information such as the file where the scanned code is located and the number of lines of code.
[0011] Optionally, the workload assessment for application migration is based on the total number of lines of code to be modified in the modification suggestions, the ratio of full assembly to embedded assembly, and the total number of application codes. This assessment provides excellent guidance for application migration.
[0012] Secondly, the present invention provides an application migration system based on the Shenwei processor, comprising: The dependency analysis module is used to analyze the software support that the source code depends on for compilation and execution, and to determine the software that needs to be installed and adapted before compilation. The porting assistance module is used to scan architecture-related branches in the source code, locate code porting objects, parse conditional compilation, locate code blocks, and provide modification suggestions for assembly code based on instruction conversion dictionaries. The assessment report module is used to display the code items to be migrated and processing suggestions, count the number of files to be modified and the number of lines of code, and assess the workload required to migrate the software to the Shenwei processing platform.
[0013] Optionally, the evaluation report module includes detailed source code migration information and report display information; The detailed source code migration information includes a list of files to be modified, file display and comparison, and porting optimization suggestions; the report display information includes detailed information on dependency library files, statistics on files to be modified, a summary of lines of code modified, and workload assessment.
[0014] Thirdly, the present invention provides a computer-readable storage medium having a computer program / instruction stored thereon, which, when executed by a processor, implements the steps of any of the application migration methods based on the Shenwei processor described in the first aspect.
[0015] Fourthly, the present invention provides a computer device / equipment / system, characterized in that it comprises: Memory, used to store computer programs / instructions; A processor for executing the computer program / instructions to implement the steps of the application migration method based on the Shenwei processor as described in any of the first aspects.
[0016] Compared with the prior art, the beneficial effects achieved by the present invention are as follows: During the application migration process, this invention directly identifies the full assembly, embedded assembly, and other architecture-related code in the application software and provides modification suggestions for the Shenwei architecture, which greatly improves the efficiency of application migration and reduces the application migration time. During the application migration process, a comprehensive assessment is conducted based on factors such as the total amount of application code, the amount of code to be modified, and the varying levels of difficulty of the code to be modified. This provides a clear and intuitive representation of the workload required for the final application migration, offering excellent guidance for the process. By visualizing the scanned data through a web page, the efficiency of application migration is improved, the migration time is reduced, and a higher degree of automation can be achieved in migrating application software to Shenwei processors, thereby enhancing Shenwei's market competitiveness. Attached Figure Description
[0017] Figure 1 This is a flowchart of the application migration method based on the Shenwei processor of the present invention. Detailed Implementation
[0018] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical solution of the present invention, rather than limitations thereof. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other. Example 1:
[0019] This embodiment describes an application migration method based on the Shenwei processor, such as... Figure 1 As shown, it includes: The source code package is initialized, the configuration file is parsed, the software dependencies of the source code package are determined, and the portability of the dependent software is determined by the software whitelist. Establish an assembly dictionary for the processor architecture, and design conditional compilation, embedded assembly, and vector extension keyword regular expressions based on the built-in macro definitions of the processor architecture; Scan the key files of the processor architecture, and scan the embedded assembly and full assembly code in the key files according to the assembly dictionary, and save the scan information to the evaluation report; The scan information is analyzed, and modification suggestions for the Shenwei processor architecture are obtained based on the correspondence between the processor architecture and the Shenwei processor architecture. The workload of application migration is evaluated based on the modification suggestions, and the analysis results are saved to the evaluation report. The evaluation report is rendered into HTML by a web server and returned to the client for user reference.
[0020] Step 1: Initialize the source code package, parse the Makefile, spec and control files, check the compilation environment of the configuration file, analyze the pre-compilation and compilation scripts to determine the software dependencies of the source code package, and determine the portability of dependent software through the software whitelist.
[0021] Step 2: Create an assembly dictionary for common architectures such as x86 or ARM; design conditional compilation, embedded assembly, and vector-extended keyword regular expressions based on the architecture-related built-in macro definitions; Step 3: Scan key files, such as architecture-related files like .c, .cpp, .h, .hpp, and .S; based on the corresponding regular expressions designed according to the assembly dictionary, scan the embedded assembly and full assembly code in the key files using precise and fuzzy matching methods, and save the scan information to the evaluation report.
[0022] Step 4: Analyze the scan information, obtain modification suggestions for the Shenwei processor architecture based on the correspondence between other architectures and the Shenwei processor architecture, and put them into the special software migration method library; evaluate the workload of application migration based on the modification suggestions, and save the analysis results to the evaluation report; the scan information includes information such as the file where the scanned code is located and the number of lines of code.
[0023] The assessment of application migration workload is based on the total number of lines of code to be modified in the modification suggestions, the ratio of full assembly to embedded assembly, and the total number of application codes. This assessment provides excellent guidance for application migration.
[0024] Step 5: The evaluation report is rendered into HTML by a web server and returned to the client for user reference. The visualization through web page mode improves application migration efficiency, reduces application migration time, and enables a higher degree of automation in migrating application software to Shenwei processors, thereby enhancing Shenwei's market competitiveness. Example 2:
[0025] Based on the same inventive concept as Embodiment 1, this embodiment introduces an application migration system based on the Shenwei processor, including: The dependency analysis module is used to analyze the software support that the source code depends on for compilation and execution, and to determine the software that needs to be installed and adapted before compilation. The porting assistance module is used to scan architecture-related branches in the source code, locate code porting objects, parse conditional compilation, locate code blocks, and provide modification suggestions for assembly code based on instruction conversion dictionaries. The assessment report module is used to display the code items to be migrated and processing suggestions, count the number of files to be modified and the number of lines of code, and assess the workload required to migrate the software to the Shenwei processing platform.
[0026] The assessment report module includes detailed source code migration information and report display information; The detailed source code migration information includes a list of files to be modified, file display and comparison, and porting optimization suggestions; the report display information includes detailed information on dependency library files, statistics on files to be modified, a summary of lines of code modified, and workload assessment.
[0027] The specific functions of each module described above are explained in the relevant content of the method in Embodiment 1, and will not be repeated here. Example 3:
[0028] Based on the same inventive concept as other embodiments, this embodiment introduces a computer-readable storage medium storing a computer program / instructions thereon, which, when executed by a processor, implements the steps of the application migration method based on the Shenwei processor as described in any of the embodiments. Example 4:
[0029] Based on the same inventive concept as other embodiments, this embodiment introduces a computer device / apparatus / system, characterized in that it includes: Memory, used to store computer programs / instructions; A processor for executing the computer program / instructions to implement the steps of the application migration method based on the Shenwei processor as described in any of Embodiment 1.
[0030] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0031] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0032] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0033] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0034] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.
Claims
1. An application migration method based on the Shenwei processor, characterized in that, include: The source code package is initialized, the configuration file is parsed, the software dependencies of the source code package are determined, and the portability of the dependent software is determined by the software whitelist. Establish an assembly dictionary for the processor architecture, and design conditional compilation, embedded assembly, and vector extension keyword regular expressions based on the built-in macro definitions of the processor architecture; Scan the key files of the processor architecture, and scan the embedded assembly and full assembly code in the key files according to the assembly dictionary, and save the scan information to the evaluation report; The scan information is analyzed, and modification suggestions for the Shenwei processor architecture are obtained based on the correspondence between the processor architecture and the Shenwei processor architecture. The workload of application migration is evaluated based on the modification suggestions, and the analysis results are saved to the evaluation report. The evaluation report is rendered into HTML by a web server and returned to the client for user reference.
2. The application migration method based on the Shenwei processor according to claim 1, characterized in that, The configuration files include Makefile, spec, and control files.
3. The application migration method based on the Shenwei processor according to claim 1, characterized in that, The processor architecture includes x86 and ARM architectures.
4. The application migration method based on the Shenwei processor according to claim 1, characterized in that, The key files for the processor architecture include .c, .cpp, .h, .hpp, and .S architecture-related files.
5. The application migration method based on the Shenwei processor according to claim 1, characterized in that, The scan information includes the file containing the scanned code and the line number of the code.
6. The application migration method based on the Shenwei processor according to claim 1, characterized in that, The workload assessment for application migration is based on the total number of lines of code to be modified in the modification suggestions, the ratio of full assembly to embedded assembly, and the total number of application codes.
7. An application migration system based on the Shenwei processor, characterized in that, include: The dependency analysis module is used to analyze the software support that the source code depends on for compilation and execution, and to determine the software that needs to be installed and adapted before compilation. The porting assistance module is used to scan architecture-related branches in the source code, locate code porting objects, parse conditional compilation, locate code blocks, and provide modification suggestions for assembly code based on instruction conversion dictionaries. The assessment report module is used to display the code items to be migrated and processing suggestions, count the number of files to be modified and the number of lines of code, and assess the workload required to migrate the software to the Shenwei processing platform.
8. The application migration system based on the Shenwei processor according to claim 7, characterized in that, The assessment report module includes detailed source code migration information and report display information; The detailed migration information for the source code includes a list of files to be modified, a file comparison display, and porting optimization suggestions. The report displays information including detailed information on dependency library files, statistics on files to be modified, a summary of lines of code to be modified, and a workload assessment.
9. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that, When the computer program / instruction is executed by the processor, it implements the steps of the application migration method based on the Shenwei processor as described in any one of claims 1 to 6.
10. A computer device / equipment / system, characterized in that, include: Memory, used to store computer programs / instructions; A processor for executing the computer program / instructions to implement the steps of the application migration method based on the Shenwei processor as described in any one of claims 1 to 6.