Spring Boot Mapper file modification method based on AI intelligent agent adaptive DM database

By introducing AI Smarts in the Spring Boot Mapper file that adapts to Dimeng Database, automatically analyzes and adapts to SQL statements, it solves the problem of low adaptation efficiency, errors, and lack of intelligence in existing technologies. Accurate database adaptation and maintenance.

CN119357207APending Publication Date: 2025-01-24GUANGZHOU YUNDI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411653059.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-19
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

When adapting to SQL from different databases, the prior art is inefficient, prone to errors, and lacks intelligent support, and cannot quickly adapt to database changes, and has high maintenance costs, especially when processing long texts, which cannot effectively manage Mapper files.

Method used

By introducing the AI ​​intelligence, obtain the SQL statement in the Mapper file, and determine whether to adapt to the current database. If it is not adapted, the SQL statement is split into multiple SQL sub -statements. The SQL submark and update the mapper file.

Benefits of technology

Significantly improves the efficiency of adapting Dameng database, reduces development and maintenance costs, provides a higher level of intelligence and accuracy, ensures that the generated SQL can be executed correctly on Dameng database, and records the history of each modification version to support quick rollback and subsequent auditing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119357207A_ABST
    Figure CN119357207A_ABST
Patent Text Reader

Abstract

The invention aims to provide a Spring Boot Mapper file modification method based on an AI (Artificial Intelligence) agent adaptive DM database. The method comprises the following steps: acquiring an SQL (Structured Query Language) statement in a Mapper file; judging whether the SQL sub-statements are matched with a current database or not; if the SQL statement is not matched with the current database, splitting the SQL statement into a plurality of SQL sub-statements, and adaptively generating the SQL sub-statements matched with the current database by adopting an AI agent; and updating the Mapper file by adopting an SQL (Structured Query Language) sub-statement adaptive to the current database. According to the method, the AI intelligent agent is introduced, intelligent modification of Spring Boot Mapper files is achieved, the efficiency of adapting to the DM database is remarkably improved, the development and maintenance cost is reduced, and compared with an existing manual operation or semi-automatic method, the higher intelligent level and accuracy are provided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a Spring Boot Mapper file modification method based on an AI agent adapting to a DAMO database. Background Art

[0002] ‌DAMO Database is a domestically produced high-performance database management system developed by DAMO. DAMO Database adopts a brand-new system architecture, and has made a lot of optimizations and improvements in terms of reliability, high performance, massive data processing and security. It can take into account both OLTP and OLAP requests and meet the application requirements of different scales and fields. ‌Spring Boot is a framework for rapid development of Java applications, which simplifies the application development process based on the Spring framework. ‌Spring Boot allows developers to quickly build projects and integrate third-party frameworks by providing default configuration and automatic configuration without writing a lot of configuration code. The Mapper file is an XML-formatted file that is mainly used to define the mapping relationship between SQL statements and their Java interface methods. These files usually have an .xml extension and must follow the corresponding DTD file specifications.

[0003] With the rapid development of enterprise informatization, the application of database technology is becoming more and more common. As a domestic database with high security and high performance, DAMO database has been widely used in many industries. As a popular Java development framework, Spring Boot can quickly build microservice-based applications, but in the process of use, the adaptation problems between different databases often trouble developers. The existing technology mainly has the following methods to adapt the SQL of different databases: Manually modify the Mapper file: Developers need to modify the SQL statements in the Mapper file one by one to adapt to different databases, which is not only time-consuming and labor-intensive, but also easy to introduce errors. Use ORM framework: SQL is automatically generated through the object-relational mapping (ORM) framework, but for specific optimizations and complex queries of DAMO database, the expected effect is often not achieved. Database middleware: Dynamic conversion of SQL statements is performed through middleware, but this will increase the complexity of the system and the difficulty of maintenance. The shortcomings of the existing technology include: Low adaptation efficiency: The process of manually modifying the Mapper file is lengthy and error-prone, especially in large projects, resulting in low efficiency. Lack of intelligence: Most of the existing adaptation solutions rely on manual operations, lack intelligent support, and cannot quickly adapt to database changes. High maintenance cost: With the iteration of the project, frequent SQL modifications increase the workload of later maintenance. Long text processing limitations: In the case of long text input and output, the existing solution cannot effectively manage Mapper files. Summary of the invention

