CN-115422223-B - Method and system for facilitating compatibility of multiple engine query semantic parsing
Abstract
The invention relates to the field of distributed databases, in particular to a method for facilitating the analysis of query semantics of a plurality of compatible engines, which comprises the following steps of S1, analyzing from_ clause content to obtain a Flag; S2, analyzing the Flag according to the step S1 to judge that the inquired object belongs to a specific engine in the plurality of engines, and S3, entering the corresponding analysis module in the plurality of analysis modules to carry out specific analysis according to the engine type judged in the step S2. Compared with the prior art, the invention can facilitate the lateral expansion of various engine queries.
Inventors
- Ruan Zhijin
Assignees
- 上海沄熹科技有限公司
- 浪潮软件集团有限公司
Dates
- Publication Date
- 20260421
- Application Date
- 20220825
- Priority Date
- 20220825
Claims (2)
- 1. A method for facilitating the semantic parsing compatible with various engine queries is characterized by comprising the following steps: S1, analyzing the content of from_ clause to obtain a Flag; Further comprises: s101, presetting a global system table; presetting a global system table, wherein when a user creates an object, the system table is inserted with one row of data, and the data comprises the name, ID and the type of an engine to which the object belongs; s102, inputting a query sentence by a user; the method comprises the steps that a user inputs a query sentence, obtains from_ clause content in the query sentence, and obtains a name table1 or device1 of a query object; s103, assigning a Flag; When the object name of the from_ clause content is analyzed, searching a preset global system table according to the object name, obtaining type data, and assigning a value to the Flag; S2, analyzing according to the step S1 to obtain a Flag, and judging that the inquired object belongs to a specific engine in the plurality of engines; The engines are KV engines, time sequence engines or graph engines; s3, entering the corresponding analysis modules in the analysis modules to perform specific analysis according to the engine type judged in the step S2; The analysis modules comprise five parts of analysis contents of select_list, where_ clause, group_ clause, sort_ clause and limit_ clause, and the analysis of each part has corresponding special processing for different engines.
- 2. A system convenient for compatible multiple engine inquiry semantic analysis is characterized in that the content of from_ clause is analyzed to obtain a Flag, and the Flag is obtained according to analysis, and the inquired object is judged to belong to a specific engine in multiple engines; The engines are KV engines, time sequence engines or graph engines; The analysis modules comprise five parts of analysis contents of select_list, where_ clause, group_ clause, sort_ clause and limit_ clause, and the analysis of each part has corresponding special processing for different engines.
Description
Method and system for facilitating compatibility of multiple engine query semantic parsing Technical Field The invention relates to the field of distributed databases, in particular to a method and a system for facilitating the analysis of query semantics of multiple compatible engines. Background Semantic parsing (SEMANTIC PARSING) is a very basic and important research problem in the field of natural language processing. In colloquial terms, semantic parsing is intended to allow computer science to understand natural language and translate it into machine-executable, formalized programming language (such as SQL statements). In this way, the user does not need to learn programming, and the system can be driven to generate codes through description. The existing semantic analysis mode can only serve the query of a single storage engine, and the single engine query mode is unfavorable for the lateral expansion of a plurality of storage engines by a database. Disclosure of Invention Aiming at the defects of the prior art, the invention provides a method which has strong practicability and is convenient for being compatible with various engine query semantic analyses. The invention further aims to provide a system which is reasonable in design, safe and applicable and is convenient for being compatible with various engine query semantic analyses. The technical scheme adopted for solving the technical problems is as follows: a method for facilitating the semantic parsing compatible with a plurality of engine queries comprises the following steps: S1, analyzing the content of from_ clause to obtain a Flag; S2, analyzing according to the step S1 to obtain a Flag, and judging that the inquired object belongs to a specific engine in the plurality of engines; S3, entering the corresponding analysis modules in the analysis modules to conduct specific analysis according to the engine type judged in the step S2. Further, in step S1, further includes: s101, presetting a global system table; s102, inputting a query sentence by a user; s103, assigning a Flag. Further, in step S101, a global system table is preset, and when the user creates the object, a row of data is inserted into the system table, where the data includes the name, ID and the type of the engine to which the object belongs. Further, in step S102, the user inputs a query sentence, obtains from_ clause content in the query sentence, and obtains the name table1 or device1 of the query object. Further, in step S103, when the object name of the from_ clause content is resolved, a preset global system table is checked according to the object name, type data is obtained, and a Flag is assigned. Preferably, in step S2, the plurality of engines are KV engines, timing engines, or graph engines. Further, in step S3, the plurality of parsing modules include five major parsing contents, namely select_list, where_ clause, group_ clause, sort_ clause, limit_ clause, and the parsing of each part has a corresponding special processing for different engines. A system convenient for analyzing semanteme compatible with multiple engines analyzes from_ clause content to obtain Flag, judges whether the inquired object belongs to a specific engine in multiple engines according to Flag obtained by analysis, and enters a corresponding analysis module in multiple analysis modules to carry out specific analysis. Preferably, the plurality of engines are KV engines, timing engines or graph engines. Further, the plurality of parsing modules all comprise five parts of parsing contents of select_list, where_ clause, group_ clause, sort_ clause and limit_ clause, and the parsing of each part has corresponding special processing for different engines. Compared with the prior art, the method and the system for facilitating the semantic analysis of the query compatible with various engines have the following outstanding beneficial effects: the invention can facilitate the lateral expansion of various engine queries. Drawings In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art. FIG. 1 is a flow diagram of a method that facilitates compatibility with multiple engine query semantic parsing; FIG. 2 is a schematic diagram of a system table in a method for facilitating semantic parsing compatible with multiple engine queries; FIG. 3 is a prior art semantic parsing flow diagram for a single storage engine query. Detailed Description In order to provide a better understanding of the aspects of the present invention, the present invention will be described in further detail with reference to s