SQL execution method and apparatus

CN122554560APending Publication Date: 2026-08-11CHINA UNICOM SMART CONNECTION TECH LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-11
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

但是,解析组件的解析效率较低

Benefits of technology

[0017]另一方面,本发明实施例提供了一种计算机存储介质,所述计算机存储介质包括存储的计算机程序,其中,在所述计算机程序运行时控制所述计算机存储介质所在设备执行上述所述的方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122554560A_ABST
    Figure CN122554560A_ABST
Patent Text Reader

Abstract

This invention provides an SQL execution method and device. The method includes: receiving a business request carrying a business number; obtaining an SQL configuration corresponding to the business number; parsing the business request and the SQL configuration using a dual-parser parsing component to generate parsed SQL; the dual parsers having a collaborative mechanism of cache sharing, unified parameter mapping, and integrated SQL injection protection; and executing the parsed SQL through an SQL executor. This invention improves the parsing efficiency of the parsing component by employing a parsing component with a dual-parser collaborative mechanism of cache sharing, unified parameter mapping, and integrated SQL injection protection to parse the SQL configuration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to an SQL execution method and device. Background Technology

[0002] After receiving a business request, the application server retrieves the corresponding SQL (Structured Query Language) configuration (also referred to as the SQL configuration template in this article) based on the business ID carried in the request. It then parses the SQL configuration using a parsing component and executes the parsed SQL. However, the parsing efficiency of this component is relatively low. Summary of the Invention

[0003] In view of this, embodiments of the present invention provide an SQL execution method and device. By employing a parsing component with a dual-parser collaborative mechanism that integrates cache sharing, unified parameter mapping, and SQL injection protection to parse SQL configuration, the parsing efficiency of the parsing component can be improved.

[0004] In a first aspect, embodiments of the present invention provide an SQL execution method, the method comprising: Receive a service request, the service request carrying a service number; Retrieve the SQL configuration corresponding to the business number; A dual-parser parsing component parses the business request and the SQL configuration to generate parsed SQL; the dual parsers have a collaborative mechanism that integrates cache sharing, unified parameter mapping, and SQL injection protection. The parsed SQL is executed by the SQL executor.

[0005] Optionally, obtaining the SQL configuration corresponding to the business number based on the business number includes: Based on the business number, retrieve the SQL configuration corresponding to the business number from the local cache; If the retrieval fails from the local cache, the SQL configuration corresponding to the business number is retrieved from the distributed cache. When the retrieval from the distributed cache fails, the SQL configuration corresponding to the business number is retrieved from the operation and maintenance service node. The operation and maintenance service node includes a visual audit and monitoring platform, which has functions such as SQL configuration management, syntax verification, performance analysis, and slow query alarms.

[0006] Optionally, after obtaining the SQL configuration corresponding to the business number from the operation and maintenance service node, the method further includes: Write the SQL configuration to the cache.

[0007] Optionally, the SQL configuration includes: SQL body configuration and SQL condition configuration; The SQL main configuration includes the business number, SQL prefix, SQL main, SQL suffix, SQL type, and effective status; The SQL condition configuration includes the defined condition rules.

[0008] Optionally, the SQL condition configuration supports parameterized placeholders and dynamic concatenation of conditions.

[0009] Optionally, the operation and maintenance service node includes: an SQL configuration table corresponding to the service number; the SQL configuration table contains all versions of the SQL configuration; each version contains the current version number, the SQL configuration, and the modification time.

[0010] Optionally, the operation and maintenance service node further includes: information on all modification operations of the SQL configuration, including adding, modifying, or rolling back.

[0011] Optionally, the dual parser includes an object parser and a service number parser.

[0012] Optionally, the parsing component employing dual parsers parses the business request and the SQL configuration, including: The object resolver is used to parse all input parameters of the business request based on Java reflection. The business number parser uses a rule engine to parse the conditional rules and all input parameters in the SQL configuration, and automatically matches the SQL configuration with the SQL parameters by parameter name or parameter order.

[0013] Optionally, executing the parsed SQL through the SQL executor includes: The parsed SQL is executed using a standard JDBC or connection pool via an SQL executor.

[0014] Optionally, it also includes: Receive configuration change notifications sent by the operation and maintenance service nodes, wherein the configuration change notifications include the service number and version number; According to the configuration change notification, delete the SQL configuration corresponding to the business number from the local cache; Obtain the SQL configuration corresponding to the business number and the version number from the operation and maintenance service node.

[0015] Optionally, it also includes: If the cache time of the SQL configuration in the local cache is greater than the first duration, check whether the version of the cached SQL configuration is consistent with the currently effective version of the SQL configuration in the operation and maintenance service node; If inconsistent, delete the cached SQL configuration; Obtain the current effective version of the SQL configuration from the operation and maintenance service node.

[0016] On the other hand, embodiments of the present invention provide a device including a memory and a processor, wherein the memory is used to store information including program instructions, and the processor is used to control the execution of the program instructions, wherein the program instructions, when loaded and executed by the processor, implement the steps of the method described above.

[0017] On the other hand, embodiments of the present invention provide a computer storage medium, the computer storage medium including a stored computer program, wherein the computer program controls the device where the computer storage medium is located to execute the method described above when it is running.

[0018] On the other hand, embodiments of the present invention provide a computer program product, the computer program product including a stored computer program, wherein, when the computer program is running, it controls the device where the computer program product is located to execute the method described above.

[0019] The technical solution of the SQL execution method and device provided in this invention includes: receiving a business request carrying a business number; obtaining an SQL configuration corresponding to the business number; parsing the business request and the SQL configuration using a dual-parser parsing component to generate parsed SQL; the dual parsers having a collaborative mechanism of cache sharing, unified parameter mapping, and integrated SQL injection protection; and executing the parsed SQL through an SQL executor. This invention improves the parsing efficiency of the parsing component by using a parsing component with a dual-parser collaborative mechanism of cache sharing, unified parameter mapping, and integrated SQL injection protection to parse the SQL configuration. Attached Figure Description

[0020] Figure 1 A flowchart of an SQL execution method provided in an embodiment of the present invention; Figure 2 This is an architecture diagram of the SQL execution system in an embodiment of the present invention; Figure 3 for Figure 1 The flowchart shows how to retrieve the SQL configuration corresponding to a business number based on the business number. Figure 4 for Figure 1The parsing component employs a dual parser to parse business requests and SQL configurations, generating a flowchart of the parsed SQL. Figure 5 This is a schematic diagram of the structure of an SQL execution device according to an embodiment of the present invention; Figure 6 This is a schematic diagram of a device provided in an embodiment of the present invention. Detailed Implementation

[0021] To better understand the technical solution of the present invention, the embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0022] It should be understood that the described embodiments are merely some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

[0023] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to limit the invention. The singular forms “a,” “the,” and “the” as used in the embodiments of this invention and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0024] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0025] First, the technical terms involved in the embodiments of the present invention are explained as follows: 1) Mybatis / Mybatis-plus: SQL mapping is configured using XML (eXtensible Markup Language) or annotations. Developers need to write SQL statements or use condition constructors, while the framework handles parameter binding and result mapping. Mybatis-plus provides a general CRUD (Create, Read, Update, Delete) interface on top of Mybatis, reducing the amount of basic code.

[0026] 2) Hibernate: A fully automatic ORM (Object-Relational Mapping) framework that generates SQL statements by configuring mapping relationships through entity class annotations or XML, and supports HQL (Hibernate Query Language) for querying.

[0027] 3) Spring JdbcTemplate: A lightweight template tool that encapsulates JDBC (Java Database Connectivity) operations. SQL statements need to be written manually, but connection management and exceptions are handled.

[0028] In a microservice architecture, the implementation of the DAL (Data Access Layer) typically relies on open-source ORM or SQL mapping frameworks, such as Mybatis (and its enhanced version Mybatis-plus), Hibernate, and SpringJdbcTemplate. The core purpose of these frameworks is to simplify database operations, implement the mapping between Java objects and database tables, or directly execute SQL statements.

[0029] With the popularization of AI (Artificial Intelligence) generative coding technology, developers' coding efficiency has increased by 3 to 10 times. However, AI generative coding only solves the problem of "code generation speed" and does not change the underlying architectural logic of related frameworks. The common problems of the aforementioned traditional frameworks are further amplified in the AI ​​era. The inability to achieve centralized management, dynamic updates, compliance auditing, and production security protection of SQL leads to a simultaneous increase in operational complexity, auditing difficulty, and production risks, making it still difficult to adapt to the rapidly iterating business needs under a microservice architecture.

[0030] While the relevant frameworks have solved some database operation problems, they have the following inherent drawbacks: (1) High learning cost and configuration complexity: For example, Hibernate requires mastering entity mapping, caching strategies and HQL syntax; Mybatis' XML configuration is cumbersome and complex SQL requires code concatenation, which significantly increases the development burden and the probability of errors.

[0031] (2) SQL and code coupling: SQL statements are directly written into Java code or XML files, resulting in tight coupling between business logic and data access layer. This affects code readability, and SQL changes require redeployment of the application, which cannot take effect in real time, resulting in low efficiency in integration testing, production or other environments.

[0032] Lack of visualization and auditing support: SQL queries are scattered throughout the code, making it difficult for DBAs (database administrators) to centrally review and optimize them. Slow log analysis requires extraction from log files, lacking a graphical interface for real-time monitoring and statistical analysis.

[0033] (3) Limited support for dynamic SQL: Related frameworks (such as Mybatis’ dynamic SQL function) only support condition-based SQL concatenation, but cannot dynamically modify the SQL structure at runtime (such as adding new conditions or connecting tables), and the application needs to be restarted after modification, which violates the agility principle of microservices.

[0034] (4) Lack of visual auditing and monitoring support: SQL logic is scattered in code or configuration files, making it difficult for DBAs (Database Administrators) to conduct centralized review; slow query analysis requires extracting relevant data from massive log files, lacking a graphical interface for real-time statistics, alarms and optimization suggestions, resulting in low operation and maintenance efficiency.

[0035] These shortcomings lead to low development efficiency and high operation and maintenance costs, severely restricting the rapid iteration capability of microservice architecture. Meanwhile, on the business application server side, the parsing component has low efficiency in parsing SQL configurations.

[0036] To address the aforementioned technical issues, this invention provides an SQL execution method suitable for scenarios including: structured data access scenarios under a microservice architecture, particularly applicable to systems with frequent changes in business rules, frequent SQL optimization, and multi-team collaboration (development + DBA); supporting CRUD operations and complex query scenarios in relational databases (MySQL, PostgreSQL, etc.); and adaptable to e-commerce, ToB, and other business domains requiring rapid iteration and centralized auditing.

[0037] Figure 1 A flowchart of an SQL execution method provided in an embodiment of the present invention is shown below. Figure 1 As shown, the method includes steps 101-104.

[0038] Step 101: Receive a service request, which carries a service number.

[0039] For example, Figure 2 This is an architecture diagram of the SQL execution system in an embodiment of the present invention, such as... Figure 2 As shown, the SQL execution system includes a parsing component, a configuration system, and a database. The SQL execution system uses a microservice-adapted distributed architecture, employing a component-based, layered deployment model, with all components deployed on servers / cloud hosts / container clusters. The deployment locations of each component and their corresponding user roles are as follows: 1. Configuration System (including visual configuration and monitoring platform): Deployed independently on the operation and maintenance service node (also referred to as the configuration system service node in this article, such as cloud host / server / K8s container). The core users are DBAs, operation and maintenance personnel, and backend developers, who are responsible for SQL configuration, review, version management, audit and monitoring.

[0040] 2. Parsing components and SQL executors: These are embedded in business microservice nodes (such as business application servers / containers) in the form of SDKs (Software Development Kits) / dependency packages. They are deployed in the same process as the business applications, and run automatically without human intervention. Developers are only responsible for business integration.