[0004] The purpose of the present invention is to provide a Spring Boot Mapper file modification method based on AI agent adaptation to the DAMO database. The method realizes the intelligent modification of the Spring Boot Mapper file by introducing AI agent, significantly improves the efficiency of adapting to the DAMO database, reduces development and maintenance costs, and provides a higher level of intelligence and accuracy compared to existing manual operations or semi-automatic methods.

[0005] A Spring Boot Mapper file modification method based on AI agent adaptation to DAMO database, including: Get the SQL statement in the Mapper file; Determine whether the SQL statement is suitable for the current database; If it is not suitable, split the SQL statement into multiple SQL sub-statements, and use AI agents to adaptively generate SQL sub-statements that are suitable for the current database; Update the Mapper file using SQL substatements that are suitable for the current database.

[0006] Preferably, splitting the SQL statement into multiple SQL sub-statements includes: Analyzing the length and components of the SQL statement; The SQL statement is divided into a plurality of SQL sub-statements according to the length and components of the SQL statement.

[0007] Preferably, if it is not suitable, splitting the SQL statement into multiple SQL sub-statements, and using an AI agent to adaptively generate SQL sub-statements that are suitable for the current database includes: Analyze the characteristics and structure of the current database; Inputting the characteristics and structure of the current database into the AI ​​agent; The AI ​​agent converts the SQL sub-statements into SQL statements that are adapted to the current database according to the characteristics and structure of the database.

[0008] Preferably, after the AI ​​agent converts the SQL sub-statement into an SQL statement adapted to the current database according to the characteristics and structure of the database, it further includes: Adjust the converted SQL statements according to the parameters set by the developer.

[0009] Preferably, if it is not suitable, splitting the SQL statement into multiple SQL sub-statements, and using the AI ​​agent to adaptively generate SQL sub-statements that are suitable for the current database, further comprising: Test the generated SQL sub-statements adapted to the DAMO database to verify whether the quality of the generated SQL sub-statements adapted to the DAMO database meets the execution standards of the current data; If it does not meet the execution standard, determine which specific standard the SQL substatement does not meet; Adjust the parameters of the AI ​​agent based on the criteria that the SQL substatement does not meet; The SQL statements that are not suitable for the current database are input into the adjusted AI agent for adaptation.

[0010] Preferably, after updating the Mapper file using the SQL substatement adapted to the current database, the method further includes: Record the historical version of each SQL statement modification and generate a modification log.

[0011] Preferably, after determining whether the SQL substatement is adapted to the current database, the method further includes: Generate an adapter for the current database based on the structure and type of the current database; Use the current database adapter to uniformly adapt and convert SQL statements.

[0012] A Spring Boot Mapper file modification system based on AI agent adaptation to DAMO database, including: Data acquisition module, used to obtain SQL statements in Mapper files; A data processing module, used for splitting the SQL statement into multiple SQL sub-statements; A data judgment module is used to judge whether the SQL sub-statement is suitable for the current database. If not, an AI agent is used to adaptively generate an SQL sub-statement suitable for the current database. The data update module is used to update the Mapper file using SQL substatements that are adapted to the current database.

[0013] An electronic device comprises: a chip, a processor and a memory, wherein the memory is used to store computer program code, and the computer program code comprises computer instructions. When the chip executes the computer instructions, the electronic device executes a Spring Boot Mapper file modification method based on an AI agent adapting to a DAMO database.

[0014] A computer-readable storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed by a processor of an electronic device, the processor executes a Spring Boot Mapper file modification method based on an AI agent adapting to a DAMO database.

