Information query method, device, terminal equipment and storage medium

By performing field marking, in-depth query and synonymous field matching on the query statements entered by the user, the problem of incomplete SQL queries in the prior art is solved, and the full retrieval and accurate understanding of vertical field information is achieved, and the accuracy and reliability of query results are improved.

CN119357216BActive Publication Date: 2025-04-08BEIJING CAPITAL INFORMATION TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411895730.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-04-08
Estimated Expiration
2044-12-23

AI Technical Summary

Technical Problem

In the prior art, complex SQL queries cannot implement comprehensive queries, resulting in low accuracy of generated answer information and inability to realize retrieval and query of vertical fields, which can easily lead to large-scale model illusions and the generated reply information is seriously misleading to users.

Method used

By obtaining the query statement information input by the user, performing field marking processing, in-depth query operations, matching synonymous field tables, and generating prompt word information to ensure sufficient information retrieval and understanding in the vertical field.

Benefits of technology

It realizes full retrieval of information in the vertical field, ensures accurate understanding of query statements, improves the accuracy and reliability of generated query results, and avoids misleading users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119357216B_ABST
    Figure CN119357216B_ABST
Patent Text Reader

Abstract

The present application provides an information query method, device, terminal device and storage medium, which are applicable to the field of data processing technology. The method includes: obtaining query statement information; based on a preset field labeling model, performing field labeling processing on the query statement information to obtain labeling field information; performing a deep query operation based on the labeling field information and a preset statement database to obtain labeling field implicit information; matching the labeling field information with a preset synonymous field table to obtain standard field prompt information; generating prompt word information based on the labeling field information, the labeling field implicit information and the standard field prompt information; generating query result information based on the prompt word information and the query statement information. The present application can perform field labeling processing based on the query information input by the user, and then generate specific prompt words based on the labeling field, and improve the accuracy and reliability of the query results through the prompt words.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of data processing technology, and in particular, relates to information query methods, devices, terminal equipment and storage media. Background Art

[0002] Currently, artificial intelligence models are widely used in various industries. For example, by connecting CodeQwen, Chat2DB, ChatGLM and other models to the database for semantic analysis, natural language text (Text) can be converted into structured query language SQL, thereby generating answer information for the query information entered by the user.

[0003] In the prior art, LangChain can be used to combine a large language model with a retrieval module so that the large language model can retrieve information from an external knowledge source. Alternatively, AnythingLLM can be used to use a ready-made commercial large language model or other open source large language model and combine it with a vector database to build a model to generate answer information for query information input by the user.

[0004] However, in the prior art, complex SQL queries usually cannot achieve comprehensive queries, resulting in low accuracy of the generated answer information. In addition, simply inputting the query information entered by the user into a general model cannot achieve retrieval and query in vertical fields, which can easily make the model's understanding of the context incomplete and inaccurate, and easily lead to the illusion of a large model, so that the generated reply information will seriously mislead the user. Summary of the invention

[0005] In view of this, the embodiments of the present application provide an information query method, apparatus, terminal device and storage medium, which aim to solve the problem of insufficient retrieval and incomplete context understanding for query information input by users, resulting in low accuracy of generated answer information, which can easily seriously mislead users.

[0006] A first aspect of an embodiment of the present application provides an information query method, comprising:

[0007] Get query statement information;

[0008] Based on a preset field labeling model, the query statement information is subjected to field labeling processing to obtain labeling field information;

[0009] Performing a deep query operation based on the tag field information and a preset statement database to obtain the tag field implicit information;

[0010] Matching the marked field information with a preset synonymous field table to obtain standard field prompt information;

[0011] Generate prompt word information according to the marked field information, the marked field implicit information and the standard field prompt information;

[0012] Generate query result information according to the prompt word information and the query statement information.

[0013] A second aspect of an embodiment of the present application provides an information query device, including:

[0014] A query statement information acquisition module, used to acquire query statement information;

[0015] A marked field information generating module is used to perform field marking processing on the query statement information based on a preset field marking model to obtain marked field information;

[0016] A tag field implicit information generation module is used to perform a deep query operation based on the tag field information and a preset statement database to obtain the tag field implicit information;

[0017] A standard field prompt information determination module is used to match the marked field information with a preset synonymous field table to obtain standard field prompt information;

[0018] A prompt word information generating module, used for generating prompt word information according to the marked field information, the marked field implicit information and the standard field prompt information;

[0019] The query result information generating module is used to generate the query result information according to the prompt word information and the query statement information.

[0020] A third aspect of an embodiment of the present application provides a terminal device, which includes a memory and a processor, wherein the memory stores a computer program that can be executed on the processor, and when the processor executes the computer program, it implements the steps of the information query method as described in any one of the first aspects above.

[0021] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, comprising: a computer program stored therein, wherein when the computer program is executed by a processor, the steps of the information query method as described in any one of the first aspects above are implemented.

