Adaptive method for identifying compatibility of domestic database and evaluating and optimizing

By identifying the compatibility of domestic databases and generating detailed reports, the problems of workload evaluation, SQL compatibility check and comprehensive adaptation methods during the Xinchuang adaptation process are solved, and the efficiency and quality of adaptation work are improved.

CN120371682APending Publication Date: 2025-07-25QIMING INFORMATION TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510507472.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-22
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

During the process of information and innovation adaptation, there are problems such as difficulty in evaluating and verifying workload, difficulty in checking SQL compatibility, insufficient comprehensiveness of the adaptation method, and lack of summary and reporting after the adaptation is completed, which affects the efficiency and quality of the adaptation work.

Method used

Adopt an adaptation method to identify compatibility of domestic databases and evaluate optimization. By recursively traversing the file system, analyzing source code and configuration files, identifying SQL statements, matching with the compatibility rule library, and generating detailed reports.

Benefits of technology

Improves the efficiency and quality of adaptation work, provides detailed reports and suggestions to ensure the integrity and accuracy of the adaptation process, and supports rapid positioning and repair of incompatibility issues.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120371682A_ABST
    Figure CN120371682A_ABST
Patent Text Reader

Abstract

The invention discloses an adaptive method for identifying compatibility of a domestic database and evaluating optimization, which comprises the following steps of: S1, performing recursive traversal on a specified scanning path and all subdirectories thereof by using a file system operation function of Java, and scanning source codes and configuration files; s2, analyzing the source code and the content of the configuration file; s3, traversing the extracted SQL statements one by one, matching the SQL statements with entries in a compatibility rule base, and identifying incompatible grammar; s4, the recognized incompatible content is generated into a report to be output; according to the adaptation method, an integrated, efficient and convenient mode is provided, and the efficiency and quality of adaptation work are improved.
Need to check novelty before this filing date? Find Prior Art

Claims

1. An adaptation method for identifying the compatibility of domestic databases and evaluating and optimizing, characterized in that, It includes the following steps: Step S1: Use the file system operation functions in Java to recursively traverse the specified scanning path and all its subdirectories, and scan the source code and configuration files; Step S2: Parse the content of the source code and configuration files; Step S3: Traverse the extracted SQL statements one by one, and match them with the entries in the compatibility rule library to identify incompatible syntax; Step S4: Generate a report for the identified incompatible content and output it.

2. The adaptation method for identifying the compatibility of domestic databases and evaluating and optimizing as claimed in claim 1, characterized in that, The said Step S1 includes the following sub-steps: Step S11: Recursively scan the local file path; Step S12: Identify the file type.

3. The adaptation method for identifying the compatibility of domestic databases and evaluating and optimizing as claimed in claim 2, wherein The said Step S11 includes: Use the Files.walk() method provided by Java NIO, combined with a custom path filter, to go deep into multiple levels of directories, identify and record each file one by one; When dealing with large project directories, pay attention to the file reading efficiency and the use of system resources; Encapsulate the scanning mechanism into an independent class, and provide flexible scanning strategies and parameter settings for users to freely choose the scanning depth and the file types to be filtered; Configure a comprehensive exception handling mechanism for abnormal situations to ensure that file permission issues or file corruption exceptions can be handled during the file reading process.

4. The adaptation method for identifying the compatibility of domestic databases and evaluating and optimizing as described in claim 2, wherein, The said Step S12 accurately determines the type of each file by parsing the file extension. Use the String method in Java, combined with the file name suffix matching logic, to distinguish different types of files, including: Determine whether it is a Java source code file by judging whether the file name ends with ".java", and determine whether it is a SQL configuration file of MyBatis by judging whether the file name ends with ".xml"; Handle exceptions for file name changes or cases, and accurately identify the file type for edge cases of misspelled file extensions or special characters in the file name.

5. The adaptation method for identifying the compatibility of domestic databases and evaluating and optimizing as claimed in claim 1, characterized in that, The said Step S2 includes the following sub-steps: Step S21: Parse the Java source code. By using the file processing API in Java, recursively traverse the directories in the project, identify all files with the ".java" extension, traverse the nodes in the AST, and identify all method declarations; extract important information such as the name, parameter type, return type, and its modifiers of each method, quickly list all public and private methods in the project, and generate a detailed method list; Step S22: Identify SQL annotations, pay attention to specific annotations, and extract the embedded SQL statements from them; Step S23: Parse the XML configuration files. By using the file and input / output stream API in Java, flexibly locate and process multiple XML files to ensure that no important files are missed during the parsing process. Use the W3C DOM API to parse the read XML files into a DOM document object model tree structure.

6. The adaptation method for identifying the compatibility of domestic databases and evaluating and optimizing as claimed in claim 5, wherein, The said Step S23 also includes: After the DOM document object model tree structure is constructed, access the nodes in the tree layer by layer, identify and extract the elements containing SQL statements, locate the SQL statements by searching for specific tags, and save them to the specified data structure.

7. The adaptation method for identifying the compatibility of domestic databases and evaluating and optimizing as claimed in claim 1, wherein The said Step S3 specifically includes the following steps: Step S31: Maintain a knowledge base containing domestic database compatibility rules, including unsupported functions and syntax structures; Step S32: Compare SQL statements, construct a comprehensive compatibility rule base, traverse the extracted SQL statements one by one, and match them with the entries in the compatibility rule base; by using regular expressions, identify various SQL syntax structures and function calls, and accurately locate the incompatible parts; if an element that does not conform to the rule base is found in a certain SQL statement, record the problem, and list in detail the name of the incompatible function, the SQL syntax used, and the recommended alternative; generate a detailed error prompt when identifying an incompatible SQL structure, specifically describe the identified problem and output the relevant file path and line number.

8. The adaptation method for identifying the compatibility of domestic databases and evaluating and optimizing as claimed in claim 7, wherein, The content of the comprehensive compatibility rule base in step S32 includes SQL syntax differences and incompatible function lists between different database systems, including common patterns, function names, data types of various SQL statements, and their respective syntax requirements.

9. The adaptation method for identifying the compatibility of domestic databases and evaluating and optimizing as claimed in claim 1, wherein, Step S4 includes the following steps: Step S41: Record the identification results, record the identified incompatible parts and the information of the file and method name where they are located; Step S42: Suggest possible optimization solutions according to the identified compatibility problems; Step S43: Estimate the man-hours required for adaptation based on the total number of SQL methods and the total number of incompatible SQL methods; Step S44: Present the identification results in the form of console output and log files for convenient subsequent processing.

Citation Information

Cited By

  • Database mapping file conversion method and system based on large model

    CN120631967A