[0015] The beneficial effects of the present invention are: 1. The present invention sets up an AI agent to perform intelligent analysis on SQL statements, and generates an intelligent adaptation algorithm for SQL statements that are not compatible with the current database, which simplifies the adaptation process of the DAMO database, facilitates the modification of Mapper files, significantly improves the adaptation efficiency, and reduces the risk of errors caused by manual operations; 2. The present invention performs quality inspection on the generated SQL statements, runs test cases to verify the adaptation quality, ensures that the generated SQL can be correctly executed on the DAMO database, and ensures the quality of the adapted SQL; 3. The present invention also adds a modification log to record the historical version of each modification, supports quick rollback, and facilitates subsequent auditing and tracing. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention. In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor. Figure 1 It is a flow chart of a Spring Boot Mapper file modification method based on AI agent adaptation to DAMO database of the present invention; Figure 2 Generate an adaptive SQL statement flow chart for the AI ​​agent of the present invention; Figure 3 The figure is a schematic diagram of the hardware structure of an electronic device of the present invention. DETAILED DESCRIPTION

[0017] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0018] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.

[0019] In addition, the descriptions of "first", "second", etc. in the present invention are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.

[0020] As a popular Java development framework, Spring Boot can quickly build microservice-based applications, but during use, the adaptation problem between different databases often troubles developers. The existing technology mainly has the following methods to adapt the SQL of different databases: Manually modify the Mapper file: Developers need to modify the SQL statements in the Mapper file one by one to adapt to different databases, which is not only time-consuming and labor-intensive, but also easy to introduce errors. Use the ORM framework: Automatically generate SQL through the object-relational mapping (ORM) framework, but for the specific optimization and complex queries of the DAMO database, it often fails to achieve the expected results. Database middleware: Dynamic conversion of SQL statements through middleware, however, this will increase the complexity of the system and the difficulty of maintenance. The shortcomings of the existing technology include: Low adaptation efficiency: The process of manually modifying the Mapper file is lengthy and error-prone, especially in large projects, resulting in low efficiency. Lack of intelligence: Most of the existing adaptation solutions rely on manual operations, lack intelligent support, and cannot quickly adapt to database changes. High maintenance cost: With the iteration of the project, frequent SQL modifications increase the workload of later maintenance. Long text processing limitations: In the case of long text input and output, the existing solution cannot effectively manage the Mapper file.

[0021] The present invention sets up an AI agent to perform intelligent analysis on SQL statements, and generates an intelligent adaptation algorithm for SQL statements that are not compatible with the current database, which simplifies the adaptation process of the DAMO database, facilitates the modification of Mapper files, significantly improves the adaptation efficiency, and reduces the risk of errors caused by manual operations; the present invention performs quality inspection on the generated SQL statements, runs test cases to verify the adaptation quality, ensures that the generated SQL can be correctly executed on the DAMO database, and ensures the quality of the adapted SQL; the present invention also adds a modification log to record the historical version of each modification, supports quick rollback, and facilitates subsequent auditing and tracing.

[0022] Example 1 A Spring Boot Mapper file modification method based on AI agent adaptation to DAMO database, reference Figure 1,include: S100, obtaining the SQL statement in the Mapper file; ‌SQL statements are a specific implementation of the Structured Query Language (SQL), a language used to operate on databases. ‌SQL statements include multiple types, mainly used for operations such as querying, inserting, updating, and deleting data. The main types include: Data Definition Language (DDL): used to define and modify the structure of databases and tables, such as creating, modifying, and deleting tables. Data Manipulation Language (DML): used to process data in tables, including querying, inserting, updating, and deleting operations. When the AI ​​agent starts, it scans all Mapper files and extracts SQL statements for analysis.

[0023] S200, determining whether the SQL statement is suitable for the current database; ‌Whether the SQL statement is suitable for the current database mainly depends on the setting of SQL Mode. ‌In MySQL, sql_mode is an important variable that determines how strictly MySQL handles SQL statements. By default, sql_mode may be set to loose mode, allowing some illegal operations, such as inserting illegal data. However, in a production environment, sql_mode is usually set to strict mode to ensure data consistency and accuracy. After setting strict mode, MySQL will be more strict with data verification to ensure data accuracy‌.

[0024] S300, if it is not suitable, split the SQL statement into multiple SQL sub-statements, and use the AI ​​agent to adaptively generate SQL sub-statements that are suitable for the current database; According to the identified database characteristics, the long SQL statement is split into multiple sub-statements, and the SQL adapted to the DAMO database is automatically generated and the Mapper file is updated.

[0025] S400, updating the Mapper file using the SQL substatement adapted to the current database.

