A database dialect conversion method, device and medium of an AST rule pool

By using context-aware AST caching and rule pooling, combined with sandbox pre-verification and reflective retry mechanisms, the problems of high translation failure rate, high latency, poor security and high maintenance cost during database migration are solved, achieving low-latency and efficient database dialect conversion.

CN123030639APending Publication Date: 2026-11-03HIGHGO SOFTWARE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611462376.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-20
Publication Date
2026-11-03

AI Technical Summary

Technical Problem

Existing technologies suffer from high translation failure rates, high latency, poor security, and high maintenance costs during database migration. In particular, static gateways lack session context awareness and large models lack grammatical constraints, leading to translation errors and operational difficulties.

Method used

By using context-aware AST caching and rule pooling, combined with sandbox pre-validation and reflective retry mechanisms, low-latency transformation and error interception are achieved. This includes parsing structured query language text, generating abstract syntax trees, performing generalization and structural rewriting, using large language models for reasoning, and performing sandbox syntax validation.

Benefits of technology

It significantly reduces CPU overhead in high-concurrency scenarios, breaks through performance bottlenecks, effectively solves syntax errors and production accidents caused by illusions, and reduces operation and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123030639A_ABST
    Figure CN123030639A_ABST
Patent Text Reader

Abstract

The application discloses a database dialect conversion method and device of an AST rule pool and a medium, and relates to the technical field of data processing. The method comprises the following steps: analyzing an original structured query language statement sent by an application layer to a source database to extract a structured query language text; analyzing a cache-missed structured query language text to generate a source abstract syntax tree and perform generalization processing to extract a skeleton fingerprint of the structured query language; if the real state of a current session meets the context dependency requirement declared in a candidate conversion rule, performing structural rewriting on the source abstract syntax tree to generate a target abstract syntax tree, and performing reverse analysis on the target abstract syntax tree to generate a target structured query language statement; inputting the structured query language text, a context environment variable and pre-acquired metadata information into a large language model to perform reasoning, and sending the target structured query language statement that passes the verification to a target database for execution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a database dialect conversion method, device and medium for AST rule pool. Background Technology

[0002] With the accelerated adoption of enterprise digital transformation and the popularization of domestic IT innovation and cloud-native architecture, migrating core business systems that originally ran on traditional commercial databases to open source or domestic databases has become an industry trend. To achieve smooth replacement of heterogeneous databases without modifying application code, the industry has introduced database virtualization proxy technology. This technology intercepts source database SQL traffic in the form of a serial gateway, translates it into target database syntax in real time, and then forwards it for execution. Currently, there are two main technical solutions. One is a traditional proxy gateway based on static rules and regular expressions, which hardcodes the conversion rules into code or configuration files and uses regular expressions or hard-coded AST traversers for matching and replacement. The other is a translation gateway based on direct connection to a large language model, which relies entirely on the zero-sample translation capability of the large model. It embeds prompt words into the SQL, calls the model interface, and directly passes the generated results down without any local syntax verification.

[0003] However, the above solutions have significant drawbacks. First, static gateways lack session context awareness and cannot obtain session states such as environment variables, resulting in a high failure rate for translating complex dialects that rely on implicit context. Furthermore, the large model is a probabilistic generation model, lacking absolute constraints on the target syntax, making it prone to generating erroneous SQL statements. Additionally, the direct connection solution lacks pre-verification and interception, and the distribution of erroneous statements may trigger production incidents such as full table scans. Fourthly, static gateways lack an execution result feedback mechanism; new syntax requires manual DBA review, test rule writing, and redeployment, resulting in extremely high maintenance costs and an inability to adapt to changes.

[0004] Therefore, how to achieve low-latency conversion through context-aware AST caching and rule pooling, and how to intercept large model illusions through sandbox pre-verification and reflective retry mechanisms, thereby solving the technical problems of high translation failure rate, high latency, poor security and high maintenance cost of traditional solutions, has become an urgent technical problem to be solved. Summary of the Invention

[0005] This application provides a database dialect conversion method, device, and medium for AST rule pools to solve the following technical problems: how to achieve low-latency conversion through context-aware AST caching and rule pools, and how to intercept large model illusions through sandbox pre-verification and reflective retry mechanisms, thereby solving the technical problems of high translation failure rate, high latency, poor security, and high maintenance cost of traditional solutions.

[0006] In a first aspect, embodiments of this application provide a database dialect conversion method for an AST rule pool. The method includes: parsing the original structured query language statement sent from the application layer to the source database to extract the structured query language text, and monitoring the context environment variables of the current database session; using the structured query language text and the context environment variables as a joint index, querying whether a corresponding converted target structured query language statement exists in the abstract syntax tree cache, and performing lexical and syntactic parsing on the structured query language text that is not found in the cache to generate a source abstract syntax tree; performing generalization processing on the source abstract syntax tree to extract the skeleton fingerprint of the structured query language, and using the skeleton fingerprint as an index to query the in-memory rule pool. The system checks if there are matching candidate transformation rules to query the true state of the current session. If the true state of the current session satisfies the context dependency requirements declared in the candidate transformation rules, the source abstract syntax tree is rewritten based on the candidate transformation rules to generate the target abstract syntax tree. The target abstract syntax tree is then parsed to generate the target structured query language statement. The structured query language text, context environment variables, and pre-acquired metadata information are input into the large language model for inference to obtain the preliminary transformation results output by the large language model. The preliminary transformation results are then subjected to sandbox syntax validation. The target structured query language statement that passes the validation is sent to the target database for execution, and the execution result is returned to the application layer.

[0007] In one implementation of this application, the original Structured Query Language (SCL) statement sent from the application layer to the source database is parsed to extract the SCL text, and the context environment variables of the current database session are monitored. Specifically, this includes: intercepting network packets sent from the application layer to the source database, and parsing the SCL instructions and database session control instructions from the network packets; extracting the SCL text from the SCL instructions, and extracting context change parameters from the database session control instructions to update the currently maintained session context state vector; wherein, the context change parameters include environment variable update values ​​and / or transaction isolation level change values ​​and / or character set switching identifiers and / or time zone adjustment values.

