Information retrieval methods, devices and electronic equipment
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-12
- Publication Date
- 2026-08-14
AI Technical Summary
但是该方式导致查询结果的准确性和可解释性较差,并且无法适应快速变化的业务需求
[0006]本公开实施例中,通过接收业务查询信息,根据业务查询信息,从预先构建的业务语义缓存区中,获取匹配的目标业务信息,其中目标业务信息包括匹配的目标业务指标和/或目标业务维度,基于业务查询信息获取查询所需的结构化参数,根据目标业务信息和结构化参数,生成可执行的查询语句,基于可执行的查询语句得到目标查询结果。由此,本公开通过从业务语义缓存区中获取匹配的目标业务信息,能够规范业务语义理解口径,避免了自然语言解析过程中易出现的语义偏离问题,并根据目标业务信息和结构化参数,生成可执行的查询语句,大幅提升了查询语句生成的准确性和业务可解释性,有利于提升查询结果的精准度和可靠性。
Smart Images

Figure CN122570538A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of artificial intelligence technology, and in particular to an information retrieval method, apparatus, and electronic device. Background Technology
[0002] In business-to-business (ToB) office scenarios, such as business intelligence (BI) analysis, data dashboard generation, and operational report creation, users typically need to query and analyze complex enterprise data to support decision-making.
[0003] In related technologies, Natural Language to Structured Query Language (NL2SQL) technology is used. Users ask questions in natural language, and the system uses artificial intelligence technologies such as Large Language Models (LLM) to understand and parse the user's intent, automatically converting it into SQL statements that can be directly executed on relational databases, and returning the query results. However, this method results in poor accuracy and interpretability of the query results and cannot adapt to rapidly changing business needs. Summary of the Invention
[0004] This disclosure provides an information retrieval method, apparatus, electronic device, storage medium, and computer program product.
[0005] The first aspect of this disclosure proposes an information query method, which includes: receiving business query information; obtaining matching target business information from a pre-built business semantic cache based on the business query information, wherein the target business information includes matching target business indicators and / or target business dimensions; obtaining structured parameters required for the query based on the business query information; generating an executable query statement based on the target business information and the structured parameters; and obtaining a target query result based on the executable query statement.
[0006] In this embodiment, by receiving business query information, matching target business information is obtained from a pre-built business semantic cache based on the business query information. The target business information includes matching target business metrics and / or target business dimensions. Structured parameters required for the query are obtained based on the business query information. An executable query statement is generated based on the target business information and the structured parameters. The target query result is obtained based on the executable query statement. Therefore, by obtaining matching target business information from the business semantic cache, this disclosure can standardize the understanding of business semantics, avoid semantic deviations that easily occur during natural language parsing, and generate an executable query statement based on the target business information and structured parameters. This significantly improves the accuracy and interpretability of the generated query statement, thus enhancing the precision and reliability of the query results.
[0007] A second aspect of this disclosure provides an information query device, comprising: a receiving module for receiving business query information; a first obtaining module for obtaining matching target business information from a pre-built business semantic cache based on the business query information, wherein the target business information includes matching target business indicators and / or target business dimensions; a second obtaining module for obtaining structured parameters required for querying based on the business query information; a generating module for generating an executable query statement based on the target business information and the structured parameters; and a querying module for obtaining a target query result based on the executable query statement.
[0008] A third aspect of this disclosure provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the information query method as described in the first aspect of the present invention.
[0009] A fourth aspect of this disclosure provides a computer-readable storage medium storing computer instructions for causing the computer to perform the information query method as described in the first aspect above.
[0010] The fifth aspect of this disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the information query method of the first aspect of this disclosure.
[0011] Additional aspects and advantages of this disclosure will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this disclosure. Attached Figure Description
[0012] The above and / or additional aspects and advantages of this disclosure will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, in which:
[0013] Figure 1 A flowchart illustrating an information query method provided in an embodiment of this disclosure; Figure 2 A flowchart illustrating an information query method provided in another embodiment of this disclosure; Figure 3 A schematic diagram illustrating an information query method provided in an embodiment of this disclosure; Figure 4 This is a schematic diagram of the structure of an information query device provided in an embodiment of the present disclosure; Figure 5 A block diagram of an electronic device provided according to an embodiment of this disclosure. Detailed Implementation
[0014] Embodiments of this disclosure are described in detail below. Examples of these embodiments are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this disclosure, and should not be construed as limiting this disclosure.
[0015] The information query method, apparatus, electronic device, and storage medium of this disclosure are described below with reference to the accompanying drawings.
[0016] Figure 1 This is a flowchart illustrating an information query method provided in an embodiment of the present disclosure.
[0017] like Figure 1 As shown, the method includes the following steps: S101, Receive service query information.
[0018] Among them, business query information can be understood as the original query content entered by the user.
[0019] Optionally, the business query information can be the original query content entered by the user on the terminal device, such as the original query content entered by the user on the mobile phone or the original query content entered by the user on the computer.
[0020] For example, a user enters the following business query information on their mobile phone: "Query the sales volume of electronic products in January 2024, summarized by province".
[0021] S102, based on the business query information, obtain matching target business information from the pre-built business semantic cache, wherein the target business information includes matching target business metrics and / or target business dimensions.
[0022] In this embodiment of the disclosure, metadata of the business can be extracted. The metadata includes different business indicators and business dimensions, as well as the calculation methods, data sources and relationships corresponding to the business indicators and business dimensions. The business indicators and business dimensions, the calculation methods, data sources and relationships corresponding to the business indicators and business dimensions are vectorized and encoded to obtain the feature vector of the business. Based on the feature vector of the business, a business semantic cache is constructed, wherein the business semantic cache is used to map the upper-layer business query and the lower-layer data storage.
[0023] Alternatively, business metadata can be extracted automatically from enterprise data governance tools, data dictionaries, or historical query logs.
[0024] For example, by extracting the business's metadata, we can obtain business metrics such as sales revenue, user retention rate, and user repurchase rate, as well as business dimensions such as time, region, and product line, and the calculation methods, data sources, and relationships corresponding to the business metrics and business dimensions.
[0025] Optionally, by using embedding technology, business metrics and business dimensions, the calculation methods, data sources and relationships corresponding to business metrics and business dimensions can be vectorized and encoded to obtain business feature vectors, and these feature vectors can be stored to construct a business semantic cache.
[0026] It should be noted that the business semantic cache can be understood as a searchable "business semantic knowledge base". As the sole source of facts in the information query chain, it can effectively decouple the frequently changing underlying database schema from the relatively stable upper-level business concepts.
[0027] In this embodiment of the disclosure, the business query information can be vectorized to obtain a business query vector. Based on the business query vector, a vector retrieval can be performed in the business semantic cache to obtain the matching target business information.
[0028] S103, obtain the structured parameters required for the query based on the business query information.
[0029] It should be noted that the structured parameters include, but are not limited to, time parameters, filtering conditions, and polymerization particle size.
[0030] Optionally, a predefined parameter extractor can be invoked to extract parameters from the business query information in order to obtain the structured parameters required for the query.
[0031] It should be noted that the parameter extractor can be a predefined rule-based regular expression engine, a pre-tuned lightweight language model, or a general language model.
[0032] For example, for the business query information: "Query the sales revenue of electronic products in January 2024, summarized by province", the parameter extractor is invoked, and the time and entity are extracted from the business query information based on the parameter extractor to obtain the time parameter (start_date='2024-01-01', end_date='2024-01-31'), filter condition (product_line='electronic products'), and aggregation granularity (group_by='province'), so as to obtain the structured parameters required for the query.
[0033] S104: Generate an executable query statement based on the target business information and structured parameters.
[0034] Among them, executable query statements can be understood as standardized query commands that can be directly run and query data.
[0035] Among them, the executable query statements can be SQL statements or multidimensional expressions (MDX).
[0036] In this embodiment of the disclosure, after obtaining the target business information and structured parameters, a call instruction corresponding to the standardized query interface can be generated based on the target business information and structured parameters. The call instruction is then structured and mapped using a semantic query engine to obtain an executable query statement.
[0037] S105, obtain the target query result based on the executable query statement.
[0038] In this embodiment of the disclosure, after obtaining an executable query statement, the target query result is obtained by executing the query statement.
[0039] In this embodiment, by receiving business query information, matching target business information is obtained from a pre-built business semantic cache based on the business query information. The target business information includes matching target business metrics and / or target business dimensions. Structured parameters required for the query are obtained based on the business query information. An executable query statement is generated based on the target business information and the structured parameters. The target query result is obtained based on the executable query statement. Therefore, by obtaining matching target business information from the business semantic cache, this disclosure can standardize the understanding of business semantics, avoid semantic deviations that easily occur during natural language parsing, and generate an executable query statement based on the target business information and structured parameters. This significantly improves the accuracy and interpretability of the generated query statement, thus enhancing the precision and reliability of the query results.
[0040] Figure 2This is a flowchart illustrating an information query method provided in one embodiment of the present disclosure. Based on the above embodiment, it further incorporates... Figure 2 The process of information retrieval is explained, including the following steps: S201, Receive service query information.
[0041] S202, obtain auxiliary information corresponding to the business query information, wherein the auxiliary information includes at least one of the session context of the session to which the business query information belongs, the user role, and common query modes.
[0042] It should be noted that, in order to improve the accuracy of the information query process, auxiliary information corresponding to the business query information is obtained simultaneously after receiving the business query information.
[0043] S203: Based on the business query information and auxiliary information, retrieve the target business information from the business semantic cache.
[0044] In this embodiment of the disclosure, business query information and auxiliary information are vectorized and encoded to obtain a query vector. Based on the query vector, vector retrieval is performed in the business semantic cache to obtain the target feature vector with the highest similarity to the query vector. The business semantic cache includes multiple feature vectors of the business. Each feature vector is related to different business indicators and business dimensions, as well as the calculation methods, data sources and associations corresponding to the business indicators and business dimensions. The business indicators and / or business dimensions associated with the target feature vector are determined as the target business information.
[0045] Optionally, embedding technology can be used to vectorize business query information and auxiliary information to obtain query vectors, thereby achieving context-enhanced semantic understanding rather than simple keyword matching.
[0046] Optionally, after obtaining the query vector, based on the vector matching model, the similarity calculation results between the query vector and each feature vector of the business included in the business semantic cache are determined. The similarity calculation results are sorted to obtain the similarity ranking results. Based on the similarity ranking results, the target feature vector with the highest similarity to the query vector is obtained. The business indicators and / or business dimensions associated with the target feature vector are used as the target business information.
[0047] Optionally, a domain-specific word vector model can be trained for proper nouns in the business domain, and vector retrieval can be performed in the business semantic cache based on the word vector model to determine the target business information based on the vector retrieval results.
[0048] Optionally, a hybrid retrieval strategy can be adopted, which combines vector matching model with keyword matching of inverted index. Vector retrieval can be performed in the business semantic cache according to the hybrid retrieval strategy to determine the target business information based on the vector retrieval results.
[0049] It should be noted that by constructing a business semantic cache, natural language queries can be mapped to a standardized business information layer first, and then the business information layer can complete a secondary mapping to the underlying data storage, which fundamentally solves the semantic deviation problem caused by traditional NL2SQL directly manipulating the physical layer.
[0050] S204 calls a predefined rule-based regular expression engine and uses the engine to perform regular expression matching on the business query information to obtain the structured parameters required for the query.
[0051] Optionally, regular expression rules can be pre-configured, and a predefined rule-based regular expression engine can be called to perform regular expression matching on the business query information, obtain the regular expression matching results, and map the regular expression matching results into the structured parameters required for the query.
[0052] S205 calls the pre-tuned lightweight language model and extracts time and entities from the business query information based on the lightweight language model to obtain structured parameters.
[0053] Optionally, business-labeled data can be obtained, and the general LLM can be fine-tuned based on the business-labeled data to obtain a lightweight language model. The lightweight language model can then be invoked to extract time and entities from the business query information and obtain structured parameters.
[0054] S206 calls the general language model and extracts prompt words based on the constructed parameters, driving the general language model to extract time and entities from the business query information to obtain structured parameters.
[0055] Optionally, a parameter extraction prompt can be pre-built, and a general language model can be called. The parameter extraction prompt and business query information are input into the general language model, which drives the general language model to extract time and entities from the business query information to obtain structured parameters.
[0056] S207 generates call instructions corresponding to the standardized query interface based on the target business information and structured parameters.
[0057] In this embodiment of the disclosure, after obtaining the target business information and structured parameters, the target business information and structured parameters are assembled to generate a call instruction corresponding to the standardized query interface.
[0058] Optionally, the target business information and structured parameters are assembled to generate calling instructions corresponding to a standardized data query application programming interface (API).
[0059] For example, if the business query is "Query the sales revenue of product line A in January 2024, by time and region", then the call command is: {"metric": "revenue", "dimensions": ["time", "region"], "filters": {"time": "2024-01", "product_line": "A"}, "aggregation": "sum"}.
[0060] S208 uses a semantic query engine to perform a structured mapping of the call instructions to obtain an executable query statement.
[0061] It should be noted that the process of obtaining an executable query statement can be decoupled into two stages: "index matching" and "parameter extraction". The first stage uses vector retrieval technology to obtain target business information from the business semantic cache based on business query information and auxiliary information. The second stage obtains structured parameters through a restricted and structured parameter extraction method to fill in the query details. Compared with the end-to-end generation of executable query statements, the above "retrieval + filling" mode has higher determinism and interpretability.
[0062] In this embodiment of the disclosure, the calculation caliber and target data source corresponding to the target business indicators and / or target business dimensions are obtained. Based on the calculation caliber, a query statement is generated for the structured parameters and target data source to obtain an executable query statement.
[0063] Optionally, based on the target business metrics and / or target business dimensions, a search can be performed in the business semantic cache to obtain the calculation methods and data sources corresponding to the target business metrics and / or target business dimensions. Using the calculation methods as the core logic, structured parameters are concatenated and transformed with the target data source to generate an executable query statement.
[0064] The data sources can include data warehouses, online analytical processing (OLAP) engines, external APIs, etc.
[0065] In this embodiment of the disclosure, a human-computer interaction interface is generated based on target business information and structured parameters, user interaction data is received, and the target business information and structured parameters are updated based on the user interaction data. Based on the updated target business information and structured parameters, an executable query statement is generated.
[0066] It should be noted that, based on the target business information and structured parameters, a visual human-computer interaction interface is generated. The human-computer interaction interface clearly displays the original business query information and the structured parameters required for the query to the user, allowing the user to confirm, modify, or select from the given alternative parsing schemes. By receiving user interaction data such as confirmation, modification, and reselection, the target business information and structured parameters can be updated based on the user interaction data, and an executable query statement can be regenerated based on the updated target business information and structured parameters.
[0067] In this embodiment of the disclosure, user interaction data is determined, the correspondence between business query information and target business information is determined, and the metadata of part of the business is optimized based on at least one of the user interaction data and the correspondence to update the business semantic cache, and / or the extraction model of structured parameters is optimized based on at least one of the user interaction data and the correspondence.
[0068] It should be noted that user interaction data can be collected, and the correspondence between business query information and target business information can be determined based on system logs. Based on at least one of the user interaction data, the correspondence between business query information and target business information, some metadata in the business system can be iteratively optimized to update the business semantic cache.
[0069] For example, if user interaction data determines that "GMV" commonly refers to "sales revenue", then "GMV" can be added as an alias for the business indicator corresponding to sales revenue to update the business semantic cache.
[0070] It should be noted that by using at least one of the user interaction data and the corresponding relationship as training labeled data, the structured parameter extraction model can be iteratively optimized. This can reduce the dependence on the initial massive labeled data, and can continuously learn and evolve in practical applications, constantly improving the accuracy of matching and extraction, forming a closed-loop mechanism driven by users and capable of self-iterative evolution.
[0071] S209, Obtain the target query result based on the executable query statement.
[0072] In this embodiment of the disclosure, in order to improve the accuracy of the target query results, after obtaining the target query results, the confidence level of the target query results is evaluated to obtain the confidence level of the target query results. When the confidence level of the target query results is less than a set threshold, a multi-round dialogue clarification process is triggered to confirm the target query results.
[0073] For example, when the confidence level of the target query result is less than a set threshold, a multi-round dialogue clarification process is triggered. For instance, the user can be proactively asked, "Which specific product line are you referring to as 'product'?" The target query result is then confirmed based on the user's response.
[0074] In this embodiment of the disclosure, after confirming the target query result, the target query result is returned to the user.
[0075] In this embodiment, business query information is received, and auxiliary information corresponding to the business query information is obtained. The auxiliary information includes at least one of the session context of the session to which the business query information belongs, user role, and common query patterns. Based on the business query information and the auxiliary information, target business information is obtained from the business semantic cache. A predefined rule-based regular expression engine is invoked, and the business query information is matched with regular expressions by the regular expression engine to obtain the structured parameters required for the query. A pre-tuned lightweight language model is invoked, and time and entity extraction is performed on the business query information based on the lightweight language model to obtain structured parameters. Based on the target business information and the structured parameters, a call instruction corresponding to a standardized query interface is generated. The call instruction is structured and mapped by the semantic query engine to obtain an executable query statement. The target query result is obtained based on the executable query statement. Therefore, this disclosure obtains target business information from the business semantic cache based on business query information and auxiliary information, improving the accuracy of business semantic understanding and ensuring the accuracy of target business information. It also obtains structured parameters through multiple methods, ensuring flexibility and accuracy in the structured parameter acquisition process. Based on the target business information and structured parameters, it generates call instructions corresponding to standardized query interfaces. The semantic query engine performs structured mapping on the call instructions to obtain executable query statements, improving the accuracy of query statement generation and business interpretability, ensuring the reliability of target query results, meeting the needs of dynamic and ever-changing business scenarios, and enhancing the user's query interaction experience.
[0076] It should be noted that the existing NL2SQL technology has the following inherent defects, which limit its application in serious commercial scenarios with high accuracy requirements: (1) Model illusion and uncontrollable query. That is, the NL2SQL model interacts directly with the underlying variable database table structure, complex table relationships and business logic. Due to the difference between the training data and the actual business database schema, the context length limit and the model's own "illusion" tendency, the SQL statements generated by the model often have syntax errors, logical errors (such as incorrect table joins, misuse of aggregate functions), or query the wrong business entities, resulting in the returned results deviating from the user's true intention and making it difficult to guarantee accuracy; (2) Business semantic gap and poor interpretability. That is, although the generated SQL is syntactically correct, it may not conform to the definition of business. For example, if a user queries "sales this month", the model may incorrectly associate the order table that does not contain return data, resulting in an incorrect calculation. This error stems from the model's lack of understanding of the clear definition of the business indicator "sales", which is essentially a "semantic gap" between natural language semantics and the underlying data physical structure; (3) Lack of trust and high maintenance costs. Due to the aforementioned uncontrollable errors, business users lack trust in the system's output and heavily rely on technical personnel to review SQL, making true "self-service analysis" impossible. Furthermore, whenever the business data model (such as table structure and fields) changes, it requires retraining or fine-tuning the model and preparing a large amount of high-quality labeled data, resulting in high system maintenance costs and difficulty in adapting to rapidly changing business needs.
[0077] The following explains the specific process of the information retrieval method provided in this publication.
[0078] For example, such as Figure 3 As shown, the information query method provided in this disclosure can be applied to query scenarios (such as data retrieval, data query, trend comparison) and diagnostic analysis scenarios (such as opportunity insight, attribution drill-down, dynamic reporting), with AI+Semantic (AI + semantic layer) in the middle as a unified support to adapt to the needs of the above scenarios.
[0079] Among them, NL2Model converts natural language queries into queries on standardized business metrics (Model), that is, it retrieves matching target business information from a pre-built business semantic cache based on business query information; BusinessModel, as a business semantic cache, carries standardized business metrics, business dimensions, calculation methods, etc.; Model2SQL converts business query information into executable SQL query statements.
[0080] Regarding the process from user query to generating an executable query statement: For external domains: SQL / API serves as the underlying data source entry point, undergoing standardized and understandable processing (productization / manual operation) to unify into standardized business definitions. AI + efficiency improvement: continuously accumulating business knowledge and skills, and iteratively optimizing the metadata model; For internal domains: The metadata model defines the metadata of all business metrics, business dimensions, and calculation methods. The metadata of the metadata model is embedded and vectorized into vector data, stored in a vector database to build a semantic cache. By obtaining auxiliary information (historical sessions, event tracking data) corresponding to the business query information, the understanding of user queries is enhanced. Based on the vector database, the target business information is obtained through similarity matching or exact matching. The structured parameters required for the query are obtained based on the user query. According to the target business information and structured parameters, the call instructions corresponding to the standardized query interface are generated. The semantic query engine (Model2SQL / API) performs structured mapping on the call instructions to obtain an executable query statement, and the target query result is obtained based on the executable query statement.
[0081] In summary, by constructing a business semantic cache, users' natural language queries are first mapped to the business concept layer, rather than directly interacting with the underlying physical data. This improves the interpretability and business consistency of query statements, solves the problems of model illusion and uncontrollable queries, ensures the accuracy and reliability of query results, and builds a closed-loop optimization mechanism based on user interaction data, significantly reducing system maintenance costs and enhancing users' trust in query results.
[0082] To implement the information query method of the first aspect embodiment described above, this disclosure proposes an information query device. Figure 4 This is a schematic diagram of the structure of an information query device according to an embodiment of this disclosure. Figure 4 As shown, the information query device 400 includes: Receiver module 410 is used to receive business query information; The first acquisition module 420 is used to acquire matching target business information from a pre-built business semantic cache based on the business query information, wherein the target business information includes matching target business metrics and / or target business dimensions. The second acquisition module 430 is used to acquire the structured parameters required for the query based on the business query information; The generation module 440 is used to generate an executable query statement based on the target business information and the structured parameters; The query module 450 is used to obtain the target query result based on the executable query statement.
[0083] In one embodiment of this disclosure, the generation module 440 is further configured to: generate a call instruction corresponding to a standardized query interface based on the target business information and the structured parameters; and perform a structured mapping of the call instruction through a semantic query engine to obtain the executable query statement.
[0084] In one embodiment of this disclosure, the generation module 440 is further configured to: obtain the calculation caliber and target data source corresponding to the target business indicator and / or target business dimension; and generate a query statement based on the calculation caliber and the target data source to obtain the executable query statement.
[0085] In one embodiment of this disclosure, the second acquisition module 430 is further configured to: invoke a predefined rule-based regular expression engine, and perform regular expression matching on the business query information through the regular expression engine to obtain the structured parameters required for the query; invoke a pre-tuned lightweight language model, and extract time and entities from the business query information based on the lightweight language model to obtain the structured parameters; invoke a general language model, and extract prompt words based on the constructed parameters, driving the general language model to extract time and entities from the business query information to obtain the structured parameters.
[0086] In one embodiment of this disclosure, the first acquisition module 420 is further configured to: acquire auxiliary information corresponding to the business query information, wherein the auxiliary information includes at least one of the session context of the session to which the business query information belongs, user role, and common query mode; and acquire the target business information from the business semantic cache based on the business query information and the auxiliary information.
[0087] In one embodiment of this disclosure, the first acquisition module 420 is further configured to: perform vectorized encoding on the business query information and the auxiliary information to obtain a query vector; perform vector retrieval in the business semantic cache based on the query vector to obtain a target feature vector with the highest similarity to the query vector, wherein the business semantic cache includes multiple feature vectors of the business, each feature vector being related to different business indicators and business dimensions, as well as the calculation methods, data sources, and associations corresponding to the business indicators and business dimensions; and determine the business indicators and / or business dimensions associated with the target feature vector as the target business information.
[0088] In one embodiment of this disclosure, the process of constructing the business semantic cache includes: extracting metadata of the business, the metadata including different business metrics and business dimensions of the business, as well as the calculation methods, data sources and relationships corresponding to the business metrics and business dimensions; performing vectorized encoding on the business metrics and business dimensions, the calculation methods, data sources and relationships corresponding to the business metrics and business dimensions to obtain the feature vector of the business; and constructing the business semantic cache based on the feature vector of the business, wherein the business semantic cache is used to map between upper-layer business queries and lower-layer data storage.
[0089] In one embodiment of this disclosure, the generation module 440 is further configured to: generate a human-computer interaction interface based on the target business information and the structured parameters; receive user interaction data and update the target business information and the structured parameters based on the user interaction data; and generate the executable query statement based on the updated target business information and structured parameters.
[0090] In one embodiment of this disclosure, the apparatus 400 is further configured to: determine user interaction data; determine the correspondence between the business query information and the target business information; optimize a portion of the metadata of the business based on at least one of the user interaction data and the correspondence to update the business semantic cache; and / or optimize the extraction model of the structured parameters based on at least one of the user interaction data and the correspondence.
[0091] In one embodiment of this disclosure, after obtaining the target query result, the device 400 is further configured to: trigger a multi-round dialogue clarification process to confirm the target query result when the confidence level of the target query result is less than a set threshold.
[0092] It should be noted that the above explanation of the information query method embodiment in the first aspect also applies to the information query device in the embodiments of this disclosure, and the specific process will not be repeated here.
[0093] In this embodiment, by receiving business query information, matching target business information is obtained from a pre-built business semantic cache based on the business query information. The target business information includes matching target business metrics and / or target business dimensions. Structured parameters required for the query are obtained based on the business query information. An executable query statement is generated based on the target business information and the structured parameters. The target query result is obtained based on the executable query statement. Therefore, by obtaining matching target business information from the business semantic cache, this disclosure can standardize the understanding of business semantics, avoid semantic deviations that easily occur during natural language parsing, and generate an executable query statement based on the target business information and structured parameters. This significantly improves the accuracy and interpretability of the generated query statement, thus enhancing the precision and reliability of the query results.
[0094] like Figure 5 The diagram shown is a block diagram of an electronic device for an information query method according to an embodiment of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as intelligent voice interaction devices, personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0095] like Figure 5 As shown, the electronic device includes one or more processors 501, a memory 502, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components are interconnected via different buses and can be mounted on a common motherboard or otherwise as required. The processor 501 can process instructions executed within the electronic device, including instructions stored in or on memory to display graphical information of a GUI on an external input / output device (such as a display device coupled to the interface). In other embodiments, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple electronic devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 5 Take a processor 501 as an example.
[0096] The memory 502 is the non-transitory computer-readable storage medium provided in this disclosure. The memory stores instructions executable by at least one processor to cause the at least one processor to perform the information query method provided in the first aspect embodiment of this disclosure. The non-transitory computer-readable storage medium of this disclosure stores computer instructions for causing a computer to perform the information query method provided in the first aspect embodiment of this disclosure.
[0097] The memory 502, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instructions / modules corresponding to the information query method provided in the first aspect of this disclosure. The processor 501 executes various functional applications and data processing of the server by running the non-transitory software programs, instructions, and modules stored in the memory 502, thereby implementing the information query method in the above method embodiments.
[0098] Memory 502 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created by the use of the electronic device according to the information retrieval method. Furthermore, memory 502 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory 502 may optionally include memory remotely located relative to processor 501, and these remote memories can be connected to the electronic device of the information retrieval method via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0099] The electronic device for the information retrieval method may further include an input device 503 and an output device 504. The processor 501, memory 502, input device 503, and output device 504 can be connected via a bus or other means. Figure 5 Taking the example of a connection between China and Israel via a bus.
[0100] Input device 503 can receive input numerical or character information, as well as key signal input related to user settings and function control of electronic devices for information query methods, such as touch screens, keypads, mice, trackpads, touchpads, joysticks, one or more mouse buttons, trackballs, joysticks, etc. Output device 504 may include display devices, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibration motors). The display device may include, but is not limited to, liquid crystal displays (LCDs), light-emitting diode (LED) displays, and plasma displays. In some embodiments, the display device may be a touch screen.
[0101] To implement the above embodiments, this disclosure also proposes a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the information query method proposed in the first aspect of the present disclosure.
[0102] To implement the above embodiments, this disclosure proposes a computer program product, including a computer program that, when executed by a processor, implements the information query method provided in the first aspect of the present disclosure.
[0103] Various implementations of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, application-specific integrated circuits (ASICs), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include: implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0104] These computational programs (also referred to as programs, software, software applications, or code) include machine instructions for a programmable processor and can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms “machine-readable medium” and “computer-readable medium” refer to any computer program product, device, and / or apparatus (e.g., disk, optical disk, memory, programmable logic device (PLD)) used to provide machine instructions and / or data to a programmable processor, including machine-readable media that receive machine instructions as machine-readable signals. The term “machine-readable signal” refers to any signal used to provide machine instructions and / or data to a programmable processor.
[0105] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0106] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0107] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system. It addresses the shortcomings of traditional physical hosts and VPS (Virtual Private Server, or simply "VPS") services, such as high management difficulty and weak business scalability.
[0108] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0109] In the description of this specification, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this disclosure, "a plurality of" means at least two, such as two, three, etc., unless otherwise expressly and specifically defined.
[0110] Although embodiments of the present disclosure have been shown and described above, it is to be understood that the above embodiments are exemplary and should not be construed as limiting the present disclosure. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present disclosure.
Claims
1. An information retrieval method, characterized in that, The method includes: Receive business query information; Based on the business query information, the matching target business information is obtained from the pre-built business semantic cache, wherein the target business information includes the matching target business metrics and / or target business dimensions; Obtain the structured parameters required for the query based on the business query information; Based on the target business information and the structured parameters, generate an executable query statement; The target query result is obtained based on the executable query statement.
2. The method according to claim 1, characterized in that, The step of generating an executable query statement based on the target business information and the structured parameters includes: Based on the target business information and the structured parameters, generate a call instruction corresponding to the standardized query interface; The executable query statement is obtained by performing a structured mapping of the calling instructions through a semantic query engine.
3. The method according to claim 2, characterized in that, The step of performing a structured mapping of the invocation instruction through a semantic query engine to obtain the executable query statement includes: Obtain the calculation methods and target data sources corresponding to the target business metrics and / or target business dimensions; Based on the aforementioned calculation method, a query statement is generated using the structured parameters and the target data source to obtain the executable query statement.
4. The method according to claim 1, characterized in that, The process of obtaining the structured parameters required for the query based on the business query information includes at least one of the following operations: A predefined rule-based regular expression engine is invoked, and the business query information is matched with regular expressions by the regular expression engine to obtain the structured parameters required for the query. The pre-tuned lightweight language model is invoked, and time and entity extraction is performed on the business query information based on the lightweight language model to obtain the structured parameters; The general language model is invoked, and prompt words are extracted based on the constructed parameters. The general language model is then used to extract time and entities from the business query information to obtain the structured parameters.
5. The method according to claim 1, characterized in that, The step of obtaining matching target business information from a pre-built business semantic cache based on the business query information includes: Obtain auxiliary information corresponding to the business query information, wherein the auxiliary information includes at least one of the session context, user role, and common query patterns of the session to which the business query information belongs; Based on the business query information and the auxiliary information, the target business information is obtained from the business semantic cache.
6. The method according to claim 5, characterized in that, The step of obtaining the target business information from the business semantic cache based on the business query information and the auxiliary information includes: The business query information and the auxiliary information are vectorized and encoded to obtain a query vector; Based on the query vector, vector retrieval is performed in the business semantic cache to obtain the target feature vector with the highest similarity to the query vector. The business semantic cache includes multiple feature vectors of the business, and each feature vector is related to different business indicators and business dimensions, as well as the calculation methods, data sources and correlations corresponding to the business indicators and business dimensions. The business metrics and / or business dimensions associated with the target feature vector are determined as the target business information.
7. The method according to claim 6, characterized in that, The process of constructing the business semantic cache includes: Extract the metadata of the business, which includes different business indicators and business dimensions of the business, as well as the calculation methods, data sources and relationships of the business indicators and business dimensions; The business metrics and business dimensions, the calculation methods, data sources, and relationships corresponding to the business metrics and business dimensions are vectorized and encoded to obtain the feature vector of the business. Based on the feature vector of the business, a business semantic cache is constructed, wherein the business semantic cache is used to map the upper-layer business query and the lower-layer data storage.
8. The method according to any one of claims 1-7, characterized in that, The step of generating an executable query statement based on the target business information and the structured parameters further includes: Generate a human-computer interaction interface based on the target business information and the structured parameters; Receive user interaction data, and update the target business information and the structured parameters based on the user interaction data; Based on the updated target business information and structured parameters, the executable query statement is generated.
9. The method according to claim 8, characterized in that, The method further includes: Determine user interaction data; Determine the correspondence between the business query information and the target business information; Based on at least one of the user interaction data and the corresponding relationship, optimize part of the metadata of the service to update the service semantic cache; and / or, The extraction model for the structured parameters is optimized based on at least one of the user interaction data and the corresponding relationship.
10. The method according to claim 1, characterized in that, After obtaining the target query result, the process also includes: When the confidence level of the target query result is less than a set threshold, a multi-round dialogue clarification process is triggered to confirm the target query result.
11. An information query device, characterized in that, The device includes: The receiving module is used to receive business query information; The first acquisition module is used to acquire matching target business information from a pre-built business semantic cache based on the business query information, wherein the target business information includes matching target business metrics and / or target business dimensions. The second acquisition module is used to acquire the structured parameters required for the query based on the business query information; The generation module is used to generate an executable query statement based on the target business information and the structured parameters; The query module is used to obtain the target query result based on the executable query statement.
12. An electronic device, characterized in that, Including memory and processor; The memory and the processor communicate with each other through an internal connection path. The memory is used to store instructions, and the processor is used to execute the instructions stored in the memory. When the processor executes the instructions stored in the memory, it causes the processor to perform the method of any one of claims 1-10.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-10.
14. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-10.