[0026] ‌Update mapper files‌ are mainly used in the MyBatis framework to define SQL statements and their mapping relationship with Java interface methods. Updating mapper files includes the following aspects:Define SQL statements‌: mapper files can define various SQL statements, including query, insert, update, delete and other operations. By defining SQL statements in mapper files, SQL statements can be decoupled from Java code, improving the maintainability and readability of the code‌. Map Java objects‌: mapper files can map query results to Java objects to implement ORM operations on data. Define the mapping relationship between Java objects and database tables through the resultMap tag, or specify the type of Java objects through the resultType tag‌. Provide dynamic SQL support‌: mapper files can use dynamic SQL statements to implement complex operations such as conditional queries and multi-table joint queries. Through tags such as if, choose, when, otherwise, dynamic SQL statements can be spliced ​​and conditional judgments can be implemented to achieve more flexible and efficient data access operations‌. Support annotation configuration of SQL statements‌: In addition to the XML file method, MyBatis also supports the use of annotations to configure SQL statements. Through annotations, SQL statements can be defined directly on Java methods to achieve more concise and intuitive SQL operations.

[0027] Preferably, S300, splitting the SQL statement into multiple SQL sub-statements includes: Analyze the length and components of SQL statements; Database Management System (DBMS) limitations: Different DBMS have different limits on the length of SQL statements. For example, SQL Server allows a maximum length of 8,000 characters, while Oracle allows a maximum length of 4,000 characters. Excessively long SQL statements may affect query performance because more computing resources are required to parse and execute complex queries. Excessively long SQL statements are difficult to read and maintain, so complex queries should be broken down into multiple smaller statements to speed up data processing later.

[0028] The components of SQL statements include: Keywords: such as SELECT, INSERT, UPDATE, DELETE, etc., indicating the operations to be performed. Identifiers: used to identify the names of objects in the database, such as table names and column names. Literals: represent specific values, characters or dates, such as numbers, strings, dates, etc. Operators: symbols or keywords used to perform operations, such as +, -, *, / , etc. Delimiters: used to separate different parts in an SQL statement, such as a semicolon (;) used to end an SQL statement. Comments: provide explanations or annotations to SQL statements and are not executed by the database. Spaces and line breaks: used to format SQL statements to enhance readability.

[0029] Divide an SQL statement into multiple SQL sub-statements according to the length and components of the SQL statement.

[0030] In the embodiment of the present invention, according to the complexity and length of the SQL statement, the Mapper file is split into multiple sub-files for management to improve readability and maintainability, and a unified management interface is provided to facilitate operation and maintenance.

[0031] Preferably, reference Figure 2 , S300, if it is not suitable, split the SQL statement into multiple SQL sub-statements, and use AI agents to adaptively generate SQL sub-statements that are suitable for the current database, including: S310, analyzing the characteristics and structure of the current database; The data structure includes: Physical storage structure: including configuration files, control files, data files, redo log files, archive log files and backup files, etc. The control file records the initial information of the database, and the data file is where the real data is stored. Logical storage structure: including tablespaces, segments, clusters and pages. The tablespace is the basic unit of logical storage, the segment is the logical unit for storing data in the tablespace, the cluster is a collection of segments, and the page is the smallest unit for storing data. Memory structure: including memory pool, buffer, sort area and hash area, etc. The memory pool is used to store temporary data, the buffer is used to cache data pages, and the sort area and hash area are used for sorting and hashing operations.

[0032] S320, inputting the characteristics and structure of the current database into the AI ​​agent; S330, the AI ​​agent converts the SQL sub-statements into SQL statements that are suitable for the current database according to the characteristics and structure of the database.

[0033] In an embodiment of the present invention, an AI agent is used to perform intelligent conversion on SQL statements. To adapt SQL statements to the DAMO database, it is necessary to ensure that the SQL syntax matches the syntax supported by the DAMO database. The DAMO database is compatible with multiple SQL standards. The AI ​​agent can check whether the functions, data types, keywords, etc. in the SQL statement are consistent with the specifications of the DAMO database. The AI ​​agent needs to make corresponding modifications or replacements for features that are not supported by the DAMO database. The AI ​​agent can also test the modified SQL statements to ensure that they can be executed normally on the DAMO database.