[0008] In one implementation of this application, a combined index of structured query language text and context environment variables is used to query whether a corresponding converted target structured query language statement exists in the abstract syntax tree cache. The structured query language text that does not match the cache is then subjected to lexical and syntactic parsing to generate a source abstract syntax tree. Specifically, this includes: normalizing the structured query language text to generate standardized query text, and performing a combined hash calculation on the standardized query text and context environment variables to generate a cached query primary key; if a cached entry matching the cached query primary key exists in the abstract syntax tree cache, the converted target structured query language statement is read from the cached entry and directly executed in the target database; if no cached entry matching the cached query primary key exists in the abstract syntax tree cache, lexical parsing is performed on the structured query language text to generate a lexical unit sequence, and syntactic parsing is performed on the lexical unit sequence to construct a memory-level abstract syntax tree for the structured query language text.

[0009] In one implementation of this application, the source abstract syntax tree is generalized to extract the skeleton fingerprint of the structured query language. Using the skeleton fingerprint as an index, a query is performed to check if a matching candidate transformation rule exists in the in-memory rule pool to determine the current session's true state. Specifically, this includes: performing a depth-first traversal of the source abstract syntax tree; identifying and removing literal constant nodes during the traversal while retaining grammatical structure nodes and keyword nodes to generate the skeleton fingerprint of the structured query language; using the skeleton fingerprint as an index, a query is performed to check if a candidate transformation rule matching the skeleton fingerprint exists in the in-memory rule pool; if no matching candidate transformation rule exists in the in-memory rule pool... If a candidate transformation rule matches the skeleton fingerprint, it is determined that the current structured query language is outside the processing range of the rule pool. The structured query language text, context environment variables, and pre-acquired metadata information are then input into the large language model for inference. If a candidate transformation rule that matches the skeleton fingerprint exists in the memory rule pool, a context dependency declaration is extracted from the candidate transformation rule. The context condition set in the context dependency declaration is used as the query term to query the context environment variables of the current database session to obtain the true state values ​​of the current database session under each condition in the context condition set. The context dependency declaration contains the set of context conditions that the candidate transformation rule must satisfy to take effect.

[0010] In one implementation of this application, if the actual state of the current session satisfies the context dependency requirements declared in the candidate transformation rules, the source abstract syntax tree is rewritten based on the candidate transformation rules to generate the target abstract syntax tree. Specifically, this includes: if the actual state of the current database session fails to fully satisfy all context conditions in the context dependency declaration, the candidate transformation rules are determined to be unsuitable for the context environment of the current database session, and the structured query language text, context environment variables, and pre-acquired metadata information are input into the large language model for inference; if the actual state of the current database session fully satisfies all context conditions in the context dependency declaration, the candidate transformation rules are determined to be suitable for the context environment of the current database session, and the source abstract syntax tree is rewritten based on the transformation actions defined in the candidate transformation rules to generate the target abstract syntax tree.

[0011] In one implementation of this application, the target abstract syntax tree is de-parsed to generate a target structured query language statement. Specifically, this includes: performing a depth-first traversal of the target abstract syntax tree and mapping each syntax node in the target abstract syntax tree to a text fragment corresponding to the dialect of the target database based on the syntax rules of the target database; if an unmapped dialect-specific structure is detected, the current de-parse process is paused, and the syntax node containing the unmapped dialect-specific structure is marked as a node to be processed, thereby triggering the node to be processed to re-enter the large language model for inference; if no unmapped dialect-specific structure is detected, the traversal continues until the mapping of all syntax nodes is completed, and all text fragments generated by the mapping are concatenated according to the structural hierarchy of the target abstract syntax tree to generate a target structured query language statement.

[0012] In one implementation of this application, the structured query language text, context environment variables, and pre-acquired metadata information are input into a large language model for reasoning to obtain a preliminary conversion result output by the large language model. Specifically, this includes: assembling the structured query language text, context environment variables, and metadata information according to a preset prompt word template to generate a full set of prompt words containing complete translation context; and inputting the full set of prompt words into the large language model for thought chain reasoning so that the large language model generates a preliminary conversion result that conforms to the grammatical specifications of the target database.

[0013] In one implementation of this application, a sandbox syntax check is performed on the preliminary conversion result to send the target structured query language statement that passes the check to the target database for execution and return the execution result to the application layer. Specifically, this includes: performing offline syntax checking on the preliminary conversion result to verify whether the preliminary conversion result conforms to the syntax specification of the target database; if the offline syntax check passes, the preliminary conversion result is determined as the target structured query language statement; if the offline syntax check fails, the error code and error log are extracted from the return result of the offline syntax check, and the number of failed checks is accumulated; the error code and error log are reassembled into a correction prompt word, and the correction prompt word is re-input into the large language model for inference retry until the offline syntax check passes; the abstract syntax tree features that pass the check are transformed into new conversion rules and injected into the in-memory rule pool, and the target structured query language statement is sent to the target database for execution to obtain the execution result and return it to the application layer.

