CN118689900B - A method of operating Elasticsearch based on SQL - Google Patents
A method of operating Elasticsearch based on SQL Download PDFInfo
- Publication number
- CN118689900B CN118689900B CN202411156408.8A CN202411156408A CN118689900B CN 118689900 B CN118689900 B CN 118689900B CN 202411156408 A CN202411156408 A CN 202411156408A CN 118689900 B CN118689900 B CN 118689900B
- Authority
- CN
- China
- Prior art keywords
- sql
- target
- user
- original
- preset
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/242—Query formulation
- G06F16/2423—Interactive query statement specification based on a database schema
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2452—Query translation
- G06F16/24526—Internal representations for queries
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2453—Query optimisation
- G06F16/24534—Query rewriting; Transformation
- G06F16/24549—Run-time optimisation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/205—Parsing
- G06F40/216—Parsing using statistical methods
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/279—Recognition of textual entities
- G06F40/284—Lexical analysis, e.g. tokenisation or collocates
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N5/00—Computing arrangements using knowledge-based models
- G06N5/04—Inference or reasoning models
- G06N5/041—Abduction
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Artificial Intelligence (AREA)
- Health & Medical Sciences (AREA)
- Mathematical Physics (AREA)
- Audiology, Speech & Language Pathology (AREA)
- General Health & Medical Sciences (AREA)
- Software Systems (AREA)
- Computing Systems (AREA)
- Probability & Statistics with Applications (AREA)
- Evolutionary Computation (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention relates to the technical field of data processing, in particular to a method for operating an elastic search based on SQL (structured query language), which comprises the steps of obtaining SQL sentence fragments input by a user, analyzing the SQL sentence fragments to obtain a plurality of original keywords, inputting the original keywords into a target deepfm model to obtain a plurality of candidate keyword combinations and corresponding probabilities, determining push keyword combinations pushed to the user in the candidate keyword combinations, sorting the SQL sentence fragments into SQL sentences after supplementing keywords and obtaining SQL sentences selected by the user based on the push keyword combinations, and processing the SQL sentences selected by the user to obtain the elastic search operation logic corresponding to the SQL sentences selected by the user. The invention can simplify the data operation and development flow of the elastic search and improve the query efficiency of the elastic search.
Description
Technical Field
The invention relates to the technical field of data processing, in particular to a method for operating an elastic search based on SQL.
Background
With the advent of the big data age, non-relational databases (nosqls) have been increasingly valued for their advantages in handling large-scale data sets, high concurrent access, and flexible data models. The elastiscearch is used as a popular open source distributed search and analysis engine, and is constructed based on Lucene to provide full text search, highlighting, automatic completion, aggregation and other functions, and is commonly used for realizing complex search functions such as log data analysis, real-time data analysis and the like.
Conventional Relational Databases (RDBMS) widely use the SQL language as a standard query language. The SQL language, by its features of structuring, ease of understanding and use, becomes a de facto standard for database operations. However, the elastsearch is used as a non-relational database, the query language is Domain Specific Language (DSL) based on json format, which is significantly different from SQL, and for a developer who is accustomed to using SQL, additional time and effort are required to learn a new query language, so that a natural requirement is to operate the data of the elastsearch through SQL sentences.
Chinese patent publication No. CN107153535A discloses a method and apparatus for operating an elastic search, the method comprising obtaining data to be operated from upstream of the elastic search, converting the data to be operated into target operation data by converting the data to be operated into SQL, the target operation data having a data structure corresponding to the elastic search, packaging the target operation data and the type of the conversion operation into an Action class, and operating the elastic search by using the Action class.
Therefore, the invention has the following problems that the converted operation data needs to be packaged into an Action class, and the Action class is used for operating the elastic search, so that the flexibility and the query efficiency are low.
Disclosure of Invention
Therefore, the invention provides a method for operating the elastic search based on SQL, which is used for solving the problem of low query efficiency based on the SQL operation in the prior art.
To achieve the above object, the present invention provides a method for operating an elastic search based on SQL, comprising:
Step S1, acquiring SQL sentence fragments input by a user;
S2, analyzing the SQL sentence fragments according to a preset sentence analysis method to obtain a plurality of original keywords;
step S3, inputting a plurality of original keywords into a target deepfm model to obtain a plurality of candidate keyword combinations output by the target deepfm model and probabilities corresponding to the candidate keyword combinations;
Step S4, determining a plurality of pushed keyword combinations pushed to a user from a plurality of candidate keyword combinations based on probabilities corresponding to the candidate keyword combinations;
step S5, pushing the SQL sentence fragments to users based on the push keyword combinations to obtain SQL sentences selected by the users;
And S6, processing the SQL sentence selected by the user according to a preset mapping rule to obtain an elastic search operation logic corresponding to the SQL sentence selected by the user, and determining the elastic search operation logic as a target operation logic.
Further, in the step S3, the target deepfm model is acquired by:
Step S31, obtaining each initial keyword combination corresponding to SQL sentence fragments input by a plurality of users in historical data and a plurality of intermediate keyword combinations corresponding to SQL sentences input by the users, wherein the initial keyword combinations comprise a plurality of initial keywords;
step S32, generating a plurality of training samples according to the initial keyword combinations;
Step S33, if the intermediate keyword combination contains all the initial keywords in the initial keyword combination, the intermediate keyword combination is used as a sample label of a training sample corresponding to the initial keyword combination;
Step S34, training the initial deepfm model according to each training sample and the corresponding sample label to obtain a target deepfm model.
Further, the step S4 includes:
Step S41, traversing the probability corresponding to each candidate keyword combination, and determining the probability larger than a preset probability threshold as a key probability;
And step S42, determining the candidate keyword combination corresponding to the keyword probability as a push keyword combination pushed to the user so as to obtain a plurality of push keyword combinations.
Further, the step S5 includes:
Step S51, comparing each push keyword in each push keyword combination with each original keyword to determine a plurality of different keywords;
Step S52, carrying out sentence analysis on a plurality of the distinguishing keywords to obtain a plurality of distinguishing sentence fragments;
Step S53, splicing the SQL sentence fragments with the different sentence fragments to obtain a plurality of SQL sentences;
And step S54, pushing a plurality of SQL sentences to the user to obtain the SQL sentences selected by the user.
Further, the step S6 includes:
step S61, analyzing the SQL sentence selected by the user according to a preset SQL analysis method to obtain semantic information corresponding to the SQL sentence selected by the user;
Step S62, the semantic information is converted into corresponding elastic search operation logic based on a preset mapping rule, and the corresponding elastic search operation logic is determined to be target operation logic.
Further, the step S2 includes:
Step S21, acquiring a target instruction according to the SQL statement fragment, wherein the target instruction at least comprises a name tag of a target task type, and the target task type is any one of a plurality of preset task types;
S22, inputting the SQL sentence fragments and the target instructions into a target information extraction model to obtain an extraction result output by the target information extraction model;
Step S23, determining a plurality of original keywords according to the extraction result.
Further, in the step S22, the target information extraction model is acquired by:
Step S221, acquiring a plurality of original text sets, wherein each original text set has a corresponding original task type, each original task type is one of a plurality of preset task types, and each original text set comprises a plurality of original texts;
Step S222, according to each original text in a plurality of original text sets, a corresponding target training sample is obtained to obtain a target training sample set;
Step S223, training the preset large language model according to the target training sample set to obtain a target information extraction model.
Further, in the step S222, the target training sample is obtained by:
Step S2221, determining a task template corresponding to each original text set according to the original task type corresponding to the original text set, wherein each preset task type is provided with a corresponding task template, each task template is provided with a plurality of slots, and each slot is filled with a name label corresponding to the corresponding preset task type;
step S2222, filling the name tag of the original task type corresponding to each original text into the slot of the corresponding task template, so as to obtain a task instruction corresponding to each original text;
step 2223, splice each original text and the task instruction corresponding to the original text, so as to obtain a corresponding target training sample.
Further, in the step S61, the preset SQL parsing method includes parsing according to the parse method of CCJSqlParserUtil classes.
Further, before the step S41, the method further includes:
And step S40, if the total number of N/A and 0 in the probabilities corresponding to the candidate keyword combinations is larger than a preset number threshold, re-acquiring a target deepfm model based on the steps S31-S34 to re-determine a plurality of candidate keyword combinations output by the target deepfm model and the probabilities corresponding to the candidate keyword combinations, wherein N/A represents the probability overflow corresponding to the candidate keyword combinations output by the target deepfm model, and 0 represents the probability underflow corresponding to the candidate keyword combinations of the tab to be displayed output by the target deepfm model.
Compared with the prior art, the method has the advantages that through analyzing the SQL sentence fragments input by the user, a plurality of original keywords corresponding to the SQL sentence fragments are obtained, the input result of the user is predicted and recommended to the user according to the target deepfm model, and the input efficiency of the user can be improved, so that the query efficiency is improved. The SQL sentences selected by the user are processed according to the preset mapping rules to obtain the corresponding elastiscearch operation logic, so that the flexibility of operation of elastiscearch can be improved, and the query efficiency of the user can be improved.
Further, the candidate keyword combinations with the probability larger than the preset probability threshold corresponding to the candidate keyword combinations are pushed, so that the input efficiency of a user and the pushing accuracy can be improved.
Furthermore, the invention can determine the distinguishing sentence fragments by determining the distinguishing keywords, splice the SQL sentence fragments with the distinguishing sentence fragments, and determine a plurality of SQL sentences pushed to the user, thereby reducing the errors pushed to the user and improving the user input efficiency.
Furthermore, the invention can improve the conversion efficiency and the flexibility of operating the elastic search by analyzing the SQL sentence and determining the target operation logic according to the SQL sentence.
Furthermore, the method and the device can improve the accuracy of determining the original keywords by constructing the target information extraction model to determine the original keywords.
Further, according to the method and the device, whether the target deepfm model is reacquired is determined according to the number of N/A and 0 in the probabilities corresponding to the candidate keyword combinations, so that accuracy of determining the candidate keyword combinations and the probabilities corresponding to the candidate keyword combinations can be improved, and accuracy of pushing SQL sentences to users is further improved.
Drawings
FIG. 1 is a flow chart of a method of the present invention for operating an elastic search based on SQL;
FIG. 2 is a flow chart of step S2 according to the embodiment of the present invention;
FIG. 3 is a flowchart of an embodiment of the present invention for obtaining a target information extraction model;
FIG. 4 is a flowchart of an embodiment of obtaining a target training sample;
FIG. 5 is a flow chart of an embodiment of the invention for obtaining a model of a target deepfm;
FIG. 6 is a flowchart of step S4 according to an embodiment of the present invention;
FIG. 7 is a flowchart of step S5 according to an embodiment of the present invention;
Fig. 8 is a flowchart illustrating step S6 in the embodiment of the invention.
Detailed Description
The invention will be further described with reference to examples for the purpose of making the objects and advantages of the invention more apparent, it being understood that the specific examples described herein are given by way of illustration only and are not intended to be limiting.
Preferred embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are merely for explaining the technical principles of the present invention, and are not intended to limit the scope of the present invention.
It should be noted that, in the description of the present invention, terms such as "upper," "lower," "left," "right," "inner," "outer," and the like indicate directions or positional relationships based on the directions or positional relationships shown in the drawings, which are merely for convenience of description, and do not indicate or imply that the apparatus or elements must have a specific orientation, be constructed and operated in a specific orientation, and thus should not be construed as limiting the present invention.
In addition, it should be noted that, in the description of the present invention, unless explicitly specified and limited otherwise, the terms "mounted," "connected," and "connected" are to be construed broadly, and may be, for example, fixedly connected, detachably connected, integrally connected, mechanically connected, electrically connected, directly connected, indirectly connected through an intermediate medium, or in communication between two elements. The specific meaning of the above terms in the present invention can be understood by those skilled in the art according to the specific circumstances.
Referring to FIG. 1, a flow chart of a method of the present invention for operating an elastic search based on SQL is shown;
the invention provides a method for operating an elastic search based on SQL, which comprises the following steps:
Step S1, acquiring SQL sentence fragments input by a user;
S2, analyzing the SQL sentence fragments according to a preset sentence analysis method to obtain a plurality of original keywords;
In the implementation, the length of the complete SQL sentence is longer, and the bytes are more, for example, the SQL sentence of the inserted data is an insert insert_main_table ('22222', 'appeared'), and the SQL sentence fragment input by the user in the invention is a plurality of bytes input in advance, for example, an insert in, and the corresponding original keywords can be inserts and in.
Fig. 2 is a schematic flow chart of step S2 in the embodiment of the present invention, specifically, step S2 includes:
Step S21, acquiring a target instruction according to the SQL statement fragment, wherein the target instruction at least comprises a name tag of a target task type, and the target task type is any one of a plurality of preset task types;
In implementation, the preset task type may be noun extraction, pronoun extraction, preposition extraction, conjunctive extraction, article extraction, adjective extraction, etc., and the corresponding name label may be noun, pronoun, preposition, conjunctive, article, adjective, etc.
S22, inputting the SQL sentence fragments and the target instructions into a target information extraction model to obtain an extraction result output by the target information extraction model;
in implementation, the extraction result is information output by the target information extraction model according to the target instruction.
Step S23, determining a plurality of original keywords according to the extraction result.
In implementation, the original keywords determined by the extraction result are information output by the target information extraction model according to the target instruction.
Fig. 3 is a flowchart of the method for obtaining the target information extraction model according to the embodiment of the invention, specifically, in the step S22, the target information extraction model is obtained by:
Step S221, acquiring a plurality of original text sets, wherein each original text set has a corresponding original task type, each original task type is one of a plurality of preset task types, and each original text set comprises a plurality of original texts;
In an implementation, several sets of original text are obtained from multiple data sources, including various SQL statements.
Step S222, according to each original text in a plurality of original text sets, a corresponding target training sample is obtained to obtain a target training sample set;
Step S223, training the preset large language model according to the target training sample set to obtain a target information extraction model.
In implementations, the preset large language model may be a T5 model, baichuan model, YAYI model, chat model, or the like. Because the large language model has strong semantic understanding capability and generalization capability, different information extraction tasks can be well adapted, and higher extraction accuracy can be ensured. The original text sets comprise original texts with different task types, target training samples are generated according to the original texts with the preset task types, and the preset large language model is trained, so that a target information extraction model is obtained, the target information extraction model can have the capability of extracting information with different task types, and the divergence of the target information extraction model can be reduced. It is to be understood that the preset large predictive model is not specifically limited herein and will not be described herein.
According to the method and the device, the original keywords are determined by constructing the target information extraction model, so that the accuracy of determining the original keywords can be improved.
Fig. 4 is a flowchart of the method for obtaining the target training sample according to the embodiment of the invention, specifically, in the step S222, the target training sample is obtained by:
Step S2221, determining a task template corresponding to each original text set according to the original task type corresponding to the original text set, wherein each preset task type is provided with a corresponding task template, each task template is provided with a plurality of slots, and each slot is filled with a name label corresponding to the corresponding preset task type;
step S2222, filling the name tag of the original task type corresponding to each original text into the slot of the corresponding task template, so as to obtain a task instruction corresponding to each original text;
step 2223, splice each original text and the task instruction corresponding to the original text, so as to obtain a corresponding target training sample.
In practice, taking one task template extracted by an entity as an example, it may be set that the extracted task type is [ "], and answers in json {": [ ] }, format. The slot in the "" "is a slot, and the slot of the task template can be filled with the extracted task type [" noun "], and is answered in json {" noun ": [ ] }, format.
Step S3, inputting a plurality of original keywords into a target deepfm model to obtain a plurality of candidate keyword combinations output by the target deepfm model and probabilities corresponding to the candidate keyword combinations;
It can be appreciated that, inputting a plurality of original keywords into the target deepfm model may obtain the confidence probability of each candidate keyword combination corresponding to the original keywords output by the target deepfm model, that is, the probability corresponding to each candidate keyword combination.
Referring to fig. 5, which is a flowchart illustrating the acquisition of the object deepfm model according to an embodiment of the present invention, specifically, in the step S3, the object deepfm model is acquired by:
Step S31, obtaining each initial keyword combination corresponding to SQL sentence fragments input by a plurality of users in historical data and a plurality of intermediate keyword combinations corresponding to SQL sentences input by the users, wherein the initial keyword combinations comprise a plurality of initial keywords;
In an implementation, if the SQL sentence fragment is insert into, the corresponding initial keywords may be insert and into, and if the SQL sentence input by the user may be insert into main_table (id, title) values ('22222', 'appeared') and insert into reader (id, bid, type) values ('101', '1001', 1), the corresponding intermediate keywords are respectively insert, into, main _ table, id, title, values, 22222, appeared and insert, into, reader, id, bid, type, values, 101, 1001, 1. It is to be understood that the intermediate keyword combination may be any two or more of the intermediate keywords, and the keyword combinations after the position order of the keywords in the intermediate keyword combination are exchanged are considered to be the same keyword combination.
Step S32, generating a plurality of training samples according to the initial keyword combinations;
Step S33, if the intermediate keyword combination contains all the initial keywords in the initial keyword combination, the intermediate keyword combination is used as a sample label of a training sample corresponding to the initial keyword combination;
Step S34, training the initial deepfm model according to each training sample and the corresponding sample label to obtain a target deepfm model.
Step S4, determining a plurality of pushed keyword combinations pushed to a user from a plurality of candidate keyword combinations based on probabilities corresponding to the candidate keyword combinations;
Fig. 6 is a schematic flow chart of step S4 in the embodiment of the present invention, specifically, step S4 includes:
Step S41, traversing the probability corresponding to each candidate keyword combination, and determining the probability larger than a preset probability threshold as a key probability;
in an actual application scene, an actual implementation person can set a preset probability threshold according to an actual situation, and preferably, the value range of the preset probability threshold can be set to be 0.7-0.8.
And step S42, determining the candidate keyword combination corresponding to the keyword probability as a push keyword combination pushed to the user so as to obtain a plurality of push keyword combinations.
According to the method and the device for pushing the candidate keyword combinations, the candidate keyword combinations with the probability larger than the preset probability threshold corresponding to the candidate keyword combinations are pushed, so that the input efficiency of a user and the pushing accuracy can be improved.
Specifically, before the step S41, the method further includes:
Step S40, if the total number of N/A and 0 in the probabilities corresponding to the candidate keyword combinations is greater than a preset number threshold, re-acquiring the target deepfm model based on the steps S31-S34 to re-determine a plurality of candidate keyword combinations output by the target deepfm model and the probabilities corresponding to the candidate keyword combinations;
Wherein N/A represents the probability overflow corresponding to the candidate keyword combination output by the target deepfm model, and 0 represents the probability underflow corresponding to the candidate keyword combination of the tab to be displayed output by the target deepfm model.
In practice, the target deepfm model is reacquired by increasing the range of historical data to increase the number of training samples and retraining the initial deepfm model based on the steps S31-S34.
In an actual application scene, an actual implementation personnel can set a preset quantity threshold according to an actual situation, and preferably, the value range of the preset quantity threshold is set to be 0.4 times to 0.6 times of the total quantity of candidate keyword combinations output by the target deepfm model.
According to the method and the device, whether the target deepfm model is reacquired is determined according to the number of N/A and 0 in the probability corresponding to each candidate keyword combination, so that accuracy of determining each candidate keyword combination and the probability corresponding to each candidate keyword combination can be improved, and accuracy of pushing SQL sentences to users is further improved.
Step S5, pushing the SQL sentence fragments to users based on the push keyword combinations to obtain SQL sentences selected by the users;
Fig. 7 is a schematic flow chart of step S5 in the embodiment of the present invention, specifically, step S5 includes:
Step S51, comparing each push keyword in each push keyword combination with each original keyword to determine a plurality of different keywords;
Step S52, carrying out sentence analysis on a plurality of the distinguishing keywords to obtain a plurality of distinguishing sentence fragments;
Step S53, splicing the SQL sentence fragments with the different sentence fragments to obtain a plurality of SQL sentences;
And step S54, pushing a plurality of SQL sentences to the user to obtain the SQL sentences selected by the user.
According to the invention, the distinguishing sentence fragments can be determined by determining the distinguishing keywords, and the SQL sentence fragments are spliced with the distinguishing sentence fragments, so that a plurality of SQL sentences pushed to the user can be determined, the errors pushed to the user can be reduced, and the user input efficiency is improved.
And S6, processing the SQL sentence selected by the user according to a preset mapping rule to obtain an elastic search operation logic corresponding to the SQL sentence selected by the user, and determining the elastic search operation logic as a target operation logic.
Fig. 8 is a schematic flow chart of step S6 in the embodiment of the present invention, specifically, step S6 includes:
step S61, analyzing the SQL sentence selected by the user according to a preset SQL analysis method to obtain semantic information corresponding to the SQL sentence selected by the user;
In implementation, the preset SQL parsing method is a method capable of parsing an SQL statement to obtain semantic information according to any one of the prior art, and will not be described herein.
Specifically, the semantic information includes information about the type of operation (e.g., SELECT, INSERT, UPDATE, DELETE) and related behavior, query conditions, table names, field names, etc.
In the step S61, the preset SQL parsing method includes parsing according to the parse method of CCJSqlParserUtil classes.
In implementation, according to the package method parsing of CCJSqlParserUtil classes, when the SQL sentence selected by the user is "insert name user (id, name, age) value", the code for parsing the SQL sentence selected by the user is:
STRING SQL = "insert_in_user (id, name, age) values;// parse" insert_in_user (id, name, age) values: id: name, age) "
Step S62, the semantic information is converted into corresponding elastic search operation logic based on a preset mapping rule, and the corresponding elastic search operation logic is determined to be target operation logic.
In practice, the actual implementation personnel can set the preset mapping rule based on the expert system according to the actual situation, for example, convert a WHERE clause in SQL into a query condition of an elastomer search, and UPDATE and insert data with UPDATE and INSTER respectively.
The invention can improve the conversion efficiency and the flexibility of operating the elastic search by analyzing the SQL sentence and determining the target operation logic according to the SQL sentence.
According to the invention, the SQL sentence fragments input by the user are analyzed to obtain a plurality of original keywords corresponding to the SQL sentence fragments, and the input result of the user is predicted and recommended to the user according to the target deepfm model, so that the input efficiency of the user can be improved, and the query efficiency is improved. The SQL sentences selected by the user are processed according to the preset mapping rules to obtain the corresponding elastiscearch operation logic, so that the flexibility of operation of elastiscearch can be improved, and the query efficiency of the user can be improved.
Thus far, the technical solution of the present invention has been described in connection with the preferred embodiments shown in the drawings, but it is easily understood by those skilled in the art that the scope of protection of the present invention is not limited to these specific embodiments. Equivalent modifications and substitutions for related technical features may be made by those skilled in the art without departing from the principles of the present invention, and such modifications and substitutions will be within the scope of the present invention.
Claims (8)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202411156408.8A CN118689900B (en) | 2024-08-22 | 2024-08-22 | A method of operating Elasticsearch based on SQL |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202411156408.8A CN118689900B (en) | 2024-08-22 | 2024-08-22 | A method of operating Elasticsearch based on SQL |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN118689900A CN118689900A (en) | 2024-09-24 |
| CN118689900B true CN118689900B (en) | 2024-12-20 |
Family
ID=92773049
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202411156408.8A Active CN118689900B (en) | 2024-08-22 | 2024-08-22 | A method of operating Elasticsearch based on SQL |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN118689900B (en) |
Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115481145A (en) * | 2022-08-15 | 2022-12-16 | 深圳壹账通智能科技有限公司 | Data query method, device, equipment and medium based on search engine |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US11023463B2 (en) * | 2016-09-26 | 2021-06-01 | Splunk Inc. | Converting and modifying a subquery for an external data system |
| CN106934062B (en) * | 2017-03-28 | 2020-05-19 | 广东工业大学 | Implementation method and system for querying elastic search |
| CN114201507A (en) * | 2021-12-14 | 2022-03-18 | 平安养老保险股份有限公司 | Log query method, device, device and storage medium based on ElasticSearch |
-
2024
- 2024-08-22 CN CN202411156408.8A patent/CN118689900B/en active Active
Patent Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115481145A (en) * | 2022-08-15 | 2022-12-16 | 深圳壹账通智能科技有限公司 | Data query method, device, equipment and medium based on search engine |
Also Published As
| Publication number | Publication date |
|---|---|
| CN118689900A (en) | 2024-09-24 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN109684448B (en) | Intelligent question and answer method | |
| CN100378724C (en) | Sentence structure analysis method based on mobile configuration concept and natural language search method using it | |
| US9824083B2 (en) | System for natural language understanding | |
| US20150081277A1 (en) | System and Method for Automatically Classifying Text using Discourse Analysis | |
| US20200342052A1 (en) | Syntactic graph traversal for recognition of inferred clauses within natural language inputs | |
| US10503769B2 (en) | System for natural language understanding | |
| US20110040553A1 (en) | Natural language processing | |
| CN111831624A (en) | Data table creating method and device, computer equipment and storage medium | |
| WO2022180989A1 (en) | Model generation device and model generation method | |
| CN119646016A (en) | Data query method, device, electronic device, medium and program product | |
| CN117034135A (en) | API recommendation method based on prompt learning and double information source fusion | |
| CN113157887A (en) | Knowledge question-answering intention identification method and device and computer equipment | |
| CN112417823A (en) | A method and system for word order adjustment and quantifier completion in Chinese text | |
| CN119227792A (en) | A method of constructing expert system based on RAG technology | |
| CN109522396B (en) | Knowledge processing method and system for national defense science and technology field | |
| CN116225933A (en) | Program code checking method and checking device | |
| CN120012771A (en) | A multilingual universal part-of-speech recognition method and system based on large language model | |
| CN120030041A (en) | Wensheng SQL method and device based on large language model prompt words | |
| CN117291192B (en) | A method and system for semantic understanding and analysis of government affairs texts | |
| CN118689900B (en) | A method of operating Elasticsearch based on SQL | |
| JP2003167898A (en) | Information retrieving system | |
| US11017172B2 (en) | Proposition identification in natural language and usage thereof for search and retrieval | |
| US20110320493A1 (en) | Method and device for retrieving data and transforming same into qualitative data of a text-based document | |
| WO2022180990A1 (en) | Question generating device | |
| CN114742068A (en) | Multi-sentence correlation analysis method and system for ISO19650 standard text |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |