A method of operating Elasticsearch based on SQL

By analyzing SQL fragments and predicting keyword combinations using a deepfm model, the method enhances user input efficiency and query flexibility in Elasticsearch operations, addressing the inefficiencies of using a JSON-based query language.

CN118689900BActive Publication Date: 2024-12-20BEIJING MIRACLES TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411156408.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2024-12-20
Estimated Expiration
2044-08-22

AI Technical Summary

Technical Problem

Developers accustomed to SQL face low query efficiency and flexibility when operating Elasticsearch due to its use of a JSON-based Domain Specific Language (DSL) instead of SQL, requiring additional learning and time to adapt.

Method used

A method that analyzes SQL statement fragments, determines original keywords, uses a deepfm model to predict candidate keyword combinations, and recommends them to users, followed by parsing and mapping to Elasticsearch operation logic, enhancing user input efficiency and query flexibility.

Benefits of technology

Improves user input efficiency and query efficiency by recommending optimized SQL statements and enhancing flexibility in operating Elasticsearch, reducing errors and improving accuracy through deepfm model training and semantic parsing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118689900B_ABST
    Figure CN118689900B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of data processing technology, and in particular to a method for operating Elasticsearch based on SQL, comprising: obtaining an SQL statement fragment input by a user; analyzing the SQL statement fragment to obtain a number of original keywords; inputting the original keywords into a target deepfm model to obtain a number of candidate keyword combinations and corresponding probabilities; determining a push keyword combination pushed to the user in the candidate keyword combination; arranging the SQL statement fragment into an SQL statement supplemented with keywords based on each push keyword combination and obtaining an SQL statement selected by the user; processing the SQL statement selected by the user to obtain the Elasticsearch operation logic corresponding to the SQL statement selected by the user. The present invention can simplify the data operation and development process of Elasticsearch, and improve the query efficiency of Elasticsearch.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a method for operating Elasticsearch based on SQL. Background Art

[0002] With the advent of the big data era, non-relational databases (NoSQL) are gaining more and more attention due to their advantages in processing large-scale data sets, high concurrent access, and flexible data models. As a popular open source distributed search and analysis engine, Elasticsearch is built on Lucene and provides full-text search, highlighting, auto-completion, and aggregation functions. It is usually used to implement complex search functions such as log data analysis and real-time data analysis.

[0003] Traditional relational database management systems (RDBMS) widely use SQL as a standard query language. SQL has become the de facto standard for database operations because of its structured, easy-to-understand and easy-to-use features. However, as a non-relational database, Elasticsearch uses a JSON-based Domain Specific Language (DSL) as its query language, which is significantly different from SQL. For developers who are accustomed to using SQL, they need to invest extra time and energy to learn a new query language. Therefore, a natural requirement is to use SQL statements to operate Elasticsearch data.

[0004] Chinese patent publication number CN107153535A discloses a method and device for operating ElasticSearch, the method comprising: obtaining data to be operated from the upstream of ElasticSearch; using SQL to perform conversion operations on the data to be operated, converting the data to be operated into target operation data, the target operation data having a data structure corresponding to ElasticSearch; encapsulating the target operation data and the type of the conversion operation into an Action class; and using the Action class to operate ElasticSearch.

[0005] It can be seen that the above invention has the following problems: the converted operation data needs to be encapsulated into an Action class, and the Action class is used to operate ElasticSearch, which has low flexibility and query efficiency. Summary of the invention

[0006] To this end, the present invention provides a method for operating Elasticsearch based on SQL, so as to overcome the problem of low query efficiency of operating Elasticsearch based on SQL in the prior art.

[0007] To achieve the above object, the present invention provides a method for operating Elasticsearch based on SQL, comprising:

[0008] Step S1, obtaining a SQL statement fragment input by a user;

[0009] Step S2, analyzing the SQL statement fragment according to a preset statement analysis method to obtain a number of original keywords;

[0010] Step S3, inputting the several original keywords into the target deepfm model to obtain several candidate keyword combinations output by the target deepfm model and the probability corresponding to each candidate keyword combination;

[0011] Step S4, determining a plurality of push keyword combinations to be pushed to the user from among the plurality of candidate keyword combinations based on the probabilities corresponding to the candidate keyword combinations;

[0012] Step S5, based on each of the push keyword combinations, the SQL statement fragments are sorted into SQL statements supplemented with keywords and pushed to the user to obtain the SQL statement selected by the user;

[0013] Step S6: Process the SQL statement selected by the user according to a preset mapping rule to obtain the Elasticsearch operation logic corresponding to the SQL statement selected by the user, and determine it as the target operation logic.

[0014] Furthermore, in step S3, the target deepfm model is obtained by the following steps:

[0015] Step S31, obtaining initial keyword combinations corresponding to several SQL statement fragments input by users in historical data and several intermediate keyword combinations corresponding to SQL statements input by each user; the initial keyword combinations include several initial keywords;

[0016] Step S32, generating a plurality of training samples according to each of the initial keyword combinations;

[0017] Step S33, if the intermediate keyword combination contains all the initial keywords in the initial keyword combination, use them as sample labels of the training samples corresponding to the initial keyword combination;

[0018] Step S34, training the initial deepfm model according to each training sample and the corresponding sample label to obtain the target deepfm model.

[0019] Furthermore, the step S4 comprises:

[0020] Step S41, traversing the probabilities corresponding to each candidate keyword combination, and determining the probability greater than a preset probability threshold as a key probability;

[0021] Step S42: determining the candidate keyword combinations corresponding to the key probabilities as the push keyword combinations pushed to the user, so as to obtain a plurality of push keyword combinations.

[0022] Furthermore, the step S5 comprises:

[0023] Step S51, comparing each push keyword in each push keyword combination with each original keyword to determine a number of distinguishing keywords;

[0024] Step S52, performing sentence analysis on the plurality of distinguishing keywords to obtain a plurality of distinguishing sentence fragments;

[0025] Step S53, concatenating the SQL statement fragment with each distinguishing statement fragment to obtain a plurality of SQL statements;

[0026] Step S54: Pushing the plurality of SQL statements to the user to obtain the SQL statement selected by the user.

[0027] Furthermore, the step S6 comprises:

[0028] Step S61, parsing the SQL statement selected by the user according to a preset SQL parsing method to obtain semantic information corresponding to the SQL statement selected by the user;

[0029] Step S62: convert the semantic information into corresponding Elasticsearch operation logic based on preset mapping rules, and determine it as the target operation logic.

[0030] Furthermore, the step S2 comprises:

[0031] Step S21, obtaining a target instruction according to the SQL statement fragment; the target instruction includes at least a name tag of a target task type; the target task type is any one of several preset task types;

[0032] Step S22, inputting the SQL statement fragment and the target instruction into the target information extraction model to obtain the extraction result output by the target information extraction model;

[0033] Step S23, determining a number of original keywords according to the extraction result.

[0034] Furthermore, in step S22, the target information extraction model is obtained by the following steps:

[0035] Step S221, obtaining a plurality of original text sets; each original text set has a corresponding original task type; each original task type is one of a plurality of preset task types; each of the original text sets includes a plurality of original texts;

[0036] Step S222, acquiring a corresponding target training sample according to each original text in the plurality of original text sets to obtain a target training sample set;

[0037] Step S223: training a preset large language model according to the target training sample set to obtain a target information extraction model.

[0038] Furthermore, in step S222, the target training sample is obtained by the following steps:

[0039] Step S2221, according to the original task type corresponding to the original text set, determine the task template corresponding to each original text set; each preset task type has a corresponding task template; each task template has a number of slots; each slot is filled with a name tag corresponding to the preset task type;

[0040] Step S2222, filling the name tag of the original task type corresponding to each original text into the slot of the corresponding task template to obtain the task instruction corresponding to each original text;

[0041] Step 2223, concatenate each original text and the task instruction corresponding to the original text to obtain the corresponding target training sample.

[0042] Further, in the step S61, the preset SQL parsing method includes parsing according to the parse method of the CCJSqlParserUtil class.

[0043] Furthermore, before step S41, the method further includes:

[0044] Step S40, if the total number of N / A and 0 in the probabilities corresponding to the candidate keyword combinations is greater than the preset threshold value, the target deepfm model is reacquired based on the steps S31-S34 to re-determine the several candidate keyword combinations output by the target deepfm model and the probabilities corresponding to each candidate keyword combination; wherein N / A indicates that the probability corresponding to the candidate keyword combination output by the target deepfm model overflows; and 0 indicates that the probability corresponding to the candidate keyword combination for the tab to be displayed output by the target deepfm model underflows.

[0045] Compared with the prior art, the beneficial effect of the present invention is that the present invention analyzes the SQL statement fragments input by the user, obtains several original keywords corresponding to the SQL statement fragments, predicts the user's input results according to the target deepfm model and recommends them to the user, which can improve the user's input efficiency and thus improve the query efficiency. By processing the SQL statement selected by the user according to the preset mapping rules to obtain the corresponding Elasticsearch operation logic, the flexibility of operating Elasticsearch can be improved, and the user's query efficiency can be improved.

[0046] Furthermore, the present invention can improve the user's input efficiency and the accuracy of push by pushing the candidate keyword combinations whose corresponding probabilities are greater than a preset probability threshold.

[0047] Furthermore, the present invention can determine distinguishing statement fragments by determining distinguishing keywords, and splicing the SQL statement fragments with the distinguishing statement fragments to determine several SQL statements pushed to the user, thereby reducing errors in pushing to the user and improving user input efficiency.

[0048] Furthermore, the present invention can improve conversion efficiency and increase the flexibility of operating Elasticsearch by parsing SQL statements and determining target operation logic accordingly.

[0049] Furthermore, the present invention can improve the accuracy of determining the original keywords by constructing a target information extraction model to determine the original keywords.

[0050] Furthermore, the present invention can improve the accuracy of determining each candidate keyword combination and the probability corresponding to each candidate keyword combination by determining whether to re-acquire the target deepfm model according to the number of N / A and 0 in the probability corresponding to each candidate keyword combination, and further improve the accuracy of SQL statements pushed to users. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 This is a flow chart of the method for operating Elasticsearch based on SQL in the present invention;

[0052] Figure 2 Schematic diagram of the process of step S2 of the embodiment of the present invention;

[0053] Figure 3 A flowchart of obtaining a target information extraction model according to an embodiment of the present invention;

[0054] Figure 4 A flowchart of obtaining a target training sample according to an embodiment of the present invention;

[0055] Figure 5 A flowchart of obtaining a target deepfm model according to an embodiment of the present invention;

[0056] Figure 6 Schematic diagram of the process of step S4 of the embodiment of the present invention;

[0057] Figure 7 Schematic diagram of the process of step S5 of the embodiment of the present invention;

[0058] Figure 8 Schematic diagram of the process of step S6 in the embodiment of the present invention. DETAILED DESCRIPTION

[0059] In order to make the objects and advantages of the present invention more clearly understood, the present invention is further described below in conjunction with embodiments; it should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0060] The 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 only used to explain the technical principles of the present invention and are not intended to limit the protection scope of the present invention.

[0061] It should be noted that, in the description of the present invention, terms such as "up", "down", "left", "right", "inside" and "outside" indicating directions or positional relationships are based on the directions or positional relationships shown in the drawings. This is merely for the convenience of description and does not indicate or imply that the device or element must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it cannot be understood as a limitation on the present invention.

[0062] In addition, it should be noted that in the description of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0063] See also Figure 1 As shown, it is a flow chart of the method for operating Elasticsearch based on SQL of the present invention;

[0064] The present invention provides a method for operating Elasticsearch based on SQL, comprising:

[0065] Step S1, obtaining a SQL statement fragment input by a user;