[0014] Secondly, embodiments of this application also provide a database dialect conversion device for an AST rule pool. The device includes: at least one processor; and a memory communicatively connected to the at least one processor. The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to: parse the original structured query language statement sent from the application layer to the source database to extract the structured query language text and monitor the context environment variables of the current database session; use the structured query language text and the context environment variables as a joint index to query whether a corresponding converted target structured query language statement exists in the abstract syntax tree cache, and perform lexical and syntactic parsing on the structured query language text that is not found in the cache to generate a source abstract syntax tree; and process the source abstract syntax tree... Generalization is performed to extract the skeleton fingerprint of the structured query language. Using the skeleton fingerprint as an index, the system queries the in-memory rule pool to see if there are matching candidate transformation rules to determine the current session's true state. If the current session's true state satisfies the context dependency requirements declared in the candidate transformation rules, the source abstract syntax tree is rewritten based on the candidate transformation rules to generate the target abstract syntax tree. The target abstract syntax tree is then de-parsed to generate the target structured query language statement. The structured query language text, context environment variables, and pre-acquired metadata information are input into the large language model for inference to obtain the preliminary transformation results output by the large language model. The preliminary transformation results are then subjected to sandbox syntax validation. The target structured query language statement that passes the validation is sent to the target database for execution, and the execution result is returned to the application layer.

[0015] Thirdly, embodiments of this application also provide a non-volatile computer storage medium for database dialect conversion of an AST rule pool, storing computer-executable instructions. These instructions are configured to: parse the original structured query language statement sent from the application layer to the source database to extract the structured query language text, and monitor the context environment variables of the current database session; use the structured query language text and the context environment variables as a joint index to query whether a corresponding converted target structured query language statement exists in the abstract syntax tree cache, and perform lexical and syntactic parsing on the structured query language text that is not found in the cache to generate a source abstract syntax tree; and perform generalization processing on the source abstract syntax tree to extract the skeleton fingerprint of the structured query language, and... Using the skeleton fingerprint as an index, the system queries the memory rule pool to see if a matching candidate transformation rule exists, thus retrieving the current session's true state. If the current session's true state satisfies the context dependency requirements declared in the candidate transformation rule, the source abstract syntax tree is rewritten based on the candidate transformation rule to generate the target abstract syntax tree. The target abstract syntax tree is then reverse-parsed to generate the target structured query language statement. The structured query language text, context environment variables, and pre-acquired metadata information are input into the large language model for inference to obtain the preliminary transformation result output by the large language model. The preliminary transformation result is then subjected to sandbox syntax validation. The target structured query language statement that passes the validation is sent to the target database for execution, and the execution result is returned to the application layer.

[0016] This application provides a database dialect conversion method, device, and medium based on an AST rule pool, which has the following advantages: It uses structured query language text and the context environment variables of the current database session as a composite index query abstract syntax tree cache. When the cache is hit, it directly skips all subsequent parsing and rewriting steps, outputs the target SQL, and enters the execution engine. Compared with the traditional gateway approach of relying on regular expressions for string replacement or requiring complete parsing of each SQL statement, this significantly reduces CPU overhead in high-concurrency scenarios. It rewrites the source abstract syntax tree based on candidate conversion rules and reverse-parses the target abstract syntax tree to generate the target structured query language statement, breaking through the performance bottleneck and parsing dead ends of traditional database middleware based on string regular expression replacement. It can handle complex dialect structures such as deeply nested queries. Through sandbox pre-validation and reflective retry mechanisms, it effectively solves the security risks of grammatical errors caused by illusions and production accidents when large language models are applied to real-time database translation. Attached Figure Description

[0017] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 A flowchart of a database dialect conversion method for an AST rule pool is provided in this application embodiment; Figure 2 This is a schematic diagram of the internal structure of a database dialect conversion device for an AST rule pool, provided as an embodiment of this application. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0019] This application provides a database dialect conversion method, device, and medium for AST rule pools to solve the following technical problems: how to achieve low-latency conversion through context-aware AST caching and rule pools, and how to intercept large model illusions through sandbox pre-verification and reflective retry mechanisms, thereby solving the technical problems of high translation failure rate, high latency, poor security, and high maintenance cost of traditional solutions.

[0020] The technical solutions proposed in the embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0021] Figure 1 A flowchart illustrating a database dialect conversion method for an AST rule pool provided in this application embodiment. Figure 1 As shown in the figure, the database dialect conversion method of the AST rule pool provided in this application embodiment specifically includes the following steps: Step 10: Parse the raw Structured Query Language (SCL) statements sent from the application layer to the source database to extract the SCL text and monitor the context environment variables of the current database session.

[0022] As an optional embodiment, the original Structured Query Language (SCL) statements sent from the application layer to the source database are parsed to extract the SCL text and monitor the context environment variables of the current database session. Specifically, this may include: Step 101: Intercepting network packets sent from the application layer to the source database and parsing the SCL instructions and database session control instructions from the network packets.

[0023] In this step, network packets sent from the application layer to the source database are first intercepted, completing packet hijacking at the database protocol level and diverting business traffic into the gateway's internal processing link. The gateway then performs protocol unpacking and parsing on the captured network packets, extracting two types of key instructions from the binary protocol packets: one is the structured query language instruction issued by the business side, and the other is the database session control instruction. After extracting the structured query language instruction, it is sent to the subsequent cache rule matching stage for dialect conversion processing. The parsed database session control instruction is then handled by the session and transaction context state machine, which updates and maintains various environmental state information corresponding to the session in real time. Subsequently, whether it is the high-speed translation link based on the abstract syntax tree rule pool or the large model translation link, the session information stored in the state machine will be read, and the session context will be used as the input condition for translation. This adapts to the implicit environmental dependencies in dialect conversion and avoids translation anomalies caused by session state mismatch. The parsed instruction data continues to flow downwards, supporting the complete heterogeneous SQL dialect conversion process.

[0024] Step 102: Extract the Structured Query Language (SCL) text from the SCL instructions and extract the context change parameters from the database session control instructions to update the currently maintained session context state vector; wherein, the context change parameters include environment variable update values ​​and / or transaction isolation level change values ​​and / or character set switching flags and / or time zone adjustment values.