[0034] Preferably, after S330, according to the characteristics and structure of the database, converting the SQL sub-statement into an SQL statement adapted to the current database, the method further includes: S340: Adjust the converted SQL statement according to the parameters set by the developer.

[0035] In the embodiment of the present invention, it is also possible to automatically generate adapted SQL statements based on the analysis results of the AI ​​agent. The present invention provides an interface for developers to confirm and modify, allowing fine-tuning of the generated SQL.

[0036] Preferably, S300, if not suitable, splitting the SQL statement into multiple SQL sub-statements, and using the AI ​​agent to adaptively generate SQL sub-statements adapted to the current database, further includes: S350, testing the generated SQL sub-statements adapted to the DAMO database to verify whether the quality of the generated SQL sub-statements adapted to the DAMO database meets the execution standard of the current data; The SQL statement standard of DM database mainly follows the SQL standard, but there are also some specific extensions and optimizations. The SQL language (DM_SQL) of DM database conforms to the standard of structured query language and is an extension of standard SQL. It integrates data definition, query, update, control and other functions, and is simple and convenient to use. The SQL statements of DM database mainly include the following: DML (Data Manipulation Language): including INSERT, UPDATE, DELETE, SELECT, etc., used for data addition, deletion, modification and query operations. DDL (Data Definition Language): including CREATE, ALTER, DROP, etc., used to create, modify and delete database objects. DCL (Data Control Language): including GRANT, REVOKE, etc., used for permission management. TCL (Transaction Control Language): including COMMIT, ROLLBACK, etc., used for transaction control. SQL keywords cannot be abbreviated or split, and keywords are not case-sensitive, but it is recommended to use uppercase to improve readability.

[0037] S360, if the execution standard is not met, determining which specific standard the SQL substatement does not meet; If we cannot find out which specific standard is not met, we will have to retrain the AI ​​agent, which will undoubtedly greatly increase the workload and reduce processing efficiency. Therefore, we need to find out which standard is not met and then fine-tune the AI ​​parameters that control these standards so that the SQL statements can meet the execution standards of the DAMO database. This can save a lot of manpower and material resources.

[0038] S370, adjusting the parameters of the AI ​​agent according to the standard that the SQL substatement does not meet; Adjusting AI parameters according to the standards that SQL substatements do not meet can optimize the performance and effect of machine learning algorithms, making them perform better in SQL statement adaptation tasks. It can also improve algorithm performance: by adjusting parameters, the algorithm structure can be simplified, unnecessary calculation steps can be reduced, thereby reducing calculation complexity and improving calculation speed.

[0039] Reduce model size and computing requirements: Model compression techniques such as weight pruning, knowledge distillation, and quantization can reduce model size, storage requirements, and computing resources. Accelerate the training and inference process: Hardware acceleration technologies such as GPU, FPGA, and ASIC can greatly increase the speed of training and inference. Optimize data preprocessing: Data cleaning, feature extraction, and data enhancement can improve data quality and thus improve model performance. Control model complexity: By adjusting hyperparameters such as the number of layers and nodes, the complexity of the model can be controlled to avoid overfitting or underfitting. Optimize the training process: By adjusting hyperparameters such as the learning rate, the learning speed of the model can be controlled so that the model converges to a better solution faster. Improve generalization ability: Hyperparameters such as regularization can improve the generalization ability of the model and make it perform better on new data.

[0040] S380, input the SQL statements that are not suitable for the current database into the adjusted AI agent for adaptation.

[0041] The SQL statements that are not compatible with the current database are input into the adjusted AI agent for adaptation and re-adaptation until the adaptation is successful.

[0042] Preferably, after S400, updating the Mapper file using the SQL sub-statement adapted to the current database, the method further includes: ‌Modify SQL statements‌: Find the SQL statements that need to be updated in the mapper file and modify them. For example, modify the WHERE condition of a query statement or update the fields of an insert statement. Update mapping relationships‌: If the fields of the SQL statement are modified or new fields are added, you need to ensure that the mapping relationship between the Java object and the database table is updated accordingly. You can define the mapping relationship between the Java object and the database table through the resultMap tag, or specify the type of the Java object through the resultType tag.‌ Test‌: After the modification is completed, test to ensure that the new SQL statement can be executed correctly and that there are no problems with the data mapping relationship. This can be verified by writing unit tests or manual tests.

[0043] S500, record the historical version of each SQL statement modification and generate a modification log.

[0044] ‌Modification log‌ refers to a record of modifications, additions, deletions, and other operations made to each update or release of software or database. It usually includes information such as version number, release date, and update content to help users understand the software update status and keep abreast of the latest features and improvements of the software so that they can use the software better. ‌Help users understand software updates: Through modification logs, users can clearly understand every update and modification of the software, including new features, fixed bugs, and performance optimizations. ‌Help developers manage versions: The modification log records every modification of the software, which helps developers trace previous modification records and ensure the smooth progress of software development and updates. ‌Data recovery and performance optimization‌: In database management, modification logs can be used for data recovery, performance optimization, and data synchronization to ensure data integrity and consistency.

[0045] Preferably, after S200, determining whether the SQL substatement is suitable for the current database, the method further includes: S210, generating an adapter for the current database according to the structure and type of the current database; S220, using the adapter of the current database to uniformly adapt and convert the SQL statements.

[0046] Integrating database-specific adapters can replace AI agents to adapt and convert SQL statements. Integrating database-specific adapters: SQL conversion is achieved by developing database adapters, but the use of unified adapters will lead to a lack of flexibility in the system. If you need to handle different database characteristics, it will lead to slower processing speed. Using script automation tools: Batch modify SQL with the help of script tools, but you need to handle the characteristics of different databases.

[0047] Example 2 A Spring Boot Mapper file modification system based on AI agent adaptation to DAMO database, including: Data acquisition module, used to obtain SQL statements in Mapper files; A data processing module, used for splitting an SQL statement into multiple SQL sub-statements; The data judgment module is used to judge whether the SQL sub-statement is suitable for the current database. If not, the AI ​​agent is used to adaptively generate the SQL sub-statement that is suitable for the current database. The data update module is used to update the Mapper file using SQL substatements that are adapted to the current database.

[0048] Example 3 An electronic device includes: a chip, a processor and a memory, the memory is used to store computer program code, the computer program code includes computer instructions, and when the chip executes the computer instructions, the electronic device executes a Spring Boot Mapper file modification method based on an AI agent adapted to a DAMO database.

[0049] refer to Figure 3 , the electronic device 2 includes a processor 21, a memory 22, an input device 23, and an output device 24. The processor 21, the memory 22, the input device 23, and the output device 24 are coupled via a connector, and the connector includes various interfaces, transmission lines, or buses, etc., which are not limited in the embodiments of the present invention. It should be understood that in various embodiments of the present invention, coupling refers to mutual connection in a specific manner, including direct connection or indirect connection through other devices, for example, through various interfaces, transmission lines, buses, etc.

[0050] The processor 21 may be one or more graphics processing units (GPUs). When the processor 21 is a GPU, the GPU may be a single-core GPU or a multi-core GPU. Optionally, the processor 21 may be a processor group consisting of multiple GPUs, and the multiple processors are coupled to each other via one or more buses. Optionally, the processor may also be other types of processors, etc., which are not limited in the embodiments of the present invention.

[0051] The memory 22 can be used to store computer program instructions and various computer program codes including program codes for executing the scheme of the present invention. Optionally, the memory includes but is not limited to random access memory (RAM), read-only memory (ROM), erasable programmable read only memory (EPROM), or portable read only memory (CD-ROM), which is used for related instructions and data.

[0052] The input device 23 is used to input data and / or signals, and the output device 24 is used to output data and / or signals. The output device 24 and the input device 23 may be independent devices or an integrated device.

[0053] Example 4 A computer-readable storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed by a processor of an electronic device, the processor executes a Spring Boot Mapper file modification method based on an AI agent adapted to a DAMO database.

