A method and system for facilitating compatibility of multiple engine query semantic parsing

By parsing the `from_clause` and using the global system table to determine the engine type, and then entering the corresponding module for parsing, the limitations of single-engine in existing technologies are overcome. This achieves compatibility with multiple engines and database expansion, and improves the applicability of query semantic parsing.

CN115422223BActive Publication Date: 2026-04-21上海沄熹科技有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
上海沄熹科技有限公司
Filing Date
2022-08-25
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing semantic parsing methods can only serve a single storage engine and cannot achieve horizontal scaling of the database to multiple storage engines.

Method used

By parsing the contents of the from_clause, the engine type of the query object is determined using the global system table, and the corresponding parsing module is entered for specific parsing. It supports multiple engines such as KV engine, time series engine or graph engine, and processes the select_list, where_clause, group_clause, sort_clause and limit_clause parts respectively.

Benefits of technology

It achieves compatibility with multiple engines, supports horizontal scaling of the database, and improves the flexibility and applicability of query semantic parsing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115422223B_ABST
    Figure CN115422223B_ABST
Patent Text Reader

Abstract

This invention relates to the field of distributed databases, specifically providing a method for semantic parsing queries that is compatible with multiple engines. The method comprises the following steps: S1, parsing the content of the `from_clause` to obtain a flag; S2, based on the flag obtained in step S1, determining which specific engine the queried object belongs to among multiple engines; S3, based on the engine type determined in step S2, entering the corresponding parsing module among multiple parsing modules for specific parsing. Compared with existing technologies, this invention facilitates horizontal expansion for queries on various different engines.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of distributed databases, and specifically provides a method and system for semantic parsing of queries that is compatible with multiple engines. Background Technology

[0002] Semantic parsing is a fundamental and crucial research problem in the field of natural language processing. Simply put, semantic parsing aims to teach computers to understand natural language and translate it into machine-executable, formalized programming languages ​​(such as SQL statements). This allows users to drive the system to generate code simply by describing it, without needing to learn programming skills.

[0003] Existing semantic parsing methods can only serve queries for a single storage engine, which is not conducive to the horizontal scaling of databases to multiple storage engines. Summary of the Invention

[0004] This invention addresses the shortcomings of the prior art by providing a highly practical method for semantic parsing queries that is compatible with multiple search engines.

[0005] A further technical objective of this invention is to provide a reasonably designed, safe, and applicable system that is compatible with multiple engine query semantic parsing.

[0006] The technical solution adopted by this invention to solve its technical problem is:

[0007] A method for semantic parsing queries that is compatible with multiple engines has the following steps:

[0008] S1. Parse the contents of from_clause to obtain the flag;

[0009] S2. Based on the flag obtained from step S1, determine which specific engine the queried object belongs to among multiple engines;

[0010] S3. Based on the engine type determined in step S2, enter the corresponding parsing module among multiple parsing modules for specific parsing.

[0011] Furthermore, step S1 further includes:

[0012] S101. Pre-set a global system table;

[0013] S102, The user enters a query statement;

[0014] S103. Assign a value to the flag.

[0015] Furthermore, in step S101, a global system table is preset. When a user creates an object, a row of data is inserted into the system table. The data includes the object name, ID, and engine type.

[0016] Furthermore, in step S102, the user inputs a query statement, obtains the content of the from_clause in the query statement, and obtains the name of the query object, table1 or device1.

[0017] Furthermore, in step S103, when parsing the object name of the from_clause content, the system looks up the preset global system table based on the object name to obtain the type data and assigns a value to the flag.

[0018] Preferably, in step S2, the plurality of engines are KV engines, time-series engines, or graph engines.

[0019] Furthermore, in step S3, each of the multiple parsing modules contains parsing content in five main parts: select_list, where_clause, group_clause, sort_clause, and limit_clause. For different engines, the parsing of each part has corresponding special processing.

[0020] A system for semantic parsing queries that is compatible with multiple engines is provided. The system parses the content of the `from_clause` to obtain a flag. Based on the obtained flag, it determines which specific engine the queried object belongs to among the multiple engines. The determined engine type is then entered into the corresponding parsing module among the multiple parsing modules for specific parsing.

[0021] Preferably, the engines are KV engines, time-series engines, or graph engines.

[0022] Furthermore, each of the multiple parsing modules contains five main parsing components: select_list, where_clause, group_clause, sort_clause, and limit_clause. For different engines, the parsing of each component has corresponding special processing.

[0023] Compared with existing technologies, the method and system for semantic parsing of queries from multiple engines proposed in this invention have the following significant advantages:

[0024] This invention facilitates horizontal expansion to various different search engines. Attached Figure Description

[0025] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0026] Appendix Figure 1 This is a flowchart illustrating a method for semantic parsing queries that is compatible with multiple search engines;

[0027] Appendix Figure 2 This is a schematic diagram of the system table structure in a method that facilitates semantic parsing of queries from multiple engines.

[0028] Appendix Figure 3 This is a flowchart of the semantic parsing process for queries using a single storage engine in existing technologies. Detailed Implementation

[0029] To enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to specific embodiments. Obviously, the described embodiments are merely some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0030] The following is a preferred embodiment:

[0031] like Figure 1 As shown, the general simple query syntax is:

[0032] SELECT select_list FROM from_clause WHERE where_clause GROUP BYgroup_clause ORDER BY sort_clause LIMIT limit_clause.

[0033] Example: SELECT a,b,c FROM t WHERE a>0and b<10ORDER BY c;

[0034] For a query statement, the SELECT and FROM parts are required, while the latter part is usually optional. In general, a query statement can contain 6 parts, and semantic parsing will perform validity and type checks on these 6 parts respectively.

[0035] The semantic parsing process for queries using a single storage engine is as follows:

[0036] Step 1: Parse the contents of the from_clause

[0037] Step 2: Parse the contents of select_list

[0038] Step 3: Parse the contents of the where_clause

[0039] Step 4: Parse the contents of group_clause

[0040] Step 5: Parse the contents of sort_clause

[0041] Step 6: Parse the content of limit_clause.

[0042] like Figure 2 , 3 As shown in this embodiment, a method for semantic parsing that is compatible with multiple search engines has the following steps:

[0043] S1. Parse the contents of from_clause to obtain the flag;

[0044] Further includes:

[0045] S101. A global system table is preset. When a user creates an object, a row of data is inserted into the system table. The data includes the object name, ID, and engine type.

[0046] S102. The user inputs a query statement, obtains the content of the from_clause in the query statement, and obtains the name of the query object, table1 or device1.

[0047] S103. Assign a value to the flag:

[0048] When parsing the object name in the from_clause content, the system looks up the default global system table based on the object name to obtain the type data and assigns a value to the flag.

[0049] S2. Based on the flag obtained from step S1, determine which specific engine the queried object belongs to among multiple engines;

[0050] Among them, multiple engines can be key-value engines, time-series engines, graph engines, etc.

[0051] S3. Based on the engine type determined in step S2, enter the corresponding parsing module among multiple parsing modules for specific parsing;

[0052] Multiple parsing modules contain five main parts: select_list, where_clause, group_clause, sort_clause, and limit_clause. For different engines, the parsing of each part has corresponding special processing.

[0053] Based on the above method, this embodiment provides a system that facilitates semantic parsing of queries from multiple engines. It parses the content of the `from_clause` to obtain a flag. Based on the obtained flag, it determines which specific engine the queried object belongs to among the multiple engines. The determined engine type is then entered into the corresponding parsing module among the multiple parsing modules for specific parsing.

[0054] Among them, many of the engines are KV engines, time-series engines, or graph engines.

[0055] Among them, multiple parsing modules contain five main parts of parsing content: select_list, where_clause, group_clause, sort_clause, and limit_clause. For different engines, the parsing of each part has corresponding special processing.

[0056] The specific embodiments described above are merely specific examples of the present invention. The patent protection scope of the present invention includes, but is not limited to, the specific embodiments described above. Any appropriate changes or substitutions made by those skilled in the art that conform to the claims of the present invention regarding a method and system for semantic parsing that is compatible with multiple engine queries should fall within the patent protection scope of the present invention.

[0057] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for semantic parsing queries that is compatible with multiple search engines, characterized in that, It has the following steps: S1. Parse the contents of from_clause to obtain the flag; Further includes: S101. Pre-set a global system table; A global system table is pre-defined. When a user creates an object, a row of data is inserted into the system table. The data includes the object name, ID, and engine type. S102, The user enters a query statement; The user enters a query statement, obtains the content of the from_clause in the query statement, and obtains the name of the query object, either table1 or device1. S103. Assign a value to the flag; When parsing the object name in the from_clause content, the system looks up the default global system table based on the object name to obtain the type data and assigns a value to the flag. S2. Based on the flag obtained from step S1, determine which specific engine the queried object belongs to among multiple engines; The engines mentioned are KV engines, time-series engines, or graph engines; S3. Based on the engine type determined in step S2, enter the corresponding parsing module among multiple parsing modules for specific parsing; The multiple parsing modules each contain five main parsing components: select_list, where_clause, group_clause, sort_clause, and limit_clause. For different engines, each part of the parsing has corresponding special processing.

2. A system for easy semantic parsing of queries from multiple engines, characterized in that, Parse the contents of the `from_clause` to obtain the flag. Based on the flag obtained from the parsing, determine which specific engine the queried object belongs to among multiple engines. Once the engine type is determined, enter the corresponding parsing module among the multiple parsing modules for specific parsing. The engines mentioned are KV engines, time-series engines, or graph engines; The multiple parsing modules each contain five main parsing components: select_list, where_clause, group_clause, sort_clause, and limit_clause. For different engines, each part of the parsing has corresponding special processing.

Citation Information

Patent Citations

  • Data processing method, device and system

    CN114356971A