[0041] 3. Database: Deployed independently on a database server / cloud database. The core management user is the DBA, who is responsible for data storage, index optimization, and database operation and maintenance.

[0042] In this embodiment of the invention, each step is executed by a device, which may specifically be a business microservice node.

[0043] For example, business requests are uniformly received by the interface layer (Controller layer) of the business microservice via HTTP (Hypertext Transfer Protocol) requests, and the sources include front-end page requests, open API interfaces, internal calls of other microservices, scheduled tasks, and asynchronously triggered requests from message queues.

[0044] For example, the core components of an order pagination query request include: 1. Business request parameters (params): including query conditions, field parameters, time range, amount range, data permissions, sorting rules, etc.; 2. Extended optional parameters: pagination parameters, data permission set, custom sorting fields, etc.

[0045] For example, the business number is globally unique and manually predefined. The specified process includes: 1. Configuration phase: When DBAs / developers create SQL configurations on the visual configuration platform, they define a unique business number for the current business scenario (user query, order query, transaction reconciliation, etc.) and permanently bind it to this set of SQL rules; 2. Development phase: Developers bind the corresponding business scenario with the preset business number in the business interface code; 3. Runtime phase: Business requests automatically carry the bound business number to match the corresponding SQL configuration, without the need for dynamic generation.

[0046] The business ID and the corresponding SQL configuration template for each business scenario have a strict one-to-one correspondence, forming a permanent binding. The business ID is not generated at request time, but rather is predefined manually and globally uniquely generated when the SQL configuration is created in the configuration system. One business ID corresponds to a fixed set of business SQL rules. The same business ID can correspond to multiple historical versions of SQL configurations (e.g., generated through iterative modifications or rollbacks), but it always corresponds to the same business scenario and will not be reused across scenarios. The business ID carried in the business request is only used for precise matching of the pre-created SQL configuration template, enabling dynamic parsing and execution.

[0047] The configuration system incorporates a built-in end-to-end SQL release review mechanism. Manual configuration operations (SQL creation, modification, version release, and review) are performed by DBAs / developers on the configuration system service node; these are manual operations, and the users are developers and DBAs. The specific process is as follows: 1. After modifying / creating the SQL configuration, the configuration personnel submit a release review application; 2. The system automatically completes SQL syntax validation and performance pre-testing; 3. DBAs / reviewers verify the SQL logic, execution performance, and business compliance through a visual interface; 4. If the review is passed, the system officially releases the configuration, generates a new version, and pushes the update; if the review is rejected, the system returns the configuration to be edited. This embodiment of the invention deeply integrates SQL syntax validation, performance analysis, slow query prediction, cache hot updates, audit traceability, and release review, forming a closed loop for the entire SQL lifecycle management, an integrated innovation not found in related technologies.

[0048] Step 102: Obtain the SQL configuration corresponding to the business number.

[0049] In some possible embodiments, such as Figure 3 As shown, step 102 includes: steps 1021-1023.

[0050] Step 1021: Based on the business number, retrieve the SQL configuration corresponding to the business number from the local cache.

[0051] Step 1022: If retrieving from the local cache fails, retrieve the SQL configuration corresponding to the business number from the distributed cache.

[0052] Step 1023: If the retrieval from the distributed cache fails, retrieve the SQL configuration corresponding to the business number from the operation and maintenance service node. The operation and maintenance service node includes a visual audit and monitoring platform, which has functions such as SQL configuration management, syntax verification, performance analysis, and slow query alerts.

[0053] In this embodiment of the invention, the business microservice nodes adopt a two-level cache + origin retrieval mechanism to accurately obtain SQL configurations based on the business ID, resulting in an efficient and stable process. The process prioritizes querying the local cache: using the business ID as the key, it reads the SQL configuration from the frequently accessed cache and uses it directly if a match is found; if the local cache misses, it queries the distributed cache: ensuring configuration consistency across multiple microservice nodes; if all caches miss, it retrieves the configuration from the independent configuration system: querying the complete SQL configuration stored in the database within the configuration system using the business ID.

[0054] For example, after obtaining the SQL configuration corresponding to the business number from the operation and maintenance service node, the SQL configuration is written to the cache. This embodiment of the invention automatically caches the latest fetched SQL configuration to a second-level cache for reuse in subsequent requests, improving parsing efficiency.

[0055] For example, the operation and maintenance service node provides a web (World Wide Web) visual interface for centralized configuration and management of SQL statements and business rules, and supports version control, release review and historical traceability of SQL configuration.

[0056] For example, SQL configuration includes: SQL body configuration and SQL condition configuration.

[0057] For example, the SQL body configuration includes a business number, an SQL prefix (such as a SELECT clause), the SQL body content (also called the SQL body), an SQL suffix (such as ORDER BY), an SQL type (such as SELECT / UPDATE), and an effective status (such as enabled / disabled). Among these, the business number is a unique identifier. The SQL body is the core logic.

[0058] For example, SQL condition configuration includes defined condition rules. These rules may include condition content (e.g., AND status = ?), attribute names (e.g., corresponding Java object fields), mandatory flags (e.g., whether required), type (e.g., string / number), and sorting values.

[0059] For example, SQL condition configuration supports parameterized placeholders (such as ?) and dynamic condition concatenation (such as based on IF-ELSE rules), ensuring that SQL can flexibly adapt to business changes.

[0060] For example, the business ID for a user information query scenario is QUERY_USER, and the SQL body configuration is SELECT. The SQL condition configuration for FROM user WHERE 1=1 includes: attribute name username, type string, mandatory flag as no, and condition content AND username = ?.

