DATA QUERY METHOD AND APPARATUS BASED ON CLOUD SEARCH SERVICE, DEVICE, AND MEDIUM

A data query method based on a cloud search service includes: acquiring key information corresponding to an input sentence, acquiring target meta-information corresponding to the input sentence from a preset intention meta-information library, and generating model prompt information based on the target meta-information and the key information, in response to receiving the input sentence from a user of the cloud search service, where the intention meta-information library includes a plurality of pieces of preset meta-information, the meta-information is information used for defining an intention to be analyzed, and the key information includes at least one of keyword information or semantic information; generating an intention analysis result by a preset intention analysis model based on the model prompt information; generating a target query statement based on the intention analysis result; and performing query processing based on the target query statement to obtain a query result corresponding to the input sentence.

Skip to: Description  ·  Claims  · Patent History  ·  Patent History
Description
CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims priority to Chinese Patent Application No. 202510670629.5 entitled “DATA QUERY METHOD AND APPARATUS BASED ON CLOUD SEARCH SERVICE, DEVICE, AND MEDIUM” and filed on May 22, 2025, the disclosure of which is hereby incorporated by reference in its entirety.

TECHNICAL FIELD

The present disclosure relates to the field of data processing technologies and, in particular, to a data query method and apparatus based on a cloud search service, a device, and a medium.

BACKGROUND

Existing data query technologies mainly need to convert a natural language input by a user into a structured query language, so as to query data required by the user based on the query language. At present, a common method in the industry is to train a large language model based on NL2SQL (Natural Language to Structured Query Language) or NL2DSL (Natural Language to Domain Specific Language) to implement structured query.

SUMMARY

The present disclosure provides a data query method and apparatus, a device, and a medium.

An embodiment of the present disclosure provides a data query method based on a cloud search service. The method includes: acquiring key information corresponding to an input sentence, and acquiring target meta-information corresponding to the input sentence from a preset intention meta-information library, and generating model prompt information based on the target meta-information and the key information, in response to receiving the input sentence from a user of the cloud search service, where the intention meta-information library includes a plurality of pieces of preset meta-information, the meta-information is information used for defining an intention to be analyzed, different meta-information corresponds to different intentions to be analyzed, and the key information includes at least one of keyword information or semantic information; generating an intention analysis result by a preset intention analysis model based on the model prompt information; generating a target query statement based on the intention analysis result; and performing query processing based on the target query statement to obtain a query result corresponding to the input sentence.

Optionally, the acquiring the key information corresponding to the input sentence includes: acquiring a target keyword instruction corresponding to the input sentence from a preset keyword instruction library, where the keyword instruction library includes a plurality of preset keyword instructions, and the keyword instruction is at least used for indicating a processing manner corresponding to a keyword; acquiring a target semantic instruction corresponding to the input sentence from a preset semantic instruction library, where the semantic instruction library includes a plurality of preset semantic instructions, and the semantic instruction is at least used for indicating a processing manner of a key semantic; and using the target keyword instruction and the target semantic instruction as specific information corresponding to the input sentence.

Optionally, the keyword instruction further carries priority information corresponding to the keyword; and the acquiring the target keyword instruction corresponding to the input sentence from the preset keyword information library includes: acquiring candidate keyword instructions corresponding to the input sentence from the preset keyword information library; and selecting, based on the priority information corresponding to the candidate keyword instructions, top N instructions with the highest priority from the candidate keyword instruction as the target keyword instruction, where N is a preset positive integer.

Optionally, the generating the target query statement based on the intention analysis result includes: determining one or more query steps based on the intention analysis result, and generating query statement segments corresponding to the query steps; and merging the query statement segments to obtain the target query statement.

Optionally, determining the one or more query steps based on the intention analysis result includes: performing reconstruction processing on the intention analysis result to obtain an intention reconstruction result, where the intention reconstruction result is structured data; and determining the query steps based on the intention reconstruction result.

Optionally, the performing the reconstruction processing on the intention analysis result to obtain the intention reconstruction result includes: invoking a preset target plugin, the target plugin including one or more of a plugin used for performing data normalization processing, a plugin used for performing data error correction processing, and a plugin used for performing data enhancement processing; and performing the reconstruction processing on the intention analysis result by the target plugin to obtain the intention reconstruction result.

Optionally, the determining the query steps based on the intention reconstruction result includes: acquiring a target rule corresponding to the intention reconstruction result from a plurality of preset query step generation rules; and generating the query steps corresponding to the intention reconstruction result based on the target rule.

Optionally, the generating the query statement segments corresponding to the query steps includes: generating the query statement segments corresponding to the query steps by a preset rule engine, where the rule engine is an engine that performs expansion processing of query data based on a structured query language SQL or a domain specific language DSL.

Optionally, the generating the query statement segments corresponding to the query steps includes: acquiring a target mapping rule from a preset mapping rule library and acquiring a target expansion operator from a preset expansion operator library based on the query step, where the mapping rule library includes a plurality of preset mapping rules, the mapping rule is at least used for indicating different fields having a mapping relationship and an expansion operator corresponding to the fields, the expansion operator library includes a plurality of preset expansion operators, and the expansion operator is a basic operation element used for generating query data; and generating the query statement segment corresponding to the query step based on the target mapping rule and the target expansion operator.

Optionally, the merging the query statement segments includes: acquiring a segment type and a segment connection manner corresponding to the query statement segments, and merging the query statement segments based on the segment type and the segment connection manner.

An embodiment of the present disclosure further provides a data query apparatus based on a cloud search service. The apparatus includes: a prompt information generation module configured to acquire key information corresponding to an input sentence, acquire target meta-information corresponding to the input sentence from a preset intention meta-information library, and generate model prompt information based on the target meta-information and the key information, in response to receiving the input sentence from a user of the cloud search service, where the intention meta-information library includes a plurality of pieces of preset meta-information, the meta-information is information used for defining an intention to be analyzed, different meta-information corresponds to different intentions to be analyzed, and the key information includes at least one of keyword information or semantic information; an intention analysis module configured to generate an intention analysis result by a preset intention analysis model based on the model prompt information; a query statement generation module configured to generate a target query statement based on the intention analysis result; and a data query module configured to perform query processing based on the target query statement to obtain a query result corresponding to the input sentence.

An embodiment of the present disclosure further provides an electronic device. The electronic device includes: a processor; and a memory configured to store instructions executable by the processor, the processor configured to read the instructions from the memory and execute the instructions to implement the data query method based on the cloud search service provided by the embodiments of the present disclosure.

An embodiment of the present disclosure further provides a non-transitory computer-readable storage medium. The storage medium stores a computer program configured to perform the data query method based on the cloud search service provided by the embodiments of the present disclosure.

An embodiment of the present disclosure further provides a computer program product, including a computer program that, when executed by a processor, implements the data query method based on the cloud search service provided by the embodiments of the present disclosure.

It should be understood that the content described in this section is not intended to identify key or important features of the embodiments of the present disclosure, nor is it 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

The drawings herein, 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.

In order to more clearly explain the technical solutions in the embodiments of the present disclosure or in the related art, the drawings required to be used in the description of the embodiments or the related art will be briefly introduced below. Apparently, for those of ordinary skill in the art, other drawings may be obtained based on these drawings without paying creative efforts.

