A software migration adaptation detection method based on source code
By analyzing the target environment and adjusting the source code, the problems of insufficient detection and insufficient security assessment before the software system migration are solved, and the normal and safe operation of the software system in the target environment is achieved.
Patent Information
- Application Number
- CN202311848558.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2043-12-29
AI Technical Summary
The existing technology lacks detection and analysis methods before the software system is migrated, which leads to the software system that may be migrated to an unsupported target environment and cannot operate normally. There is a lack of security assessment after the migration, resulting in the operational security being not guaranteed.
Through the detection device, analyze the target environment, identify the functional modules and components of the software system, map it to the target environment interface, adjust the source code, resolve dependency conflicts, optimize performance, and conduct security evaluation and improvements to ensure that the software system operates safely in the target environment.
It realizes determining whether the target environment supports the operation of the software system before migration, avoiding migration failure, and enhancing source code security after migration, ensuring that the software system runs normally and safely in the target environment.
Smart Images

Figure CN117806703B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software migration detection, and particularly relates to a method for detecting and adapting software migration based on source code. Background Art
[0002] With the rapid development of information technology, the requirements for migration and adaptation of software systems are increasing day by day. Migration refers to migrating a software system from one environment or platform to another, such as from one operating system to another, or from one hardware platform to another. Adaptation refers to adjusting the software system to meet the requirements of the new environment or platform, such as adjusting the code to adapt to a new programming language or library.
[0003] In domestic software systems, migration and adaptation are common tasks, which may be because the software system needs to adapt to a new hardware platform or operating system, or because the software system needs to comply with new laws, regulations, or standards.
[0004] The existing technologies have the following deficiencies:
[0005] 1. Before the migration of the software system, the existing detection device lacks detection and analysis means for the adaptation and transformation of the source code. If the software system is migrated to a target environment that does not support running, it will lead to compatibility problems and the software system cannot run normally.
[0006] 2. After the software migration is completed, the detection device does not perform security evaluation and processing on the software system, so it is impossible to enhance and improve the source code, and the security of the software system running in the target environment cannot be guaranteed, resulting in security risks in the operation of the software system after migration. Summary of the Invention
[0007] The purpose of the present invention is to provide a method for detecting and adapting software migration based on source code to solve the deficiencies in the background art.
[0008] To achieve the above purpose, the present invention provides the following technical solution: A method for detecting and adapting domestic migration based on source code, the detection method includes the following steps:
[0009] S1: The detection device analyzes the target environment according to the characteristics of the software system, analyzes whether the target environment supports the operation of the software system, and obtains the requirements of the target environment.
[0010] S2: In the source code, identify the functional modules and components of the original software system, and map each functional module and component to the interfaces of the target environment.
[0011] S3: Convert and adjust the source code, and analyze the dependency relationships in the source code to solve potential dependency conflict problems in the source code.
[0012] S4: After optimizing the performance of the source code, perform a security assessment on the source code of the software system, and improve the source code according to the assessment results;
[0013] S5: After migration and adaptation are completed, perform functional verification and testing on the software system.
[0014] In a preferred embodiment, in step S1, the detection device obtains the normalized operating system value, the third-party library incompatibility index, and the concurrent connection number of the target environment according to the characteristics of the software system, and after removing the dimensions of the normalized operating system value, the third-party library incompatibility index, and the concurrent connection number, comprehensively calculates to obtain the target environment coefficient.
[0015] In a preferred embodiment, after obtaining the target environment coefficient, compare the target environment coefficient with a preset threshold. If the target environment coefficient is greater than or equal to the preset threshold, the detection device determines that the target environment supports the operation of the software system; if the target environment coefficient is less than the preset threshold, the detection device determines that the target environment does not support the operation of the software system.
[0016] In a preferred embodiment, the acquisition logic of the normalized operating system value is as follows: obtain the operating system range in which the software system runs through the software system log, obtain the operating system of the target environment based on the target environment log. If the operating system of the target environment falls within the operating system range in which the software system runs, the normalized operating system value is 1; if the operating system of the target environment does not fall within the operating system range in which the software system runs, the normalized operating system value is 0.
[0017] In a preferred embodiment, the calculation expression of the third-party library incompatibility index is: In the formula, gn c is the number of supported functions, gn z is the total number of functions. The number of supported functions represents the number of third-party library functions successfully supported in the target environment, and the total number of functions represents the total number of functions provided by the third-party library.
[0018] In a preferred embodiment, in step S4, the detection device performs a security assessment on the source code of the software system, including the following steps:
[0019] When the software system is running, the detection device obtains the number of source code vulnerabilities, the number of coding violations, and the authentication strength assignment, and after removing the dimensions of the number of vulnerabilities, the number of coding violations, and the authentication strength assignment, comprehensively calculates to obtain the security coefficient.
[0020] In a preferred embodiment, after obtaining the safety factor, the safety factor is compared with a safety threshold. If the safety factor is greater than or equal to the safety threshold, the source code security of the software system is evaluated as high. If the safety factor is less than the safety threshold, the source code security of the software system is evaluated as low.
[0021] The present invention also provides a domestic migration adaptation detection device based on source code, including a processing module, a mapping module, an adjustment module, an analysis module, an optimization module, an evaluation module, and a testing module;
[0022] The processing module analyzes the target environment according to the characteristics of the software system, analyzes whether the target environment supports the operation of the software system, and obtains the requirements of the target environment. The mapping module identifies and understands the functional modules and components of the original software system in the source code, and maps each functional module and component to the interface of the target environment according to the requirements of the target environment. The adjustment module converts and adjusts the source code according to the requirements of the target environment. The analysis module analyzes the dependency relationships in the source code and solves potential dependency conflict problems in the source code. After the optimization module optimizes the performance of the source code, the evaluation module performs a security evaluation on the source code of the software system and makes corresponding improvements to the source code according to the evaluation results. After the migration and adaptation are completed, the testing module performs functional verification and testing on the software system.
[0023] In the above technical solution, the technical effects and advantages provided by the present invention are as follows:
[0024] 1. According to the characteristics of the software system, the detection device of the present invention analyzes the target environment, analyzes whether the target environment supports the operation of the software system, and obtains the requirements of the target environment, so as to make correct decisions during the migration and adaptation process. Therefore, before the software system is migrated, it can be analyzed whether the target environment supports the operation of the software system. When the target environment does not support the migration, programmers can make judgments in advance, including changing the migration target environment, etc., to avoid the software system from being unable to run or causing source code damage when the software system is migrated to a target environment that does not support operation. Moreover, after the software system migration is completed, a security evaluation is performed on the software system, and corresponding enhancements and improvements are made to the source code according to the evaluation results to ensure the safe operation of the software system in the target environment;
[0025] 2. According to the characteristics of the software system, the detection device of the present invention obtains the normalized value of the operating system, the incompatibility index of the third-party library, and the number of concurrent connections of the target environment. After removing the dimensions of the normalized value of the operating system, the incompatibility index of the third-party library, and the number of concurrent connections, the target environment coefficient is comprehensively calculated, effectively improving the data processing efficiency and making the analysis more comprehensive. Description of the Drawings
[0026] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the accompanying drawings required for use in the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments described in the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings.
[0027] Figure 1 It is the flowchart of the method of the present invention.
[0028] Figure 2 It is the system module diagram of the present invention. Specific embodiments
[0029] To make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without making creative efforts fall within the scope of protection of the present invention.
[0030] Embodiment 1: Please refer to Figure 1 As shown, a domestic migration adaptation detection method based on source code in this embodiment, the detection method includes the following steps:
[0031] The detection device analyzes the target environment according to the characteristics of the software system, analyzes whether the target environment supports the operation of the software system, and obtains the requirements of the target environment, so as to make correct decisions during the migration and adaptation process;
[0032] In the source code, the detection device identifies and understands the functional modules and components of the original software system, and then, according to the requirements of the target environment, maps each functional module and component to appropriate alternatives or interfaces in the target environment. The specific steps are as follows:
[0033] 1) Understand the original software system: Carefully study and understand the architecture, design and functions of the original software system, which includes consulting documents, analyzing source code, understanding the working principle of the system, etc.;
[0034] 2) Determine the interfaces of the target environment: Study the interface specifications, API documents or related documents of the target environment to understand the interfaces and functions supported by the target environment;
[0035] 3) Compare functions and interfaces: Compare the functional modules and components of the original software system with the interfaces of the target environment to identify the corresponding relationships between the functional modules and components in the original system and the interfaces of the target environment;
[0036] 4) Perform mapping and adaptation: Based on the comparison results, map each functional module and component to the appropriate interfaces in the target environment. This may involve refactoring, modifying, or re-implementing the original functions to meet the interface requirements of the target environment.
[0037] 5) Update documentation and comments: Update the relevant documentation and comments in the source code to clearly record the mapping relationships and adaptation operations between each functional module and component and the target environment interfaces. This helps with subsequent maintenance and understanding of the code.
[0038] 6) Conduct testing and verification: Test and verify the mapped and adapted system to ensure that the functional modules and components work properly in the target environment and interact correctly with other modules and components.
[0039] According to the requirements of the target environment, the detection device performs conversion and adjustment on the source code. The conversion and adjustment include syntax conversion, library function replacement, interface adjustment, etc., to ensure that the source code can be correctly compiled, run, and achieve the expected functions in the target environment. The specific steps are as follows:
[0040] 1) Understand the requirements of the target environment: Carefully study the requirements and limitations of the target environment, which includes understanding the programming language, library functions, interface specifications, operating system requirements, etc. of the target environment.
[0041] 2) Syntax conversion: Perform syntax conversion on the source code according to the programming language requirements of the target environment. This may involve adjusting the syntax structure, using of keywords, differences in syntax rules, etc.
[0042] 3) Library function replacement: Replace the library functions used in the source code according to the library function requirements of the target environment. This may involve using equivalent library functions, API calls, etc. in the target environment.
[0043] 4) Interface adjustment: Adjust the interfaces in the source code according to the interface specifications of the target environment. This may involve modifying function signatures, parameter passing methods, interface protocols, etc.
[0044] 5) Code refactoring: Refactor and optimize the source code according to the best practices and coding specifications of the target environment. This includes improvements in aspects such as code structure adjustment, performance optimization, error handling, etc.
[0045] 6) Compilation and testing: Compile and test the converted and adjusted source code in the target environment to ensure that the code can be successfully compiled, run, and achieve the expected functions.
[0046] 7) Debugging and fixing: If problems occur during compilation or testing, perform debugging and fix the errors or problems in the source code. This may involve further modification of the converted and adjusted code.
[0047] The detection device analyzes the dependency relationships in the source code. The dependency relationships include library files, external services, configuration files, etc., to ensure that the migrated and adapted software system can meet the dependency requirements in the target environment and solve potential dependency conflicts or missing problems, including the following steps:
[0048] 1) Identify dependencies: Carefully analyze the source code to identify the dependency relationships, which include dependency items related to the normal operation of the software system such as library files, external services, configuration files, etc.;
[0049] 2) Understand the dependency requirements of the target environment: Study the dependency requirements of the target environment, including supported library versions, interface specifications of external services, format requirements of configuration files, etc., and understand the existing dependency items and their versions in the target environment;
[0050] 3) Compare dependencies: Compare the dependency items in the source code with the dependency requirements of the target environment to identify the differences between the dependency items in the source code and the existing dependency items in the target environment;
[0051] 4) Resolve dependency conflicts: If there are conflicts between the dependency items in the source code and the existing dependency items in the target environment, these conflicts need to be resolved, which may require upgrading or downgrading library versions, modifying configuration parameters of dependency items, etc.;
[0052] 5) Handle missing dependencies: If the dependency items in the source code are missing in the target environment, these missing dependency problems need to be handled, which may include installing missing library files, configuring access permissions for external services, adjusting configuration files, etc.;
[0053] 6) Update documentation and comments: Update the relevant documentation and comments in the source code to clearly record the corresponding relationships and adaptation operations of each dependency item with the target environment, which helps with subsequent maintenance and understanding of the code.
[0054] The detection device performs performance optimization and adjustment on the source code, which may involve adjustments in aspects such as algorithm improvement, concurrent processing, resource management, etc., to ensure that the software system has good performance and stability in the target environment, including the following steps:
[0055] 1) Performance evaluation: Perform a performance evaluation on the source code to understand the bottlenecks of the current system and the modules or components where the performance bottlenecks lie. This can obtain performance data and key metrics through methods such as performance testing, profiling tools, and log analysis;
[0056] 2) Bottleneck analysis: Analyze the performance evaluation results to determine the bottlenecks of the system. The bottlenecks may involve aspects such as low algorithm efficiency, excessive resource occupation, and unreasonable concurrent processing;
[0057] 3) Algorithm improvement: If the bottleneck lies in the algorithm, consider improving the algorithm to enhance performance, which may involve optimizing the time complexity and space complexity of the algorithm, or adopting a more efficient algorithm implementation;
[0058] 4) Concurrent processing: If the bottleneck involves concurrent processing, consider using concurrent programming techniques to improve the concurrency and response performance of the system. This includes using multi-threading, multi-processing, asynchronous programming, etc. to enhance the concurrent processing ability of the system;
[0059] 5) Resource management: Optimize the use and management of resources, including memory management, file handle usage, database connection pool management, etc., to avoid resource leakage and waste, and improve the resource utilization rate of the system;
[0060] 6) Caching and prefetching: Consider introducing a caching mechanism and data prefetching technology to reduce frequent access to external resources and improve the response speed and efficiency of the system;
[0061] 7) Responsive design: Adopt responsive design principles, divide the modules and components of the system into independent services, enable the system to adjust adaptively according to the load situation, and improve the elasticity and stability of the system;
[0062] The detection device conducts a security assessment on the source code of the software system, and makes corresponding enhancements and improvements to the source code based on the assessment results to ensure that the software system can run securely in the target environment;
[0063] After migration and adaptation are completed, conduct functional verification and testing to ensure that the software system can run correctly and meet the requirements in the target environment. Conduct unit testing, integration testing, system testing, etc., and fix any possible problems and defects.
[0064] In this application, the detection device analyzes the target environment based on the characteristics of the software system, determines whether the target environment supports the operation of the software system, and obtains the requirements of the target environment, so as to make correct decisions during the migration and adaptation process. Thus, before migrating the software system, it can be analyzed whether the target environment supports the operation of the software system. When the target environment does not support migration, programmers can make early judgments, including changing the migration target environment, etc., to avoid situations where the software system cannot run or the source code is damaged when the software system is migrated to a target environment that does not support operation. Moreover, after the software system migration is completed, a security assessment is conducted on the software system, and corresponding enhancements and improvements are made to the source code based on the assessment results to ensure that the software system can run securely in the target environment.
[0065] Embodiment 2: The detection device analyzes the target environment based on the characteristics of the software system, analyzes whether the target environment supports the operation of the software system, and obtains the requirements of the target environment to make correct decisions during the migration and adaptation processes;
[0066] The detection device analyzes the target environment based on the characteristics of the software system. Analyzing whether the target environment supports the operation of the software system specifically includes the following steps:
[0067] The detection device obtains the normalized operating system value, the third-party library incompatibility index, and the concurrent connection number of the target environment based on the characteristics of the software system;
[0068] After removing the dimensions of the normalized operating system value, the third-party library incompatibility index, and the concurrent connection number, the target environment coefficient hj is comprehensively calculated m , and the calculation expression is:
[0069]
[0070] In the formula, cz gy is the normalized operating system value, bf s is the concurrent connection number, sf z is the third-party library incompatibility index, ω, are respectively the proportionality coefficients of the concurrent connection number and the third-party library incompatibility index, and ω, are both greater than 0.
[0071] After obtaining the target environment coefficient hj m , the target environment coefficient is compared with a preset threshold. If the target environment coefficient is greater than or equal to the preset threshold, the detection device determines that the target environment supports the operation of the software system; if the target environment coefficient is less than the preset threshold, the detection device determines that the target environment does not support the operation of the software system. When it is determined that the target environment does not support the operation of the software system, the migration personnel need to debug the target environment or replace the target environment.
[0072] In this application, the detection device obtains the normalized operating system value, the third-party library incompatibility index, and the concurrent connection number of the target environment based on the characteristics of the software system. After removing the dimensions of the normalized operating system value, the third-party library incompatibility index, and the concurrent connection number, the target environment coefficient is comprehensively calculated, effectively improving the data processing efficiency and making the analysis more comprehensive.
[0073] The acquisition logic of the operating system normalization value is as follows: obtain the operating system range in which the software system runs through the software system log, and obtain the operating system of the target environment based on the target environment log. If the operating system of the target environment falls within the operating system range in which the software system runs, the operating system normalization value is 1; if the operating system of the target environment does not fall within the operating system range in which the software system runs, the operating system normalization value is 0.
[0074] The calculation expression of the third-party library incompatibility index is: In the formula, gn c is the number of supported functions, gn z is the total number of functions. The number of supported functions represents the number of third-party library functions successfully supported in the target environment, and the total number of functions represents the total number of functions provided by the third-party library.
[0075] The acquisition logic of the concurrent connection number is as follows: using network monitoring tools (such as Wireshark, tcpdump, etc.) can capture network traffic and analyze the connection number. These tools provide the function of counting the connection number and can monitor the current concurrent connection number in real time.
[0076] The detection device performs a security assessment on the source code of the software system, and makes corresponding enhancements and improvements to the source code based on the assessment results to ensure that the software system can run safely in the target environment;
[0077] The security assessment of the source code of the software system by the detection device includes the following steps:
[0078] When the software system is running, after the detection device obtains the number of vulnerabilities, the number of coding violations, and the authentication strength assignment of the source code, it removes the dimension of the number of vulnerabilities, the number of coding violations, and the authentication strength assignment and calculates comprehensively to obtain the security coefficient aq z , and the calculation expression is:
[0079]
[0080] In the formula, rz q is the authentication strength assignment, ld s is the number of vulnerabilities, wg s is the number of coding violations. α, β, and γ are the proportionality coefficients of the authentication strength assignment, the number of vulnerabilities, and the number of coding violations respectively, and α, β, and γ are all greater than 0.
[0081] The number of vulnerabilities is detected and counted in the source code through static code analysis tools, vulnerability scanning tools, etc.;
[0082] The number of coding violations is obtained online through the SonarQube tool. SonarQube is an open-source static code analysis tool that supports multiple programming languages. It can detect various violations in the code, including security vulnerabilities, code quality issues, coding standard violations, etc.;
[0083] The logic for obtaining the authentication strength assignment is as follows: Classify the authentication and authorization mechanisms according to their strength levels, and assign corresponding numerical values to each level. The basic authentication mechanism is assigned 1, the multi-factor authentication mechanism is assigned 2, and the single sign-on mechanism is assigned 3.
[0084] Obtain the security factor aq z After that, compare the security factor with the security threshold. If the security factor is greater than or equal to the security threshold, the source code security of the software system is evaluated as high. If the security factor is less than the security threshold, the source code security of the software system is evaluated as low;
[0085] When the source code security of the software system is evaluated as low, corresponding enhancements and improvements are made to the source code, including the following steps:
[0086] 1) Vulnerability repair: Repair the source code according to the vulnerabilities and weaknesses found in the security assessment results, which includes fixing known security vulnerabilities, strengthening input validation and filtering, correcting the use of insecure functions, etc.;
[0087] 2) Authentication and authorization enhancement: Improve the authentication and authorization mechanisms to ensure the security and reliability of user authentication. Measures such as stronger password policies, enhanced session management, and implementation of multi-factor authentication can be adopted to enhance the security of authentication and authorization;
[0088] 3) Data encryption: Strengthen the protection of sensitive data, including encryption of data transmission, encryption of stored data, etc. Use appropriate encryption algorithms and key management mechanisms to ensure the security of data during storage and transmission;
[0089] 4) Secure coding practices: Strengthen secure coding practices, follow secure coding specifications and best practices, use secure programming techniques and library functions, and avoid common security vulnerabilities such as buffer overflows and cross-site scripting attacks;
[0090] 5) Security logging and monitoring: Enhance the logging and monitoring functions to detect and respond to security events in a timely manner. Record critical operations, abnormal events, and security-related logs, and establish appropriate alerting and auditing mechanisms;
[0091] 6) Security training and awareness: Strengthen the security training and awareness of team members, improve their understanding and awareness of security issues, cultivate security awareness, and ensure that everyone can take security measures during development and maintenance;
[0092] 7) Security testing and verification: Conduct security testing and verification to ensure that the enhanced and improved source code can meet security requirements in the target environment. Perform vulnerability scanning, penetration testing, security audits, etc. to verify the security of the system;
[0093] 8) Continuous improvement and update: Security work is an ongoing process. Continuously track security threats and the latest security standards, and update and improve the source code in a timely manner to address new security challenges and threats.
[0094] Example 3: Please refer to Figure 2 As shown, a domestic migration adaptation detection device based on source code in this example includes a processing module, a mapping module, an adjustment module, an analysis module, an optimization module, an evaluation module, and a testing module;
[0095] The processing module analyzes the target environment according to the characteristics of the software system, analyzes whether the target environment supports the operation of the software system, and obtains the requirements of the target environment to make correct decisions during the migration and adaptation process. When it is analyzed that the target environment supports the operation of the software system, the mapping module is started, and the requirements of the target environment are sent to the mapping module, the adjustment module, and the optimization module respectively;
[0096] The mapping module identifies and understands the functional modules and components of the original software system in the source code, and then maps each functional module and component to appropriate alternatives or interfaces in the target environment according to the requirements of the target environment;
[0097] The adjustment module converts and adjusts the source code according to the requirements of the target environment. The conversion and adjustment include syntax conversion, library function replacement, interface adjustment, etc., to ensure that the source code can be correctly compiled, run, and achieve the expected functions in the target environment. The adjusted source code is sent to the analysis module;
[0098] The analysis module analyzes the dependency relationships in the source code. The dependency relationships include library files, external services, configuration files, etc., to ensure that the migrated and adapted software system can meet the dependency requirements in the target environment and solve potential dependency conflicts or missing problems;
[0099] The optimization module performs performance optimization and adjustment on the source code, which may involve adjustments in aspects such as algorithm improvement, concurrent processing, and resource management, to ensure that the software system has good performance and stability in the target environment. The optimized source code is sent to the evaluation module;
[0100] The evaluation module conducts a security evaluation of the source code of the software system, and enhances and improves the source code according to the evaluation results to ensure that the software system can run securely in the target environment. The testing module is started when evaluating the security of the source code of the software system;
[0101] After the migration and adaptation of the test module are completed, functional verification and testing are carried out to ensure that the software system can run correctly and meet the requirements in the target environment. Unit testing, integration testing, system testing, etc. are performed, and possible problems and defects are fixed.
[0102] The above formulas are all dimensionless and take their numerical values for calculation. The formulas are obtained by collecting a large amount of data for software simulation to get a formula closest to the actual situation. The preset parameters in the formulas are set by those skilled in the art according to the actual situation.
[0103] In the description of this specification, the descriptions referring to terms such as "one embodiment", "example", "specific example", etc. mean that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in a suitable manner in any one or more embodiments or examples.
[0104] The preferred embodiments of the present invention disclosed above are only used to help illustrate the present invention. The preferred embodiments do not describe all the details in detail, nor do they limit the present invention to only the specific implementation manners. Obviously, according to the content of this specification, many modifications and changes can be made. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can well understand and utilize the present invention. The present invention is only limited by the claims and their full scope and equivalents.
Claims
1. A domestic migration adaptation detection method based on source code, characterized in that: The detection method includes the following steps: S1: The detection device analyzes the target environment according to the characteristics of the software system, analyzes whether the target environment supports the operation of the software system, and obtains the requirements of the target environment; S2: In the source code, identify the functional modules and components of the original software system, and map each functional module and component to the interfaces of the target environment; S3: Convert and adjust the source code, and analyze the dependency relationships in the source code to solve potential dependency conflict problems in the source code; S4: After optimizing the performance of the source code, perform a security assessment on the source code of the software system, and improve the source code according to the assessment results; S5: After migration and adaptation are completed, perform functional verification and testing on the software system; In step S1, the detection device obtains the normalized operating system value, the third-party library incompatibility index, and the concurrent connection number of the target environment according to the characteristics of the software system, and after removing the dimensions of the normalized operating system value, the third-party library incompatibility index, and the concurrent connection number, comprehensively calculates to obtain the target environment coefficient; After obtaining the target environment coefficient, compare the target environment coefficient with a preset threshold. If the target environment coefficient is greater than or equal to the preset threshold, the detection device determines that the target environment supports the operation of the software system; if the target environment coefficient is less than the preset threshold, the detection device determines that the target environment does not support the operation of the software system; The acquisition logic of the normalized operating system value is as follows: obtain the operating system range in which the software system runs through the software system log, obtain the operating system of the target environment based on the target environment log. If the operating system of the target environment falls within the operating system range in which the software system runs, the normalized operating system value is 1. If the operating system of the target environment does not fall within the operating system range in which the software system runs, the normalized operating system value is 0.
2. The domestic migration adaptation detection method based on source code according to claim 1, characterized in that: The calculation expression of the target environment coefficient is: ; In the formula, is the target environment coefficient, is the normalized value of the operating system, is the number of concurrent connections, is the incompatibility index of the third-party library, , are the proportionality coefficients of the number of concurrent connections and the incompatibility index of the third-party library respectively, and , are both greater than 0.
3. The domestic migration adaptation detection method based on source code according to claim 2, characterized in that: The calculation expression of the third-party library incompatibility index is: , where is the number of supported functions, is the total number of functions. The number of supported functions represents the number of third-party library functions successfully supported in the target environment, and the total number of functions represents the total number of functions provided by the third-party library.
4. The domestic migration adaptation detection method based on source code according to claim 3, characterized in that: In step S4, the detection device performs a security assessment on the source code of the software system, including the following steps: When the software system is running, the detection device obtains the number of vulnerabilities, the number of coding violations, and the authentication strength assignment of the source code, and after removing the dimensions of the number of vulnerabilities, the number of coding violations, and the authentication strength assignment, comprehensively calculates to obtain the security coefficient.
5. The domestic migration adaptation detection method based on source code according to claim 4, wherein: After obtaining the security coefficient, compare the security coefficient with a security threshold. If the security coefficient is greater than or equal to the security threshold, evaluate that the source code security of the software system is high. If the security coefficient is less than the security threshold, evaluate that the source code security of the software system is low.
Citation Information
Patent Citations
System and method for evaluating migration workload of credential and credential adaptive code
CN112947994A
Domestic migration adaptation method for embedded edge computing service application system
CN115599772A