[0066] Step S2, analyzing the SQL statement fragment according to a preset statement analysis method to obtain a number of original keywords;

[0067] In implementation, the complete SQL statement is relatively long and contains many bytes. For example, the SQL statement for inserting data is: insert into main_table (id, title) values ​​('22222', 'appeared'). In the present invention, the SQL statement fragment input by the user is a few bytes input first, such as: insert in, and the corresponding original keywords can be insert and in.

[0068] See also Figure 2 As shown, it is a schematic diagram of the process of step S2 of an embodiment of the present invention; specifically, step S2 includes:

[0069] Step S21, obtaining a target instruction according to the SQL statement fragment; the target instruction includes at least a name tag of a target task type; the target task type is any one of several preset task types;

[0070] In implementation, the preset task types may be noun extraction, pronoun extraction, preposition extraction, conjunction extraction, article extraction, adjective extraction, etc., and the corresponding name tags may be: noun, pronoun, preposition, conjunction, article, adjective, etc.

[0071] Step S22, inputting the SQL statement fragment and the target instruction into the target information extraction model to obtain the extraction result output by the target information extraction model;

[0072] In implementation, the extraction result is information output by the target information extraction model according to the target instruction.

[0073] Step S23, determining a number of original keywords according to the extraction result.

[0074] In implementation, the several original keywords determined by the extraction result are the information output by the target information extraction model according to the target instruction.

[0075] See also Figure 3 As shown, it is a flow chart of obtaining a target information extraction model according to an embodiment of the present invention; specifically, in step S22, the target information extraction model is obtained by the following steps:

[0076] Step S221, obtaining a plurality of original text sets; each original text set has a corresponding original task type; each original task type is one of a plurality of preset task types; each of the original text sets includes a plurality of original texts;

[0077] In implementation, several original text sets are obtained from multiple data sources, including various SQL statements.

[0078] Step S222, acquiring a corresponding target training sample according to each original text in the plurality of original text sets to obtain a target training sample set;

[0079] Step S223: training a preset large language model according to the target training sample set to obtain a target information extraction model.

[0080] In implementation, the preset large language model can be a T5 model, a Baichuan model, a YAYI model, a Chat model, and the like. Since the large language model has strong semantic understanding and generalization capabilities, it can be well adapted to different information extraction tasks and can ensure higher extraction accuracy. Several original text sets include original texts of different task types. Target training samples are generated based on the original texts of several preset task types, and the preset large language model is trained to obtain a target information extraction model. This enables the target information extraction model to simultaneously have the ability to extract information of different task types, and can reduce the divergence of the target information extraction model. It is understandable that the preset large prediction model is not specifically limited here and will not be elaborated on here.

[0081] The present invention can improve the accuracy of determining the original keywords by constructing a target information extraction model to determine the original keywords.

[0082] See also Figure 4 As shown, it is a flow chart of obtaining a target training sample according to an embodiment of the present invention; specifically, in step S222, the target training sample is obtained by the following steps:

[0083] Step S2221, according to the original task type corresponding to the original text set, determine the task template corresponding to each original text set; each preset task type has a corresponding task template; each task template has a number of slots; each slot is filled with a name tag corresponding to the preset task type;

[0084] Step S2222, filling the name tag of the original task type corresponding to each original text into the slot of the corresponding task template to obtain the task instruction corresponding to each original text;

[0085] Step 2223, concatenate each original text and the task instruction corresponding to the original text to obtain the corresponding target training sample.

[0086] In implementation, taking a task template of entity extraction as an example, it can be set as follows: Extract task type is [""], and answer in json{"":[ ]} format. "" is a slot, and after filling the slot of the task template, it can be: Extract task type is ["noun"], and answer in json{"noun":[ ]} format.

[0087] Step S3, inputting the several original keywords into the target deepfm model to obtain several candidate keyword combinations output by the target deepfm model and the probability corresponding to each candidate keyword combination;

[0088] It can be understood that by inputting several of the original keywords into the target deepfm model, the confidence probability of each candidate keyword combination corresponding to the several original keywords output by the target deepfm model can be obtained, that is, the probability corresponding to each candidate keyword combination.

[0089] See also Figure 5 As shown, it is a flow chart of obtaining a target deepfm model according to an embodiment of the present invention; specifically, in step S3, the target deepfm model is obtained by the following steps:

[0090] Step S31, obtaining initial keyword combinations corresponding to several SQL statement fragments input by users in historical data and several intermediate keyword combinations corresponding to SQL statements input by each user; the initial keyword combination includes several initial keywords; the intermediate keyword combination includes several intermediate keywords; the several intermediate keywords include each of the initial keywords;

[0091] In implementation, if the SQL statement fragment is insert into, the corresponding initial keywords may be insert and into, and the SQL statements 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), and the corresponding intermediate keyword combinations are insert, into, main_table, id, title, values, 22222, appeared and insert, into, reader, id, bid, type, values, 101, 1001, 1. It can be understood that the intermediate keyword combination may be any two or more of the intermediate keywords mentioned above, and the keyword combination after the position order of each keyword in the keyword combination is exchanged is considered to be the same keyword combination.

[0092] Step S32, generating a plurality of training samples according to each of the initial keyword combinations;

[0093] Step S33, if the intermediate keyword combination contains all the initial keywords in the initial keyword combination, use them as sample labels of the training samples corresponding to the initial keyword combination;

[0094] Step S34, training the initial deepfm model according to each training sample and the corresponding sample label to obtain the target deepfm model.

[0095] Step S4, determining a plurality of push keyword combinations to be pushed to the user from among the plurality of candidate keyword combinations based on the probabilities corresponding to the candidate keyword combinations;

[0096] See also Figure 6 As shown, it is a schematic diagram of the process of step S4 of an embodiment of the present invention; specifically, step S4 includes:

[0097] Step S41, traversing the probabilities corresponding to each candidate keyword combination, and determining the probability greater than a preset probability threshold as a key probability;

[0098] In actual application scenarios, actual implementers can set a preset probability threshold according to actual conditions. Preferably, the value range of the preset probability threshold can be set to 0.7-0.8.

[0099] Step S42: determining the candidate keyword combinations corresponding to the key probabilities as the push keyword combinations pushed to the user, so as to obtain a plurality of push keyword combinations.

[0100] The present invention can improve the user's input efficiency and the accuracy of push by pushing candidate keyword combinations whose corresponding probabilities are greater than a preset probability threshold.

[0101] Specifically, before step S41, the method further includes:

[0102] Step S40, if the total number of N / A and 0 in the probabilities corresponding to the candidate keyword combinations is greater than the preset number threshold, then reacquire the target deepfm model based on the steps S31 to S34 to re-determine the several candidate keyword combinations output by the target deepfm model and the probabilities corresponding to the candidate keyword combinations;

[0103] Among them, N / A indicates that the probability of candidate keyword combination output by the target deepfm model overflows; 0 indicates that the probability of candidate keyword combination of the to-be-displayed tab output by the target deepfm model underflows.

[0104] In implementation, the number of training samples is increased by increasing the range of historical data, and the initial deepfm model is retrained based on the steps S31 to S34 to reacquire the target deepfm model.

[0105] In actual application scenarios, actual implementers can set a preset quantity threshold according to actual conditions. Preferably, the value range of the preset quantity threshold is set to 0.4 to 0.6 times the total number of candidate keyword combinations output by the target deepfm model.

[0106] The present invention determines whether to re-acquire the target deepfm model according to the number of N / A and 0 in the probability corresponding to each candidate keyword combination, thereby improving the accuracy of determining each candidate keyword combination and the probability corresponding to each candidate keyword combination, and further improving the accuracy of SQL statements pushed to users.

[0107] Step S5, based on each of the push keyword combinations, the SQL statement fragments are sorted into SQL statements supplemented with keywords and pushed to the user to obtain the SQL statement selected by the user;