[0061] For example, in e-commerce platform order query scenarios, it is necessary to support multi-dimensional dynamic condition combinations (such as order status, payment method, order time range, amount range, user level), and DBAs need to optimize query performance in real time. The configuration system can create SQL configurations with the business number QUERY_ORDER as follows: SQL body configuration: SELECT id, order_no, order_amount, pay_type, status, create_time FROM t_order WHERE 1=1 SQL condition configuration: Attribute name: status, type (string), mandatory flag: no, comparison operator: =, association logic: AND, condition content: AND status = ? Attribute name: createTimeStart; Type: Date; Required flag: No; Comparison operator: >=; Association logic: AND; Condition content: AND create_time>= ? Attribute name: createTimeEnd; Type: Date; Required flag: No; Comparison operator: Logical AND; Condition content: AND create_time <= ? Attribute name: orderAmountMin, Type: numeric, Required flag: NOT, Comparison operator: >, Association logic: AND, Condition content: AND order_amount>? Attribute name: userLevel, type: string, mandatory flag: no, comparison operator: IN, association logic: AND, condition content: AND user_level IN (?) ...... For example, the configuration system in the operations and maintenance service node includes a visual configuration and monitoring platform with a declarative SQL configuration mechanism. Users can break down SQL configurations into structured configurations of prefixes, bodies, suffixes, and conditional rules through a visual interface, completely decoupling them from the code. The configuration system supports SQL release approval, version control, and historical traceability, realizing full lifecycle management of SQL configurations. DBAs can adjust SQL index optimizations through the visual interface without requiring developers to modify the code; configuration changes take effect immediately.

[0062] For example, the configuration system in the operation and maintenance service node includes: an SQL configuration table corresponding to the business number; the SQL configuration table contains all versions of the SQL configuration; each version contains the version number of the current version, the SQL configuration, and the modification time.

[0063] For example, each modification to a SQL configuration generates a unique version number (e.g., in the format YYYYMMDDHHMMSS + random number), which is associated with the modifier, modification time, and modification description. The configuration system stores each version of the SQL configuration completely in the SQL configuration table, supporting queries of historical configurations by business number, version number, and modification time.

[0064] For example, the configuration system supports one-click rollback to a historical version of the SQL configuration. The rollback operation generates a new version record to ensure the integrity of version traceability. After the rollback, the historical version of the SQL configuration takes effect in real time through a cache refresh mechanism.

[0065] Rollback is a standard professional term in configuration management and version control, distinct from database transaction rollback. In this embodiment of the invention, rollback refers to restoring the currently effective SQL configuration to any archived historical version configuration under that business number. Operators select the target historical version and execute a one-click rollback operation; the system sets the historical version configuration as the currently effective version and automatically generates a new version record, recording the rollback action, operator, operation time, and version differences, ensuring full-chain traceability; rollback triggers a cache refresh mechanism, and the historical version SQL configuration takes effect in real time without requiring a service restart. All rollback operations are traceable and tamper-proof, meeting compliance audit requirements.

[0066] For example, the operation and maintenance service node also includes change logs, which include information on all modification operations of the SQL configuration, including additions, modifications, or rollbacks. The configuration system automatically records all modification operations for each SQL configuration, including a comparison of configuration differences before and after the modification, the person who made the modification, the operation time, and other information, and supports exporting audit reports.

[0067] In this embodiment of the invention, the visual configuration and monitoring platform is a core extension module of the configuration system, belonging to the built-in capabilities of the configuration system, and is not an independent component. This module integrates SQL configuration management, online syntax checking, SQL performance statistics, slow query monitoring, anomaly alerts, and execution log analysis functions; it supports DBA visual review and optimization of SQL; DBAs can review SQL and optimize performance in real time without relying on developers to extract SQL, log, and code information, realizing the integration of SQL operation and maintenance, auditing, and performance optimization.

[0068] Step 103: The parsing component of the dual parser is used to parse the business request and SQL configuration to generate the parsed SQL; the dual parser has a collaborative mechanism that integrates cache sharing, parameter mapping, and SQL injection protection.

[0069] For example, the parsing component is based on a dual-parser architecture, which dynamically parses and generates executable SQL based on the parameters of the business request and the information of the SQL configuration. It supports ORM-style automated generation and rule-based dynamic concatenation, and achieves seamless switching through cache sharing, unified parameter mapping, and integrated SQL injection protection.

[0070] For example, the dual resolvers include an object resolver and a business number resolver.

[0071] In some possible embodiments, such as Figure 4 As shown, step 103 includes: step 1031-step 1032.

[0072] Step 1031: Use an object resolver to parse all input parameters of the business request based on Java reflection mechanism.

[0073] Step 1032: Use the business number parser to parse the conditional rules and all input parameters in the SQL configuration based on the rule engine, and automatically match the SQL configuration with the SQL parameters by parameter name or parameter order.

[0074] For example, the object resolver is a SQL auto-generation sub-engine implemented in the parsing component based on Java reflection and custom ORM annotations. It takes Java entity POJO (Plain Old Java Object) objects as input data, and obtains table and field mapping relationships by parsing annotations such as @TableName, @PrimaryKey, @Column, and @JoinTable on the entity class. Combined with reflection metadata caching, parent-child class field inheritance parsing, and automatic field type adaptation, it automatically generates standard INSERT / UPDATE / SELECT / DELETE SQL statements in a parameterized pre-compiled format. It has built-in unified parameter binding and SQL injection protection logic, achieving automated construction of SQL without hard-coded SQL in ORM mode. The core features of the object resolver include: caching reflection metadata (reducing the overhead of repeated reflection), support for parent class attribute inheritance (such as the createTime field in BaseEntity), automatic type conversion (such as mapping LocalDateTime to the database datetime type), relational table query parsing (based on the @JoinTable annotation), and SQL injection protection (parameterized queries).

[0075] For example, the object resolver automatically parses the SQL statement and SQL parameters from the business request and the specified generic method, based on the corresponding Java entity. When used alone, the parsed result includes the SQL statement and SQL parameters.