[0022] Compared with the prior art, the embodiments of the present application have the following beneficial effects: by performing entity extraction on the query statement input by the user, the extracted entities can be subjected to in-depth search and query in the actual database to ensure the adequacy of information retrieval in the vertical field, and the extracted entities are matched with the preset synonymous field table so that the unofficial terms in the query statement can be identified and matched to ensure the accuracy of understanding of the entities, and then prompt words are generated according to the extracted entities, the information obtained by the in-depth search and the information matched by the unofficial terms, so as to generate query results according to the prompt words and the query statement to ensure the accuracy and reliability of the query results. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0024] Figure 1 It is a schematic diagram of the implementation process of the information query method provided in the embodiment of the present application;

[0025] Figure 2 It is a schematic diagram of the implementation process of the information query method provided in the embodiment of the present application;

[0026] Figure 3 It is a schematic diagram of the implementation process of the information query method provided in the embodiment of the present application;

[0027] Figure 4 It is a schematic diagram of the implementation process of the information query method provided in the embodiment of the present application;

[0028] Figure 5 It is a schematic diagram of the implementation process of the information query method provided in the embodiment of the present application;

[0029] Figure 6 It is a schematic diagram of the implementation process of the information query method provided in the embodiment of the present application;

[0030] Figure 7 It is a schematic diagram of the implementation process of the information query method provided in the embodiment of the present application;

[0031] Figure 8 is a schematic diagram of the structure of an information query device provided in an embodiment of the present application;

[0032] Fig. 9 It is a schematic diagram of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0033] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0034] In order to illustrate the technical solution described in this application, a specific embodiment is provided below for illustration.

[0035] Figure 1 The following is a flowchart of the information query method provided in the first embodiment of the present application, which is described in detail as follows:

[0036] Step S101, obtaining query statement information.

[0037] In this embodiment, the query statement information may be information input by a user through a terminal, and is used to reflect the user's query needs, such as "what is the average amount of money spent by users in Changgao City, XX this month?".

[0038] Step S102: Based on a preset field labeling model, field labeling processing is performed on the query statement information to obtain labeling field information.

[0039] In this embodiment, the preset field tagging model can be a UIE model, which is a general information extraction unified framework proposed and implemented by the PaddlePaddle team for entity extraction. It is understandable that the UIE model can be obtained by fine-tuning 5,000 data for 30 minutes, where 30 minutes refers to the time obtained based on the average training time statistics of NVIDIA 4090. The UIE model can be used to extract entities of time, place, dimension, special field, and indicator from the query statement information, and the extracted entities are marked, and the marked entities are the marked field information. For example, the key fields in "What is the per capita outgoing amount of users in Changgao, XX City this month" are extracted and marked, and the obtained marked field information is: the time is "this month", the location is "XX City", the dimension is "Changgao", the special query field is "per capita", and the indicator is "outgoing amount".

[0040] Step S103: performing a deep query operation according to the tag field information and a preset statement database to obtain the tag field implicit information.

[0041] In this embodiment, the preset statement database may be an SQL database, and the deep query operation is a query performed on a special field in the tag field information. The deep query operation may be a nested query, an aggregate query, a union query, a cross-table query, and the like. The information obtained after the deep query operation is the implicit information of the tag field. It is understandable that when time information appears in the query statement information, the time information needs to be rewritten into a natural number sequence that can be recognized by the computer by calling a specific function in order to perform a deep query operation.

[0042] Step S104: Match the marked field information with a preset synonymous field table to obtain standard field prompt information.

[0043] In this embodiment, the preset synonymous field table can be a table in which dialect information collected and collated by business personnel in various regions corresponds to the official standard terms, and is input into the computer for matching with the marked field information, so as to identify the dialect or industry jargon information in the query statement input by the user. The matching method can be to first convert the marked field information and each dialect information in the synonymous field table into a vector, and then calculate the logical distance between the vectors, so as to screen the dialect information with a small logical distance, and determine the standard term corresponding to the dialect information, which is the standard field prompt information. It can be understood that each information in the synonymous field table is collected and collated by business personnel in various regions, and includes not only dialect information in various regions, but also specific industry terms and various local jargons, which are used to solve the problem of inaccurate context understanding of the query statement information by the computer.

[0044] Step S105, generating prompt word information according to the marked field information, the marked field implicit information and the standard field prompt information.

[0045] In this embodiment, the RAG method, that is, the retrieval enhancement generation method, can be used to update the content after retrieval of the tagged field information, the tagged field implicit information and the standard field prompt information, and generate prompt word information based on the updated content for subsequent generation of query results simultaneously with the query statement information.

[0046] Step S106: Generate query result information according to the prompt word information and the query statement information.

[0047] In this embodiment, it is understood that not all fields in the query statement information are extracted and interpreted to avoid the lack of flexibility in the generation of query results. Therefore, it is necessary to generate query results based on both the prompt word information and the query statement information. It is understandable that the query result information can be generated with the help of the LLM large model.