[0108] See also Figure 7 As shown, it is a schematic diagram of the process of step S5 of an embodiment of the present invention; specifically, step S5 includes:

[0109] Step S51, comparing each push keyword in each push keyword combination with each original keyword to determine a number of distinguishing keywords;

[0110] Step S52, performing sentence analysis on the plurality of distinguishing keywords to obtain a plurality of distinguishing sentence fragments;

[0111] Step S53, concatenating the SQL statement fragment with each distinguishing statement fragment to obtain a plurality of SQL statements;

[0112] Step S54: Pushing the plurality of SQL statements to the user to obtain the SQL statement selected by the user.

[0113] The present invention can determine distinguishing statement fragments by determining distinguishing keywords, and splice the SQL statement fragments with the distinguishing statement fragments to determine several SQL statements pushed to the user, thereby reducing the error of pushing to the user and improving the user input efficiency.

[0114] Step S6: Process the SQL statement selected by the user according to a preset mapping rule to obtain the Elasticsearch operation logic corresponding to the SQL statement selected by the user, and determine it as the target operation logic.

[0115] See also Figure 8 As shown, it is a schematic diagram of the process of step S6 of an embodiment of the present invention; specifically, step S6 includes:

[0116] Step S61, parsing the SQL statement selected by the user according to a preset SQL parsing method to obtain semantic information corresponding to the SQL statement selected by the user;

[0117] In implementation, the preset SQL parsing method is any method in the prior art that can parse an SQL statement to obtain its semantic information, which will not be described in detail here.

[0118] Specifically, the semantic information includes the type of operation (such as SELECT, INSERT, UPDATE, DELETE) and related behavior, query conditions, table name, field name and other information.

[0119] In the step S61, the preset SQL parsing method includes parsing according to the parse method of the CCJSqlParserUtil class.

[0120] In the implementation, according to the parse method of CCJSqlParserUtil class, when the SQL statement selected by the user is "insert into user(id ,name ,age)values(:id ,:name ,:age)", the code for parsing the SQL statement selected by the user is:

[0121] String sql="insert into user(id ,name ,age)values(:id ,:name ,:age)"; / / Parse "insert into user(id ,name ,age)values(:id ,:name ,:age)"

[0122] Step S62: convert the semantic information into corresponding Elasticsearch operation logic based on preset mapping rules, and determine it as the target operation logic.

[0123] In implementation, actual implementers can set the preset mapping rules based on the expert system according to actual conditions, for example, converting the WHERE clause in SQL into the query condition of Elasticsearch, using UPDATE and INSTER to update and insert data respectively, etc.

[0124] The present invention can improve conversion efficiency and increase the flexibility of operating Elasticsearch by parsing SQL statements and determining target operation logic.

[0125] The present invention analyzes the SQL statement fragments input by the user, obtains several original keywords corresponding to the SQL statement fragments, predicts the user's input results according to the target deepfm model and recommends them to the user, which can improve the user's input efficiency and thus improve the query efficiency. By processing the SQL statement selected by the user according to the preset mapping rules to obtain the corresponding Elasticsearch operation logic, the flexibility of operating Elasticsearch can be improved, and the user's query efficiency can be improved.

[0126] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.

Claims