[0025] In this step, after obtaining the Structured Query Language (SCL) instructions and database session control instructions through protocol parsing, the protocol encapsulation information is stripped from the SCL instructions to extract the original SCL text, which serves as the processing object for subsequent dialect conversion. Simultaneously, the database session control instructions are parsed to extract various context change parameters, including one or more of the following: environment variable update values, transaction isolation level change values, character set switching flags, and time zone adjustment values. These extracted context change parameters are input into the session and transaction context state machine, which updates the internally maintained session context state vector in real time, continuously recording the runtime environment state corresponding to the current database connection. This session environment information is used as a prerequisite input condition for translation, performing context assertion matching and verification. This adapts to the implicit environment dependencies inherent in dialect grammars and avoids translation failures caused by inconsistent session states. The extracted SCL text then continues to flow downwards, entering the cache rule matching process for heterogeneous dialect translation processing.

[0026] Step 20: Using the structured query language text and context environment variables as a joint index, query whether there is a corresponding converted target structured query language statement in the abstract syntax tree cache, and perform lexical and syntactic parsing on the structured query language text that is not found in the cache to generate the source abstract syntax tree.

[0027] As an optional implementation, the structured query language text and context environment variables are used as a joint index to query whether there is a corresponding converted target structured query language statement in the abstract syntax tree cache, and the structured query language text that is not found in the cache is subjected to lexical and syntactic parsing to generate the source abstract syntax tree. Specifically, it may include: Step 201: Normalizing the structured query language text to generate standardized query text, and performing joint hash calculation on the standardized query text and context environment variables to generate the cache query primary key.

[0028] In this step, after obtaining the parsed structured query language text, a normalization process is performed on the text to remove interference from variable literals, strip dynamic constant information within the statements, and retain the skeleton syntax structure of the query itself. This generates a standardized query text, eliminating recognition bias caused by parameter differences in similar business queries. Subsequently, the context environment variables stored in the session context state vector are read, and the standardized query text is combined with the currently effective context environment variables for joint hash calculation. This calculation integrates the query skeleton structure with the session runtime environment information to generate the corresponding cache query primary key. This cache query primary key serves as the retrieval basis for the AST cache, enabling rapid cache short-circuit matching.

[0029] Step 202: If there is a cache entry in the abstract syntax tree cache that matches the cache query primary key, then read the converted target structured query language statement from the cache entry and directly enter the target database execution stage.

[0030] In this step, after generating the cache query primary key, the abstract syntax tree (AST) cache is retrieved using this key to perform cache entry matching. If a cache entry matching the cache query primary key exists within the AST cache, it means that the current query with a specific session context has already undergone complete dialect conversion processing. Therefore, it is unnecessary to perform the costly processing steps of lexical and syntactic parsing, AST construction, rule validation, and AST rewriting again. The already converted target structured query language statement is directly read from the matched cache entry, skipping the entire AST rewriting process. The read target structured query language statement is then directly sent to the query translation execution stage, entering the target database execution phase. This cache short-circuit mechanism significantly reduces CPU computational consumption and ensures the performance of dialect conversion in high-concurrency business scenarios.

[0031] Step 203: If there is no cached entry in the abstract syntax tree cache that matches the cached query primary key, then perform lexical analysis on the structured query language text to generate a sequence of lexical units, and perform syntactic analysis on the sequence of lexical units to construct a memory-level abstract syntax tree for the structured query language text.

[0032] In this step, when the cache query primary key retrieves the abstract syntax tree cache and no matching cache entry is found, lexical analysis is first performed on the structured query language text. This involves disassembling the character stream of the original statement, identifying various grammatical elements, generating corresponding lexical unit sequences, and completing the basic word segmentation and symbol recognition of the statement. Then, syntax analysis is performed on the obtained lexical unit sequences. According to the dialect grammar rules of the source database, the grammatical logic of the statement is verified, and a memory-level abstract syntax tree corresponding to the structured query language text is constructed. The abstract syntax tree completely restores the grammatical logic structure of the query in the form of tree nodes in memory, removing the interference from the original text format, and providing a processing carrier for subsequent fingerprint extraction, rule matching, and syntax tree rewriting.

[0033] Step 30: Generalize the source abstract syntax tree to extract the skeleton fingerprint of the structured query language, and use the skeleton fingerprint as an index to query whether there are matching candidate transformation rules in the memory rule pool in order to query the true state of the current session.

[0034] As an optional embodiment, the source abstract syntax tree is generalized to extract the skeleton fingerprint of the structured query language, and the skeleton fingerprint is used as an index to query whether there are matching candidate transformation rules in the memory rule pool to query the real state of the current session. Specifically, it may include: Step 301: Perform a depth-first traversal of the source abstract syntax tree, identify and remove literal constant nodes in the source abstract syntax tree during the traversal, and retain the syntax structure nodes and keyword nodes in the source abstract syntax tree to generate the skeleton fingerprint of the structured query language.

[0035] In this step, after constructing the source abstract syntax tree, a depth-first traversal is performed on it, visiting each node in the tree layer by layer according to its structure. During the traversal, all literal constant nodes in the tree are identified. These nodes, which carry dynamic constant content passed in during business operations, are completely stripped and removed, and no longer participate in fingerprint generation. The traversal process fully preserves the syntax structure nodes and keyword nodes within the source abstract syntax tree, thus completely retaining the query's logical framework, unaffected by specific business constant data. After node filtering, a skeleton fingerprint of the structured query language is finally generated. This skeleton fingerprint represents the query's grammatical pattern and can be used as a retrieval index to interface with the in-memory rule pool for matching corresponding dialect conversion candidate rules.

[0036] Step 302: Using the skeleton fingerprint as an index, query whether there are candidate transformation rules in the memory rule pool that match the skeleton fingerprint.

[0037] Step 303: If there is no candidate transformation rule matching the skeleton fingerprint in the memory rule pool, it is determined that the current structured query language is outside the processing range of the rule pool, and the structured query language text, context environment variables and pre-acquired metadata information are input into the large language model for inference.