FIG. 1 is a schematic flowchart of a data query method based on a cloud search service provided by an embodiment of the present disclosure;

FIG. 2 is a schematic flowchart of determining target meta-information provided by an embodiment of the present disclosure;

FIG. 3 is a schematic flowchart of determining a target keyword instruction provided by an embodiment of the present disclosure;

FIG. 4 is a schematic flowchart of determining a target semantic instruction provided by an embodiment of the present disclosure;

FIG. 5 is a schematic diagram of generating an intention analysis result provided by an embodiment of the present disclosure;

FIG. 6 is a schematic flowchart of intention reconstruction provided by an embodiment of the present disclosure;

FIG. 7 is a schematic flowchart of generating a target query statement provided by an embodiment of the present disclosure;

FIG. 8 is a schematic flowchart of data query provided by an embodiment of the present disclosure;

FIG. 9 is a schematic structural diagram of a data query apparatus based on a cloud search service provided by an embodiment of the present disclosure; and

FIG. 10 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure.

DETAILED DESCRIPTION OF EMBODIMENTS

In order to understand the above objects, features and advantages of the present disclosure more clearly, the solutions of the present disclosure will be further described below. It should be noted that, in case of no conflict, the features in one embodiment or in different embodiments may be combined.

Many specific details are set forth in the following description to fully understand the present disclosure, but the present disclosure may also be implemented in other ways different from those described here. Apparently, the embodiments in the specification are only a part but not all of the embodiments of the present disclosure.

The large model obtained by training in the existing method is difficult to generate a relatively accurate query statement in many cases, resulting in the inability to perform data query normally or the occurrence of data query errors.

According to the above technical solutions provided by the embodiments of the present disclosure, the target meta-information corresponding to the input sentence may be acquired from the preset intention meta-information library, and the key information corresponding to the input sentence may be acquired, the key information including the keyword information and/or the semantic information, so as to generate the model prompt information based on the target meta-information and the key information. On this basis, the intention analysis result may be generated by the preset intention analysis model, and then the target query statement may be generated and the query processing may be performed to obtain the query result. Compared with the existing method of only using conventional static prompt information as the model prompt information, the embodiment of the present disclosure may determine the target meta-information of the input sentence directly based on the intention meta-information library including a plurality of pieces of meta-information, and generate the model prompt information comprehensively in combination with the key information such as the keyword information and the semantic information. The above method may efficiently and accurately focus on the main information of the sentence input by the user, and the model prompt information dynamically determined based on this is more accurate and reliable. On this basis, it is more convenient 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 accordingly effectively improving the accuracy of the target query statement, so as to ensure that a more accurate and reliable query result is obtained.

Compared with simple full-text retrieval or semantic retrieval, the result of structured query is more accurate. For example, if a user input sentence is “please search for dangerous driving cases with fines exceeding 2500 yuan in XX city”, simple full-text retrieval or semantic retrieval may hit irrelevant cases where the family address of the party is in XX city or the compensation amount is similar to 2500 yuan, and the desired case cannot be accurately hit. However, if the user input sentence is converted into a structured query based on NL2SQL or NL2DSL technology, the relevant cases may be accurately queried by directly querying the fields of region and fine. However, the inventors have found that in the related technologies, the large language model is mostly trained based on NL2SQL or NL2DSL technology to implement structured query, but in the case of diverse domain scenarios and numerous words, the accuracy of query statements generated by the trained large language model is relatively low, especially for complex query tasks, the accuracy is even lower. The related technologies need to additionally perform operations such as fine-tuning the model or constructing a complex task agent when dealing with complex tasks, which is costly and inefficient. In addition, problems such as matching errors often occur between a database framework, which is used for defining how to organize and store data, and the intention analysis result. For example, the user searches for “bidding in the elevator industry”, but there is no “elevator” industry in the industries in the database, resulting in a query exception. In order to solve the above problems, embodiments of the present disclosure provide a data query method and apparatus based on a cloud search service, a device, and a medium.

FIG. 1 is a schematic flowchart of a data query method based on a cloud search service provided by an embodiment of the present disclosure. The method may be executed by a data query apparatus based on the cloud search service. The apparatus may be implemented by software and/or hardware, and may generally be integrated into an electronic device. As shown in FIG. 1, the method mainly includes the following steps S102 to S108.

    • Step S102: acquiring key information corresponding to an input sentence, acquiring target meta-information corresponding to the input sentence from a preset intention meta-information library, and generating model prompt information based on the target meta-information and the key information, in response to receiving the input sentence from a user of the cloud search service, where the intention meta-information library includes a plurality of pieces of preset meta-information, the meta-information is information used for defining an intention to be analyzed, and the key information includes keyword information and/or semantic information.

The cloud search service is a search service provided based on cloud computing technology. Users may use the cloud search service to implement efficient data search. The data query method provided by the embodiments of the present disclosure may be well applied to the cloud search service. For users who enjoy the cloud search service, the input sentence of the user is a natural language. In the embodiment of the present disclosure, an intention meta-information library is introduced, and the intention meta-information library may include a plurality of pieces of preset meta-information. The plurality of pieces of preset meta-information may belong to one or more specified domains. The meta-information is information used for defining an intention to be analyzed. Different meta-information corresponds to different intentions to be analyzed. For example, in the legal field, “case cause”, “fine”, “case details”, etc., which require the model to analyze the intention, may be set with corresponding meta-information. The meta-information may be composed of at least one preset field, and the preset fields in the meta-information are arranged according to a first specified structure. The preset field and the first specified structure are not limited in the embodiments of the present disclosure, and any information that may assist the model in understanding the intention to be analyzed is acceptable. For example, the meta-information includes four preset fields: “field name”, “description”, “format requirement” and “static example”, and the first specified structure is used to indicate that the four preset fields are arranged in sequence. Exemplarily, a piece of meta-information belonging to the search field may be: “product function: the product function refers to the names of various functions to be searched in the cloud, and multiple functions are separated by semicolons. For example, how to create an instance and expand an instance is extracted as “create an instance; expand an instance””. A piece of meta-information belonging to the legal field may be: “time range: the range of judgment time, which is output in the format of (start time, end time), and not limit is represented by INF. For example, cases after 2020 are extracted as (2020-01-01, INF)”. The above are only examples and should not be construed as limiting. In practical applications, the required meta-information may be flexibly set according to requirements. Referring to the schematic flowchart of determining target meta-information shown in FIG. 2, in the embodiments of the present disclosure, the target meta-information corresponding to the input sentence may be determined by querying the intention meta-information library on the basis of receiving the input sentence of the user, where the intention meta-information library may be dynamically maintained by relevant personnel according to requirements. By setting the intention meta-information library, it is convenient for the model to quickly identify, understand and process important intentions, intentions that are easily ignored by the model or specified intentions that need extra attention of the model in the input sentence of the user, which helps the model to perform intention analysis more accurately.

In some examples, the key information may be information obtained by directly analyzing the input sentence. In some specific examples, the key information may be represented by a key instruction, and the key instruction may be an instruction used for dynamically generating the model prompt information, and thus may also be called a dynamic instruction. Specifically, the key instruction may include a keyword instruction corresponding to the keyword information and a semantic instruction corresponding to the semantic information. Exemplarily, a dynamic instruction library may be preset in the embodiments of the present disclosure, and specifically, a keyword instruction library and a semantic instruction library may be preset, so as to quickly acquire more accurate, reliable and standard-format key information from the above instruction libraries based on the input sentence.

    • Step S104: generating an intention analysis result by a preset intention analysis model based on the model prompt information.

The intention analysis model is specifically a neural network model in the field of artificial intelligence, and the implementation of the intention analysis model is not limited in the embodiments of the present disclosure. For example, the intention analysis model may be a generative model, and specifically may be implemented using a large language model. It should be noted that the related technologies usually only use conventional static prompt information as the model prompt information, while the embodiments of the present disclosure may directly determine the target meta-information of the input sentence based on the additionally set intention meta-information library including a plurality of pieces of meta-information, and combine the key information such as the keyword information and the semantic information to comprehensively generate more accurate and reliable model prompt information, which may efficiently and accurately assist the model to accurately understand and process the main information of the input sentence of the user, and perform in-depth analysis on the input sentence of the user, such as analyzing information in various dimensions such as time, region, entity, and implicit knowledge, so as to generate accurate intention analysis result and achieve flexible and convenient rapid optimization effect.

    • Step S106: generating a target query statement based on the intention analysis result. For example, the target query statement may be structured data. In practical applications, processing such as formatting may be performed based on the intention analysis result, and on this basis, the target query statement may be generated by expansion. In addition, query planning may also be performed based on the intention analysis result and disassembled into one or more query steps, so as to generate the target query statement more conveniently and efficiently. The above are only examples, and the manner of generating the target query statement based on the intention analysis result is not limited here.
    • Step S108: performing query processing based on the target query statement to obtain a query result corresponding to the input sentence.

Compared with the existing method of only using conventional static prompt information as the model prompt information, the embodiments of the present disclosure may directly determine the target meta-information of the input sentence based on the intention meta-information library including a plurality of pieces of meta-information, and combine the key information such as the keyword information and the semantic information to comprehensively generate the model prompt information. The above method may efficiently and accurately focus on the main information of the sentence input by the user, and the model prompt information dynamically determined based on this is more accurate and reliable. On this basis, it is more convenient for the intention analysis 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 accordingly effectively improving the accuracy of the target query statement, so as to ensure that a more accurate and reliable query result is obtained.

In some implementations, the step of acquiring the key information corresponding to the input sentence may be executed with reference to the following steps (1) to (3).

Step (1): acquiring a target keyword instruction corresponding to the input sentence from a preset keyword instruction library, where the keyword information library includes a plurality of preset keyword instructions, and the keyword instruction is an instruction having a second specified structure and is at least used for indicating a processing manner corresponding to a keyword.

It is considered that the general language model generally has a poor processing effect on professional words such as new product functions, game characters and game skills, and the cost of model fine-tuning is high and rapid optimization cannot be achieved. In order to efficiently and accurately identify keywords of the input sentence and enable the model to exactly know the corresponding processing manner, so as to achieve the effect of rapid model optimization for specific words such as professional words without fine-tuning the model separately, a keyword instruction library may be set in the embodiments of the present disclosure. Exemplarily, the keyword instruction further carries priority information corresponding to the keyword. On this basis, acquiring the target keyword instruction corresponding to the input sentence from the preset keyword instruction library includes: acquiring candidate keyword instructions corresponding to the input sentence from the preset keyword instruction library; and selecting, based on the priority information corresponding to the candidate keyword instructions, top N instructions with the highest priority (i.e., top N instructions sorted in descending order of the priority) from the candidate keyword instructions as the target keyword instruction, where N is a preset positive integer, and the number of candidate keyword instructions may also be set according to requirements and is not limited here. In practical applications, matching may be performed with the keyword instruction library based on each word or at least some words in the input sentence, that is, if each word or at least some words in the input sentence hit keywords corresponding to keyword instructions in the keyword instruction library, the keyword instructions may be used as candidate keyword instructions, and at least one corresponding candidate keyword instruction may be obtained through the above method. On this basis, the target keyword instruction may be obtained by screening through the priority information carried by the candidate keyword instructions. The above method fully considers the length limitation of the model prompt information, and therefore determines the target keyword instruction based on the priority, which may effectively ensure that the model preferentially processes more important keyword instructions when the prompt information is limited.

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 second specified structure is not limited in the embodiments of the present disclosure. 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 four preset fields are arranged in sequence. Exemplarily, a keyword instruction in the game field may be: “XX want, /XX want/, 1, XX want is extracted as a game character name”. If “XX want” is included in the input sentence of the user, the corresponding keyword instruction may be quickly found from the keyword instruction library, and it is learned that the processing manner is to extract “XX want” as the game character name. A keyword instruction in the legal field may be: “disease, illness, symptom, disorder, /any word is consistent/, 1, if the mentioned disease has a causal relationship with what the court believes or the core case details, 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 instruction may be flexibly set and the structure of the keyword instruction may be flexibly adjusted. The above keyword condition may be understood as a keyword that needs to be included, and a keyword instruction that meets the keyword condition may be used as a candidate keyword instruction. The above filtering rule is used to indicate that the candidate keyword instruction is filtered according to a specific rule. For example, the default rule is that all keywords are hit, or the regular expression custom rules and the script custom rules may be used to perform the matching, and only rules that meet the conditions are retained, which may be specifically and flexibly set. The above priority rule may indicate the corresponding priority of the keyword, which is used for sorting based on the configured priority, and a rule that the priority is higher if the keyword matches word frequency and compactness of the input sentence of the user is preferred. For example, if the input sentence of the user is: “can you provide me with an operation and maintenance operation manual”, 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 a substring is reduced, for example, the priority of matching “collapse” is lower than the priority of matching “house collapse”. The instruction content is used to indicate how to process the keyword. For example, the instruction content indicates that the keyword “XX want” is extracted as the game character name. On the basis of the foregoing, reference may also be made to the schematic flowchart of determining a target keyword instruction shown in FIG. 3. The keyword instruction library may be maintained by a relevant person such as a business expert. The keyword search may be performed for the user input sentence based on the keyword instruction library to preliminarily obtain the candidate keyword instructions, and then obtain the target keyword instruction through operations such as filtering and priority sorting. The above method helps the model quickly identify, accurately understand and process important keywords in the input sentence of the user during the intention analysis process.

    • Step (2): acquiring a target semantic instruction corresponding to the input sentence from a preset semantic instruction library, where the semantic instruction library includes a plurality of preset semantic instructions, and the semantic instruction is an instruction having a third specified structure and is at least used for indicating a processing manner of a key semantic.

It is considered that the general language model has difficulty in better processing the concept of some input sentences, and confusion is prone to occur, and it is difficult to identify the implicit knowledge of the input sentence or understand the semantics of a specific situation. In order to enable the model to more clearly grasp the implicit knowledge or the specific situation in the input sentence of the user, a semantic instruction library may be set in the embodiments of the present disclosure, so as to achieve the effect of rapid model optimization for the implicit knowledge or the specific situation without fine-tuning the model separately. Exemplarily, semantic analysis may be performed on the input sentence first, and similarity matching is performed between the semantic analysis result and information of a key semantic corresponding to a semantic instruction in the semantic instruction library, and a semantic instruction with the highest similarity or a semantic instruction with similarity higher than a preset threshold is used as the target semantic instruction. Referring to the schematic flowchart of determining a target semantic instruction shown in FIG. 4, the semantic instruction library may be maintained by a relevant person such as a business expert, and the user input sentence may be searched based on the semantic instruction library to obtain the target semantic instruction corresponding to the input sentence. The semantic instruction in the semantic instruction library may be composed of at least one preset field, and the preset fields in the semantic instruction are arranged according to the third specified structure. The third specified structure is not limited in the embodiments of the present disclosure. In practical applications, the semantic instruction may be divided into one or more categories according to requirements, for example, the semantic instruction may be divided into two categories, one is a semantic instruction corresponding to implicit knowledge, and the other is a semantic instruction corresponding to a dynamic example, and different categories of semantic instructions may correspond to different third specified structures. For example, the semantic instruction corresponding to the implicit knowledge includes two fields: “noun explanation+typical scenario” and “optimization instruction”, and the third specified structure of the semantic instruction corresponding to the implicit knowledge is used to indicate that the two fields are arranged in sequence. The semantic instruction corresponding to the dynamic example includes two fields: “example question” and “example output”, and the third specified structure of the semantic instruction corresponding to the dynamic example is used to indicate that the two fields are arranged in sequence. The above methods may more clearly indicate the processing manner of the key semantic. For ease of understanding, the semantic instruction corresponding to the implicit knowledge is described below. In the legal field, if the input sentence of the user implicitly contains a situation of “apparent agency”, it is usually difficult for the large model to identify, at this time, the “apparent agency” may be explained through the semantic instruction library. For example, the semantic instruction library includes a semantic instruction corresponding to “apparent agency”, which contains a specific explanation of apparent agency and common situations of apparent agency in the field of “noun explanation+typical scenario”, and the above information may also be converted into a vector form to facilitate semantic search. In addition, the instruction may detail the definition, scenarios and analytical approaches of the apparent agency in the “optimization instruction”, through which the model may be effectively assisted to identify the implicit situation of “apparent agency” from the input sentence of the user. In addition, considering that the model has a poor processing effect on some subdomains, some semantic instructions corresponding to dynamic examples may be provided for such subdomains, the “example question” field of the instruction may contain an input sentence related to such subdomains, and the “example output” field of the instruction may contain an example of intention analysis result of the example question for the model to learn and refer to. The above method helps the model quickly identify, accurately understand and process keywords in the input sentence of the user during the intention analysis process, and is helpful to significantly improve the intention analysis effect in a specific field.

    • Step (3): using the target keyword instruction and the target semantic instruction as the key information corresponding to the input sentence.

Through the above method, the target keyword instruction and the target semantic instruction that are matched with the input sentence and selected from the instruction library may accurately and reliably present important information of the input sentence, and the instructions selected through the instruction library usually carry more information such as paraphrasing instructions and processing method instructions, which is equivalent to additionally supplementing relevant information to the model. The obtained key information is more abundant and the format is more standard, which is more convenient for the model to understand and process.

On the basis of the foregoing, the intention meta-information and the key information may be assembled into the model prompt information. Specifically, the key information may also be called a dynamic instruction, that is, an instruction used for dynamically generating the model prompt information. Moreover, on the basis of the intention meta-information and the key information, a user static prompt instruction or a preset prompt may be further combined, and the model prompt information may be generated by comprehensive assembly. For ease of understanding, reference may be made to the schematic diagram of generating an intention analysis result shown in FIG. 5, which illustrates that on the basis of the user input sentence, the target meta-information, the target keyword instruction and the target semantic instruction may be obtained based on the intention meta-information library, the keyword instruction library and the semantic instruction library, respectively, where the target keyword instruction and the target semantic instruction may be collectively referred to as the dynamic instruction, the target meta-information, the dynamic instruction and the user static prompt instruction may be assembled into the model prompt information, and the model prompt information may be input into an AI (Artificial Intelligence) model such as a large language model for performing intention analysis to obtain the intention analysis result. It may be understood that the general large language model usually has a poor processing effect on professional words or complex sentences, and the cost of model fine-tuning is relatively high and the effect of rapid optimization cannot be achieved. However, with the method provided by the embodiments of the present disclosure, even for complex tasks or fields with many professional words, there is no need to perform additional model fine-tuning, and it is only necessary to add the meta-information corresponding to the corresponding words to the meta-information library, or add the semantic instructions corresponding to the complex semantics or the keyword instructions corresponding to the specific keywords to the instruction library. For example, in the legal field, “case cause”, “fine” and “case details” are important, so they may be added to the intention meta-information library, so as to effectively prompt the model to pay attention to relevant information subsequently. For another example, “XX want” is a game character name, and for the user input sentence “what is the weapon of XX want”, most models are difficult to accurately give the intention analysis result, and may mistakenly think that it is the weapon that XX needs, rather than the weapon that “XX want” has. However, by adding “XX want” to the keyword instruction library, the model may be simply and conveniently prompted to extract “XX want” as the game character name. For another example, the user input sentence implicitly contains a situation of “apparent agency”, which is usually difficult to be identified by the large model, but by putting the “apparent agency” in the semantic instruction library and supplementing relevant implicit knowledge, the model may be prompted to identify the semantics of “apparent agency” in the user input sentence. As mentioned above, the above method of acquiring the meta-information and the dynamic instruction of the user input sentence may achieve the effect of quickly converging bad cases and improving the accuracy of model intention analysis. In summary, by acquiring the meta-information and the key information such as the keyword information and the semantic information corresponding to the input sentence, the accurate model prompt information may be dynamically generated, and the network model may generate a more accurate intention analysis result by using the model prompt information.

On the basis of obtaining a more accurate intention analysis result, in order to further obtain a precise target query statement, the embodiments of the present disclosure further provide a specific implementation example of the above step S106, that is, the step of generating the target query statement based on the intention analysis result, which may be executed with reference to the following steps A to C.

    • Step A: determining a query step based on the intention analysis result. There may be one or more query steps, that is, the input sentence of the user may be split into one or more query steps based on the intention analysis result, and each query step may correspond to a corresponding query condition and query analysis method, which is not limited here. For example, the intention related to the winning rate needs to be transformed into funnel analysis, which depends on the analysis results of bidding and winning query steps.

In some specific implementation examples, step A may be executed with reference to the following steps A1 to A2.

    • Step A1: performing reconstruction processing on the intention analysis result to obtain an intention reconstruction result. The intention reconstruction result is structured data. It may be understood that the intention analysis result may be semi-structured data and is not standardized, therefore, the reconstruction processing may be performed on the intention analysis result based on the requirements of subsequent processing. The reconstruction processing is processing of reconstructing and optimizing the intention analysis result, and the reconstruction processing includes but not limited to one or more of formatting processing, data normalization processing, data error correction processing and data enhancement processing. Exemplarily, the formatting processing may be performed by means of regular expressions to convert the semi-structured data into structured data, and then the data normalization processing, the data error correction processing, the data enhancement processing and other processing are performed. In some examples, the intention analysis result itself is structured data, and accordingly, the intention reconstruction result is also structured data. In this case, the reconstruction processing may not need to include formatting processing (that is, the processing of converting data to be processed into structured data), and specifically, the reconstruction processing may include processing of optimizing the intention analysis result, such as the data normalization processing, the data error correction processing, and the data enhancement processing. In some other examples, the intention analysis result is not structured data. In this case, the reconstruction processing includes at least the formatting processing, that is, the above step of performing the reconstruction processing on the intention analysis result may include a processing step of converting the intention analysis result into structured data, on this basis, other optimization processing steps such as the data normalization processing, the data error correction processing, and the data enhancement processing may also be included, which is not limited here.

In order to improve the efficiency and flexibility of the formatting processing, exemplarily, step A1 may be executed with reference to the following steps A1.1 to A1.2.

    • Step A1.1: invoking a preset target plugin, the target plugin including one or more of a plugin used for performing data normalization processing, a plugin used for performing data error correction processing, and a plugin used for performing data enhancement processing.

That is, in the embodiments of the present disclosure, a variety of plugins may be flexibly set to facilitate different processing. The plugin used for performing data normalization processing may be referred to as a normalization plugin for short, which may normalize scalar query data such as amount and date, for example, unify exchange rates, unify digital precision, unify date formats, etc. The plugin used for performing data error correction processing may be referred to as an error correction plugin for short, which may correct errors and align fields such as an enumeration type. For example, the input sentence of the user contains “elevator industry”, but the industry enumeration does not contain “elevator industry”, so it is necessary to find a similar industry to replace. For another example, if the normalized document type enumeration item is “winning the bid”, “winning the bid document” in the input sentence of the user may be replaced with “winning the bid”. The plugin used for performing data enhancement processing may be referred to as an enhancement plugin for short, which is used for performing further enhancement processing on the intention information and supplementing associated information. For example, if the input sentence of the user only contains license plate number information, the vehicle identification required for the query may be supplemented based on the license plate number. For another example, the company region etc. may be supplemented based on the company name. In practical applications, one or more plugins of each of the above types may be set, which helps to enhance the comprehensiveness of the reconstruction processing.

    • Step A1.2: performing the reconstruction processing on the intention analysis result by the target plugin to obtain the intention reconstruction result. For ease of understanding, reference may be made to the schematic flowchart of intention reconstruction shown in FIG. 6, which illustrates that the intention formatting processing is performed first, and then the processing is performed through the normalization plugin, the error correction plugin and the enhancement plugin on the basis of the formatted intention analysis result, so as to obtain the intention reconstruction result. The above method of using the plugin to perform reconstruction processing on the intention analysis result is more flexible and convenient, and fully ensures that the intention reconstruction result is more standard and accurate, which may effectively ensure that the subsequent process may be normally executed, avoid query errors caused by problems such as mismatch between the database framework and the intention analysis result, and further improve the query accuracy.
    • Step A2: determining the query steps based on the intention reconstruction result. Specifically, query planning may be performed based on the intention reconstruction result to obtain the query steps. Exemplarily, step A2 may be executed with reference to the following steps A2.1 to A2.2.
    • Step A2.1: acquiring a target rule corresponding to the intention reconstruction result from a plurality of preset query step generation rules.

The plurality of query step generation rules include but not limited to a complex rule, a general aggregation rule, a detail rule, etc. The complex rule may also be called a complex indicator expansion rule, in which a specific complex indicator is expanded by using a processing manner such as funnel analysis. For example, the related query of the intention of “winning the bid” needs to rely on the number of bids, the number of candidates, etc., therefore, it is necessary to reasonably plan the steps, first check the number of bids, then check the number of candidates, and finally determine the number of winning bids, etc. The general aggregation rule may be determined according to a preset aggregation function. For example, if the intention analysis result indicates that the total winning amount needs to be calculated, the general summation rule may be used to calculate the total winning amount. The detail rule is mainly used to extract information of a specific field, for example, if the intention analysis result contains a field to be recalled, the field may be defined to query corresponding detailed data.

In practical applications, a mapping relationship between the intentions and the query step generation rules may be established in advance. Exemplarily, the mapping relationship may enumerate, by means of enumeration, the intention suitable for analysis by each query step generation rule, so that subsequently, in the case that the intention is known, the corresponding target rule may be determined based on the mapping relationship. Specifically, based on the mapping relationship, a rule corresponding to the content of the intention reconstruction result may be searched for from the plurality of generation rules. For example, the intention containing the “winning rate” has a mapping relationship with the complex rule, and in the case that the intention reconstruction result contains the winning rate, the target rule contains the complex rule.

    • Step A2.2: generating the query steps corresponding to the intention reconstruction result based on the target rule. The query step may be one step or multiple steps. Generally speaking, the more complex the intention of the user input sentence, the more query steps there will be.

In the related art, the accuracy of directly generating the corresponding query data for the complex input sentence is usually relatively low, but with the above method provided by the embodiments of the present disclosure, the reasonable planning manner corresponding to the intention reconstruction result may be quickly determined, so as to determine the query step(s) of the intention reconstruction result more accurately and reliably, which helps to disassemble the complex intention, so as to perform step-by-step query according to the query steps, thereby reducing the difficulty in generating the query statement and improving the query reliability.

    • Step B: generating query statement segments corresponding to the query steps. In practical applications, the query step may further specifically indicate a query condition, a query analysis manner, etc., and the query statement segment corresponding to the query step may be generated based on DSL (Domain Specific Language) or SQL (Structured Query Language) technology.

Exemplarily, step B may be executed with reference to the following steps: generating the query statement segments corresponding to the query steps by a preset rule engine, where the rule engine is an engine that performs expansion processing of query data based on the DSL or the SQL, which may be referred to as a DSL/SQL expansion rule engine for short, and it may perform DSL/SQL expansion by using expansion operators based on the sequence of the above query steps. For ease of understanding, in some specific examples, the rule engine may generate the query statement segment corresponding to the query step according to the following steps 1 to 2.

    • Step 1: acquiring a target mapping rule from a preset mapping rule library and acquiring a target expansion operator from a preset expansion operator library based on the query step, where the mapping rule library includes a plurality of preset mapping rules, the mapping rule is at least used for indicating different fields having a mapping relationship and an expansion operator corresponding to the fields, the mapping rule library may include a general mapping rule, such as represented by a triple (query field, intention field, expansion operator), and may also include a custom mapping rule, such as generating SQL/DSL clause segments by a specified scripting language, which is not specifically limited. Exemplarily, a keyword hit policy or a semantic matching policy may be adopted, and a mapping rule whose query field and/or intention field are matched with the query step is selected from the mapping rule library based on the content of the query step and used as the target mapping rule. The expansion operator library includes a plurality of preset expansion operators, and the expansion operator is a basic operation element used for generating query data, which may be understood as the element that convert query conditions into a standardized query structure that may be executed at the bottom layer. For example, an And operator, an Or operator, a Not operator, a Must operator, a Filter operator, a Should operator, etc. may all be regarded as expansion operators and will not be listed one by one. The operator library may also include built-in operators such as the operator corresponding to the normalization plugin, and custom operators set by the scripting language, which is not limited here. In practical applications, each specification of the normalization plugin may correspond to a corresponding expansion operator, and the standardized expansion may be quickly implemented based on the corresponding expansion operator, for example, a date format corresponds to range expansion, a proximity query corresponds to intervals condition expansion, etc. It may be determined, based on the mapping rule, which operators are needed to expand each query step corresponding to the intention analysis result, so as to map and convert each query step into the standardized query data. Exemplarily, after the target mapping rule is known, if the target mapping rule is a rule represented by the triple, the expansion operator included in the triple corresponding to the target mapping rule may be used as the target expansion operator, and the target expansion operator may be acquired from the expansion operator library. In practical applications, the target expansion operator may also be directly determined based on the content of the query step, for example, if the query step indicates that an addition operation is required, it is determined that the target expansion operator includes the And operator.
    • Step 2: generating the query statement segment corresponding to the query step based on the target mapping rule and the target expansion operator. In practical applications, each query step may be expanded and converted into the query statement segment based on the target mapping rule and the target expansion operator.
    • Step C: merging the query statement segments to obtain the target query statement. Exemplarily, a segment type and a segment connection manner corresponding to the query statement segments may be acquired, and the query statement segments may be merged based on the segment type and the segment connection manner. For example, the segment type may be based on a Where segment, a Group By segment, etc., which may be specifically and flexibly set and is not limited here. For example, query statement segments of the Where segment type may be connected based on an And operator or an Or operator, Bool conditions may be merged according to path grouping and operators such as a Must operator, a Filter operator, and a Should operator, aggregation functions with the same Group By and Where conditions may be merged, etc. The complex query may additionally replace combination segments in specified characters such as {}, which may be specifically set according to requirements. For ease of understanding, reference may also be made to the schematic flowchart of generating target query statements shown in FIG. 7, which illustrates that on the basis of obtaining the query planning result, the target mapping rule and the target expansion operator may be obtained based on the mapping rule library and the expansion operator library, so as to expand and generate the query statement segment, and the target query statement may be obtained by merging. Through the above method, the complex query task may be disassembled, the query difficulty may be effectively reduced, and the reliability of the finally generated target query statement may be improved.

On the basis of the foregoing, reference may be made to the schematic flowchart of data query shown in FIG. 8. After obtaining the user input sentence, the following five key processing steps are mainly executed, which are: intention analysis processing, intention reconstruction processing, query planning processing, rule engine expansion processing, and query processing. For the specific implementation of each of the above processing steps, reference may be made to the foregoing related content, which will not be repeated here.

In summary, according to the above method provided by the embodiments of the present disclosure, by setting the intention meta-information library, the keyword instruction library and the semantic instruction library, acquiring the target meta-information and the dynamic instructions (the target keyword instruction and the target semantic instruction) corresponding to the user input sentence, and dynamically generating the accurate model prompt information on this basis, the model may efficiently and accurately focus on the main information of the user input sentence by using the above model prompt information. On this basis, it is more convenient for the intention analysis model to understand the intention of the input sentence, thereby improving the accuracy of the intention analysis result generated by the intention analysis model. For the complex field and the complex sentence, the effect of flexible and rapid optimization may be achieved, and the query accuracy of the complex query task may be improved without additional high-cost and low-efficiency operations such as fine-tuning the model or constructing a complex task agent. In addition, by reconstructing the intention analysis result outputted by the model, specifically performing formatting processing, normalization processing, error correction processing, enhancement processing, etc., the obtained intention reconstruction result may effectively ensure that the subsequent process may be normally executed, avoid query errors caused by problems such as mismatch between the database framework and the intention analysis result, and further improve the query accuracy. In addition, the complex intention may be disassembled by the query planning processing, and on this basis, the expansion is performed by the rule engine to obtain the query statement segment corresponding to each query step, and then the target query statement is generated by segment merging, which may effectively reduce the difficulty in generating the query statement and comprehensively improve the query accuracy and reliability.

Corresponding to the foregoing data query method, an embodiment of the present disclosure further provides a data query apparatus based on a cloud search service. FIG. 9 is a schematic structural diagram of the data query apparatus based on the cloud search service provided by the embodiment of the present disclosure. The apparatus may be implemented by software and/or hardware, and may generally be integrated into an electronic device. As shown in FIG. 9, the data query apparatus includes:

    • a prompt information generation module 902 configured to acquire key information corresponding to an input sentence, acquire target meta-information corresponding to the input sentence from a preset intention meta-information library, and generate model prompt information based on the target meta-information and the key information, in response to receiving the input sentence from a user of the cloud search service, where the intention meta-information library includes a plurality of pieces of preset meta-information, the meta-information is information used 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;
    • an intention analysis module 904 configured to generate an intention analysis result by a preset intention analysis model based on the model prompt information;
    • a query statement generation module 906 configured to generate a target query statement based on the intention analysis result; and
    • a data query module 908 configured to perform query processing based on the target query statement to obtain a query result corresponding to the input sentence.

Compared with the existing method of only using conventional static prompt information as the model prompt information, the embodiments of the present disclosure may directly determine the target meta-information of the input sentence based on the intention meta-information library including a plurality of pieces of meta-information, and combine the key information such as the keyword information and the semantic information to comprehensively generate the model prompt information. The above apparatus may efficiently and accurately focus on the main information of the sentence input by the user, and the model prompt information dynamically determined based on this is more accurate and reliable. On this basis, it is more convenient for the intention analysis 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 accordingly effectively improving the accuracy of the target query statement, so as to ensure that a more accurate and reliable query result is obtained.

In some implementations, the prompt information generation module 902 is further configured to: acquire a target keyword instruction corresponding to the input sentence from a preset keyword instruction library, where the keyword instruction library includes a plurality of preset keyword instructions, and the keyword instruction is at least used for indicating a processing manner corresponding to a keyword; acquire a target semantic instruction corresponding to the input sentence from a preset semantic instruction library, where the semantic instruction library includes a plurality of preset semantic instructions, and the semantic instruction is at least used for indicating a processing manner of a specific semantic; and use the target keyword instruction and the target semantic instruction as specific information corresponding to the input sentence.

In some implementations, the keyword instruction further carries priority information corresponding to the keyword; and the prompt information generation module 902 is further configured to: acquire candidate keyword instructions corresponding to the input sentence from a preset keyword information library; and select, based on the priority information corresponding to the candidate keyword instructions, top N instructions with the highest priority from the candidate keyword instructions as the target keyword instruction, where N is a preset positive integer.

In some implementations, the query statement generation module 906 is further configured to: determine one or more query steps based on the intention analysis result, and generate query statement segments corresponding to the query steps; and merge the query statement segments to obtain the target query statement.

In some implementations, the query statement generation module 906 is further configured to: perform reconstruction processing on the intention analysis result to obtain an intention reconstruction result, where the intention reconstruction result is structured data; and determine the query steps based on the intention reconstruction result.

In some implementations, the query statement generation module 906 is further configured to: invoke a preset target plugin, the target plugin including one or more of a plugin used for performing data normalization processing, a plugin used for performing data error correction processing, and a plugin used for performing data enhancement processing; and perform the reconstruction processing on the intention analysis result by the target plugin to obtain the intention reconstruction result.

In some implementations, the query statement generation module 906 is further configured to: acquire a target rule corresponding to the intention reconstruction result from a plurality of preset query step generation rules; and generate the query steps corresponding to the intention reconstruction result based on the target rule.

In some implementations, the query statement generation module 906 is further configured to: generate the query statement segments corresponding to the query steps by a preset rule engine, where the rule engine is an engine that performs expansion processing of query data based on a structured query language SQL or a domain specific language DSL.

In some implementations, the query statement generation module 906 is further configured to: acquire a target mapping rule from a preset mapping rule library and acquire a target expansion operator from a preset expansion operator library based on the query step, where the mapping rule library includes a plurality of preset mapping rules, the mapping rule is at least used for indicating different fields having a mapping relationship and an expansion operator corresponding to the fields, the expansion operator library includes a plurality of preset expansion operators, and the expansion operator is a basic operation element used for generating query data; and generate the query statement segment corresponding to the query step based on the target mapping rule and the target expansion operator.

In some implementations, the query statement generation module 906 is further configured to: acquire a segment type and a segment connection manner corresponding to the query statement segments, and merge the query statement segments based on the segment type and the segment connection manner.

The data query apparatus provided by the embodiments of the present disclosure may execute the data query method provided by any embodiment of the present disclosure, and has corresponding functional modules for executing the method and beneficial effects.

It may be clearly understood by those skilled in the art that, for the convenience and brevity of description, for the specific working process of the apparatus embodiment described above, reference may be made to the corresponding process in the method embodiment, which will not be repeated here.

An embodiment of the present disclosure provides an electronic device. The electronic device includes: a memory having a computer program stored thereon; and a processor configured to execute the computer program in the memory to implement the steps of any one of the methods in the present disclosure.

Reference is made to FIG. 10 below, which illustrates a schematic structural diagram of an electronic device 1000 suitable for implementing the embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a laptop, a digital broadcast receiver, a personal digital assistant (PDA), a tablet computer, a portable media player (PMP) and an in-vehicle terminal (such as an in-vehicle navigation terminal), and a stationary terminal such as a digital television and a desktop computer. The electronic device shown in FIG. 10 is only an example, and should not impose any limitation on the function and scope of use of the embodiments of the present disclosure.

As shown in FIG. 10, the electronic device 1000 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 1001, which may 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. In the RAM 1003, various programs and data required for operations of the electronic device 1000 are also stored. The processing device 1001, the ROM 1002 and the RAM 1003 are interconnected by means of a bus 1004. An input/output (I/O) interface 1005 is also connected to the bus 1004.

Generally, 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.; the 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 perform wireless or wired communication with other devices to exchange data. Although FIG. 10 shows the electronic device 1000 with various devices, it should be understood that it is not required to implement or provide all of the shown devices. Alternatively, more or fewer devices may be implemented or provided.

In particular, according to the embodiments of the present disclosure, the process described above with reference to the flowcharts may be implemented as a computer software program. For example, the embodiments of the present disclosure include a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, where the computer program includes program codes for performing the method shown in the flowchart. In such an embodiment, the computer program may be downloaded and installed from a 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 embodiments of the present disclosure are executed.

In addition to the above methods and devices, the embodiments of the present disclosure may also be a computer program product, which includes computer program instructions that, when executed by a processor, cause the processor to perform the method provided by the embodiments of the present disclosure. The computer program product may be written in any combination of one or more programming languages to execute the program codes for the operations of the embodiments of the present disclosure, the programming languages including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as “C” language or similar programming languages. The program codes may be executed entirely on a user computing device, partly on the user device, as a stand-alone software package, partly on the user computing device and partly on a remote computing device, or entirely on the remote computing device or server.

In addition, the embodiments of the present disclosure may also be a computer-readable storage medium having computer program instructions stored thereon, the computer program instructions, when executed by a processor, causing the processor to perform the data query method provided by the embodiments of the present disclosure.

The computer-readable storage medium may adopt any combination of one or more readable mediums. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may include, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the above. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having 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 of the above.

An embodiment of the present disclosure further provides a computer program product, including a computer program/instructions, where the data query method in the embodiments of the present disclosure is implemented when the computer program/instructions are executed by a processor.

It may be understood that before using the technical solutions disclosed in the embodiments of the present disclosure, the user shall be informed of the type, range of use, use scenarios, etc., of personal information involved in the present disclosure in an appropriate manner and the authorization of the user shall be obtained in accordance with relevant laws and regulations.

For example, in response to receiving an active request from the user, prompt information is sent to the user to clearly prompt the user that the requested operation will require access to and use of the user's personal information. In this way, the user may independently choose, based on the prompt information, whether to provide the personal information to software or hardware, such as an electronic device, an application, a server, or a storage medium, that performs the operations of the technical solutions of the present disclosure.

As an optional but non-limiting implementation, in response to receiving the active request from the user, the prompt information may be sent to the user in the form of, for example, a pop-up window, in which the prompt information may be presented in text. In addition, the pop-up window may also carry a selection control for the user to select “agree” or “disagree” to provide the personal information to the electronic device.

It may be understood that the above process of notifying and acquiring user authorization is only illustrative and does not limit the implementations of the present disclosure, and other methods that satisfy relevant laws and regulations may also be applied to the implementations of the present disclosure.

It should be noted that in this paper, relational terms such as “first” and “second” are only used 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 “include”, “contain” or any other variation thereof are intended to cover non-exclusive inclusion, so that a process, method, object or device including a series of elements includes not only those elements, but also other elements not explicitly listed or elements inherent to such process, method, object or device. Without further restrictions, an element defined by the phrase “includes a” does not exclude the existence of additional identical elements in the process, method, object or device that includes the element.

The above descriptions are only specific embodiments of the present disclosure, so that those skilled in the art may understand or implement the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be practiced in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure is not to be limited to the embodiments described herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A data query method based on a cloud search service, comprising:

acquiring key information corresponding to an input sentence, acquiring first meta-information corresponding to the input sentence from an intention meta-information library, and generating model prompt information based on the first meta-information and the key information, in response to receiving the input sentence from a user of the cloud search service, wherein the intention meta-information library comprises a plurality of pieces of meta-information, the meta-information is information used for defining an intention to be analyzed, and the key information comprises at least one of keyword information or semantic information;
generating an intention analysis result by an intention analysis model based on the model prompt information;
generating a query statement based on the intention analysis result; and
performing query processing based on the query statement to obtain a query result corresponding to the input sentence.

2. The method of claim 1, wherein the acquiring the key information corresponding to the input sentence comprises:

acquiring a first keyword instruction corresponding to the input sentence from a keyword instruction library, wherein the keyword instruction library comprises a plurality of keyword instructions, and the keyword instruction is at least used for indicating a processing manner corresponding to a keyword;
acquiring a first semantic instruction corresponding to the input sentence from a semantic instruction library, wherein the semantic instruction library comprises a plurality of semantic instructions, and the semantic instruction is at least used for indicating a processing manner of a key semantic; and
using the first keyword instruction and the first semantic instruction as specific information corresponding to the input sentence.

3. The method of claim 2, wherein the keyword instruction further carries priority information corresponding to the keyword; and

the acquiring the first keyword instruction corresponding to the input sentence from the keyword information library comprises:
acquiring candidate keyword instructions corresponding to the input sentence from the keyword information library; and
selecting, based on the priority information corresponding to the candidate keyword instructions, top N instructions sorted in descending order of priority from the candidate keyword instructions as the first keyword instruction, wherein N is a positive integer.

4. The method of claim 1, wherein the generating the query statement based on the intention analysis result comprises:

determining one or more query steps based on the intention analysis result, and generating query statement segments corresponding to the query steps; and
merging the query statement segments to obtain the query statement.

5. The method of claim 4, wherein the determining the one or more query steps based on the intention analysis result comprises:

performing reconstruction processing on the intention analysis result to obtain an intention reconstruction result, wherein the intention reconstruction result is structured data; and
determining the query steps based on the intention reconstruction result.

6. The method of claim 5, wherein the performing the reconstruction processing on the intention analysis result to obtain the intention reconstruction result comprises:

invoking a first plugin, the first plugin comprising one or more of a plugin used for performing data normalization processing, a plugin used for performing data error correction processing, and a plugin used for performing data enhancement processing; and
performing the reconstruction processing on the intention analysis result by the first plugin to obtain the intention reconstruction result.

7. The method of claim 5, wherein the determining the query steps based on the intention reconstruction result comprises:

acquiring a first rule corresponding to the intention reconstruction result from a plurality of query step generation rules; and
generating the query steps corresponding to the intention reconstruction result based on the first rule.

8. The method of claim 4, wherein the generating the query statement segments corresponding to the query steps comprises:

generating the query statement segments corresponding to the query steps by a rule engine, wherein the rule engine is an engine that performs expansion processing of the query statement segment based on a structured query language SQL or a domain specific language DSL.

9. The method of claim 4, wherein the generating the query statement segments corresponding to the query steps comprises:

acquiring a first mapping rule from a mapping rule library and acquiring a first expansion operator from an expansion operator library based on the query step, wherein the mapping rule library comprises a plurality of mapping rules, the mapping rule is at least used for indicating different fields having a mapping relationship and an expansion operator corresponding to the fields, the expansion operator library comprises a plurality of expansion operators, and the expansion operator is a basic operation element used for generating the query statement segment; and
generating the query statement segment corresponding to the query step based on the first mapping rule and the first expansion operator.

10. The method of claim 4, wherein the merging the query statement segments comprises:

acquiring a segment type and a segment connection manner corresponding to the query statement segments, and merging the query statement segments based on the segment type and the segment connection manner.

11. An electronic device, comprising:

a memory configured to store a computer program; and
a processor configured to execute the computer program in the memory to implement following data query operations based on a cloud search service:
acquiring key information corresponding to an input sentence, acquiring first meta-information corresponding to the input sentence from an intention meta-information library, and generating model prompt information based on the first meta-information and the key information, in response to receiving the input sentence from a user of the cloud search service, wherein the intention meta-information library comprises a plurality of pieces of meta-information, the meta-information is information used for defining an intention to be analyzed, and the key information comprises at least one of keyword information or semantic information;
generating an intention analysis result by an intention analysis model based on the model prompt information;
generating a query statement based on the intention analysis result; and
performing query processing based on the query statement to obtain a query result corresponding to the input sentence.

12. The electronic device of claim 11, wherein the acquiring the key information corresponding to the input sentence comprises:

acquiring a first keyword instruction corresponding to the input sentence from a keyword instruction library, wherein the keyword instruction library comprises a plurality of keyword instructions, and the keyword instruction is at least used for indicating a processing manner corresponding to a keyword;
acquiring a first semantic instruction corresponding to the input sentence from a semantic instruction library, wherein the semantic instruction library comprises a plurality of semantic instructions, and the semantic instruction is at least used for indicating a processing manner of a key semantic; and
using the first keyword instruction and the first semantic instruction as specific information corresponding to the input sentence.

13. The electronic device of claim 12, wherein the keyword instruction further carries priority information corresponding to the keyword; and

the acquiring the first keyword instruction corresponding to the input sentence from the keyword information library comprises:
acquiring candidate keyword instructions corresponding to the input sentence from the keyword information library; and
selecting, based on the priority information corresponding to the candidate keyword instructions, top N instructions sorted in descending order of priority from the candidate keyword instructions as the first keyword instruction, wherein N is a positive integer.

14. The electronic device of claim 11, wherein the generating the query statement based on the intention analysis result comprises:

determining one or more query steps based on the intention analysis result, and generating query statement segments corresponding to the query steps; and
merging the query statement segments to obtain the query statement.

15. The electronic device of claim 14, wherein the determining the one or more query steps based on the intention analysis result comprises:

performing reconstruction processing on the intention analysis result to obtain an intention reconstruction result, wherein the intention reconstruction result is structured data; and
determining the query steps based on the intention reconstruction result.

16. A non-transitory computer-readable storage medium storing a computer program which is configured to perform following data query operations based on a cloud search service:

acquiring key information corresponding to an input sentence, acquiring first meta-information corresponding to the input sentence from an intention meta-information library, and generating model prompt information based on the first meta-information and the key information, in response to receiving the input sentence from a user of the cloud search service, wherein the intention meta-information library comprises a plurality of pieces of meta-information, the meta-information is information used for defining an intention to be analyzed, and the key information comprises at least one of keyword information or semantic information;
generating an intention analysis result by an intention analysis model based on the model prompt information;
generating a query statement based on the intention analysis result; and
performing query processing based on the query statement to obtain a query result corresponding to the input sentence.

17. The non-transitory computer-readable storage medium of claim 16, wherein the acquiring the key information corresponding to the input sentence comprises:

acquiring a first keyword instruction corresponding to the input sentence from a keyword instruction library, wherein the keyword instruction library comprises a plurality of keyword instructions, and the keyword instruction is at least used for indicating a processing manner corresponding to a keyword;
acquiring a first semantic instruction corresponding to the input sentence from a semantic instruction library, wherein the semantic instruction library comprises a plurality of semantic instructions, and the semantic instruction is at least used for indicating a processing manner of a key semantic; and
using the first keyword instruction and the first semantic instruction as specific information corresponding to the input sentence.

18. The non-transitory computer-readable storage medium of claim 17, wherein the keyword instruction further carries priority information corresponding to the keyword; and

the acquiring the first keyword instruction corresponding to the input sentence from the keyword information library comprises:
acquiring candidate keyword instructions corresponding to the input sentence from the keyword information library; and
selecting, based on the priority information corresponding to the candidate keyword instructions, top N instructions sorted in descending order of priority from the candidate keyword instructions as the first keyword instruction, wherein N is a positive integer.

19. The non-transitory computer-readable storage medium of claim 16, wherein the generating the query statement based on the intention analysis result comprises:

determining one or more query steps based on the intention analysis result, and generating query statement segments corresponding to the query steps; and
merging the query statement segments to obtain the query statement.

20. The non-transitory computer-readable storage medium of claim 19, wherein the determining the one or more query steps based on the intention analysis result comprises:

performing reconstruction processing on the intention analysis result to obtain an intention reconstruction result, wherein the intention reconstruction result is structured data; and
determining the query steps based on the intention reconstruction result.
Patent History
Publication number: 20260377400
Type: Application
Filed: Jan 26, 2026
Publication Date: Nov 26, 2026
Inventors: Weiqiang YU (Beijing), Zheng WANG (Beijing), Jiahui QI (Beijing), Yuncheng LU (Beijing), Dongyu WANG (Beijing), Yipeng JIANG (Beijing), Yakun LI (Beijing)
Application Number: 19/459,746
Classifications
International Classification: G06F 16/242 (20190101); G06F 40/279 (20200101); G06F 40/30 (20200101); G06F 40/40 (20200101);