[0076] For example, the object resolver parses the custom annotations of the input parameter object as follows: @TableName("t_user") public class User{ @PrimaryKey private Long id; @Column("user_name") private String userName; @Column("user_status") private Integer userStatus; ...... } In this embodiment of the invention, the core technology of the object resolver lies in annotation-based metadata parsing. It reads object field names, types, and table relationships via reflection, and automatically generates optimized SQL. The caching mechanism adopts a two-level caching architecture: local caching and distributed caching. The local cache stores frequently accessed reflection metadata, while the distributed cache ensures cross-service cache consistency.

[0077] For example, in the new scenario, when a User object is passed in, the parser automatically generates INSERT INTO t_user (id, user_name) VALUES (?, ?).

[0078] For example, in an update scenario, when a User object is passed in, the parser automatically generates UPDATE t_user set user_name=?, user_status=? WHERE id=?.

[0079] Meanwhile, the object resolver stores reflection metadata in a cache, which can be reused directly when resolving the same object later, improving resolution efficiency by more than 80%.

[0080] For example, the business number parser is a sub-engine in the parsing component that uses pre-stored rules in the configuration system to dynamically concatenate SQL. It uses the unique business number (Business Code, bizCode) carried in the request as an index to load pre-configured configuration data such as the SQL body and SQL condition rules from the configuration system. Then, combined with the JSON parameters passed in the request, it performs parameter matching, type conversion, multi-value IN decomposition, range conditions, dynamic sorting, and data permission fragment concatenation according to the configuration rules, dynamically assembling a complete parameterized SQL. It achieves configuration-driven SQL generation by relying on configuration caching, unified parameter mapping, and security verification mechanisms.

[0081] For example, the business ID parser loads the SQL configuration based on the business ID (such as QUERY_USER) in the business request, and then parses the parameter mapping (such as mapping object properties to SQL placeholders) based on the rule engine. Caching, type conversion, and security checks are also supported.