[0038] Step 304: If there is a candidate transformation rule in the memory rule pool that matches the skeleton fingerprint, extract the context dependency declaration from the candidate transformation rule, and use the context condition set in the context dependency declaration as the query term to query the context environment variable of the current database session to obtain the actual state value of the current database session on each condition in the context condition set; wherein, the context dependency declaration contains the set of context conditions that the candidate transformation rule needs to satisfy to take effect.

[0039] In this step, after generating the skeleton fingerprint of the structured query language, this skeleton fingerprint is used as a retrieval index to initiate a query matching operation on the local in-memory rule pool to check if there are any candidate conversion rules corresponding to the current skeleton fingerprint. The in-memory rule pool stores various dialect conversion rules that have been accumulated and iteratively updated, and all rules use the query skeleton fingerprint as the association identifier. When the in-memory rule pool is searched using the skeleton fingerprint as the index and no matching candidate conversion rule is found, it is determined that the current structured query language is outside the processing coverage of the rule pool. Then, the structured query language text, the context environment variables of the current session, and the pre-acquired metadata information are assembled together and input into the large language model for inference operations. The dialect conversion is completed by leveraging the generalization inference capability of the large model. If the in-memory rule pool successfully matches a candidate conversion rule with the skeleton fingerprint, the conversion is successful. Instead of directly rewriting the abstract syntax tree, it extracts the context dependency declaration from the candidate transformation rule. This declaration records the set of context conditions that the transformation rule must meet to take effect. The set of context conditions in the context dependency declaration is used as the query term to read the corresponding context environment variables from the current database session. This allows the current database session to obtain the actual state value corresponding to each condition in the set of conditions. This step is used to avoid the defects caused by relying solely on SQL syntax skeleton matching. Some dialect conversion logic is highly dependent on the session runtime environment. Even if the query statement skeleton is consistent, applying the transformation rule will still produce translation errors if the session state does not meet the requirements. Only when the actual state of the current session fully meets the constraints of the context condition set is it allowed to call the candidate transformation rule to rewrite the source abstract syntax tree.

[0040] Step 40: If the actual state of the current session satisfies the context dependency requirements declared in the candidate transformation rules, then the source abstract syntax tree is rewritten based on the candidate transformation rules to generate the target abstract syntax tree, and the target abstract syntax tree is parsed in reverse to generate the target structured query language statement.

[0041] As an optional implementation, if the actual state of the current session satisfies the context dependency requirements declared in the candidate transformation rules, the source abstract syntax tree is rewritten based on the candidate transformation rules to generate the target abstract syntax tree, and the target abstract syntax tree is reverse parsed to generate the target structured query language statement. Specifically, this may include: Step 401: If the actual state of the current database session fails to fully satisfy all context conditions in the context dependency declaration, it is determined that the candidate transformation rules are not applicable to the context environment of the current database session, and the structured query language text, context environment variables, and pre-acquired metadata information are input into the large language model for inference.

[0042] In this step, after completing the context condition query of the candidate transformation rule, the actual state obtained by the database session is compared with all the context conditions in the context dependency declaration. If the actual state of the current database session cannot fully satisfy all the context conditions in the context dependency declaration, it is determined that the candidate transformation rule is not applicable to the context environment of the current database session. Even if the skeleton fingerprint has been successfully matched, the rule cannot be used to complete the abstract syntax tree rewriting. At this time, the structured query language will be determined as a query that the rule pool cannot handle. The structured query language text, the context environment variables corresponding to the current session, and the pre-collected metadata information are input into the large language model to carry out inference. The dialect conversion work is completed through the dynamic inference capability of the large model.

[0043] Step 402: If the actual state of the current database session fully satisfies all the context conditions in the context dependency declaration, then the candidate transformation rule is determined to be applicable to the context environment of the current database session, and the source abstract syntax tree is rewritten based on the transformation actions defined in the candidate transformation rule to generate the target abstract syntax tree.

[0044] In this step, if the actual state of the current database session can fully satisfy all the context conditions contained in the context dependency declaration, then the candidate transformation rule is determined to be suitable for the context environment of the current database session, and the rule can be enabled to carry out dialect transformation. The predefined transformation actions within the candidate transformation rule are read, and a memory-level structural rewrite operation is performed on the source abstract syntax tree based on these actions. The rewrite process includes adjusting syntax nodes, changing parameter arrangement, and injecting session dynamic variables, modifying, replacing, or deleting nodes in the source abstract syntax tree, thereby generating a target abstract syntax tree that adapts to the target database syntax specification. After generating the target abstract syntax tree, a reverse parsing process is performed on the syntax tree to output the corresponding target structured query language text. Simultaneously, the transformation result is also written to the AST cache for easy reuse in subsequent queries with the same conditions, reducing the performance overhead caused by repeated parsing and rewriting.

[0045] Step 403: Perform a depth-first traversal of the target abstract syntax tree and map each syntax node in the target abstract syntax tree to a text fragment corresponding to the dialect of the target database based on the syntax rules of the target database.

[0046] In this step, after obtaining the target abstract syntax tree adapted to the target database, a depth-first traversal is performed on the syntax tree, visiting all syntax nodes within the tree structure layer by layer. During the traversal, the syntax rules of the target database are referenced, and each syntax node is mapped to a text fragment corresponding to the dialect of the target database. Different types of syntax nodes will generate corresponding text according to the dialect syntax rules. The hierarchical relationship and logical connection between nodes will also be preserved during the text fragment splicing process to ensure that the original business semantics of the query will not be deviated. The text fragments generated by each node are spliced ​​in order according to the traversal order to complete the reverse parsing process of the abstract syntax tree, and finally assembled into a complete target structured query language text.

[0047] Step 404: If an unmapped dialect-specific structure is detected, the current anti-parsing process is paused, and the grammar node containing the unmapped dialect-specific structure is marked as a node to be processed, so as to trigger the node to be processed to re-enter the large language model for inference.