[0048] The information query method provided in the embodiment of the present application extracts entities from the query statement input by the user, so that the extracted entities can be deeply searched and queried in the actual database to ensure the adequacy of the retrieval of information in the vertical field, and the extracted entities are matched with the preset synonymous field table so that the unofficial terms in the query statement can be identified and matched to ensure the accuracy of the understanding of the query statement, and then generate prompt words based on the extracted entities, the information obtained by the deep search and the information matched by the unofficial terms, so as to generate query results based on the prompt words and the query statement to ensure the accuracy and reliability of the query results.

[0049] Figure 2 The flowchart of the information query method provided in the second embodiment of the present application is shown. The difference between the second embodiment and the first embodiment is that: the preset synonymous field table includes multiple reference field information;

[0050] The step S104 specifically includes:

[0051] Step S201, calculating the logical distance value between the tag field information and a plurality of the reference field information.

[0052] In this embodiment, it is understandable that the tag field information and the reference field information need to be converted into a tag field vector and a reference field vector respectively, and then the logical distance between the tag field vector and the reference field vector is calculated. The method of converting the tag field information and the reference field information into a vector may be through TF-IDF, or through LSA / LSI, etc. The logical distance may be a cosine value.

[0053] Step S202, determining whether each of the logical distance values ​​is less than a preset distance threshold, if so, proceeding to step S203; if not, proceeding to step S204.

[0054] In this embodiment, the preset distance threshold may be 0.3. When the logical distance value is less than the preset distance threshold, it indicates that the current database has data content that matches the tag field information, and the matched data content is transmitted to the user terminal together with the tag field information, and the user judges and clicks to confirm whether the matched data content is accurate; when the logical distance value is greater than the preset distance threshold, it indicates that the current database does not have data content that is close to the tag field information, and this tag field information is a "new word" for the database, so the tag field information and the matching item closest to its logical distance value are transmitted to the user terminal, and the user judges and clicks to confirm whether the matched data content is accurate.

[0055] Step S203: Generate reference field query information according to the tag field information and the reference field information corresponding to the logical distance value.

[0056] In this embodiment, the reference field inquiry information may be generated by replacing the marked field information in the query information with the reference field information to confirm whether the user needs to query or consult the question.

[0057] Step S204: Generate reference field query information according to the tag field information and the reference field information corresponding to the minimum value of the logical distance value.

[0058] In this embodiment, the reference field inquiry information may be generated by replacing the mark field information in the query information with the reference field information corresponding to the minimum value of the logical distance value to confirm whether the user needs to query or consult the question.

[0059] Step S205 , in response to the user's confirmation operation on the reference field inquiry information, a confirmation field is generated, and the confirmation field is used as standard field prompt information.

[0060] In this embodiment, the user can confirm the reference field query information through the terminal device, so as to select the reference field information. In response to the user's confirmation operation, the computer uses the reference field information selected by the user as the confirmation field and the confirmation field as the standard field prompt information for subsequent generation of prompt word information.

[0061] The information query method provided in the embodiment of the present application realizes the recognition and matching of unofficial terms in the query statement information by calculating the logical distance value between the marked field information and multiple reference field information, so as to avoid context misunderstanding errors caused by unofficial terms, and generates reference field query information from the matched reference field information, and then pushes the reference field query information to the user terminal for the user to confirm the reference field information, thereby ensuring the matching accuracy of the marked field information and the reference field information, so as to improve the reliability of the generated query results.

[0062] Figure 3 The flowchart of the information query method provided in the third embodiment of the present application is shown. The difference between the third embodiment and the first embodiment is that the step S106 specifically includes:

[0063] Step S301, generating prompt text information according to the prompt word information.

[0064] In this embodiment, an example sentence may be generated based on the trained LLM model and the prompt word information, and the example sentence is the prompt text information. The prompt word information may be used to replace the tag field information in the query sentence information to generate the prompt text information.

[0065] Step S302: Generate a prompt text vector and a query sentence vector according to the prompt text information and the query sentence information.

[0066] In this embodiment, One-hot encoding, TF-IDF, Word2Vec, Doc2Vec, BERT, ELMo, GPT, FastText, GloVe and other methods can be used to convert prompt text information and query statement information into prompt text vectors and query statement vectors, which are used to map the prompt text information and query statement information into nonlinear space for analysis and calculation.

[0067] Step S303: obtaining a prompt text offset vector and a query sentence offset vector according to the prompt text vector, the query sentence vector and a preset relative position offset vector.

[0068] In this embodiment, the preset relative position offset vector can be manually set to characterize the relative displacement of the prompt text vector and the query statement vector in the nonlinear space. The vectors after the relative displacement are the prompt text offset vector and the query statement offset vector.

[0069] Step S304, obtaining a prompt text feature matrix according to the prompt text offset vector, a preset weight matrix and a preset scaling matrix.

[0070] In this embodiment, the preset weight matrix and the preset scaling matrix can be manually set. The weight matrix can be multiplied by the prompt text offset vector to assign weights to each value in the prompt text offset vector to highlight the important semantic features in the prompt text, and then the multiplied result is multiplied by the scaling matrix to avoid data overflow during the calculation process and cause inaccurate calculation results.