[0082] In this embodiment of the invention, the key technology of the business number parser is the rule engine. By parsing the conditional rules and input parameters in the SQL configuration, it constructs a conditional expression tree, supporting complex condition combinations (such as range queries and LIKE operations). Parameter type conversion adopts a type converter registry mode, supporting custom type conversion (such as mapping enumeration types to database strings). SQL security filtering avoids direct SQL concatenation through parameterized queries, and escapes special characters (such as ', ", ;, etc.) to prevent SQL injection attacks.

[0083] For example, the business number parser identifies the business number through the business request, completes SQL parsing using the business number and SQL configuration, and simultaneously parses the SQL parameters using the object parser. The business number parser must have an object parser configured. The result of the business number parser is the SQL statement, and the object parser, when used in conjunction with the business number parser, only needs to parse the SQL parameters.

[0084] For example, if the request parameters for a business request are {"bizCode": "QUERY_USER", "params": {"user_name": "zhangsan"}}, the parser will combine the SQL as SELECT. FROM t_user WHERE 1=1 AND user_name= ?, with the parameter bound to "zhangsan".

[0085] For example, in a transaction reconciliation scenario, it is necessary to support multi-dimensional filtering (transaction type, transaction status, amount range, transaction time, merchant ID, payment channel), dynamic sorting, and data access control. For instance, the request parameters for a business request might be as follows: { "bizCode": "QUERY_TRANSACTION", "params": { "transType": ["PAY", "REFUND"], "status": "SUCCESS", "amountMin": 100, "amountMax": 10000, "transTimeStart": "2024-01-01 00:00:00", "transTimeEnd": "2024-01-31 23:59:59", "merchantNo": "MER123456", "channel": "ALIPAY", "orderBy": "trans_time", sort": "DESC", "dataScope": ["MER123456", "MER654321"] / / Data access control field }} For this business request, the business number resolver execution process includes: ① Load the SQL configuration corresponding to QUERY_TRANSACTION (the main body is SELECT) FROM t_transactionWHERE 1=1); ② Parse the multi-valued parameter transType and generate AND trans_type IN (?, ?); ③ Conditions for concatenating the amount range AND amount BETWEEN ? AND ?; ④ Process date parameters, automatically convert them to a database-compatible format, and generate AND trans_time BETWEEN? AND ?; ⑤ Parse the data scope field to generate AND merchant_no IN (?, ?); ⑥ Dynamically add sorting conditions ORDER BY trans_time DESC; ⑦ Finally, the SQL is generated: SELECT FROM t_transaction WHERE 1=1 AND trans_type IN (?, ?) ANDstatus = ? AND amount BETWEEN ? AND ? AND trans_time BETWEEN ? AND ? ANDmerchant_no = ? AND channel = ? AND merchant_no IN (?, ?) ORDER BY trans_timeDESC Meanwhile, the business number parser uses a unified parameter mapping mechanism to accurately bind JSON (JavaScript Object Notation) parameters with SQL placeholders, avoiding parameter misalignment issues.

[0086] For example, the dual parser has the ability to automatically recognize scenes, and the two parsers have different recognition logic: 1. Object resolver: It distinguishes between new and updated scenarios based on the method type called by the business code. If an add method is called, it is determined to be an add scenario and an INSERT statement is automatically generated. If an update method is called, it is determined to be an update scenario and an UPDATE statement with primary key conditions is automatically generated in combination with the @PrimaryKey annotation.

[0087] 2. Business Number Parser: Based on the SQL type fields (SELECT / INSERT / UPDATE / DELETE) preset in the configuration system, it directly identifies the current operation scenario and generates the corresponding SQL statement.

[0088] In this embodiment of the invention, the collaborative mechanism between the object resolver and the business number resolver achieves seamless switching through the following three core technologies: ①Cache sharing: Unify cache reflection metadata and SQL configuration templates, and realize the sharing of metadata and configuration templates through unified cache key rules (such as prefix + business number / fully qualified class name of object), reducing the overhead of repeated queries and parsing; ② Unified parameter mapping: Define standardized parameter binding rules. Unified parameter mapping is based on a standardized parameter context object. Both parsers convert input parameters into a parameter list in a unified format and then bind it to SQL placeholders. It supports multiple input parameter types such as Java objects, JSON, and Map. Both parsers reuse the same set of parameter conversion logic. ③ Integrated SQL Injection Protection: Integrates multiple protection mechanisms such as parameterized queries, syntax validation, and special character escaping; the SQL injection protection component is independently encapsulated as a public service, and the two parsers call it through dependency injection, sharing the security protection component to ensure the consistency and maintainability of the protection logic and ensure execution security.

[0089] In this embodiment of the invention, the dual-parser architecture can cover automated CRUD and complex dynamic SQL scenarios, improving parsing efficiency by more than 30%.

[0090] Step 104: Execute the parsed SQL using the SQL executor.

[0091] The core logic of this invention is: manual visual configuration + system persistent storage + runtime invocation. All SQL configurations must be manually created, edited, and configured by DBAs / developers through a visual web interface, including the SQL body, prefixes and suffixes, conditional rules, parameter attributes, SQL type, etc. After the configuration is submitted and approved, the system automatically persists the complete configuration to the configuration system database and generates a corresponding version record. During business operation, the parsing component obtains the pre-configured and stored SQL configuration template and completes dynamic parsing without hard-coding SQL.

[0092] In some possible embodiments, step 104 includes: executing the parsed SQL using standard JDBC or a connection pool via an SQL executor.

[0093] For example, the SQL executor supports automatic mapping of result sets to Java objects (such as POJO) or Maps, and records logs such as SQL execution time, number of rows affected, and parameter information during execution for slow query analysis and auditing; it also supports transaction management (such as integration with SpringTransaction, which stands for Spring TransactionManagement) to ensure data consistency.

[0094] For example, SQL execution refers to the process where the parsing component dynamically generates executable standard SQL statements, and then the SQL executor submits the SQL with parameter placeholders to the database for execution through JDBC / database connection pool to complete CRUD operations. The database result set is automatically mapped to Java objects / Maps, and execution logs are recorded for auditing and monitoring.

[0095] For example, in an order pagination query scenario, the parsing component dynamically constructs the final executable SQL based on the business number (such as QUERY_ORDER_01) and input parameters; binds request parameters (order type, status, amount, time, data permissions, etc.); the SQL executor submits the SQL to the database for execution to query the corresponding order data; the database automatically encapsulates the query results into a Java object and returns it to the business layer, while recording logs such as execution time and number of rows affected.

[0096] In this embodiment of the invention, business request reception, business number matching, SQL configuration retrieval, dynamic SQL parsing, SQL execution, and result mapping are all automatically executed by the business microservice nodes. These are runtime behaviors of the program and require no manual operation by human users or developers. Only the initial configuration work is completed by the developer / DBA; the entire system operation process is automated and does not rely on manual intervention.

[0097] For example, the business microservice node also receives a configuration change notification sent by the operation and maintenance service node, which includes the business number and version number; according to the configuration change notification, it deletes the SQL configuration corresponding to the business number from the local cache; and obtains the SQL configuration corresponding to the business number and version number from the operation and maintenance service node.

[0098] In this embodiment of the invention, after the SQL configuration is reviewed and published, the configuration system proactively pushes a configuration change notification to the relevant business microservices, carrying the business number and version information. Upon receiving the notification, the business microservices proactively retrieve the latest business configuration information; simultaneously, they also proactively update the configuration information in the distributed cache. After receiving the push, the business microservices automatically refresh the configuration and proactively clear the old and new second-level caches. The next business request directly loads the latest SQL configuration without requiring an application restart.

[0099] For example, in a business microservice node, if the cache time of the SQL configuration in the local cache is greater than the first duration, it checks whether the version of the cached SQL configuration is consistent with the currently effective version of the SQL configuration in the operation and maintenance service node; if they are inconsistent, it deletes the cached SQL configuration and obtains the currently effective version of the SQL configuration from the operation and maintenance service node.

[0100] In this embodiment of the invention, the parsing component's secondary cache is set to a first duration, i.e. a fixed expiration time (e.g., 1 to 3 minutes). Upon expiration, it automatically and proactively checks whether the version information is consistent. If they are inconsistent, it actively retrieves the latest configuration from the source to avoid configuration lag caused by push failure.

[0101] This invention implements runtime SQL hot updates based on a dual mechanism of configuration system push and parsing component cache refresh. After SQL configuration changes, there is no need to restart the application; the SQL changes take effect dynamically at runtime through automatic cache expiration or active refresh, with the effect delay controlled within 1 second.

[0102] The parsing component cache refresh is an update mechanism for the local cache. Its core is to clear old SQL configurations and load the latest configurations, ensuring that the runtime SQL logic is consistent with the configuration system. It has two modes: 1. Proactive refresh: After receiving a configuration system change notification, proactively delete the cached data for the corresponding business number and force the next request to fetch the new configuration from the origin server. 2. Passive refresh: The cache expires automatically upon timeout, and the system automatically retrieves and caches the latest SQL configuration and reflection metadata again.

[0103] The parsing component cache refresh mechanism is the core technology for achieving hot SQL updates without downtime.

[0104] The SQL execution method provided in this embodiment of the invention has the following beneficial effects: (1) Significantly improved development efficiency: Developers do not need to write repetitive CRUD code and complex SQL. They can complete data access operations through annotations or configuration. At the same time, the configuration platform can integrate AI large models to assist in creating complex SQL, thereby improving development efficiency. The learning cost of the framework is reduced by 50%, and novices can get started quickly.

[0105] (2) Enhanced maintainability: SQL is centrally managed, supporting version rollback and historical change query. DBAs can directly audit and optimize SQL through a visual interface, reducing operation and maintenance costs by 60%. SQL changes do not require code modification, reducing release risks.

[0106] (3) Improve agility: Build a hot update mechanism for SQL configuration, which allows SQL modification, release and take effect without restarting the application, shortens the joint debugging test cycle, and reduces the time for emergency problem repair from hours to minutes; supports scenarios with frequent changes in business rules and adapts to the rapid iteration requirements of microservices.

[0107] (4) Security and stability: Built-in multiple SQL injection protection mechanisms and parameter type verification reduce human coding errors; caching mechanism reduces database access pressure; comprehensive logging supports problem tracing and performance optimization.

[0108] This invention provides a technical solution for an SQL execution method, the method comprising: receiving a business request, the business request carrying a business number; obtaining an SQL configuration corresponding to the business number based on the business number; parsing the business request and the SQL configuration using a dual-parser parsing component to generate parsed SQL; the dual parsers having a collaborative mechanism of cache sharing, unified parameter mapping, and integrated SQL injection protection; and executing the parsed SQL through an SQL executor. This invention improves the parsing efficiency of the parsing component by employing a parsing component with a dual-parser collaborative mechanism of cache sharing, unified parameter mapping, and integrated SQL injection protection to parse the SQL configuration.

[0109] Figure 5 This is a schematic diagram of the structure of an SQL execution device according to an embodiment of the present invention, as shown below. Figure 5 As shown, the device includes: Transceiver module 11 is used to receive service requests, wherein the service requests carry a service number; Processing module 12 is used to obtain the SQL configuration corresponding to the business number according to the business number; use a parsing component with dual parsers to parse the business request and the SQL configuration to generate parsed SQL; the dual parsers have a collaborative mechanism of cache sharing, unified parameter mapping and integrated SQL injection protection; and execute the parsed SQL through an SQL executor.

[0110] In this embodiment of the invention, the processing module 12 is specifically used to retrieve the SQL configuration corresponding to the business number from the local cache according to the business number; if the retrieval from the local cache fails, the processing module 12 retrieves the SQL configuration corresponding to the business number from the distributed cache according to the business number. The transceiver module 11 is specifically used to handle the failure of module 12 to retrieve the SQL configuration corresponding to the business number from the operation and maintenance service node when the business number is obtained. The operation and maintenance service node includes a visual audit and monitoring platform, which has functions such as SQL configuration management, syntax verification, performance analysis, and slow query alarm.

[0111] In this embodiment of the invention, after the transceiver module 11 obtains the SQL configuration corresponding to the business number from the operation and maintenance service node, the processing module 12 is further used to write the SQL configuration into the cache.

[0112] In this embodiment of the invention, the SQL configuration includes: SQL body configuration and SQL condition configuration; the SQL body configuration includes the business number, SQL prefix, SQL body, SQL suffix, SQL type and effective status; the SQL condition configuration includes defined condition rules.

[0113] In this embodiment of the invention, the SQL condition configuration supports parameterized placeholders and dynamic concatenation of conditions.

[0114] In this embodiment of the invention, the operation and maintenance service node includes: an SQL configuration table corresponding to the service number; the SQL configuration table contains all versions of the SQL configuration; each version contains the current version number, the SQL configuration, and the modification time.

[0115] In this embodiment of the invention, the operation and maintenance service node further includes: information on all modification operations of the SQL configuration, wherein the modification operations include adding, modifying, or rolling back.

[0116] In this embodiment of the invention, the dual parser includes an object parser and a business number parser.

[0117] In this embodiment of the invention, the processing module 12 is specifically used to use the object parser to parse all input parameters of the business request based on the Java reflection mechanism; and to use the business number parser to parse the condition rules in the SQL configuration and all input parameters based on the rule engine, and automatically match the SQL configuration with the SQL parameters by parameter name or parameter order.

[0118] In this embodiment of the invention, the processing module 12 is specifically used to execute the parsed SQL using standard JDBC or a connection pool through an SQL executor.

[0119] In this embodiment of the invention, the transceiver module 11 is further configured to receive a configuration change notification sent by the operation and maintenance service node, the configuration change notification including the service number and the version number; the processing module 12 is further configured to delete the SQL configuration corresponding to the service number in the local cache according to the configuration change notification; the transceiver module 11 is further configured to obtain the SQL configuration corresponding to the service number and the version number from the operation and maintenance service node.

[0120] In this embodiment of the invention, the processing module 12 is further configured to, when the caching time of the SQL configuration in the local cache is greater than a first duration, detect whether the version of the cached SQL configuration is consistent with the currently effective version of the SQL configuration in the operation and maintenance service node; if they are inconsistent, delete the cached SQL configuration; the transceiver module 11 is further configured to obtain the currently effective version of the SQL configuration from the operation and maintenance service node.

[0121] The SQL execution device provided in this embodiment of the invention can be used to implement the above. Figures 1 to 4 For a detailed description of the SQL execution method, please refer to the above-mentioned SQL execution method implementation examples, which will not be repeated here.

[0122] In a technical solution for an SQL execution device provided by this invention, a business request carrying a business number is received; an SQL configuration corresponding to the business number is obtained; a parsing component with dual parsers parses the business request and the SQL configuration to generate parsed SQL; the dual parsers have a collaborative mechanism for shared cache, unified parameter mapping, and integrated SQL injection protection; and the parsed SQL is executed by an SQL executor. This invention improves the parsing efficiency of the parsing component by employing a parsing component with a dual-parser collaborative mechanism that integrates shared cache, unified parameter mapping, and integrated SQL injection protection to parse the SQL configuration.

[0123] Figure 6 This is a schematic diagram of the structure of one embodiment of the device in this specification, as shown below. Figure 6 As shown, the device may include at least one processor; and at least one memory communicatively connected to the processor, wherein the memory stores program instructions executable by the processor, and the processor can execute this specification by calling the program instructions. Figures 1-4 The SQL execution method provided in the illustrated embodiment.

[0124] Figure 6 A block diagram of an exemplary device suitable for implementing embodiments of this specification is shown. Figure 6 The device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments described in this specification.

[0125] like Figure 6 As shown, the device is presented in the form of a general-purpose computing device. The components of the device may include, but are not limited to: one or more processors 21, memory 23, and communication bus 24 connecting different system components (including memory 23 and processor 21).

[0126] Communication bus 24 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, Industry Standard Architecture (ISA) buses, Micro Channel Architecture (MAC) buses, Enhanced ISA buses, Video Electronics Standards Association (VESA) local buses, and Peripheral Component Interconnection (PCI) buses.

[0127] Devices typically include a variety of computer system readable media. These media can be any available media that can be accessed by the device, including volatile and non-volatile media, removable and non-removable media.

[0128] Memory 23 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) and / or cache memory. The device may further include other removable / non-removable, volatile / non-volatile computer system storage media. Memory 23 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments described herein.

[0129] A program / utility having a set (at least one) of program modules may be stored in memory 23. Such program modules include—but are not limited to—an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. The program modules typically perform the functions and / or methods described in the embodiments of this specification.

[0130] Processor 21 executes various functional applications and data processing by running programs stored in memory 23, such as implementing the specifications herein. Figures 1-4 The SQL execution method provided in the illustrated embodiment.

[0131] This specification provides a non-transitory computer-readable storage medium that stores computer instructions that cause the computer to execute this specification. Figures 1-4 The SQL execution method provided in the illustrated embodiment.

[0132] The aforementioned non-transitory computer-readable storage medium may be any combination of one or more computer-readable media. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or flash memory, optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in connection with an instruction execution system, apparatus, or device.

[0133] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including—but not limited to—electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of transmitting, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.

[0134] The program code contained on a computer-readable medium may be transmitted using any suitable medium, including—but not limited to—wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0135] Computer program code for performing the operations described herein may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer may be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN), or it may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0136] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0137] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this specification. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0138] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this specification, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0139] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this specification includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which the embodiments of this specification pertain.