[0054] The present invention sets up an AI agent to perform intelligent analysis on SQL statements, and generates an intelligent adaptation algorithm for SQL statements that are not compatible with the current database, which simplifies the adaptation process of the DAMO database, facilitates the modification of Mapper files, significantly improves the adaptation efficiency, and reduces the risk of errors caused by manual operations; the present invention performs quality inspection on the generated SQL statements, runs test cases to verify the adaptation quality, ensures that the generated SQL can be correctly executed on the DAMO database, and ensures the quality of the adapted SQL; the present invention also adds a modification log to record the historical version of each modification, supports quick rollback, and facilitates subsequent auditing and tracing.

[0055] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A Spring Boot Mapper file modification method based on AI agent adaptation to DAMO database, characterized in that: include: Get the SQL statement in the Mapper file; Determine whether the SQL statement is suitable for the current database; If it is not suitable, split the SQL statement into multiple SQL sub-statements, and use AI agents to adaptively generate SQL sub-statements that are suitable for the current database; Update the Mapper file using SQL substatements that are suitable for the current database.

2. According to claim 1, a Spring Boot Mapper file modification method based on AI agent adaptation to DAMO database is characterized in that: The step of splitting the SQL statement into multiple SQL sub-statements includes: Analyzing the length and components of the SQL statement; The SQL statement is divided into a plurality of SQL sub-statements according to the length and components of the SQL statement.

3. According to claim 1, a Spring Boot Mapper file modification method based on AI agent adaptation to DAMO database is characterized in that: If it is not suitable, splitting the SQL statement into multiple SQL sub-statements, and using AI agents to adaptively generate SQL sub-statements that are suitable for the current database includes: Analyze the characteristics and structure of the current database; Inputting the characteristics and structure of the current database into the AI ​​agent; The AI ​​agent converts the SQL sub-statements into SQL statements that are adapted to the current database according to the characteristics and structure of the database.

4. According to claim 3, a Spring Boot Mapper file modification method based on AI agent adaptation to DAMO database is characterized in that: After the AI ​​agent converts the SQL sub-statement into an SQL statement adapted to the current database according to the characteristics and structure of the database, the method further includes: Adjust the converted SQL statements according to the parameters set by the developer.

5. According to claim 3, a Spring Boot Mapper file modification method based on AI agent adaptation to DAMO database is characterized in that: If it is not suitable, the SQL statement is split into multiple SQL sub-statements, and the AI ​​agent is used to adaptively generate SQL sub-statements that are suitable for the current database, and the method further includes: Test the generated SQL sub-statements adapted to the DAMO database to verify whether the quality of the generated SQL sub-statements adapted to the DAMO database meets the execution standards of the current data; If it does not meet the execution standard, determine which specific standard the SQL substatement does not meet; Adjust the parameters of the AI ​​agent based on the criteria that the SQL substatement does not meet; The SQL statements that are not suitable for the current database are input into the adjusted AI agent for adaptation.

6. According to claim 1, a Spring Boot Mapper file modification method based on AI agent adaptation to DAMO database is characterized in that: After the Mapper file is updated using the SQL substatement adapted to the current database, the following is also included: Record the historical version of each SQL statement modification and generate a modification log.

7. According to claim 1, a Spring Boot Mapper file modification method based on AI agent adaptation to DAMO database is characterized in that: After determining whether the SQL substatement is suitable for the current database, the method further includes: Generate an adapter for the current database based on the structure and type of the current database; Use the current database adapter to uniformly adapt and convert SQL statements.

8. A Spring Boot Mapper file modification system based on AI agent adaptation to DAMO database, characterized in that: include: Data acquisition module, used to obtain SQL statements in Mapper files; A data processing module, used for splitting the SQL statement into multiple SQL sub-statements; A data judgment module is used to judge whether the SQL sub-statement is suitable for the current database. If not, an AI agent is used to adaptively generate an SQL sub-statement suitable for the current database. The data update module is used to update the Mapper file using SQL substatements that are adapted to the current database.

9. An electronic device, characterized in that: include: A chip, a processor and a memory, wherein the memory is used to store computer program codes, wherein the computer program codes include computer instructions. When the chip executes the computer instructions, the electronic device executes a Spring Boot Mapper file modification method based on an AI agent adapted to the DAMO database as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: A computer program is stored in the computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a processor of an electronic device, the processor executes a Spring Boot Mapper file modification method based on AI agent adaptation to the DAMO database as described in any one of claims 1 to 7.