[0071] Step S305 , obtaining a query statement feature matrix according to the query statement offset vector, a preset weight mapping matrix and a preset scaling transformation matrix.

[0072] In this embodiment, the preset weight mapping matrix and the preset scaling transformation matrix can be manually set. The weight mapping matrix can be multiplied by the query offset vector to assign weights to each value in the query offset vector to highlight important semantic features in the query, and then the multiplied result can be multiplied by the scaling transformation vector to avoid data overflow during the calculation process and cause inaccurate calculation results.

[0073] Step S306: merge the prompt text feature matrix and the query statement feature matrix to obtain a query text feature variable matrix.

[0074] In this embodiment, the merging process can be achieved by using feature fusion to merge the prompt text feature matrix and the query statement feature matrix into one matrix, namely, the query text feature variable matrix; or the prompt text feature matrix and the query statement feature matrix can be added together to achieve the merging process, and the result of the addition is the query text feature variable matrix.

[0075] Step S307, obtaining a query result feature vector according to the query text feature variable matrix, a preset linear transformation matrix, a preset nonlinear mapping function and a preset bias variable function.

[0076] In this embodiment, the preset linear transformation matrix, the preset nonlinear mapping function and the preset bias variable function can all be artificially set, wherein the bias variable function can be a constant function. The query text feature variable matrix can be first multiplied by the linear transformation matrix to implement the scaling process for the query text feature variable, and then the multiplication result is added to the bias variable function to characterize the displacement of the query text feature variable in the linear space, and then the addition result is used as the independent variable of the nonlinear mapping function, and the function value calculated is used as the query result feature vector.

[0077] Step S308: Generate query result information according to the query result feature vector.

[0078] In this embodiment, the query result feature vector may be converted into text information by using methods such as One-hot encoding, TF-IDF, Word2Vec, Doc2Vec, BERT, ELMo, GPT, FastText, GloVe, etc. The text information is the query result information.

[0079] The information query method provided in the embodiment of the present application introduces prompt word information instead of just performing semantic analysis processing based on query statement information to ensure the accuracy and reliability of the query results. The important semantic features in the prompt word information and the query statement information are highlighted by introducing a weight matrix and a weight mapping matrix so that the important semantic features can be taken into consideration. The important semantic features can be fully perceived and calculated through linear transformation and nonlinear transformation processing, thereby ensuring the accuracy and comprehensiveness of the query results to avoid misleading the user.

[0080] Figure 4 The flowchart of the information query method provided in the fourth embodiment of the present application is shown. The difference between the fourth embodiment and the third embodiment is that the step S301 specifically includes:

[0081] Step S401: performing a search process according to the prompt word information and a preset prompt sentence template to obtain a plurality of initial prompt content information.

[0082] In this embodiment, the preset prompt sentence template may have at least one space, wherein one or more spaces are input spaces and the remaining spaces are answer spaces, similar to the sentence structure of a fill-in-the-blank question. It can be understood that the prompt word information is filled into the input space of the prompt sentence template, and then the formed sentence is retrieved and processed in the SQL database to obtain the contents of multiple answer spaces as multiple initial prompt content information.

[0083] Step S402: using the plurality of initial prompt content information as independent variables of a preset matching degree test function to obtain a prompt information matching degree function value.

[0084] In this embodiment, the preset matching degree checking function may be an argmax function or a sampling function, and the obtained function value is used as the prompt information matching degree function value.

[0085] Step S403: taking the initial prompt content information corresponding to the maximum value of the prompt information matching function as the target prompt content information.

[0086] In this embodiment, the initial prompt content information corresponding to the maximum value of the prompt information matching function is used as the target prompt content information, which is used to subsequently generate prompt text information, so as to introduce the prompt text information as reference information for generating query results to ensure the accuracy and reliability of the query results.

[0087] Step S404: Generate prompt text information according to the prompt word information and the target prompt content information.

[0088] In this embodiment, it is understandable that the prompt text information may be generated by filling the prompt word information into the input space and filling the target prompt content information into the answer space according to the preset prompt sentence template.

[0089] The information query method provided in the embodiment of the present application introduces prompt word information, obtains prompt content according to a prompt sentence template, ensures the accuracy of the prompt content according to a matching detection function, and uses the prompt content information that meets the matching detection requirements to guide the generation of query results, thereby avoiding inaccurate query results due to incomplete understanding of the content context of the query statement, thereby improving the reliability of the generated query results.

[0090] Figure 5 The flowchart of the information query method provided in the fifth embodiment of the present application is shown. The difference between the fifth embodiment and the third embodiment is that the preset weight matrix includes a preset first weight matrix, a preset second weight matrix and a preset third weight matrix;

[0091] The step S304 specifically includes:

[0092] Step S501, multiplying the prompt text offset vector and a preset first weight matrix, a preset second weight matrix and a preset third weight matrix respectively to obtain a first prompt text intermediate variable matrix, a second prompt text intermediate variable matrix and a third prompt text intermediate variable matrix.