1. A method for operating Elasticsearch based on SQL, characterized in that: include: Step S1, obtaining a SQL statement fragment input by a user; Step S2, analyzing the SQL statement fragment according to a preset statement analysis method to obtain a number of original keywords; The step S2 comprises: Step S21, obtaining a target instruction according to the SQL statement fragment; the target instruction includes at least a name tag of a target task type; the target task type is any one of several preset task types; Step S22, inputting the SQL statement fragment and the target instruction into the target information extraction model to obtain the extraction result output by the target information extraction model; Step S23, determining a number of original keywords according to the extraction result; In step S22, the target information extraction model is obtained by the following steps: Step S221, obtaining a plurality of original text sets; each original text set has a corresponding original task type; each original task type is one of a plurality of preset task types; each of the original text sets includes a plurality of original texts; Step S222, acquiring a corresponding target training sample according to each original text in the plurality of original text sets to obtain a target training sample set; Step S223, training a preset large language model according to the target training sample set to obtain the target information extraction model; Step S3, inputting the several original keywords into the target deepfm model to obtain several candidate keyword combinations output by the target deepfm model and the probability corresponding to each candidate keyword combination; Step S4, determining a plurality of push keyword combinations to be pushed to the user from among the plurality of candidate keyword combinations based on the probabilities corresponding to the candidate keyword combinations; Step S5, based on each of the push keyword combinations, the SQL statement fragments are sorted into SQL statements supplemented with keywords and pushed to the user to obtain the SQL statement selected by the user; Step S6: Process the SQL statement selected by the user according to a preset mapping rule to obtain the Elasticsearch operation logic corresponding to the SQL statement selected by the user, and determine it as the target operation logic.

2. The method for operating Elasticsearch based on SQL according to claim 1, characterized in that: In step S3, the target deepfm model is obtained by the following steps: Step S31, obtaining initial keyword combinations corresponding to several SQL statement fragments input by users in historical data and several intermediate keyword combinations corresponding to SQL statements input by each user; the initial keyword combinations include several initial keywords; Step S32, generating a plurality of training samples according to each of the initial keyword combinations; Step S33, if the intermediate keyword combination contains all the initial keywords in the initial keyword combination, use them as sample labels of the training samples 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 the target deepfm model.

3. The method for operating Elasticsearch based on SQL according to claim 2, characterized in that: The step S4 comprises: Step S41, traversing the probabilities corresponding to each candidate keyword combination, and determining the probability greater than a preset probability threshold as a key probability; Step S42: determining the candidate keyword combinations corresponding to the key probabilities as the push keyword combinations pushed to the user, so as to obtain a plurality of push keyword combinations.

4. The method for operating Elasticsearch based on SQL according to claim 3, characterized in that: The step S5 comprises: Step S51, comparing each push keyword in each push keyword combination with each original keyword to determine a number of distinguishing keywords; Step S52, performing sentence analysis on the plurality of distinguishing keywords to obtain a plurality of distinguishing sentence fragments; Step S53, concatenating the SQL statement fragment with each distinguishing statement fragment to obtain a plurality of SQL statements; Step S54: Pushing the plurality of SQL statements to the user to obtain the SQL statement selected by the user.

5. The method for operating Elasticsearch based on SQL according to claim 4, characterized in that: The step S6 comprises: Step S61, parsing the SQL statement selected by the user according to a preset SQL parsing method to obtain semantic information corresponding to the SQL statement selected by the user; Step S62: convert the semantic information into corresponding Elasticsearch operation logic based on preset mapping rules, and determine it as the target operation logic.

6. The method for operating Elasticsearch based on SQL according to claim 5, characterized in that: In step S222, the target training sample is obtained by the following steps: Step S2221, determining a task template corresponding to each original text set according to the original task type corresponding to the original text set; each preset task type has a corresponding task template; Each task template has a number of slots; each slot is filled with a name tag corresponding to the 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 to obtain the task instruction corresponding to each original text; Step 2223, concatenate each original text and the task instruction corresponding to the original text to obtain the corresponding target training sample.

7. The method for operating Elasticsearch based on SQL according to claim 6, characterized in that: In the step S61, the preset SQL parsing method includes parsing according to the parse method of the CCJSqlParserUtil class.

8. The method for operating Elasticsearch based on SQL according to claim 7, characterized in that: Before 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 threshold, then reacquire the target deepfm model based on the steps S31 to S34 to re-determine the several candidate keyword combinations output by the target deepfm model and the probabilities corresponding to the candidate keyword combinations; Among them, N / A indicates that the probability of candidate keyword combination output by the target deepfm model overflows; 0 indicates that the probability of candidate keyword combination of the to-be-displayed tab output by the target deepfm model underflows.