[0140] Depending on the context, the word "if" as used here can be interpreted as "when," "when," "in response to determination," or "in response to detection." Similarly, depending on the context, the phrase "if determination" or "if detection (of the stated condition or event)" can be interpreted as "when determination," "in response to determination," "when detection (of the stated condition or event)," or "in response to detection (of the stated condition or event)."

[0141] It should be noted that the terminals involved in the embodiments of this specification may include, but are not limited to, personal computers (PCs), personal digital assistants (PDAs), wireless handheld devices, tablet computers, mobile phones, MP3 players, MP4 players, etc.

[0142] In the several embodiments provided in this specification, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0143] Furthermore, the functional units in the various embodiments of this specification can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in a combination of hardware and software functional units.

[0144] The integrated units implemented as software functional units described above can be stored in a computer-readable storage medium. These software functional units, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods described in the various embodiments of this specification. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0145] The above description is merely a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of protection of this specification.

Claims

1. A method of SQL execution, characterized by, The method includes: Receive a service request, the service request carrying a service number; Retrieve the SQL configuration corresponding to the business number; A dual-parser parsing component parses the business request and the SQL configuration to generate parsed SQL; the dual parsers have a collaborative mechanism that integrates cache sharing, unified parameter mapping, and SQL injection protection. The parsed SQL is executed by the SQL executor.

2. The method of claim 1, wherein, The step of obtaining the SQL configuration corresponding to the business number based on the business number includes: Based on the business number, retrieve the SQL configuration corresponding to the business number from the local cache; If the retrieval fails from the local cache, the SQL configuration corresponding to the business number is retrieved from the distributed cache. When the retrieval from the distributed cache fails, the SQL configuration corresponding to the business number is retrieved from the operation and maintenance service node. The operation and maintenance service node includes a visual audit and monitoring platform, which has functions such as SQL configuration management, syntax verification, performance analysis, and slow query alarms.

3. The method of claim 2, wherein, After obtaining the SQL configuration corresponding to the service number from the operation and maintenance service node, the process also includes: Write the SQL configuration to the cache.

4. The method according to any one of claims 1 to 3, characterized in that, The SQL configuration includes: SQL body configuration and SQL condition configuration; The SQL main configuration includes the business number, SQL prefix, SQL main, SQL suffix, SQL type, and effective status; The SQL condition configuration includes the defined condition rules.

5. The method of claim 4, wherein, The SQL condition configuration supports parameterized placeholders and dynamic concatenation of conditions.

6. The method according to claim 2, characterized in that, The operation and maintenance service node includes: an SQL configuration table corresponding to the service number; the SQL configuration table contains all versions of the SQL configuration; each version contains the current version number, the SQL configuration, and the modification time.

7. The method according to claim 6, characterized in that, The operation and maintenance service node also includes: information on all modification operations of the SQL configuration, including adding, modifying, or rolling back.

8. The method according to claim 1, characterized in that, The dual parser includes an object parser and a business number parser.

9. The method according to claim 8, characterized in that, The parsing component employing dual parsers parses the business request and the SQL configuration, including: The object resolver is used to parse all input parameters of the business request based on Java reflection. The business number parser uses a rule engine to parse the conditional rules and all input parameters in the SQL configuration, and automatically matches the SQL configuration with the SQL parameters by parameter name or parameter order.

10. The method according to claim 1, characterized in that, The execution of the parsed SQL via the SQL executor includes: The parsed SQL is executed using a standard JDBC or connection pool via an SQL executor.

11. The method according to claim 1, characterized in that, Also includes: Receive configuration change notifications sent by the operation and maintenance service nodes, wherein the configuration change notifications include the service number and version number; According to the configuration change notification, delete the SQL configuration corresponding to the business number from the local cache; Obtain the SQL configuration corresponding to the business number and the version number from the operation and maintenance service node.

12. The method according to claim 1 or 11, characterized in that, Also includes: If the cache time of the SQL configuration in the local cache is greater than the first duration, check whether the version of the cached SQL configuration is consistent with the currently effective version of the SQL configuration in the operation and maintenance service node; If inconsistent, delete the cached SQL configuration; Obtain the current effective version of the SQL configuration from the operation and maintenance service node.

13. An apparatus comprising a memory and a processor, the memory for storing information including program instructions, the processor for controlling the execution of the program instructions, characterized in that, When the program instructions are loaded and executed by the processor, they implement the steps of the method according to any one of claims 1-12.