[0093] In this embodiment, the preset first weight matrix, the preset second weight matrix and the preset third weight matrix can be manually set. It can be understood that the prompt text offset vector is respectively inner-producted with the first weight matrix, the second weight matrix and the third weight matrix to extract semantic features of the prompt text offset vector, thereby obtaining the first prompt text intermediate variable matrix, the second prompt text intermediate variable matrix and the third prompt text intermediate variable matrix.

[0094] Step S502: performing a transposition calculation on the second prompt text intermediate variable matrix to obtain a second prompt text intermediate variable transposition matrix.

[0095] In this embodiment, the row labels and column labels of all elements in the second prompt text intermediate variable matrix are swapped to obtain the second prompt text intermediate variable transposed matrix.

[0096] Step S503, multiplying the second prompt text intermediate variable transposition matrix, the first prompt text intermediate variable matrix and a preset scaling matrix to obtain an initial prompt text feature matrix.

[0097] In this embodiment, the preset scaling matrix can be manually set. First, the second prompt text intermediate variable transposed matrix and the first prompt text intermediate variable matrix are inner-product calculated, and then the result of the inner-product calculation is multiplied by the scaling matrix to prevent the data size from exceeding the dimension requirement and causing overflow. The result of the multiplication calculation is the initial prompt text feature matrix.

[0098] Step S504, normalizing the initial prompt text feature matrix to obtain an intermediate prompt text feature matrix.

[0099] In this embodiment, the normalization calculation can be performed through the premnmx function, that is, the initial prompt text feature matrix is ​​used as the independent variable of the premnmx function, and the function value is the intermediate prompt text feature matrix.

[0100] Step S505: multiply the intermediate prompt text feature matrix and the third prompt text intermediate variable matrix to obtain a prompt text feature matrix.

[0101] In this embodiment, an inner product operation is performed on the intermediate prompt text feature matrix and the third prompt text intermediate variable matrix, and the result of the inner product operation is the prompt text feature matrix.

[0102] The information query method provided in the embodiment of the present application quantifies the important semantic features of the prompt text through the first weight matrix, the second weight matrix and the third weight matrix, and assigns higher weights to semantic features with high importance, so as to fully extract the important semantic features in the prompt text through the weights, thereby ensuring that the important semantic features in the prompt text can be used to generate query results, thereby ensuring the accuracy and reliability of the query results.

[0103] Figure 6 The flowchart of the implementation of the information query method provided in the sixth embodiment of the present application is shown, which differs from the third embodiment in that: the preset weight mapping matrix includes a preset first weight mapping matrix, a preset second weight mapping matrix and a preset third weight mapping matrix;

[0104] The step S305 specifically includes:

[0105] Step S601, multiplying the query statement offset vector and a preset first weight mapping matrix, a preset second weight mapping matrix and a preset third weight mapping matrix respectively to obtain a first query statement intermediate variable matrix, a second query statement intermediate variable matrix and a third query statement intermediate variable matrix.

[0106] In this embodiment, the preset first weight mapping matrix, the preset second weight mapping matrix, and the preset third weight mapping matrix can be manually set. It can be understood that the query statement offset vector is respectively inner-producted with the first weight mapping matrix, the second weight mapping matrix, and the third weight mapping matrix to extract semantic features from the query statement offset vector, thereby obtaining the first query statement intermediate variable matrix, the second query statement intermediate variable matrix, and the third query statement intermediate variable matrix.

[0107] Step S602: performing a transposition calculation on the intermediate variable matrix of the second query statement to obtain a transposed matrix of the intermediate variables of the second query statement.

[0108] In this embodiment, the row labels and column labels of all elements in the second query statement intermediate variable matrix are swapped to obtain the second query statement intermediate variable transposed matrix.

[0109] Step S603: multiply the second query statement intermediate variable transposition matrix, the first query statement intermediate variable matrix, and a preset scaling transformation matrix to obtain an initial query statement feature matrix.

[0110] In this embodiment, the preset scaling transformation matrix can be manually set. First, the inner product calculation is performed on the second query statement intermediate variable transposition matrix and the first query statement intermediate variable matrix, and then the result of the inner product calculation is multiplied by the scaling transformation matrix to prevent the data size from exceeding the dimension requirement and causing overflow. The result of the multiplication calculation is the initial query statement feature matrix.

[0111] Step S604: normalize the initial query statement feature matrix to obtain an intermediate query statement feature matrix.

[0112] In this embodiment, the normalization calculation can be performed through the premnmx function, that is, the initial query statement feature matrix is ​​used as the independent variable of the premnmx function, and the function value is the intermediate query statement feature matrix.

[0113] Step S605: multiply the intermediate query statement feature matrix and the third query statement intermediate variable matrix to obtain a query statement feature matrix.

[0114] In this embodiment, an inner product operation is performed on the intermediate query statement feature matrix and the third query statement intermediate variable matrix, and the result of the inner product operation is the query statement feature matrix.

[0115] The information query method provided in the embodiment of the present application quantifies the important semantic features of the query statement through the first weight mapping matrix, the second weight mapping matrix and the third weight mapping matrix, and assigns higher weights to semantic features with high importance, so as to fully extract the important semantic features in the query statement through the weights, thereby ensuring that the important semantic features in the query statement can be used to generate query results, thereby ensuring the accuracy and reliability of the query results.

[0116] Figure 7 The flowchart of the information query method provided by the seventh embodiment of the present application is shown. The difference between the seventh embodiment and the third embodiment is that: the preset linear transformation matrix includes a preset first linear transformation matrix and a preset second linear transformation matrix; the preset bias variable function includes a preset first bias variable function and a preset second bias variable function;

[0117] The step S307 specifically includes:

[0118] Step S701: multiply the query text feature variable matrix and a preset first linear transformation matrix to obtain a first query text linear transformation feature.

[0119] In this embodiment, the preset first linear transformation matrix can be artificially set. The query text feature variable matrix and the first linear transformation matrix are inner-product calculated, and the result of the inner-product calculation is the first query text linear transformation feature.

[0120] Step S702: summing up the first query text linear transformation feature and a preset first bias variable function to obtain a query text feature intermediate variable.

[0121] In this embodiment, the preset first bias variable function can be manually set or a constant function. The first query text linear transformation feature and the first bias variable function are summed to characterize the offset of the first query text linear transformation feature in the linear space, and the sum result is the query text feature intermediate variable.

[0122] Step S703: obtain a query text nonlinear feature variable by applying the query text feature intermediate variable and a preset nonlinear mapping function.

[0123] In this embodiment, the preset nonlinear mapping function may be a GeLU function, which may use the query text feature intermediate variable as the independent variable of the nonlinear mapping function, and the function value obtained by calculation is the query text nonlinear feature variable.

[0124] Step S704: multiply the query text nonlinear feature variable and a preset second linear transformation matrix to obtain a second query text linear transformation feature.

[0125] In this embodiment, the preset second linear transformation matrix can be artificially set. The inner product operation is performed on the query text nonlinear feature variable and the second linear transformation matrix, and the result of the inner product operation is the second query text linear transformation feature.

[0126] Step S705: summing up the second query text linear transformation feature and the preset second bias variable function to obtain a query result feature vector.

[0127] In this embodiment, the preset second offset variable function may be manually set or may be a constant function. The second query text linear transformation feature is summed with the second offset variable function, and the sum result is the query result feature vector.

[0128] The information query method provided in the embodiment of the present application amplifies the features of the query text through a linear transformation matrix, enhances the contrast of the query text features in the linear space through a bias variable function, and then maps the query text features after the linear transformation to the nonlinear space through a nonlinear mapping function, thereby improving the full expressiveness of the query text features, allowing the semantic features in the query text to be fully analyzed and calculated, thereby improving the comprehensiveness and accuracy of the query results, and effectively avoiding misleading the query results to the user.

[0129] Corresponding to the method of the above embodiment, Figure 8 A structural block diagram of an information query device provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown. Figure 8 The exemplary information query device may be an execution subject of the information query method provided in the aforementioned first embodiment.

[0130] Reference Figure 8 , the information query device comprises:

[0131] A query statement information acquisition module, used to acquire query statement information;

[0132] A marked field information generating module is used to perform field marking processing on the query statement information based on a preset field marking model to obtain marked field information;

[0133] A tag field implicit information generation module is used to perform a deep query operation based on the tag field information and a preset statement database to obtain the tag field implicit information;

[0134] A standard field prompt information determination module is used to match the marked field information with a preset synonymous field table to obtain standard field prompt information;

[0135] A prompt word information generating module, used for generating prompt word information according to the marked field information, the marked field implicit information and the standard field prompt information;

[0136] The query result information generating module is used to generate the query result information according to the prompt word information and the query statement information.

[0137] The process of each module in the information query device provided in the embodiment of the present application realizing its own function can be specifically referred to the aforementioned Figure 1 The description of the first embodiment is not repeated here.

[0138] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0139] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0140] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0141] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0142] In addition, in the description of the present specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish descriptions, and cannot be understood as indicating or suggesting relative importance. It should also be understood that although the terms "first", "second", etc. are used to describe various elements in some embodiments of the present application in the text, these elements should not be limited by these terms. These terms are only used to distinguish one element from another element. For example, the first table can be named as the second table, and similarly, the second table can be named as the first table without departing from the scope of the various described embodiments. The first table and the second table are both tables, but they are not the same table.

[0143] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0144] The information query method provided in the embodiments of the present application can be applied to terminal devices such as mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA), etc. The embodiments of the present application do not impose any restrictions on the specific types of terminal devices.

[0145] For example, the terminal device can be a station (STAION, ST) in a WLAN, a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA) device, a handheld device with wireless communication function, a computing device or other processing device connected to a wireless modem, a vehicle-mounted device, a vehicle networking terminal, a computer, a laptop computer, a handheld communication device, a handheld computing device, a satellite wireless device, a wireless modem card, a TV set top box (STB), a customer premises equipment (CPE) and / or other devices for communicating on a wireless system and a next-generation communication system, such as a mobile terminal in a 5G network or a mobile terminal in a future evolved Public Land Mobile Network (PLMN) network, etc.

[0146] As an example but not limitation, when the terminal device is a wearable device, the wearable device can also be a general term for wearable devices that are intelligently designed and developed using wearable technology for daily wear, such as glasses, gloves, watches, clothing and shoes. A wearable device is a portable device that is worn directly on the body or integrated into the user's clothes or accessories. Wearable devices are not just hardware devices, but also achieve powerful functions through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include those that are fully functional, large in size, and can achieve complete or partial functions without relying on smartphones, such as smart watches or smart glasses, as well as those that only focus on a certain type of application function and need to be used in conjunction with other devices such as smartphones, such as various smart bracelets and smart jewelry for vital sign monitoring.

[0147] Fig. 9Schematic diagram of the structure of a terminal device provided by an embodiment of the present application. Fig. 9 As shown, the terminal device 9 of this embodiment includes: at least one processor 90 ( Fig. 9 Only one is shown in the figure), a memory 91, wherein the memory 91 stores a computer program 92 that can be run on the processor 90. When the processor 90 executes the computer program 92, the steps in the above-mentioned information query method embodiments are implemented, such as Figure 1 Alternatively, when the processor 90 executes the computer program 92, the functions of each module / unit in the above-mentioned device embodiments are realized, for example, Figure 8 Functions of modules 810 to 860 are shown.

[0148] The terminal device 9 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal device may include, but is not limited to, a processor 90 and a memory 91. Those skilled in the art will appreciate that Fig. 9 It is only an example of the terminal device 9 and does not constitute a limitation on the terminal device 9. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal device may also include an input sending device, a network access device, a bus, etc.

[0149] The processor 90 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0150] In some embodiments, the memory 91 may be an internal storage unit of the terminal device 9, such as a hard disk or memory of the terminal device 9. The memory 91 may also be an external storage device of the terminal device 9, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 9. Further, the memory 91 may also include both an internal storage unit of the terminal device 9 and an external storage device. The memory 91 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory 91 may also be used to temporarily store data that has been sent or is to be sent.

[0151] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0152] An embodiment of the present application also provides a terminal device, which includes at least one memory, at least one processor, and a computer program stored in the at least one memory and executable on the at least one processor, wherein when the processor executes the computer program, the terminal device implements the steps in any of the above-mentioned method embodiments.

[0153] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0154] An embodiment of the present application provides a computer program product. When the computer program product runs on a terminal device, the terminal device can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0155] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc.

[0156] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0157] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0158] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0159] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. An information query method, characterized in that: include: Get query statement information; Based on a preset field labeling model, the query statement information is subjected to field labeling processing to obtain labeling field information; Performing a deep query operation based on the tag field information and a preset statement database to obtain the tag field implicit information; Matching the marked field information with a preset synonymous field table to obtain standard field prompt information; Generate prompt word information according to the marked field information, the marked field implicit information and the standard field prompt information; Generate query result information according to the prompt word information and the query statement information; The step of generating query result information according to the prompt word information and the query statement information specifically includes: Generate prompt text information according to the prompt word information; Generate a prompt text vector and a query sentence vector according to the prompt text information and the query sentence information; Obtaining a prompt text offset vector and a query statement offset vector according to the prompt text vector, the query statement vector and a preset relative position offset vector; Obtaining a prompt text feature matrix according to the prompt text offset vector, a preset weight matrix, and a preset scaling matrix; Obtaining a query statement feature matrix according to the query statement offset vector, a preset weight mapping matrix, and a preset scaling transformation matrix; The prompt text feature matrix and the query statement feature matrix are combined to obtain a query text feature variable matrix; Obtaining a query result feature vector according to the query text feature variable matrix, a preset linear transformation matrix, a preset nonlinear mapping function, and a preset bias variable function; Generate query result information according to the query result feature vector.

2. The information query method according to claim 1, characterized in that: The preset synonymous field table includes multiple reference field information; The step of matching the marked field information with a preset synonymous field table to obtain standard field prompt information specifically includes: Calculating the logical distance value between the tag field information and the plurality of reference field information; Determining whether each of the logical distance values ​​is less than a preset distance threshold; If yes, generating reference field query information according to the tag field information and the reference field information corresponding to the logical distance value; If not, generating reference field query information according to the tag field information and the reference field information corresponding to the minimum value of the logical distance value; In response to the user's confirmation operation on the reference field query information, a confirmation field is generated, and the confirmation field is used as standard field prompt information.

3. The information query method according to claim 1, characterized in that: The step of generating prompt text information according to the prompt word information specifically includes: Performing a search process according to the prompt word information and a preset prompt sentence template to obtain a plurality of initial prompt content information; Using the plurality of initial prompt content information as independent variables of a preset matching degree test function to obtain a prompt information matching degree function value; Taking the initial prompt content information corresponding to the maximum value of the prompt information matching function as the target prompt content information; Prompt text information is generated according to the prompt word information and the target prompt content information.

4. The information query method according to claim 1, characterized in that: The preset weight matrix includes a preset first weight matrix, a preset second weight matrix and a preset third weight matrix; The step of obtaining the prompt text feature matrix according to the prompt text offset vector, the preset weight matrix and the preset scaling matrix specifically includes: Multiplying the prompt text offset vector with a preset first weight matrix, a preset second weight matrix, and a preset third weight matrix respectively to obtain a first prompt text intermediate variable matrix, a second prompt text intermediate variable matrix, and a third prompt text intermediate variable matrix; Performing a transposition calculation on the second prompt text intermediate variable matrix to obtain a second prompt text intermediate variable transposition matrix; The second prompt text intermediate variable transposition matrix, the first prompt text intermediate variable matrix and a preset scaling matrix are multiplied to obtain an initial prompt text feature matrix; Normalizing the initial prompt text feature matrix to obtain an intermediate prompt text feature matrix; The intermediate prompt text feature matrix and the third prompt text intermediate variable matrix are multiplied to obtain a prompt text feature matrix.

5. The information query method according to claim 1, characterized in that: The preset weight mapping matrix includes a preset first weight mapping matrix, a preset second weight mapping matrix and a preset third weight mapping matrix; The step of obtaining the query statement feature matrix according to the query statement offset vector, the preset weight mapping matrix and the preset scaling transformation matrix specifically includes: Multiplying the query statement offset vector with a preset first weight mapping matrix, a preset second weight mapping matrix, and a preset third weight mapping matrix respectively to obtain a first query statement intermediate variable matrix, a second query statement intermediate variable matrix, and a third query statement intermediate variable matrix; Performing a transposition calculation on the intermediate variable matrix of the second query statement to obtain a transposed matrix of the intermediate variables of the second query statement; The second query statement intermediate variable transposition matrix, the first query statement intermediate variable matrix and a preset scaling transformation matrix are multiplied to obtain an initial query statement feature matrix; Normalizing the initial query statement feature matrix to obtain an intermediate query statement feature matrix; The intermediate query statement feature matrix and the third query statement intermediate variable matrix are multiplied to obtain a query statement feature matrix.

6. The information query method according to claim 1, characterized in that: The preset linear transformation matrix includes a preset first linear transformation matrix and a preset second linear transformation matrix; The preset bias variable function includes a preset first bias variable function and a preset second bias variable function; The step of obtaining the query result feature vector according to the query text feature variable matrix, the preset linear transformation matrix, the preset nonlinear mapping function and the preset bias variable function specifically includes: The query text feature variable matrix and a preset first linear transformation matrix are multiplied to obtain a first query text linear transformation feature; The first query text linear transformation feature and a preset first bias variable function are summed to obtain a query text feature intermediate variable; The query text feature intermediate variable and a preset nonlinear mapping function are used to obtain a query text nonlinear feature variable; The query text nonlinear feature variable and a preset second linear transformation matrix are multiplied to obtain a second query text linear transformation feature; The second query text linear transformation feature and the preset second bias variable function are summed up to obtain a query result feature vector.

7. An information query device, characterized in that: include: A query statement information acquisition module, used to acquire query statement information; A marked field information generating module is used to perform field marking processing on the query statement information based on a preset field marking model to obtain marked field information; A tag field implicit information generation module is used to perform a deep query operation based on the tag field information and a preset statement database to obtain the tag field implicit information; A standard field prompt information determination module is used to match the marked field information with a preset synonymous field table to obtain standard field prompt information; A prompt word information generating module, used for generating prompt word information according to the marked field information, the marked field implicit information and the standard field prompt information; A query result information generating module, used to generate query result information according to the prompt word information and the query statement information; The step of generating query result information according to the prompt word information and the query statement information specifically includes: Generate prompt text information according to the prompt word information; Generate a prompt text vector and a query sentence vector according to the prompt text information and the query sentence information; Obtaining a prompt text offset vector and a query statement offset vector according to the prompt text vector, the query statement vector and a preset relative position offset vector; Obtaining a prompt text feature matrix according to the prompt text offset vector, a preset weight matrix, and a preset scaling matrix; Obtaining a query statement feature matrix according to the query statement offset vector, a preset weight mapping matrix, and a preset scaling transformation matrix; The prompt text feature matrix and the query statement feature matrix are combined to obtain a query text feature variable matrix; Obtaining a query result feature vector according to the query text feature variable matrix, a preset linear transformation matrix, a preset nonlinear mapping function, and a preset bias variable function; Generate query result information according to the query result feature vector.

8. A terminal device, characterized in that: The terminal device includes a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Method and device for prompting search term

    CN108846037A

  • Data query method and device, electronic equipment and storage medium

    CN118035280A

  • Database query method and device, electronic equipment and storage medium

    CN118779315A