[0048] Step 405: If no unmapped dialect-specific structures are detected, continue traversing until all syntax nodes are mapped, and then concatenate all the text fragments generated by the mapping according to the structural hierarchy of the target abstract syntax tree to generate the target structured query language statement.

[0049] In this step, during the depth-first traversal of the target abstract syntax tree and the reverse parsing of syntax node mapping, various dialect-specific structures in the nodes are simultaneously identified. Once a dialect-specific structure that cannot be mapped is detected, the ongoing reverse parsing process is paused, and the syntax node carrying this type of dialect-specific structure is marked as a pending node. This pending node is then sent to the large language model for inference, and the generalization ability of the large model is used to complete the dialect conversion processing of this part of the dialect-specific syntax. If no unmapped dialect-specific structures are detected during the traversal, the depth-first traversal continues until the mapping conversion of all syntax nodes is completed. All text fragments obtained from the mapping of each node are then sequentially assembled in strict accordance with the inherent structural hierarchy and logical relationships of the target abstract syntax tree to fully restore the business semantics of the query. Finally, a complete target structured query language statement is generated. This statement can directly enter the subsequent query translation and execution stage and be sent to the target database for execution. At the same time, the conversion result is written to the abstract syntax tree cache for subsequent similar requests to be directly reused, reducing the overhead of repeated parsing.

[0050] Step 50: Input the structured query language text, context environment variables, and pre-acquired metadata information into the large language model for inference to obtain the preliminary conversion result output by the large language model. Perform sandbox syntax verification on the preliminary conversion result, send the target structured query language statement that passes the verification to the target database for execution, and return the execution result to the application layer.

[0051] As an optional embodiment, the structured query language text, context environment variables, and pre-acquired metadata information are input into a large language model for reasoning to obtain a preliminary conversion result output by the large language model. The preliminary conversion result is then subjected to sandbox syntax validation. The target structured query language statement that passes the validation is sent to the target database for execution, and the execution result is returned to the application layer. Specifically, this may include: Step 501: Assembling the structured query language text, context environment variables, and metadata information according to a preset prompt word template to generate a full set of prompt words containing a complete translation context. The full set of prompt words is then input into the large language model for thought chain reasoning so that the large language model generates a preliminary conversion result that conforms to the grammatical specifications of the target database.

[0052] In this step, when the large model translation process is triggered, the structured query language text to be processed, the context environment variables corresponding to the current session, and the pre-collected metadata information are obtained. The above-mentioned information is assembled according to the preset prompt word template to generate a full set of prompt words carrying complete translation context. This prompt word integrates the SQL statement, session runtime environment, and database table metadata, providing the large model with all the references required for translation and avoiding semantic understanding bias caused by missing information. Subsequently, the assembled full set of prompt words is sent to the large language model, guiding the large model to perform step-by-step derivation based on all the input context information, and outputting preliminary conversion results that adapt to the target database syntax specifications.

[0053] Step 502: Perform offline syntax checking on the preliminary conversion results to verify whether the preliminary conversion results conform to the syntax specifications of the target database.

[0054] In this step, after the large language model outputs the initial conversion result through thought chain reasoning, it does not directly deliver the result to the target database for execution. Instead, it enters the sandbox in memory to conduct offline syntax checking. This checking process does not interact with the real business database and completes offline verification through the target database's native parser, comprehensively verifying the grammatical validity of the initial conversion result. The checking process parses the statement structure of the initial conversion result, checks whether the syntax format, function usage, and statement logic of the statement conform to the syntax specifications of the target database, identifies various syntax defects caused by the illusion of the large model, and outputs the corresponding verification conclusions. At the same time, the corresponding error information can be extracted for subsequent process judgment.

[0055] Step 503: If the offline syntax check passes, the preliminary conversion result is determined as the target structured query language statement.

[0056] Step 504: If the offline syntax check fails, extract the error code and error log from the offline syntax check result, and accumulate the number of failed checks.

[0057] In this step, if the offline syntax check passes successfully, it means that the initial conversion result output by the large model conforms to the syntax constraints of the target database. At this time, the initial conversion result is directly identified as the target structured query language statement, and the subsequent rule distillation and forwarding process can proceed. If the offline syntax check fails, it means that there is a syntax problem in the initial conversion result, which is an output defect caused by the illusion of the large model. In this case, the corresponding error code and error log are extracted from the return result of the offline syntax check, and the specific reason for the failure of this syntax check is fully recorded. At the same time, the number of failures of this check is accumulated. The extracted error code and error log are re-encapsulated into prompt information and sent back to the large language model, driving the large model to reflect and correct based on the error information and regenerate the conversion result.

[0058] Step 505: Reassemble the error code and error log into a correction prompt, and re-input the correction prompt into the large language model for inference retry until the offline syntax check passes.

[0059] In this step, after obtaining the error codes and error logs from the offline syntax check, the above fault information is reassembled to generate correction prompts. The failed conversion statement, the detected error codes, and the error logs are all included in the prompts, clearly informing the large language model of the syntax problems in the previous conversion result. The correction prompts are then sent back to the large language model to trigger a new round of inference retry, guiding the large model to review the inference defects of the previous round based on the error information, correct the conversion logic, and re-output the conversion result. The newly generated conversion result of the large model still needs to be sent to the offline syntax check stage for syntax compliance verification, repeating the closed-loop process of inference verification. If the new round of offline syntax check still fails, the error information is extracted again, and the correction prompts are reassembled for retry. This reflection and retry loop continues until the offline syntax check determines that the conversion result is grammatically compliant, at which point the retry process will terminate. The statement that passes the verification is identified as the target structured query language statement and transferred to the subsequent rule distillation and execution stages.

[0060] Step 506: After converting the detected abstract syntax tree features into new transformation rules, inject them into the memory rule pool, and send the target structured query language statement to the target database for execution to obtain the execution results and return them to the application layer.

