Data query method and device based on cloud search service, equipment and medium
Through the intention element information database and key information generation model prompt information based on cloud search services, the problem of low data query accuracy in the prior art is solved, and more efficient and accurate data query results are achieved.
Patent Information
- Application Number
- CN202510670629.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-22
- Publication Date
- 2025-08-15
AI Technical Summary
The existing data query technology is low in accuracy when converting the natural language input by the user into a structured query language, resulting in query errors or inability to conduct data queries normally, especially in complex tasks and diversified fields scenarios.
Through a cloud search service-based method, the intent meta information database and key information are used to generate model prompt information, and the intent analysis model is combined to generate target query statements, including obtaining target meta information, keyword and semantic information, and dynamically generating model prompt information to improve the accuracy of intent analysis results.
Improve the accuracy and reliability of data queries, better understand user intentions, generate more accurate query results, and reduce the cost and complexity of model fine-tuning.
Smart Images

Figure CN120492482A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing technology, and in particular to a data query method, apparatus, device, and medium based on a cloud search service. Background Art
[0002] Existing data query technologies mainly require converting the natural language input by users into a structured query language, so as to query the data required by users based on the query language. The common method currently adopted in the industry is to train large language models based on NL2SQL (Natural Language to Structured Query Language) or NL2DSL (Natural Language to Domain Specific Language) to implement structured queries. However, the large models trained by the existing methods are difficult to generate more accurate query statements in many cases, resulting in the inability to perform normal data queries or data query errors. Summary of the Invention
[0003] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a data query method, apparatus, device and medium.
[0004] An embodiment of the present disclosure provides a data query method based on a cloud search service, the method comprising: in response to an input statement of a user received from a cloud search service, obtaining key information corresponding to the input statement, and obtaining target meta-information corresponding to the input statement from a preset intention meta-information library, and generating model prompt information based on the target meta-information and the key information; wherein the intention meta-information library contains a plurality of preset meta-information, the meta-information is information for defining an intention to be analyzed, different meta-information corresponds to different intentions to be analyzed, and the key information includes keyword information and / or semantic information; based on the model prompt information, generating an intention analysis result through a preset intention analysis model; generating a target query statement based on the intention analysis result; performing query processing based on the target query statement to obtain a query result corresponding to the input statement.
[0005] Optionally, obtaining the key information corresponding to the input sentence includes: obtaining a target keyword instruction corresponding to the input sentence from a preset keyword instruction library; wherein the keyword instruction library contains a plurality of preset keyword instructions, and the keyword instruction is at least used to indicate a processing method corresponding to the keyword; obtaining a target semantic instruction corresponding to the input sentence from a preset semantic instruction library; wherein the semantic instruction library contains a plurality of preset semantic instructions, and the semantic instruction is at least used to indicate a processing method of key semantics; and using the target keyword instruction and the target semantic instruction as specific information corresponding to the input sentence.
[0006] Optionally, the keyword instruction also carries priority information corresponding to the keyword; obtaining the target keyword instruction corresponding to the input statement from the preset keyword information library includes: obtaining candidate keyword instructions corresponding to the input statement from the preset keyword information library; based on the priority information corresponding to the candidate keyword instructions, selecting the top N instructions with the highest priority from the candidate keyword instructions as target keyword instructions; wherein N is a preset positive integer.
[0007] Optionally, generating a target query statement based on the intention analysis result includes: determining a query step based on the intention analysis result, and generating a query statement fragment corresponding to the query step; and merging the query statement fragments to obtain a target query statement.
[0008] Optionally, determining the query step based on the intention analysis result includes: reconstructing the intention analysis result to obtain an intention reconstruction result; wherein the intention reconstruction result is structured data; and determining the query step based on the intention reconstruction result.
[0009] Optionally, the reconstructing the intent analysis result to obtain the intent reconstruction result includes: calling a preset target plug-in; the target plug-in includes one or more of a plug-in for performing data normalization processing, a plug-in for performing data error correction processing, and a plug-in for performing data enhancement processing; reconstructing the intent analysis result through the target plug-in to obtain the intent reconstruction result.
[0010] Optionally, determining the query step based on the intention reconstruction result includes: obtaining a target rule corresponding to the intention reconstruction result from a plurality of preset query step generation rules; and generating a query step corresponding to the intention reconstruction result based on the target rule.
[0011] Optionally, generating the query statement fragment corresponding to the query step includes: using a preset rule engine to generate the query statement fragment corresponding to the query step; wherein, the rule engine is an engine that performs query data expansion processing based on structured query language SQL or specific domain language DSL.
[0012] Optionally, generating the query statement fragment corresponding to the query step includes: based on the query step, obtaining a target mapping rule from a preset mapping rule library and obtaining a target expansion operator from a preset expansion operator library; wherein, the mapping rule library contains a plurality of preset mapping rules, and the mapping rules are at least used to indicate different fields with a mapping relationship and the expansion operators corresponding to the fields, and the expansion operator library contains a plurality of preset expansion operators, and the expansion operators are basic operation elements for generating query data; based on the target mapping rule and the target expansion operator, generating the query statement fragment corresponding to the query step.
[0013] Optionally, the merging the query statement fragments includes: obtaining a fragment type and a fragment connection mode corresponding to the query statement fragments, and merging the query statement fragments based on the fragment type and the fragment connection mode.
[0014] An embodiment of the present disclosure also provides a data query device based on a cloud search service, including: a prompt information generation module, which is used to obtain key information corresponding to the input statement in response to an input statement received from a user of the cloud search service, and obtain target meta information corresponding to the input statement from a preset intention meta information library, and generate model prompt information based on the target meta information and the key information; wherein the intention meta information library contains multiple preset meta information, and the meta information is information used to define the intention to be analyzed, and different meta information corresponds to different intentions to be analyzed, and the key information includes keyword information and / or semantic information; an intention analysis module, which is used to generate an intention analysis result through a preset intention analysis model based on the model prompt information; a query statement generation module, which is used to generate a target query statement based on the intention analysis result; and a data query module, which is used to perform query processing based on the target query statement to obtain a query result corresponding to the input statement.
[0015] An embodiment of the present disclosure also provides an electronic device, which includes: a processor; a memory for storing instructions executable by the processor; the processor is used to read the executable instructions from the memory and execute the instructions to implement a data query method based on a cloud search service as provided in an embodiment of the present disclosure.
[0016] An embodiment of the present disclosure further provides a computer-readable storage medium, which stores a computer program for executing the data query method based on the cloud search service provided by the embodiment of the present disclosure.
[0017] The embodiments of the present disclosure also provide a computer program product, including a computer program, which, when executed by a processor, implements the data query method based on the cloud search service provided in the embodiments of the present disclosure.
[0018] The above technical solution provided by the embodiment of the present disclosure can obtain the target meta information corresponding to the input sentence from the preset intention meta information library, as well as the key information corresponding to the input sentence, the key information including keyword information and / or semantic information, so as to generate model prompt information based on the target meta information and key information. On this basis, the intention analysis result can be generated by the preset intention analysis model, and then the target query sentence is generated and query processing is performed to obtain the query result. Compared with the existing method of only using conventional static prompt information as model prompt information, the embodiment of the present disclosure can directly determine the target meta information of the input sentence based on the intention meta information library containing multiple meta information, and comprehensively generate model prompt information by combining key information such as keyword information and semantic information. The above method can efficiently and accurately focus on the main information of the user input sentence, and the model prompt information dynamically determined based on this is more accurate and reliable. On this basis, it is easier for the network model to understand the intention of the input sentence, thereby improving the accuracy of the intention analysis result generated by the intention analysis model, and correspondingly effectively improving the accuracy of the target query sentence, thereby ensuring that more accurate and reliable query results are obtained.
[0019] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0021] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0022] Figure 1 A flowchart of a data query method based on a cloud search service provided in an embodiment of the present disclosure;
[0023] Figure 2 A schematic diagram of a target meta-information determination process provided by an embodiment of the present disclosure;
[0024] Figure 3 A schematic diagram of a target keyword instruction determination process provided by an embodiment of the present disclosure;
[0025] Figure 4 A schematic diagram of a target semantic instruction determination process provided by an embodiment of the present disclosure;
[0026] Figure 5 A schematic diagram of generating an intent analysis result provided by an embodiment of the present disclosure;
[0027] Figure 6 A schematic diagram of an intention reconstruction process provided by an embodiment of the present disclosure;
[0028] Figure 7 A schematic diagram of a target query statement generation process provided by an embodiment of the present disclosure;
[0029] Figure 8 A data query process diagram provided in an embodiment of the present disclosure;
[0030] Figure 9 A schematic diagram of the structure of a data query device based on a cloud search service provided in an embodiment of the present disclosure;
[0031] Figure 10 A schematic structural diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0032] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features therein can be combined with each other in the absence of conflict.
[0033] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0034] Compared to simple full-text or semantic searches, structured queries provide more accurate results. For example, if a user inputs the sentence "Please search for dangerous driving cases in XX City with fines exceeding 2,500 yuan," a simple full-text or semantic search may result in irrelevant cases where the parties' home addresses are in XX City or where the compensation amounts are close to 2,500 yuan, and the desired cases may not be accurately found. However, if the user input sentence is converted into a structured query based on NL2SQL or NL2DSL technology, directly querying the region and fine fields can accurately search for relevant cases. However, the inventors have discovered through research that in the related art, most of the large language models are trained based on NL2SQL or NL2DSL technology to implement structured queries. However, in the case of diverse domain scenarios and a large vocabulary, the query sentences generated by the trained large language models are less accurate, especially for complex query tasks, where the accuracy is even lower. When processing complex tasks, the related art requires additional operations such as fine-tuning the model or building complex task agents, which is costly and inefficient. In addition, there are often problems such as mismatching between the database framework used to define how to organize and store data and the intent analysis results. For example, when a user searches for "tendering in the elevator industry," the "elevator" industry does not exist in the database, resulting in an abnormal query. To improve the above problems, the embodiments of the present disclosure provide a data query method, device, equipment, and medium based on cloud search services.
[0035] Figure 1 This is a flow chart of a data query method based on a cloud search service provided by an embodiment of the present disclosure. The method can be executed by a data query device based on a cloud search service, wherein the device can be implemented using software and / or hardware and can generally be integrated into an electronic device. Figure 1 As shown, the method mainly includes the following steps S102 to S108:
[0036] Step S102, in response to receiving the input statement of the user of the cloud search service, obtain the key information corresponding to the input statement, and obtain the target meta information corresponding to the input statement from the preset intention meta information library, and generate model prompt information based on the target meta information and the key information; wherein, the intention meta information library contains multiple preset meta information, the meta information is information used to define the intention to be analyzed, and the key information includes keyword information and / or semantic information.
[0037] Cloud search services are search services based on cloud computing technology. Users can use cloud search services to efficiently search for data. The data query method provided in the embodiments of the present disclosure is well-suited for cloud search services. For users of cloud search services, user input sentences are natural language. The embodiments of the present disclosure introduce an intent metadata library. The intent metadata library can contain multiple preset metadata, each of which can belong to one or more specified fields. Meta information is used to define the intent to be analyzed. Different metadata corresponds to different intents to be analyzed. For example, in the legal field, metadata can be set for "cause of action," "fine," "case details," and other fields that require the model to analyze intent. Meta information can be composed of at least one preset field, and the preset fields in the metadata are arranged according to a first specified structure. The embodiments of the present disclosure do not restrict the preset fields and the first specified structure; any information that can assist the model in understanding the intent to be analyzed can be used. For example, the metadata includes four preset fields: "field name," "description," "format requirements," and "static example," and the first specified structure is used to indicate the order in which these four preset fields are arranged. For example, a piece of meta-information in the search field can be: "Product function: Product function refers to the name of various cloud search functions, and multiple functions are separated by ;. For example, how to activate an instance and expand the capacity of an instance is extracted as "activate instance; expand the capacity of an instance"". A piece of meta-information in the legal field can be: "Time range: The range of judgment time, output in the format of (start time, end time), and no limit is represented by INF. For example, cases after 2020 are extracted as (2020-01-01, INF)". The above is only an example and should not be regarded as a limitation. In actual application, the required meta-information can be flexibly set according to needs. See Figure 2 A schematic diagram of a target meta-information determination process is shown. According to an embodiment of the present disclosure, the target meta-information corresponding to the input sentence can be determined by querying the intent meta-information library based on the received user input sentence. The intent meta-information library can be dynamically maintained by relevant personnel according to needs. By setting up the intent meta-information library, it is convenient for the model to quickly identify, understand and process the important intents of the user input sentence, the intents that are easily overlooked by the model or the specified intents that require extra attention from the model, which helps the model to perform intent analysis more accurately.
[0038] In some examples, the key information may be information directly obtained by analyzing the input sentence. In some specific examples, the key information may be represented by key instructions, which may be instructions for dynamically generating model prompt information and are therefore also referred to as dynamic instructions. Specifically, the key instructions may include keyword instructions corresponding to keyword information and semantic instructions corresponding to semantic information. For example, embodiments of the present disclosure may pre-set a dynamic instruction library, specifically a keyword instruction library and a semantic instruction library, so that more accurate, reliable, and standardly formatted key information can be quickly obtained from the instruction library based on the input sentence.
[0039] Step S104: Generate an intention analysis result based on the model prompt information through a preset intention analysis model.
[0040] The intent analysis model is specifically a neural network model in the field of artificial intelligence. The embodiments of the present disclosure do not limit the implementation method of the intent analysis model. For example, the intent analysis model can be a generative model, which can be specifically implemented using a large language model. It should be noted that the relevant technology usually only uses conventional static prompt information as model prompt information, while the embodiments of the present disclosure can directly determine the target meta-information of the input sentence based on an additionally set intent meta-information library containing a variety of meta-information, and combine key information such as keyword information and semantic information to comprehensively generate more accurate and reliable model prompt information, which can efficiently and accurately assist the model to accurately understand and process the main information of the user input sentence, and can perform in-depth analysis of the user input sentence, such as analyzing information of various dimensions such as time, region, entity, implicit knowledge, etc., so as to generate accurate intent analysis results and achieve flexible and convenient rapid tuning effects.
[0041] Step S106: Generate a target query statement based on the intent analysis results. For example, the target query statement can be structured data. In practical applications, it can be formatted based on the intent analysis results, and then expanded to generate the target query statement. In addition, query planning can be performed based on the intent analysis results, breaking it down into one or more query steps, thereby generating the target query statement more conveniently and efficiently. The above is only an example, and the method of generating the target query statement based on the intent analysis results is not limited here.
[0042] Step S108: perform query processing based on the target query statement to obtain a query result corresponding to the input statement.
[0043] Compared with the existing method of only using conventional static prompt information as model prompt information, the embodiment of the present disclosure can directly determine the target meta-information of the input sentence based on the intention meta-information library containing multiple meta-information, and combine key information such as keyword information and semantic information to comprehensively generate model prompt information. The above method can efficiently and accurately focus on the main information of the user input sentence. The model prompt information dynamically determined based on this is more accurate and reliable. On this basis, it is easier for the intention analysis model to understand the intention of the input sentence, thereby improving the accuracy of the intention analysis results generated by the intention analysis model, and correspondingly effectively improving the accuracy of the target query sentence, thereby ensuring more accurate and reliable query results.
[0044] In some implementations, the above step of obtaining key information corresponding to the input sentence can be performed with reference to the following steps (1) to (3):
[0045] Step (1) obtains a target keyword instruction corresponding to the input sentence from a preset keyword instruction library; wherein the keyword information library contains a plurality of preset keyword instructions, the keyword instruction is an instruction having a second specified structure, and the keyword instruction is at least used to indicate a processing method corresponding to the keyword.
[0046] Taking into account that the general language model generally does not handle professional vocabulary such as new product features, game characters, game skills, etc. well, the cost of model fine-tuning is high and cannot be quickly tuned. In order to be able to efficiently and accurately identify the keywords of the input sentence and enable the model to accurately know the corresponding processing method, the model can be quickly tuned for specific vocabulary such as professional vocabulary without the need to fine-tune the model separately. The embodiment of the present disclosure can set up a keyword instruction library. For example, the keyword instruction also carries priority information corresponding to the keyword; on this basis, the target keyword instruction corresponding to the input sentence is obtained from the preset keyword instruction library, including: obtaining the candidate keyword instruction corresponding to the input sentence from the preset keyword instruction library; based on the priority information corresponding to the candidate keyword instruction, the top N instructions with the highest priority are selected from the candidate keyword instructions as the target keyword instruction; wherein N is a preset positive integer, and the number of candidate keyword instructions can also be set according to demand, and is not limited here. In practical applications, each word or at least part of the words in the input sentence can be matched with the keyword instruction library. That is, if each word or at least part of the words in the input sentence hits the keyword corresponding to the keyword instruction in the keyword instruction library, then the keyword instruction can be used as a candidate keyword instruction. Through the above method, at least one corresponding candidate keyword instruction can be obtained, and on this basis, the target keyword instruction can be obtained by screening the priority information carried by the candidate keyword instruction. The above method fully takes into account the length limit of the model prompt information, and thus determines the target keyword instruction based on the priority. When the prompt information is limited, it can effectively ensure that the model gives priority to more important keyword instructions.
[0047] The keyword instruction may be composed of at least one preset field, and the preset fields in the keyword instruction are arranged according to the second specified structure. The embodiments of the present disclosure do not limit the second specified structure. For example, the keyword instruction includes four preset fields: "keyword condition", "filtering rule", "priority rule", and "instruction content", and the second specified structure is used to indicate that the above four preset fields are arranged in sequence. Exemplarily, a keyword instruction in the game field may be: "XX wants, / XX wants / ,1,XX wants to be extracted as a game character name". If the user's input statement contains "XX wants", the corresponding keyword instruction can be quickly found in the keyword instruction library, and it is known that its processing method is to extract "XX wants" as a game character name. A keyword instruction in the legal field may be: "disease, illness, symptom, syndrome, / any word meets the requirement / ,1, if the mentioned disease has a causal relationship with what the court deems or the core case, extract it as a keyword, such as'mental illness','schizophrenia', etc.". The above are all examples and are not limited here. In practical applications, the keyword instructions can be set flexibly and the structure of the keyword instructions can be adjusted flexibly. The above keyword condition can be understood as the keyword that needs to be included, and the keyword instruction that meets the keyword condition can be used as a candidate keyword instruction. The above filtering rule is used to indicate filtering the candidate keyword instructions according to a specific rule. For example, the default rule is that the keyword is fully matched, or custom rules can be matched using regular expressions or scripts, and only the rules that meet the conditions are retained, which can be set flexibly specifically. The above priority rule can indicate the corresponding priority of the keyword, and is used for sorting based on the configured priority. Moreover, the rule with a higher word frequency and compactness in matching the user's input statement is prioritized. For example, if the user's input statement is: "Can you provide me with an operation and maintenance manual?", then the compactness of "operation manual" in the keyword instruction library is greater than that of "operation and maintenance manual", and the priority of "operation manual" is higher. In addition, the priority of the substring is reduced. For example, the priority of matching "collapse" is lower than that of "house collapse". The instruction content is used to indicate how to process the keyword. For example, the instruction content indicates that the keyword "XX wants" is extracted as a game character name. On this basis, reference can also be made to Figure 3 As shown in the schematic diagram of a target keyword instruction determination process, relevant personnel such as business experts can maintain the keyword instruction library. The user's input statement can perform keyword search based on the keyword instruction library to initially obtain candidate keyword instructions, and then through operations such as filtering and priority sorting, the target keyword instruction is obtained. Through the above method, it helps the model to quickly identify, accurately understand, and process the important keywords in the user's input statement during the intent analysis process.
[0048] Step (2) obtains the target semantic instruction corresponding to the input sentence from a preset semantic instruction library; wherein the semantic instruction library contains multiple preset semantic instructions, the semantic instruction is an instruction with a third specified structure, and the semantic instruction is at least used to indicate the processing method of key semantics.
[0049] Considering that general language models have difficulty in processing the concepts of some input sentences, confusion is likely to occur, and it is difficult to identify the implicit knowledge of input sentences or understand the semantics of specific situations. In order to enable the model to more clearly grasp the implicit knowledge or specific situations in the user's input sentences, the embodiment of the present disclosure can set a semantic instruction library, so as to achieve the effect of rapid model tuning for implicit knowledge or specific situations without the need to fine-tune the model separately. For example, the input sentence can be semantically analyzed first, and the semantic analysis results can be matched with the key semantic information corresponding to the semantic instructions in the semantic instruction library for similarity, and the semantic instruction with the highest similarity or the semantic instruction with a similarity higher than a preset threshold can be used as the target semantic instruction. See Figure 4The following is a schematic diagram of a target semantic instruction determination process. A semantic instruction library can be maintained by relevant personnel, such as business experts. User input statements can be searched based on the semantic instruction library to obtain the target semantic instruction corresponding to the input statement. The semantic instruction in the semantic instruction library can be composed of at least one preset field, and the preset fields in the semantic instruction are arranged according to a third specified structure. The present disclosure does not limit the third specified structure. In practical applications, semantic instructions can be divided into one or more categories as needed. For example, semantic instructions can be divided into two categories: one for semantic instructions corresponding to implicit knowledge and the other for semantic instructions corresponding to dynamic examples. Semantic instructions in different categories can have different third specified structures. For example, semantic instructions corresponding to implicit knowledge include two fields: "Term explanation + typical scenario" and "Tuning instruction." The third specified structure of the semantic instruction corresponding to implicit knowledge indicates that these two fields are arranged in order. Semantic instructions corresponding to dynamic examples include two fields: "Example question" and "Example output." The third specified structure of the semantic instruction corresponding to dynamic examples indicates that these two fields are arranged in order. All of the above methods can clearly indicate how key semantics are handled. To facilitate understanding, the following explains the semantic instructions corresponding to implicit knowledge: In the legal field, if a user's input sentence contains implicit "apparent agency" situations, large models often have difficulty identifying them. In this case, a semantic instruction library can be used to explain "apparent agency." For example, the semantic instruction library contains a semantic instruction corresponding to "apparent agency." This instruction contains a specific explanation of apparent agency and common scenarios of apparent agency in the "Term Explanation + Typical Scenarios" field. This information can also be converted into vector form to facilitate semantic search. In addition, this instruction can detail the definition, scenarios, and analysis of apparent agency in the "Tuning Instructions." This approach can effectively assist the model in identifying implicit "apparent agency" situations from user input sentences. In addition, considering that the model's processing performance is poor in certain sub-fields, semantic instructions corresponding to dynamic examples can be provided for such sub-fields. The "Example Question" field of this instruction can contain input sentences related to this sub-field, and the "Example Output" field of this instruction can contain examples of the intent analysis results of the example questions for the model to learn and reference. The above method helps the model to quickly identify, accurately understand and process keywords in user input sentences during intent analysis, which helps to significantly improve the intent analysis effect in specific fields.
[0050] Step (3) takes the target keyword instruction and the target semantic instruction as the key information corresponding to the input sentence.
[0051] Through the above method, the target keyword instructions and target semantic instructions that match the input sentence filtered out from the instruction library can accurately and reliably present the important information of the input sentence. Moreover, the above instructions filtered out through the instruction library usually carry more information such as interpretation instructions and processing method instructions, which is equivalent to supplementing the model with additional relevant information. The key information obtained is richer and the format is more standardized, which is easier for the model to understand and process.
[0052] Based on the above, the intention meta-information and key information can be assembled into model prompt information. Specifically, the key information can also be called dynamic instructions, that is, instructions for dynamically generating model prompt information. Moreover, based on the intention meta-information and key information, the user's static prompt instructions or preset prompt words can be further combined to comprehensively assemble and generate model prompt information. For easier understanding, please refer to Figure 5The diagram shown is a schematic diagram of generating intent analysis results, indicating that based on the user input sentence, the target meta-information, target keyword instructions and target semantic instructions can be obtained respectively based on the intent meta-information library, keyword instruction library and semantic instruction library, among which the target keyword instructions and target semantic instructions can be collectively referred to as dynamic instructions. The target meta-information, dynamic instructions and user static prompt instructions can be assembled into model prompt information, and the model prompt information can be input into an AI (Artificial Intelligence) model such as a large language model for intent analysis to obtain the intent analysis result. It is understandable that general large language models usually have poor processing effects on professional vocabulary or complex sentences, and the cost of model fine-tuning is high and it is impossible to achieve fast tuning effects. The above-mentioned method provided by the embodiment of the present disclosure does not require additional model fine-tuning even for complex tasks or fields with more professional vocabulary. It is only necessary to add the meta-information corresponding to the corresponding vocabulary to the meta-information library, or to add the semantic instructions corresponding to complex semantics or the keyword instructions corresponding to specific keywords to the instruction library. For example, for the legal field, "cause of the case", "fine", "case details" and so on are more important, so they can be added to the intent meta-information library so that the model can be effectively prompted to pay attention to relevant information in the future. For example, "XX wants" is the name of a game character. When the user inputs the sentence "What is the weapon that XX wants", most models find it difficult to accurately give intent analysis results and may mistakenly think that it is the weapon that XX needs, rather than the weapon that "XX wants". However, by adding "XX wants" to the keyword instruction library, the model can be simply and conveniently prompted to extract "XX wants" as the name of the game character. For example, when a user's input sentence contains implicit "apparent proxy," large models often have difficulty identifying it. However, by placing "apparent proxy" in a semantic instruction library and supplementing it with relevant implicit knowledge, the model can be prompted to recognize the "apparent proxy" semantics of the user's input sentence. As previously mentioned, the above-mentioned method of obtaining the meta-information and dynamic instructions of the user's input sentence can achieve the effect of quickly converging bad examples and improving the accuracy of the model's intent analysis. In summary, by obtaining the meta-information corresponding to the input sentence, as well as key information such as keyword information and semantic information, accurate model prompt information is dynamically generated. With the help of this model prompt information, the network model can generate more accurate intent analysis results.
[0053] On the basis of obtaining a relatively accurate intent analysis result, in order to further obtain a precise target query statement, the embodiment of the present disclosure further provides the above-mentioned step S106, i.e., a specific implementation example of the step of generating a target query statement based on the intent analysis result, which can be performed with reference to the following steps A to C:
[0054] Step A: Determine the query steps based on the intent analysis results. There can be one or more query steps. That is, based on the intent analysis results, the user's input statement can be split into one or more query steps. Each query step can correspond to corresponding query conditions and query analysis methods, which are not limited here. For example, the intent related to bid winning rate needs to be converted into a funnel analysis, which relies on the analysis results of the bidding and winning query steps.
[0055] In some specific implementation examples, step A can be performed with reference to the following steps A1 to A2:
[0056] Step A1, reconstruct the intent analysis result to obtain the intent reconstruction result. The intent reconstruction result is structured data. It is understandable that the intent analysis result may be semi-structured data and is not standardized. Therefore, the intent analysis result can be reconstructed based on the needs of subsequent processing. The reconstruction process is to reconstruct and optimize the intent analysis result. The reconstruction process includes but is not limited to one or more of formatting, data normalization, data error correction, and data enhancement. For example, formatting can be performed by methods such as regular expressions to convert semi-structured data into structured data, and then data normalization, data error correction, data enhancement, and other processes are performed. In some examples, the intent analysis result itself is structured data, and accordingly, the intent reconstruction result is also structured data. At this time, the reconstruction process does not need to include formatting (that is, the process of converting the data to be processed into structured data). Specifically, it may include data normalization, data error correction, data enhancement, and other processes to optimize the intent analysis results. In other examples, the intent analysis results are not structured data. In this case, the reconstruction process at least includes formatting processing, that is, the above-mentioned steps of reconstructing the intent analysis results will include the processing steps of converting the intent analysis results into structured data. On this basis, it can also include other optimization processing steps such as data normalization processing, data error correction processing, and data enhancement processing, which are not limited here.
[0057] To improve the efficiency and flexibility of the formatting process, step A1 may be performed, for example, with reference to steps A1.1 to A1.2 below:
[0058] Step A1.1, calling a preset target plug-in; the target plug-in includes one or more of a plug-in for performing data normalization processing, a plug-in for performing data error correction processing, and a plug-in for performing data enhancement processing.
[0059] That is, the embodiments of the present disclosure can flexibly set up multiple plug-ins to facilitate the execution of different processing. The plug-in used to perform data normalization processing can be simply referred to as a normalization plug-in, which can normalize scalar query data such as amounts and dates, such as unifying exchange rates, unifying digital precision, and unifying date formats; the plug-in used to perform data error correction processing can be simply referred to as an error correction plug-in, which can correct and align fields such as enumeration types. For example, the user's input statement contains "elevator industry", but the industry enumeration does not have "elevator industry", so it is necessary to find a similar industry to replace it. For example, if the normalized document type enumeration item is "winning bid", then the "winning bid document" in the user's input statement can be replaced with "winning bid". The plug-in used to perform data enhancement processing can be simply referred to as an enhancement plug-in, which is used to further enhance the intent information and supplement the associated information. For example, if the user's input statement only contains license plate number information, then the vehicle identity required for the query can be supplemented based on the license plate number. For example, the company region can be supplemented based on the company name. In actual applications, one or more of the above-mentioned various types of plug-ins can also be set separately to help enhance the comprehensiveness of the reconstruction processing.
[0060] Step A1.2, reconstruct the intent analysis result through the target plug-in to obtain the intent reconstruction result. For ease of understanding, you can refer to Figure 6 The diagram of the intent reconstruction process shown in the figure shows that the intent formatting process is first performed. Then, based on the formatted intent analysis results, the normalization plug-in, error correction plug-in, and enhancement plug-in are used to process the intent reconstruction results. The above-mentioned method of using plug-ins to reconstruct the intent analysis results is relatively flexible and convenient, and fully ensures that the intent reconstruction results are more standardized and accurate. It can effectively ensure that subsequent processes can be executed normally, avoid query errors caused by problems such as mismatch between the database framework and the intent analysis results, and further improve query accuracy.
[0061] Step A2: Determine the query steps based on the intent reconstruction results. Specifically, query planning can be performed based on the intent reconstruction results to obtain query steps. For example, step A2 can be performed with reference to the following steps A2.1 to A2.2:
[0062] Step A2.1, obtain the target rule corresponding to the intention reconstruction result from the preset multiple query step generation rules.
[0063] The various query step generation rules include but are not limited to complex rules, general aggregation rules, detailed rules, etc. Complex rules can also be called complex indicator expansion rules, and funnel analysis and other processing methods are used to expand specific complex indicators. For example, related queries on the "winning bid" intention need to rely on the number of bids, the number of candidates, etc., so it is necessary to plan the steps reasonably, first check the number of bids, then check the number of candidates, and finally determine the number of winning bids, etc. General aggregation rules can be determined according to preset aggregation functions. For example, if the intent analysis result indicates that the total amount of the winning bid needs to be calculated, the general summation rule can be used to calculate the total amount of the winning bid. Detailed rules are mainly used to extract information of specific fields. For example, if the intent analysis result contains a field to be recalled, the field can be limited to query the corresponding detailed data.
[0064] In practical applications, a mapping relationship between intent and query step generation rules can be established in advance. For example, the mapping relationship can be enumerated to list the intents applicable to the analysis of each query step generation rule, so that when the intent is known, the corresponding target rule can be determined based on the mapping relationship. Specifically, based on the mapping relationship, rules corresponding to the content of the intent reconstruction result can be found from multiple generation rules. For example, the intent containing "winning bid rate" has a mapping relationship with the complex rule. When the intent reconstruction result contains the winning bid rate, the target rule contains complex planning.
[0065] Step A2.2: Generate query steps corresponding to the intent reconstruction result based on the target rule. The query step can be one or more steps. Generally speaking, the more complex the intent of the user input sentence, the more query steps there will be.
[0066] The accuracy of query data directly generated corresponding to complex input statements in related technologies is usually low. However, the above-mentioned method provided by the embodiment of the present disclosure can quickly determine the reasonable planning method corresponding to the intention reconstruction result, thereby more accurately and reliably determining the query steps of the intention reconstruction result, which helps to decompose complex intentions, so as to query step by step according to the query steps, reduce the difficulty of generating query statements, and improve query reliability.
[0067] Step B: Generate a query statement fragment corresponding to the query step. In practical applications, the query step may further specifically indicate query conditions, query analysis methods, etc., and the query statement fragment corresponding to the query step may be generated based on DSL (Domain Specific Language) or SQL (Structured Query Language) technology.
[0068] Exemplarily, step B may be performed with reference to the following steps: using a preset rule engine to generate a query statement fragment corresponding to the query step; wherein the rule engine is an engine that performs query data expansion processing based on DSL or SQL, which may be referred to as a DSL / SQL expansion rule engine. The rule engine may use an expansion operator to perform DSL / SQL expansion based on the order of the above query steps. For ease of understanding, in some specific examples, the rule engine may generate a query statement fragment corresponding to the query step according to the following steps 1 to 2:
[0069] Step 1: Based on the query step, obtain the target mapping rule from the preset mapping rule library and the target expansion operator from the preset expansion operator library; wherein, the mapping rule library contains a plurality of preset mapping rules, and the mapping rule is at least used to indicate different fields with mapping relationships and the expansion operators corresponding to the fields. The mapping rule library may contain general mapping rules, such as represented by (query field, intent field, expansion operator) triples, and may also contain custom mapping rules, such as generating SQL / DSL clause fragments through a specified scripting language. There is no specific limitation. For example, a keyword hit strategy or a semantic matching strategy may be adopted. Based on the content of the query step, a mapping rule that matches the query field and / or intent field with the query step is selected from the mapping rule library, and the mapping rule is used as the target mapping rule. The expansion operator library contains a variety of pre-defined expansion operators. Expansion operators are fundamental operational elements used to generate query data. They can be thought of as elements that convert query conditions into standardized query structures that can be executed at the underlying level. Operators such as And, Or, Not, Must, Filter, and Should can all be considered expansion operators and are not listed here. The operator library can also include built-in operators, such as those corresponding to normalization plugins, as well as custom operators defined through scripting languages, without limitation here. In practice, each specification in the normalization plugin corresponds to a corresponding expansion operator, enabling rapid implementation of normalized expansion based on the corresponding expansion operator. For example, range expansion for date formats and interval expansion for proximity queries can be used. Mapping rules can be used to determine which operators should be used for each query step corresponding to the intent analysis results, thereby mapping each query step into standardized query data. For example, once the target mapping rule is known, if the target mapping rule is represented by a triple, the expansion operator contained in the triple corresponding to the target mapping rule can be used as the target expansion operator and obtained from the expansion operator library. In actual applications, the target expansion operator can also be determined directly based on the content of the query step. For example, if the query step indicates that a sum operation is required, the target expansion operator is determined to include the And operator.
[0070] Step 2: Generate query statement fragments corresponding to the query steps based on the target mapping rules and the target expansion operator. In practical applications, each query step can be expanded and converted into a query statement fragment based on the target mapping rules and the target expansion operator.
[0071] Step C, merge the query statement fragments to obtain the target query statement. Exemplarily, the fragment type and fragment connection method corresponding to the query statement fragment can be obtained, and the query statement fragments can be merged based on the fragment type and fragment connection method. For example, the fragment type can be based on Where (condition) fragment, Group By (aggregation) fragment, etc., which can be flexibly set and is not limited here. For example, the query statement fragment of the Where (condition) fragment type can be connected based on the And operator or the Or operator, and the Bool (Boolean) condition can be merged according to the path (path) grouping and the Must (must) operator, the Filter (filter) operator, the Should (should) operator and other operators. The same aggregate function of the Group By condition and the Where (condition) can be merged, etc. Complex queries can also additionally replace the combined fragments within specified characters such as {}, which can be set according to needs. For ease of understanding, please also refer to Figure 7 The diagram below illustrates a target query generation process, showing how, based on the query planning results, target mapping rules and target expansion operators can be derived from a mapping rule library and an expansion operator library. These fragments are then expanded and combined to form the target query. This approach allows complex query tasks to be broken down, effectively reducing query complexity and improving the reliability of the resulting target query.
[0072] On the basis of the above, we can refer to Figure 8 The data query process shown in the figure shows that after receiving the user input statement, the following five key processing steps are mainly performed: intent analysis processing, intent reconstruction processing, query planning processing, rule engine expansion processing, and query processing. The specific implementation methods of each of these processing steps can be referred to the relevant content above and will not be repeated here.
[0073] In summary, the above method provided by the embodiment of the present disclosure obtains the target meta-information and dynamic instructions (target keyword instructions and target semantic instructions) corresponding to the user input sentence by setting an intention meta-information library, a keyword instruction library, and a semantic instruction library, and dynamically generates accurate model prompt information on this basis. With the help of the above model prompt information, the model can efficiently and accurately focus on the main information of the user input sentence, and on this basis, it is easier for the intention analysis model to understand the intention of the input sentence, thereby improving the accuracy of the intention analysis results generated by the intention analysis model. For complex fields and complex sentences, flexible and fast tuning effects can be achieved, and the query accuracy of complex query tasks can be improved without the need for additional fine-tuning of the model or the construction of complex task intelligent agents and other high-cost and low-efficiency operations. In addition, by reconstructing the intention analysis results output by the model, specifically performing formatting, normalization, error correction, enhancement, etc., the obtained intention reconstruction results can effectively ensure that the subsequent processes can be executed normally, avoid query errors caused by problems such as mismatch between the database framework and the intention analysis results, and further improve the query accuracy. In addition, complex intents can be broken down through query planning processing, and then expanded through the rule engine to obtain query statement fragments corresponding to each query step. The target query statement is then generated by merging the fragments, which can effectively reduce the difficulty of generating query data and comprehensively improve the query accuracy and reliability.
[0074] Corresponding to the aforementioned data query method, the embodiment of the present disclosure further provides a data query device based on cloud search service, Figure 9 This is a schematic diagram of the structure of a data query device based on a cloud search service provided by an embodiment of the present disclosure. The device can be implemented by software and / or hardware and can generally be integrated into an electronic device, such as Figure 9 As shown, the data query device includes:
[0075] Prompt information generation module 902 is configured to, in response to receiving a user input statement from a cloud search service, obtain key information corresponding to the input statement, obtain target meta-information corresponding to the input statement from a preset intent meta-information library, and generate model prompt information based on the target meta-information and the key information; wherein the intent meta-information library contains a plurality of preset meta-information, wherein the meta-information is information used to define the intent to be analyzed, and different meta-information corresponds to different intents to be analyzed, and the key information includes keyword information and / or semantic information;
[0076] Intent analysis module 904, used to generate intent analysis results based on model prompt information using a preset intent analysis model;
[0077] A query statement generating module 906 is configured to generate a target query statement based on the intent analysis result;
[0078] The data query module 908 is used to perform query processing based on the target query statement to obtain the query result corresponding to the input statement.
[0079] Compared with the existing method of only using conventional static prompt information as model prompt information, the embodiment of the present disclosure can directly determine the target meta-information of the input sentence based on the intention meta-information library containing multiple meta-information, and combine key information such as keyword information and semantic information to comprehensively generate model prompt information. The above-mentioned device can efficiently and accurately focus on the main information of the user input sentence. The model prompt information dynamically determined based on this is more accurate and reliable. On this basis, it is easier for the intention analysis model to understand the intention of the input sentence, thereby improving the accuracy of the intention analysis results generated by the intention analysis model, and correspondingly effectively improving the accuracy of the target query sentence, thereby ensuring more accurate and reliable query results.
[0080] In some embodiments, the prompt information generation module 902 is specifically used to: obtain the target keyword instruction corresponding to the input sentence from a preset keyword instruction library; wherein the keyword instruction library contains a plurality of preset keyword instructions, and the keyword instruction is at least used to indicate the processing method corresponding to the keyword; obtain the target semantic instruction corresponding to the input sentence from a preset semantic instruction library; wherein the semantic instruction library contains a plurality of preset semantic instructions, and the semantic instruction is at least used to indicate the processing method of specific semantics; use the target keyword instruction and the target semantic instruction as specific information corresponding to the input sentence.
[0081] In some embodiments, the keyword instruction also carries priority information corresponding to the keyword; the prompt information generation module 902 is specifically used to: obtain candidate keyword instructions corresponding to the input statement from a preset keyword information library; based on the priority information corresponding to the candidate keyword instructions, select the top N instructions with the highest priority from the candidate keyword instructions as target keyword instructions; wherein N is a preset positive integer.
[0082] In some implementations, the query statement generation module 906 is specifically used to: determine the query steps based on the intent analysis results, and generate query statement fragments corresponding to the query steps; and merge the query statement fragments to obtain a target query statement.
[0083] In some embodiments, the query statement generation module 906 is specifically used to: reconstruct the intent analysis result to obtain an intent reconstruction result; wherein the intent reconstruction result is structured data; and determine the query steps based on the intent reconstruction result.
[0084] In some embodiments, the query statement generation module 906 is specifically used to: call a preset target plug-in; the target plug-in includes one or more of a plug-in for performing data normalization processing, a plug-in for performing data error correction processing, and a plug-in for performing data enhancement processing; and reconstruct the intent analysis result through the target plug-in to obtain an intent reconstruction result.
[0085] In some embodiments, the query statement generation module 906 is specifically used to: obtain a target rule corresponding to the intention reconstruction result from a preset plurality of query step generation rules; and generate a query step corresponding to the intention reconstruction result based on the target rule.
[0086] In some embodiments, the query statement generation module 906 is specifically used to: use a preset rule engine to generate a query statement fragment corresponding to the query step; wherein, the rule engine is an engine that performs query data expansion processing based on the structured query language SQL or the specific domain language DSL.
[0087] In some embodiments, the query statement generation module 906 is specifically used to: based on the query step, obtain the target mapping rule from the preset mapping rule library and obtain the target expansion operator from the preset expansion operator library; wherein, the mapping rule library contains a plurality of preset mapping rules, and the mapping rules are at least used to indicate different fields with mapping relationships and the expansion operators corresponding to the fields, and the expansion operator library contains a plurality of preset expansion operators, and the expansion operators are basic operation elements for generating query data; based on the target mapping rule and the target expansion operator, generate the query statement fragment corresponding to the query step.
[0088] In some implementations, the query statement generating module 906 is specifically configured to: obtain a fragment type and a fragment connection mode corresponding to the query statement fragment, and merge the query statement fragments based on the fragment type and the fragment connection mode.
[0089] The data query device provided by the embodiments of the present disclosure can execute the data query method provided by any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0090] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described device embodiment can refer to the corresponding process in the method embodiment, and will not be repeated here.
[0091] An embodiment of the present disclosure provides an electronic device, which includes: a storage device storing a computer program; and a processing device configured to execute the computer program in the storage device to implement the steps of any one of the methods in the present disclosure.
[0092] Reference below Figure 10 , which shows a schematic structural diagram of an electronic device 1000 suitable for implementing the embodiments of the present disclosure. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Devices), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and fixed terminals such as digital televisions and desktop computers. Figure 10 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0093] like Figure 10 As shown, the electronic device 1000 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1008 into a random access memory (RAM) 1003. Various programs and data required for the operation of the electronic device 1000 are also stored in the RAM 1003. The processing device 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0094] Typically, the following devices may be connected to the I / O interface 1005: an input device 1006 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 1007 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1008 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 may allow the electronic device 1000 to communicate with other devices wirelessly or by wire to exchange data. Figure 10 The electronic device 1000 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.
[0095] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 1009, or installed from the storage device 1008, or installed from the ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0096] In addition to the above-mentioned methods and devices, the embodiments of the present disclosure may also be a computer program product, which includes computer program instructions, which, when executed by a processor, cause the processor to perform the method provided by the embodiments of the present disclosure. The computer program product can be written in any combination of one or more programming languages to write program codes for performing the operations of the embodiments of the present disclosure, and the programming languages include object-oriented programming languages such as Java, C++, etc., and also include conventional procedural programming languages such as "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0097] In addition, the embodiment of the present disclosure may also be a computer-readable storage medium having computer program instructions stored thereon. When the computer program instructions are executed by a processor, the processor executes the data query method provided by the embodiment of the present disclosure.
[0098] The computer-readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can, for example, include but is not limited to a system, device or component of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical fiber, a portable compact disk read-only memory, an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0099] The embodiments of the present disclosure further provide a computer program product, including a computer program / instruction, which implements the data query method in the embodiments of the present disclosure when executed by a processor.
[0100] It is understandable that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0101] For example, in response to a user's active request, a prompt message is sent to the user to clearly inform the user that the operation requested will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the electronic device, application, server, storage medium, or other software or hardware that performs the operations of the disclosed technical solution based on the prompt message.
[0102] As an optional but non-limiting implementation, in response to receiving a user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. Furthermore, the pop-up window may also contain a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.
[0103] It is understandable that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0104] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
[0105] The foregoing description is intended only to provide specific embodiments of the present disclosure, intended to enable those skilled in the art to understand and implement the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the embodiments described herein, but rather to be construed in the broadest manner consistent with the principles and novel features disclosed herein.
Claims
1. A data query method based on cloud search service, characterized in that: include: In response to receiving an input statement from a user of a cloud search service, obtaining key information corresponding to the input statement, and obtaining target meta information corresponding to the input statement from a preset intent meta information library, and generating model prompt information based on the target meta information and the key information; wherein the intent meta information library contains a plurality of preset meta information, the meta information is information used to define the intent to be analyzed, and the key information includes keyword information and / or semantic information; Based on the model prompt information, generating an intent analysis result through a preset intent analysis model; Generate a target query statement based on the intent analysis result; Query processing is performed based on the target query statement to obtain a query result corresponding to the input statement.
2. The method according to claim 1, characterized in that The obtaining of key information corresponding to the input sentence includes: Obtaining a target keyword instruction corresponding to the input sentence from a preset keyword instruction library; wherein the keyword instruction library contains a plurality of preset keyword instructions, and the keyword instruction is at least used to indicate a processing method corresponding to the keyword; Obtaining a target semantic instruction corresponding to the input sentence from a preset semantic instruction library; wherein the semantic instruction library contains a plurality of preset semantic instructions, and the semantic instructions are at least used to indicate a processing method for key semantics; The target keyword instruction and the target semantic instruction are used as specific information corresponding to the input sentence.
3. The method according to claim 2, characterized in that The keyword instruction also carries priority information corresponding to the keyword; The step of obtaining a target keyword instruction corresponding to the input sentence from a preset keyword information library includes: Obtaining candidate keyword instructions corresponding to the input sentence from a preset keyword information library; Based on the priority information corresponding to the candidate keyword instructions, the first N instructions with the highest priority are selected from the candidate keyword instructions as target keyword instructions; wherein N is a preset positive integer.
4. The method according to claim 1, wherein Generating a target query statement based on the intent analysis result includes: Determine a query step based on the intent analysis result, and generate a query statement fragment corresponding to the query step; The query statement fragments are merged to obtain a target query statement.
5. The method according to claim 4, characterized in that The step of determining a query based on the intention analysis result includes: Reconstructing the intention analysis result to obtain an intention reconstruction result; wherein the intention reconstruction result is structured data; The query step is determined based on the intention reconstruction result.
6. The method according to claim 5, characterized in that The reconstructing the intention analysis result to obtain an intention reconstruction result includes: Calling a preset target plug-in; the target plug-in includes one or more of a plug-in for performing data normalization processing, a plug-in for performing data error correction processing, and a plug-in for performing data enhancement processing; The intent analysis result is reconstructed by the target plug-in to obtain an intent reconstruction result.
7. The method according to claim 5, characterized in that The step of determining a query based on the intention reconstruction result includes: Obtaining a target rule corresponding to the intention reconstruction result from a plurality of preset query step generation rules; Based on the target rule, a query step corresponding to the intention reconstruction result is generated.
8. The method according to claim 4, characterized in that The generating of the query data fragment corresponding to the query step includes: A preset rule engine is used to generate a query statement fragment corresponding to the query step; wherein the rule engine is an engine that performs query data expansion processing based on structured query language SQL or specific domain language DSL.
9. The method according to claim 4 or 8, characterized in that The step of generating a query statement fragment corresponding to the query step includes: Based on the query step, a target mapping rule is obtained from a preset mapping rule library and a target expansion operator is obtained from a preset expansion operator library; wherein the mapping rule library contains a plurality of preset mapping rules, each of which is used to indicate at least different fields having a mapping relationship and an expansion operator corresponding to the field; and the expansion operator library contains a plurality of preset expansion operators, each of which is a basic operation element for generating query data; Based on the target mapping rule and the target expansion operator, a query statement fragment corresponding to the query step is generated.
10. The method according to claim 4, characterized in that The merging of the query statement fragments includes: The fragment types and fragment connection modes corresponding to the query statement fragments are obtained, and the query statement fragments are merged based on the fragment types and fragment connection modes.
11. A data query device based on cloud search service, characterized in that: include: a prompt information generation module for, in response to receiving an input statement from a user of a cloud search service, obtaining key information corresponding to the input statement, obtaining target meta-information corresponding to the input statement from a preset intent meta-information library, and generating model prompt information based on the target meta-information and the key information; wherein the intent meta-information library contains a plurality of preset meta-information, wherein the meta-information is information used to define the intent to be analyzed, and different meta-information corresponds to different intents to be analyzed, and the key information includes keyword information and / or semantic information; An intention analysis module is used to generate an intention analysis result based on the model prompt information through a preset intention analysis model; A query statement generation module, configured to generate a target query statement based on the intent analysis result; The data query module is used to perform query processing based on the target query statement to obtain the query result corresponding to the input statement.
12. An electronic device, characterized in that: The electronic device comprises: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the data query method based on cloud search service according to any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that The storage medium stores a computer program, and the computer program is used to execute the data query method based on the cloud search service according to any one of claims 1 to 10.
14. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the data query method based on cloud search service according to any one of claims 1 to 10.
Citation Information
Patent Citations
SQL (Structured Query Language) statement generation method, device and equipment based on large language model
CN117271561A
SQL statement generation method and device based on large model, equipment and medium
CN117874052A
Database query statement generation method and device, equipment and storage medium
CN118227655A
Dynamic multi-intention semantic understanding method and device, computer equipment and readable storage medium
CN118467680A
Large model-based intention recognition method and device, electronic equipment and storage medium
CN118940768A
Cited By
Query statement processing method and device, vehicle and storage medium
CN120804139A
Query statement processing method and device, vehicle, and storage medium
CN120804139B
Information analysis method, equipment and product
CN121070968A