[0061] In this step, after passing offline syntax checking and verification, the abstract syntax tree features corresponding to the current valid conversion result are extracted, transformed into new conversion rules, and injected into the online in-memory rule pool. This realizes the accumulation of large model translation experience into a high-speed rule link, so that subsequent similar queries can directly call the rule to complete fast dialect conversion without repeatedly calling the large model for inference. After the rule accumulation is completed, the target structured query language statement is sent to the target database for execution. The target database completes the query operation and returns the corresponding execution result. After receiving the execution result returned by the database side, the gateway performs heterogeneous conversion of data type and result set, re-encapsulates the returned data at the protocol level, and sends the processed result back according to the source database protocol format, returning it to the upper-layer business application layer through the original path, completing a complete SQL request processing loop.

[0062] The above are embodiments of the method proposed in this application. Based on the same inventive concept, embodiments of this application also provide a database dialect conversion device for an AST rule pool, the structure of which is as follows: Figure 2 As shown.

[0063] Figure 2 This is a schematic diagram of the internal structure of a database dialect conversion device for an AST rule pool, provided as an embodiment of this application. Figure 2 As shown, the device includes: At least one processor 201; And a memory 202 that is communicatively connected to at least one processor; The memory 202 stores instructions executable by at least one processor. These instructions are executed by at least one processor 201 to enable the processor 201 to: parse the raw Structured Query Language (SCL) statement sent from the application layer to the source database to extract the SCL text and monitor the context environment variables of the current database session; use the SCL text and context environment variables as a joint index to query whether a corresponding converted target SCL statement exists in the abstract syntax tree (API) cache, and perform lexical and syntactic parsing on the SCL text that is not found in the cache to generate a source API; generalize the source API to extract the skeleton fingerprint of the SCL, and use the skeleton fingerprint as... The system indexes and queries the memory rule pool to determine if a matching candidate transformation rule exists, thus retrieving the current session's true state. If the current session's true state satisfies the context dependency requirements declared in the candidate transformation rule, the source abstract syntax tree is rewritten based on the candidate transformation rule to generate the target abstract syntax tree. The target abstract syntax tree is then de-parsed to generate the target structured query language statement. The structured query language text, context environment variables, and pre-acquired metadata information are input into the large language model for inference to obtain the preliminary transformation result output by the large language model. The preliminary transformation result is then subjected to sandbox syntax validation. The target structured query language statement that passes the validation is sent to the target database for execution, and the execution result is returned to the application layer.

[0064] Some embodiments of this application provide corresponding to Figure 1A non-volatile computer storage medium for database dialect conversion using an AST rule pool stores computer-executable instructions. These instructions are configured to: parse the raw Structured Query Language (SCL) statement sent from the application layer to the source database to extract the SCL text, and monitor the context environment variables of the current database session; use the SCL text and context environment variables as a joint index to query whether a corresponding converted target SCL statement exists in the Abstract Syntax Tree (AST) cache, and perform lexical and syntactic parsing on the SCL text that is not found in the cache to generate a source AST; and generalize the source AST to extract the skeleton fingerprint of the SCL, using the skeleton fingerprint as an index. The system queries the memory rule pool to determine if there are matching candidate transformation rules to query the current session's actual state. If the current session's actual state satisfies the context dependency requirements declared in the candidate transformation rules, the source abstract syntax tree is rewritten based on the candidate transformation rules to generate the target abstract syntax tree. The target abstract syntax tree is then de-parsed to generate the target structured query language statement. The structured query language text, context environment variables, and pre-acquired metadata information are input into the large language model for inference to obtain the preliminary transformation results output by the large language model. The preliminary transformation results are then subjected to sandbox syntax validation. The target structured query language statement that passes the validation is sent to the target database for execution, and the execution result is returned to the application layer.

[0065] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments for IoT devices and media are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0066] The systems, media, and methods provided in this application are one-to-one correspondences. Therefore, the systems and media also have similar beneficial technical effects as their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the systems and media will not be repeated here.

[0067] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0068] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0069] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0070] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0071] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0072] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0073] Computer-readable media include both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0074] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0075] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A database dialect conversion method using an AST rule pool, characterized in that, The method includes: The raw Structured Query Language (SCL) statements sent from the application layer to the source database are parsed to extract the SCL text, and the context environment variables of the current database session are monitored. Using the structured query language text and the context environment variable as a joint index, query whether there is a corresponding converted target structured query language statement in the abstract syntax tree cache, and perform lexical and syntactic parsing on the structured query language text that is not found in the cache to generate the source abstract syntax tree; The source abstract syntax tree is generalized to extract the skeleton fingerprint of the structured query language, and the skeleton fingerprint is used as an index to query whether there are matching candidate transformation rules in the memory rule pool in order to query the real state of the current session. If the actual state of the current session satisfies the context dependency requirements declared in the candidate transformation rules, the source abstract syntax tree is rewritten based on the candidate transformation rules to generate the target abstract syntax tree, and the target abstract syntax tree is parsed in reverse to generate the target structured query language statement. The structured query language text, the context environment variables, and the pre-acquired metadata information are input into the large language model for inference to obtain the preliminary conversion result output by the large language model. The preliminary conversion result is then subjected to sandbox syntax verification. The target structured query language statement that passes the verification is sent to the target database for execution, and the execution result is returned to the application layer.

2. The database dialect conversion method for an AST rule pool according to claim 1, characterized in that, The raw Structured Query Language (SCL) statements sent from the application layer to the source database are parsed to extract the SCL text, and the context environment variables of the current database session are monitored, specifically including: The network packets sent from the application layer to the source database are intercepted, and the structured query language instructions and database session control instructions are parsed from the network packets. The structured query language text is extracted from the structured query language instructions, and context change parameters are extracted from the database session control instructions to update the currently maintained session context state vector; wherein, the context change parameters include environment variable update values ​​and / or transaction isolation level change values ​​and / or character set switching identifiers and / or time zone adjustment values.

3. The database dialect conversion method for an AST rule pool according to claim 1, characterized in that, Using the structured query language text and the context environment variable as a joint index, the system queries whether a corresponding converted target structured query language statement exists in the abstract syntax tree cache. Then, it performs lexical and syntactic analysis on the structured query language text that does not appear in the cache to generate a source abstract syntax tree. Specifically, this includes: The structured query language text is normalized to generate standardized query text, and the standardized query text and the context environment variable are jointly hashed to generate a cached query primary key. If a cache entry matching the cache query primary key exists in the abstract syntax tree cache, the converted target structured query language statement is read from the cache entry, and the execution phase of the target database is directly initiated. If there is no cache entry in the abstract syntax tree cache that matches the cache query primary key, then the structured query language text is lexically parsed to generate a sequence of lexical units, and the sequence of lexical units is parsed to construct a memory-level abstract syntax tree for the structured query language text.

4. The database dialect conversion method for an AST rule pool according to claim 1, characterized in that, The source abstract syntax tree is generalized to extract the skeleton fingerprint of the structured query language. Using this skeleton fingerprint as an index, a query is performed to check if a matching candidate transformation rule exists in the in-memory rule pool, thus querying the current session's true state. Specifically, this includes: A depth-first traversal is performed on the source abstract syntax tree. During the traversal, literal constant nodes in the source abstract syntax tree are identified and stripped, while syntactic structure nodes and keyword nodes in the source abstract syntax tree are retained to generate the skeleton fingerprint of the structured query language. Using the skeleton fingerprint as an index, query whether there is a candidate transformation rule in the memory rule pool that matches the skeleton fingerprint; If there is no candidate transformation rule matching the skeleton fingerprint in the memory rule pool, it is determined that the current structured query language is outside the processing range of the rule pool, and the structured query language text, the context environment variables, and the pre-acquired metadata information are input into the large language model for inference; If a candidate transformation rule matching the skeleton fingerprint exists in the memory rule pool, then a context dependency declaration is extracted from the candidate transformation rule, and a query is initiated to the context environment variable of the current database session using the context condition set in the context dependency declaration as the query term to obtain the actual state value of the current database session on each condition in the context condition set; wherein, the context dependency declaration contains the set of context conditions that the candidate transformation rule needs to satisfy to take effect.

5. The database dialect conversion method for an AST rule pool according to claim 1, characterized in that, If the actual state of the current session satisfies the context dependency requirements declared in the candidate transformation rules, then the source abstract syntax tree is structurally rewritten based on the candidate transformation rules to generate the target abstract syntax tree, specifically including: If the actual state of the current database session fails to fully satisfy all the context conditions in the context dependency declaration, then it is determined that the candidate transformation rule is not applicable to the context environment of the current database session, and the structured query language text, the context environment variables, and the pre-acquired metadata information are input into the large language model for inference; If the actual state of the current database session fully satisfies all the context conditions in the context dependency declaration, then the candidate transformation rule is determined to be applicable to the context environment of the current database session, and the source abstract syntax tree is rewritten based on the transformation actions defined in the candidate transformation rule to generate the target abstract syntax tree.

6. The database dialect conversion method for an AST rule pool according to claim 1, characterized in that, The target abstract syntax tree is de-parsed to generate the target structured query language statement, specifically including: A depth-first traversal is performed on the target abstract syntax tree, and each syntax node in the target abstract syntax tree is mapped to a text fragment corresponding to the dialect of the target database based on the syntax rules of the target database. If an unmapped dialect-specific structure is detected, the current anti-parsing process is paused, and the grammar node containing the unmapped dialect-specific structure is marked as a node to be processed, so as to trigger the node to be processed to re-enter the large language model for inference. If no unmapped dialect-specific structures are detected, the traversal continues until all syntax nodes are mapped, and all text fragments generated by the mapping are concatenated according to the structural hierarchy of the target abstract syntax tree to generate the target structured query language statement.

7. The database dialect conversion method for an AST rule pool according to claim 1, characterized in that, The structured query language text, the context environment variables, and the pre-acquired metadata information are input into the large language model for inference to obtain the preliminary conversion results output by the large language model, specifically including: The structured query language text, the context environment variables, and the metadata information are assembled according to a preset prompt word template to generate a full set of prompt words containing complete translation context. The full set of prompt words is then input into the large language model for thought chain reasoning, so that the large language model generates a preliminary conversion result that conforms to the grammatical specifications of the target database.

8. The database dialect conversion method for an AST rule pool according to claim 1, characterized in that, The preliminary conversion result is subjected to sandbox syntax validation. The validated target structured query language statement is then sent to the target database for execution, and the execution result is returned to the application layer. Specifically, this includes: Offline syntax checking is performed on the preliminary conversion results to verify whether the preliminary conversion results conform to the syntax specifications of the target database; If the offline syntax check passes, the preliminary conversion result is determined as the target structured query language statement; If the offline syntax check fails, the error code and error log are extracted from the return result of the offline syntax check, and the number of failed checks is accumulated. The error code and the error log are reassembled into a correction prompt word, and the correction prompt word is re-input into the large language model for inference retry until the offline syntax check passes; After the detected abstract syntax tree features are transformed into new transformation rules, they are injected into the memory rule pool, and the target structured query language statement is sent to the target database for execution to obtain the execution result and return it to the application layer.

9. A database dialect conversion device for an AST rule pool, characterized in that, The device includes: At least one processor; And, a memory communicatively connected to the at least one processor; The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform a method as described in any one of claims 1-8.

10. A non-volatile computer storage medium for AST rule pool database dialect conversion, storing computer-executable instructions, characterized in that, When the computer-executable instructions are executed, they implement a method as described in any one of claims 1-8.