Data query method, electronic device, storage medium and program product

By performing task disassembly and slot value analysis on complex query requests, the problem that computers find it difficult to accurately generate SQL statements is solved, and the accuracy of data query is improved.

CN120011389APending Publication Date: 2025-05-16KE COM (BEIJING) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411958064.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

When query requests are more complicated, it is difficult for the computer to accurately generate SQL statements, which affects the accuracy of data query.

Method used

By performing task disassembly on the target query request, the task disassembly steps are generated, including taking number subtasks, obtaining slot values, and determining the level of slot values ​​in the database organizational structure, so as to accurately analyze and obtain target data.

Benefits of technology

Improves the accuracy of data queries, especially when handling complex query requests, it is more accurate than the method of converting directly into SQL statements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120011389A_ABST
    Figure CN120011389A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a data query method, electronic equipment, a storage medium and a program product, and the method comprises the steps: carrying out task disassembly on a target query request to obtain a task disassembly step, and obtaining a plurality of access sub-tasks according to a plurality of slot positions corresponding to the access sub-tasks in the task disassembly step; and obtaining a slot position value corresponding to each slot position from the first sub-query statement corresponding to the access sub-task, and determining the level of each slot position value in the database organization structure. And further, obtaining target data from the database according to the level of each slot position value in the database organization structure. When the target query request is relatively complex, compared with a method of directly converting the target query request into the SQL statement, the method provided by the embodiment of the invention can be used for accurately analyzing the target query request, so that the accuracy of data query is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a data query method, electronic device, storage medium and program product. Background Art

[0002] With the continuous development of computer technology, a large amount of data can be stored in the database. When the user needs to query the target data, he only needs to enter the query request in the form of natural language on the computer, and the computer can convert the query request into a structured query language (SQL) statement and obtain the target data from the database according to the SQL statement.

[0003] However, when the query request is more complex, the computer will not be able to accurately generate SQL statements, thus affecting the accuracy of data query. Summary of the invention

[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the embodiments of the present disclosure provide a data query method, an electronic device, a storage medium and a program product, which help to accurately analyze the target query request, thereby improving the accuracy of data query.

[0005] The present disclosure provides a data query method, which includes:

[0006] Get the target query request;

[0007] According to the target query request and the knowledge data corresponding to the target query request, a task decomposition step corresponding to the target query request is generated, wherein the task decomposition step includes a data acquisition subtask;

[0008] According to the multiple slots corresponding to the data acquisition subtask, a slot value corresponding to each slot is obtained from the first sub-query statement corresponding to the data acquisition subtask;

[0009] Determine the level of each slot value in the database organization structure;

[0010] According to the level of each slot value in the database organizational structure, target data is obtained from the database.

[0011] The present disclosure also provides a data query device, which includes:

[0012] A first acquisition module, used to acquire a target query request;

[0013] A generation module, used for generating a task decomposition step corresponding to the target query request according to the target query request and the knowledge data corresponding to the target query request, wherein the task decomposition step includes a data acquisition subtask;

[0014] A second acquisition module is used to acquire a slot value corresponding to each slot from a first sub-query statement corresponding to the data acquisition subtask according to the multiple slots corresponding to the data acquisition subtask;

[0015] A determination module, used to determine the level of each slot value in the database organization structure;

[0016] The third acquisition module is used to acquire target data from the database according to the level of each slot value in the database organizational structure.

[0017] The present disclosure also provides an electronic device, the electronic device comprising:

[0018] one or more processors;

[0019] A storage device for storing one or more programs;

[0020] When the one or more programs are executed by the one or more processors, the one or more processors implement the data query method as described above.

[0021] The embodiment of the present disclosure further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the data query method described above is implemented.

[0022] The embodiment of the present disclosure further provides a computer program product, including computer program instructions, which implement the data query method as described above when executed by a processor.

[0023] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has at least the following advantages:

[0024] The data query method provided by the embodiment of the present disclosure obtains a task decomposition step by decomposing the target query request, and obtains the slot value corresponding to each slot from the first sub-query statement corresponding to the number-taking sub-task according to the multiple slots corresponding to the number-taking sub-task in the task decomposition step, and determines the level of each slot value in the database organizational structure. Further, the target data is obtained from the database according to the level of each slot value in the database organizational structure. When the target query request is more complex, compared with directly converting the target query request into an SQL statement, the method described in this embodiment can accurately analyze the target query request, thereby improving the accuracy of data query. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.

[0026] Figure 1 is a flow chart of a data query method in an embodiment of the present disclosure;

[0027] Figure 2 A schematic diagram of an application scenario in an embodiment of the present disclosure;

[0028] Figure 3 is a schematic diagram of a slot in an embodiment of the present disclosure;

[0029] Figure 4 is a schematic diagram of a user interface in an embodiment of the present disclosure;

[0030] Figure 5 is a flow chart of another data query method in an embodiment of the present disclosure;

[0031] Figure 6 is a flow chart of another data query method in an embodiment of the present disclosure;

[0032] Figure 7 is a structural schematic diagram of a data query device in an embodiment of the present disclosure;

[0033] Figure 8 It is a structural schematic diagram of an electronic device in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0034] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0035] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0036] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0037] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0038] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0039] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0040] Figure 1 1 is a flowchart of a data query method in an embodiment of the present disclosure. The method can be executed by a data query device. The device can be implemented in software and / or hardware. The device can be configured on a server or server cluster. Specifically, the method can be applied to Figure 2The application scenario shown includes a server 21 and a terminal device 22, wherein the server 21 and the terminal device 22 can interact with each other, and the terminal device 22 specifically includes but is not limited to a smart phone, a PDA, a tablet computer, a wearable device with a display screen, a desktop computer, a laptop computer, an all-in-one machine, a smart home device, etc. For example, the terminal device 22 is installed with an intelligent chat software, and the server 21 is a service platform corresponding to the intelligent chat software. The user inputs a query request in the form of natural language on the user interface provided by the intelligent chat software, and the terminal device 22 sends the query request to the server 21. The server 21 can process the query request using the data query method described in the embodiment of the present disclosure, obtain the query result, and send the query result to the terminal device 22, so that the terminal device 22 displays the query result to the user. Specifically, the query result can be a query result in the form of natural language, such as a query result in the form of text, a query result in the form of a chart, etc. Specifically, the data query method described in the embodiment of the present disclosure is applicable to an intelligent chat system with natural language interaction, and the intelligent chat system can be deployed in the server 21, or in a server cluster composed of multiple servers. The intelligent chat system is, for example, ChatBI, which is a natural language business intelligence analysis system based on a large language model. Users can interact with the system through natural language chat. After the system recognizes the user's intention to retrieve data and perform analysis, it retrieves data from the database and generates an analysis report based on the user's needs. In this scenario, the interaction between the user and the system is mainly achieved through question-and-answer mode. Figure 2 The method described in the embodiment of the present disclosure is introduced. Figure 1 As shown, the method may specifically include the following steps:

[0041] S101: Obtain a target query request.

[0042] For example, the target query request may be a query request in natural language input by a user on a user interface. The terminal device 22 sends the target query request to the server 21 , that is, the server 21 obtains the target query request from the terminal device 22 .

[0043] S102. Generate a task decomposition step corresponding to the target query request according to the target query request and the knowledge data corresponding to the target query request, wherein the task decomposition step includes a data acquisition subtask.

[0044] After the server 21 obtains the target query request from the terminal device 22, the knowledge data matching the target query request is obtained from the preset knowledge base. The preset knowledge base includes an indicator knowledge base and a business knowledge base. The indicator knowledge base includes a large number of indicators, a large number of dimensions and a large number of enumeration values. The knowledge data matching the target query request can be indicators, dimensions, and enumeration values ​​matching the target query request, wherein the indicator is the query object, the dimension is the restriction condition on the indicator, and the enumeration value is the enumeration value of the dimension. For example, the target query request is "What is the second-hand business opportunity volume, second-hand online transaction volume, and customer source transaction volume in City A this month?" The indicators in the target query request include "business opportunity volume", "second-hand online transaction volume", and "transaction volume". The dimensions include "city" and "business type". "City A" is the enumeration value of "city", and "second-hand" is the enumeration value of "business type".

[0045] In the disclosed embodiment, the business knowledge base includes a mapping relationship between user idioms and standard terms in the indicator knowledge base. For example, the type of payment is a user idiom, and the type of business is a standard term in the indicator knowledge base. In addition, the business knowledge base also includes explanations for user idioms, and the explanations can be a combination of standard terms in the indicator knowledge base and common language. For example, "hanging eggs" is a user idiom, and the corresponding explanation for "hanging eggs" is "an economic person with zero performance."

[0046] Specifically, when the server 21 obtains the knowledge data matching the target query request from the preset knowledge base, the text of the preset length can be extracted from the target query request, and further, the knowledge data matching the text can be recalled from the preset knowledge base. Among them, the preset length can be increased from 2 to the total length of the target query request in sequence. For example, the target query request is "the performance income of the operation of the Beilian business unit of C City Tianxin District this year_South, presented by the business district", and the target query request is segmented according to the preset length to obtain the text of the preset length. Specifically, the preset length is a variable and can be increased from 2 to the total length of the target query request in sequence. For example, when the preset length is 2, the target query request is segmented, and the obtained text includes "C City", "City Bei", "Bei Lian", "Lian Shi", etc., and so on. When the preset length is 3, the target query request is segmented, and the obtained text includes "C City Bei", "City Bei Lian", "Bei Lian Shi", "Lian Shi", etc., and so on. When the preset length is the total length of the target query request, the text obtained is "This year's performance income of the operation of the Tianxin District of Beilian Business Unit in City C_South, presented in different business districts". That is to say, multiple texts can be obtained after segmenting the target query request according to the gradually increasing preset length. Further, taking each text as a search term, the knowledge data matching the text is recalled from the preset knowledge base, thereby obtaining the knowledge data such as indicators, dimensions, and enumeration values ​​related to the target query request. For example, taking "City C" as an example, the knowledge data matching "City C" includes the dimension "geographic city", the dimension "performance city", and the enumeration value "City C".

[0047] In addition, when each text is used as a search term and the knowledge data matching the text is recalled from the preset knowledge base, the knowledge data consistent with the text expression can be recalled from the preset knowledge base; and / or the knowledge data whose similarity with the text is greater than or equal to the preset threshold can be recalled from the preset knowledge base. For example, taking the text "Performance Income_South" in the target query request as an example, when searching in the preset knowledge base, the indicator that is consistent with the expression of "Performance Income_South", namely "Performance Income_South", can be recalled, and the indicator whose similarity with the text is greater than or equal to the preset threshold can also be recalled from the preset knowledge base based on the representation vector of "Performance Income_South". Specifically, during the retrieval process, the similarity between each indicator in the preset knowledge base and "Performance Income_South" is calculated based on the representation vector of each indicator in the preset knowledge base and the representation vector of "Performance Income_South", and the indicator is recalled when the similarity is greater than or equal to the preset threshold.

[0048] After the server 21 obtains the knowledge data matching the target query request from the preset knowledge base, the task decomposition steps corresponding to the target query request are generated according to the target query request and the knowledge data matching the target query request. For example, if the target query request is "what is the volume of second-hand business opportunities, second-hand online transaction volume, and customer transaction volume in City A this month", the task decomposition steps corresponding to the target query request are as follows:

[0049] #1=Get data (number of second-hand business opportunities in City A this month)

[0050] #2 = Get data (second-hand online transaction volume in City A this month)

[0051] #3 = Get data (customer transaction volume of City A this month)

[0052] That is, the first step (#1) is to query the second-hand business opportunities in City A this month. The second step (#2) is to query the second-hand online transaction volume in City A this month. The third step (#3) is to query the customer transaction volume in City A this month.

[0053] For another example, the target query request is "year-on-year analysis of total assessment commissions from January to July in City B". The task decomposition steps corresponding to this target query request are as follows:

[0054] #1 = Get data (total assessment commission from January to July in City B)

[0055] #2 = Get data (total assessment commission from January to July last year in City B)

[0056] #3=year-on-year ([#1,#2]; year-on-year)

[0057] That is, the first step (#1) is to query the total assessment commission of City B from January to July this year. The second step (#2) is to query the total assessment commission of City B from January to July last year. The third step (#3) is to calculate the year-on-year growth rate of these two data.

[0058] S103. According to the multiple slots corresponding to the data acquisition subtask, obtain a slot value corresponding to each slot from a first sub-query statement corresponding to the data acquisition subtask.

[0059] As described above, the task decomposition steps corresponding to the target query request may include multiple processing steps, each of which corresponds to a subtask, such as a data acquisition subtask, a year-over-year subtask, etc. The subtasks corresponding to different steps may be the same or different. Different subtasks correspond to different slot sets, and each slot set includes multiple slots. For example Figure 3The figure shows multiple slots corresponding to the data acquisition subtask, where 'indicator', 'time', 'constraint', 'sort', 'number of rows', 'combination', and 'table' are slots, and 'indicator information', 'time information', 'constraint 1', 'constraint 2', 'sort condition, desc or asc', 'number of limits', 'entity category or enumeration value name mentioned in query', and 'user expressed table description or table name' are slot values ​​to be obtained from the target query request. The 'constraint' can be an enumeration value as described above, or it can be a dimension and an enumeration value. For example, if the user asks "What is the GTV of City A", the 'constraint' is an enumeration value, i.e., "City A". If the user asks "What is the GTV of City A", the 'constraint' is a dimension and an enumeration value, such as "City: City A", i.e., the dimension is before the colon and the enumeration value is after the colon.

[0060] For example, taking the target query request as described above as "how many second-hand business opportunities, second-hand online transactions, and customer transaction volumes are there in City A this month", the task decomposition step corresponding to the target query request includes multiple data acquisition subtasks, and the first data acquisition subtask is "acquire data (second-hand business opportunities in City A this month)". Among them, "second-hand business opportunities in City A this month" is the first subquery statement corresponding to the first data acquisition subtask, and the first subquery statement is derived from the target query request, for example, the first subquery statement is a part of the target query request, or the first subquery statement is a combination of multiple parts in the target query request. Taking "second-hand business opportunities in City A this month" as an example, 'business opportunity quantity' is the slot value of 'indicator'. After extracting 'business opportunity quantity' from "second-hand business opportunities in City A this month", fill 'business opportunity quantity' into the position of 'indicator information', that is, replace 'indicator information' with 'business opportunity quantity'. Similarly, extract the slot values ​​corresponding to other slots from "second-hand business opportunities in City A this month". If there is no slot value corresponding to a certain slot in "Second-hand business opportunities in City A this month", the slot value corresponding to the slot is empty. For example, if there is no slot value corresponding to 'Table' in "Second-hand business opportunities in City A this month", the slot value corresponding to 'Table' is empty. Similarly, extract the following from the first sub-query statement corresponding to the second data retrieval subtask, namely "Data retrieval (second-hand online transaction volume in City A this month)", namely "Second-hand online transaction volume in City A this month" Figure 3 The slot values ​​corresponding to the slots shown in FIG. 4 and the first sub-query statement corresponding to the third data retrieval subtask, namely, “retrieve data (customer transaction volume of city A this month)”, namely, “customer transaction volume of city A this month”, are extracted as follows: Figure 3 That is to say, for any data acquisition subtask, a set of data such as Figure 3 The slot value for each slot is shown.

[0061] S104: Determine the level of each slot value in the database organizational structure.

[0062] In this embodiment, the database stores data in the form of tables. For example, the database includes multiple tables, each table includes multiple columns and multiple rows. A row represents a specific instance or data record in the table, such as the information of an employee. Columns represent the attributes of these records, such as the employee's name, age, position, etc. In other words, the database includes tables, the tables include multiple columns, and each column includes multiple values. This structure of tables, columns, and values ​​under columns is recorded as the database organization structure. For any data retrieval subtask, a set of such as Figure 3 After the slot values ​​shown, further, determine the level of each slot value in the database organization structure, for example, determine that each slot value is a table name, a column name, or a value under a column name in the database. For example, the indicators and dimensions described above are column names, and the enumeration values ​​are values ​​under the column names.

[0063] S105 . Acquire target data from the database according to the level of each slot value in the database organizational structure.

[0064] For example, taking the data acquisition subtask "acquire data (second-hand business opportunities in City A this month)" as an example, a set of data such as Figure 3 The slot values ​​of each slot are shown, and after determining that each slot value is the table name, column name, or the value under the column name in the database, the target data is obtained from the database according to each slot value being the table name, column name, or the value under the column name in the database. The target data is the second-hand business opportunities in City A this month.

[0065] The data query method provided by the embodiment of the present disclosure obtains a task decomposition step by decomposing the target query request, and obtains the slot value corresponding to each slot from the first sub-query statement corresponding to the number-taking sub-task according to the multiple slots corresponding to the number-taking sub-task in the task decomposition step, and determines the level of each slot value in the database organizational structure. Further, the target data is obtained from the database according to the level of each slot value in the database organizational structure. When the target query request is more complex, compared with directly converting the target query request into an SQL statement, the method described in this embodiment can accurately analyze the target query request, thereby improving the accuracy of data query.

[0066] In the disclosed embodiment, a question and an answer between a user and an intelligent chat system is recorded as a round of dialogue. Usually, a user and an intelligent chat system can have multiple rounds of dialogue. Figure 4As shown, "What is the GTV of a new house" and "The GTV of a new house is xxx" are a round of historical conversation information between the user and the intelligent chat system. "What about second-hand ones?" is the user's current query request. If the current query request is used as the target query request as described above, the semantics of the target query request may be incomplete, or the user's intention may not be accurately identified. Therefore, in an embodiment of the present disclosure, obtaining the target query request includes: completing the current query request according to the historical conversation information to obtain the target query request.

[0067] Specifically, the historical conversation information may be one or more rounds of historical conversations. The disclosed embodiment may complete the current query request based on one or more rounds of historical conversations to obtain a target query request, which may be the complete question that the user wants to express this time. Figure 4 Taking the situation shown as an example, according to the historical conversation information, the target query request obtained after completing the current query request is "how much is a second-hand GTV".

[0068] Optionally, the current query request is completed according to the historical conversation information to obtain the target query request, including: inputting the current query request, the knowledge data corresponding to the current query request, the historical conversation information, and the knowledge data corresponding to the historical conversation information into a context integration model, the context integration model is used to complete the current query request and output the target query request.

[0069] For example, Figure 4Taking the situation shown as an example, the current query request, the knowledge data corresponding to the current query request, the historical conversation information, and the knowledge data corresponding to the historical conversation information are input into the context integration model. The context integration model can complete the current query request and output the target query request. Among them, the method of obtaining the knowledge data corresponding to the current query request is similar to the method of obtaining the knowledge data matching the target query request from the preset knowledge base as described above, and will not be elaborated here. Similarly, the method of obtaining the knowledge data corresponding to the historical conversation information is similar to the method of obtaining the knowledge data matching the target query request from the preset knowledge base as described above, and will not be elaborated here. The context integration model can be a large model. For example, GPT-4o, where GPT is the abbreviation of Generative Pre-trained Transformer, and o represents Omni, meaning all-powerful. In other embodiments, the knowledge data can also be referred to as business entities. In addition, after completing the current query request to obtain the target query request, the target query request can be further normalized and rewritten to make the target query request clearer. For example, the target query request obtained after completion is "What is the price of a second-hand GTV", and the result after normalization and rewriting is "Query the GTV with the business type of second-hand". Since the content after the word "of" is usually the user's query object, that is, the indicator, it is defaulted that the content after the word "of" is the indicator, and it is not necessary to specify that the "GTV" after the word "of" is the indicator in the result after normalization and rewriting. However, if the content after the word "of" is more, it is also possible to specify which content after the word "of" is the indicator in the result after normalization and rewriting.

[0070] Optionally, generating the task decomposition steps corresponding to the target query request according to the target query request and the knowledge data corresponding to the target query request includes: performing intent recognition on the target query request to obtain an intent recognition result; if the intent recognition result is data processing, generating the task decomposition steps corresponding to the target query request according to the target query request and the knowledge data corresponding to the target query request.

[0071] After obtaining the target query request, the target query request is input into the intent recognition model. The intent recognition model can perform intent recognition on the target query request, that is, recognize the user's work intention this time, and obtain the intent recognition result. There are two situations for the intention recognition result. One situation is that the intention recognition result is data processing, and the other situation is that the intention recognition result is that the system does not support the function or exception processing. If the intention recognition result output by the intention recognition model is data processing, then according to the target query request and the knowledge data corresponding to the target query request, the task decomposition steps corresponding to the target query request are generated. If the intention recognition result output by the intention recognition model is that the system does not support the function or exception processing, the target query request will not be task decomposed. The intention recognition model can also be a large model.

[0072] Optionally, the task decomposition step is described in an intermediate language between natural language and structured query language. For example, the intermediate language is query processing language (QPL). That is to say, the task decomposition step corresponding to the target query request is a processing step for the target query request described in QPL, which is an intermediate language between natural language and SQL.

[0073] Optionally, based on the target query request and the knowledge data corresponding to the target query request, a task decomposition step corresponding to the target query request is generated, including: inputting the target query request, the knowledge data corresponding to the target query request, and the data processing capability supported by the intermediate language into a task decomposition model, and the task decomposition model is used to output the task decomposition steps corresponding to the target query request.

[0074] Specifically, the data processing capabilities supported by the intermediate language include: data acquisition, processing, year-on-year, month-on-month, analysis, and visualization. For example, the data processing capabilities supported by QPL include: data acquisition, processing, year-on-year, month-on-month, analysis, and visualization. The task decomposition steps described by QPL can be composed of a series of lines, each line representing a processing step. Each step can be operations such as data acquisition (such as data query), processing (such as data processing), year-on-year (such as year-on-year analysis), month-on-month (such as month-on-month analysis) or visualization (such as data display). The grammatical components of QPL are as follows:

[0075] <qpl> ::= <line> +

[0076] <line> ::=# <integer> = <tool>

[0077] <tool>::=<get number>

[0078] |<Processing>

[0079] |<Year-on-year>

[0080] |<Month-on-month>

[0081] |<Analysis>

[0082] |<Visualization>

[0083] <Get number>::=Get number( <query>)

[0084] <Processing>::=Processing([<object list>]; <parameter>)

[0085] <Year-on-year>::=Year-on-year([<object list>]; <parameter>)

[0086] <Year-on-year>::=Year-on-year([<object list>]; <parameter>)

[0087] <Analysis>::=Analysis([<object list>]; <parameter>)

[0088] <Visualization>::=Visualization([<object list>]; <parameter>)

[0089] Specifically, the syntax components of QPL are introduced as follows:

[0090] <qpl>: The beginning of the entire QPL script, consisting of one or more <line>composition.

[0091] <line>: Represents a single processing step, consisting of a unique number and a <tool>composition.

[0092] <tool>:Specific data processing tools can be data acquisition, processing, year-on-year, month-on-month comparison, analysis or visualization.

[0093] <Get data>: Query the data of specific indicators, which can be subject to time and space constraints.

[0094] <Processing>: Process the data, such as calculating average, aggregation, filtering, etc.

[0095] <Year-on-year>: Calculate the year-on-year growth rate of a single indicator at the same time granularity.

[0096] <Month-on-month>: Calculates the month-on-month growth rate of a single indicator at the same time granularity.

[0097] <Analysis>: Conduct in-depth analysis of data, such as trend analysis.

[0098] <Visualization>: Display data in graphical form, such as line chart, bar chart, etc.

[0099] <Object list>: A list of one or more data objects, which can be data acquisition results or other processing results.

[0100] <parameters>: Specific parameters passed to the tool, such as time range, calculation method, etc.

[0101] Specifically, when the embodiment of the present disclosure generates the task decomposition steps corresponding to the target query request according to the target query request and the knowledge data corresponding to the target query request, the target query request, the knowledge data corresponding to the target query request, and the data processing capability supported by the intermediate language can be input into the task decomposition model, and the task decomposition model can output the task decomposition steps corresponding to the target query request. The task decomposition model can specifically be a large model. The data processing capability supported by the intermediate language can be a description of the tool supported by the intermediate language. The following Table 1 shows the correspondence between the tool name and the tool description.

[0102] Table 1

[0103]

[0104]

[0105] Optionally, determining the level of each slot value in the database organizational structure includes: if the slot value is different from the description in the database, correcting the slot value to the description in the database, and determining the level of the corrected slot value in the database organizational structure.

[0106] For example, after task decomposition is performed on the target query request and the task decomposition steps are obtained, the slot value corresponding to each slot is obtained from the first sub-query statement corresponding to the data acquisition sub-task. After obtaining multiple slot values ​​from the first sub-query statement, each slot value can also be aligned with the description in the database. Specifically, if any slot value is consistent with the description in the database, for example, any slot value is "GTV" and the description in the database is also "GTV", that is, the slot value is consistent with the description in the database, then there is no need to correct the slot value, and the slot value is directly determined to be the table name, column name, or value under the column name in the database. If any slot value is inconsistent with the description in the database, for example, any slot value is "performance", but the description in the database is "sales", that is, the slot value is inconsistent with the description in the database, then the slot value needs to be corrected, for example, "performance" is corrected to "sales", and further, it is determined that the corrected slot value, i.e., "sales", is the table name, column name, or value under the column name in the database.

[0107] Optionally, according to the multiple slots corresponding to the number retrieval subtask, the slot value corresponding to each slot is obtained from the first sub-query statement corresponding to the number retrieval subtask, including: inputting the first sub-query statement corresponding to the number retrieval subtask and the knowledge data corresponding to the first sub-query statement into a first slot model, and the first slot model is used to output the slot values ​​of the multiple slots corresponding to the number retrieval subtask.

[0108] For example, when obtaining the slot value corresponding to each slot from the first sub-query statement corresponding to the data acquisition sub-task, the first sub-query statement and the knowledge data corresponding to the first sub-query statement can be specifically input into the first slot model, and the first slot model can output the slot values ​​of multiple slots corresponding to the data acquisition sub-task. Taking the data acquisition sub-task "Get data (the amount of second-hand business opportunities in City A this month)" as described above as an example, "the amount of second-hand business opportunities in City A this month" is the first sub-query statement corresponding to the data acquisition sub-task. Input the knowledge data corresponding to "the amount of second-hand business opportunities in City A this month" and "the amount of second-hand business opportunities in City A this month" into the first slot model, and the first slot model can obtain the slot value of each of the multiple slots from "the amount of second-hand business opportunities in City A this month" according to the multiple slots corresponding to the data acquisition sub-task. If a slot does not have a corresponding slot value, the slot value corresponding to the slot is empty.

[0109] Optionally, determining the level of each slot value in the database organizational structure includes: inputting the slot values ​​of multiple slots corresponding to the data acquisition subtask into an entity disambiguation model, the entity disambiguation model is used to align each slot value with the description in the database, and outputting the level of each slot value in the database organizational structure.

[0110] For example, after the first slot model outputs the slot values ​​of multiple slots corresponding to the data acquisition subtask, the slot values ​​of the multiple slots are input into the entity disambiguation model, and the entity disambiguation model is used to align each slot value with the description in the database. The specific alignment process is as described above and will not be repeated here. In addition, after aligning each slot value with the description in the database, the entity disambiguation model can also output that each slot value is a table name, column name, or value under a column name in the database.

[0111] In addition, in other embodiments, there is a time conversion model between the first slot model and the entity disambiguation model. For example, when the first slot model extracts the slot value corresponding to each slot from the first sub-query statement corresponding to the data acquisition subtask, Figure 3 For the slot 'time' shown, the time information in the first subquery statement is converted into a standard representation through the time conversion model, and the standard representation is used as the slot value of the slot 'time'. The entity disambiguation model is used to align the standard representation with the description in the database. For example, taking "get data (second-hand business opportunities in City A on the 3rd of last month)" as an example, "the 3rd of last month" is the time information. The first slot model inputs "the 3rd of last month" into the time conversion model, and the time conversion model converts "the 3rd of last month" into the standard representation "-1m3D", and feeds "-1m3D" back to the first slot model, and the first slot model uses "-1m3D" as the slot value of the slot 'time'. When the slot values ​​of multiple slots corresponding to the data retrieval subtask are input into the entity disambiguation model, the entity disambiguation model aligns "-1m3D" with the description in the database.

[0112] Optionally, according to the level of each slot value in the database organization structure, the target data is obtained from the database, including: Figure 5 The following steps are shown:

[0113] S501 : Generate a structured query language statement according to the level of each slot value in the database organizational structure.

[0114] For example, after determining that each slot value is a table name, a column name, or a value under a column name in the database, an SQL statement can be generated based on each slot value being a table name, a column name, or a value under a column name in the database.

[0115] S502: Acquire the target data from the database according to the structured query language statement.

[0116] For example, query the database according to the SQL statement to obtain the target data to be obtained by the data acquisition subtask from the database.

[0117] Optionally, the task decomposition step also includes a data processing subtask; after obtaining the target data from the database, the method also includes: inputting a second sub-query statement corresponding to the data processing subtask, the level of each slot value in the database organizational structure, and the target data into a second slot model, and the second slot model is used to output operations for the level.

[0118] For example, after decomposing the target query request and obtaining the task decomposition steps, the task decomposition steps include not only the data acquisition subtask, but also the data processing subtask. For example, if the target query request is "query the sales and average value of area A this month", the task decomposition steps corresponding to the target query request are as follows:

[0119] #1 = Get data (sales volume of area A this month)

[0120] #2=Process([#1]; calculate the average value of #1)

[0121] For example, the data processing subtask is followed by the data fetching subtask, that is, the target data needs to be processed after being fetched from the database. Among them, "[#1]; calculate the average value of #1" is the second subquery statement corresponding to the data processing subtask. Specifically, the second subquery statement, the level of the slot values ​​of multiple slots corresponding to the data fetching subtask in the database organizational structure (that is, each slot value is the table name, column name, or the value under the column name in the database), and the target data are input into the second slot model, and the second slot model can output what operations are performed on the table name, column name, or the value under the column name.

[0122] Optionally, the task decomposition step also includes a data visualization subtask; after obtaining the target data from the database, the method also includes: inputting a third sub-query statement corresponding to the data visualization subtask and the target data into a third slot model, and the third slot model is used to output a visualization chart type.

[0123] For example, after decomposing the target query request and obtaining the task decomposition steps, the task decomposition steps include not only the data acquisition subtask, but also the data visualization subtask. For example, if the target query request is "query the sales and average value of area A this month, and display it in a histogram", the task decomposition steps corresponding to the target query request are as follows:

[0124] #1 = Get data (sales volume of area A this month)

[0125] #2=Process([#1]; calculate the average value of #1)

[0126] #3 = Visualization ([#2]; Histogram)

[0127] For example, the data acquisition subtask is followed by the data processing subtask, and the data processing subtask is followed by the data visualization subtask. In some other embodiments, the data acquisition subtask may be directly followed by the data visualization subtask. Taking the data visualization subtask described above as an example, "[#2]; histogram" is the third sub-query statement corresponding to the data visualization subtask. Specifically, the third sub-query statement and the target data are input into the third slot model, and the third slot model can identify which type of chart the user wants to display the target data in. Therefore, the third slot model can output a visualized chart type, such as a histogram. Specifically, the third slot model can identify multiple types of charts, such as bar charts, bar charts, line charts, pie charts, tables, scatter plots, bubble charts, and the like.

[0128] Figure 6 A flowchart of a data query method provided for another embodiment of the present disclosure. The method is applicable to scenarios with multiple rounds of dialogue. Specifically, a question and an answer between a user and a system is recorded as a round of dialogue. Multiple rounds of dialogue between a user and a system may correspond to the same session identifier. Therefore, when obtaining historical dialogues, historical dialogues within the same session identifier may be obtained. Further, the historical dialogues, user identifiers, and user's current questions are input into a context integration model, and the context integration model may complete the user's current question based on the historical dialogues to obtain a completed target query request. The target query request may be used as an input to an intent recognition model, and the intent recognition model may perform intent recognition on the target query request, that is, recognize the user's work intention this time, and obtain an intent recognition result. There are two situations for the intent recognition result, one situation is that the intent recognition result is data processing, and the other situation is that the intent recognition result is that the system does not support the function or exception handling.

[0129] If the intent recognition result output by the intent recognition model is that the system does not support the function or exception handling, it is determined whether the execution is terminated, for example, Figure 6 If the error message is not shown, then the intent recognition result, the target query request, the exception type, and the error message can be input into the comprehensive response model. The comprehensive response model can generate a comprehensive response content and display the comprehensive response content to the user. The comprehensive response content can be a content that prompts the user to ask again, or a content that prompts the user that an exception has occurred, etc. The error message is a description of the exception type. In addition, if the execution is not completed, the system can also restart the execution from the intent recognition performed by the intent recognition model. During the restart process, each model or each module can make adjustments to avoid the exception from occurring again.

[0130] If the intent recognition result output by the intent recognition model is data processing, the subsequent task decomposition is continued, that is, the target query request, the knowledge data corresponding to the target query request, and the data processing capability supported by the intermediate language are input into the task decomposition model, and the task decomposition model can output the task decomposition steps corresponding to the target query request. For example, the task decomposition steps include data acquisition subtask, data processing subtask, and data visualization subtask.

[0131] For the data acquisition subtask, the first subquery statement corresponding to the data acquisition subtask and the knowledge data corresponding to the first subquery statement are input into the first slot model, and the first slot model can output the slot values ​​of the multiple slots corresponding to the data acquisition subtask. Further, the slot values ​​of the multiple slots corresponding to the data acquisition subtask output by the first slot model are input into the entity disambiguation model, and the entity disambiguation model is used to align each slot value with the description in the database, and output that each slot value is the table name, column name, or value under the column name in the database. Further, the data acquisition module generates an SQL statement according to the output of the entity disambiguation model, and queries the database according to the SQL statement to obtain the target data to be obtained by the data acquisition subtask from the database. Among them, the slot values ​​of the multiple slots corresponding to the data acquisition subtask output by the first slot model are slots. The entity disambiguation model outputs a domain specific language (Domain Specific Language, DSL), which includes indicators, dimensions, enumeration values ​​and query methods, and DSL as a language describes that each slot value is a table name, column name, or value under a column name in the database.

[0132] For the data processing subtask, the second sub-query statement corresponding to the data processing subtask, the DSL output by the entity disambiguation model, and the target data acquired by the data acquisition module from the database are input into the second slot model. The second slot model can identify the type of data processing calculation that the user wants to perform (such as data merging, addition, subtraction, multiplication, division, filtering, sorting / aggregation after merging, calculation of average value, year-on-year and other basic operations), and add content related to data processing on the basis of the DSL output by the entity disambiguation model to output the data processing DSL.

[0133] For the data visualization subtask, the third subquery statement corresponding to the data visualization subtask and the target data are input into the third slot model. The third slot model can identify which chart type the user wants to display the target data in. If the target data does not support the display of the chart type required by the user, or the system does not support the chart type required by the user, the third slot model can output an exception type, which is used to indicate which exception causes the third slot model to be unable to output the visualized chart type, for example, the target data does not support the display of the chart type required by the user, or the system does not support the chart type required by the user. If there is no abnormal situation, the third slot model can output the visualized chart type.

[0134] In the embodiments of the present disclosure, it is not limited to the intention recognition model and the third slot model generating errors as described above. Figure 6 Each model or module shown may generate errors. When any model or module generates an error, the exception type and error information will be passed to the comprehensive response model. The comprehensive response model can generate response information and display the response information to the user.

[0135] The disclosed embodiment provides a systematic solution for implementing ChatBI based on large model capabilities. By introducing complex task decomposition, complex user questions are decomposed into a combination of multiple simple queries and basic operations. The difficulty of data query tasks is reduced, thereby improving the accuracy of the entire process from user input of questions to system answers, so that the solution provided by the disclosed embodiment can achieve higher accuracy than the existing technology on the business evaluation set.

[0136] Figure 7 Schematic diagram of the structure of a data query device in an embodiment of the present disclosure. The device provided in the embodiment of the present disclosure can be configured on a server or a server cluster. Figure 7 As shown, the data query device 70 specifically includes:

[0137] A first acquisition module 71, used to acquire a target query request;

[0138] A generating module 72, configured to generate a task decomposition step corresponding to the target query request according to the target query request and the knowledge data corresponding to the target query request, wherein the task decomposition step includes a data acquisition subtask;

[0139] A second acquisition module 73 is used to acquire a slot value corresponding to each slot from the first sub-query statement corresponding to the data acquisition subtask according to the multiple slots corresponding to the data acquisition subtask;

[0140] A determination module 74, used to determine the level of each slot value in the database organization structure;

[0141] The third acquisition module 75 is used to acquire target data from the database according to the level of each slot value in the database organizational structure.

[0142] Optionally, when the first acquisition module 71 acquires the target query request, it is specifically used to: complete the current query request according to the historical conversation information to obtain the target query request.

[0143] Optionally, the first acquisition module 71 completes the current query request according to the historical conversation information, and when the target query request is obtained, it is specifically used to: input the current query request, the knowledge data corresponding to the current query request, the historical conversation information, and the knowledge data corresponding to the historical conversation information into a context integration model, and the context integration model is used to complete the current query request and output the target query request.

[0144] Optionally, when the generation module 72 generates the task decomposition steps corresponding to the target query request based on the target query request and the knowledge data corresponding to the target query request, it is specifically used to: perform intent recognition on the target query request to obtain an intent recognition result; if the intent recognition result is data processing, then generate the task decomposition steps corresponding to the target query request based on the target query request and the knowledge data corresponding to the target query request.

[0145] Optionally, the task decomposition steps are described in an intermediate language between natural language and structured query language; when the generation module 72 generates the task decomposition steps corresponding to the target query request based on the target query request and the knowledge data corresponding to the target query request, it is specifically used to: input the target query request, the knowledge data corresponding to the target query request, and the data processing capability supported by the intermediate language into a task decomposition model, and the task decomposition model is used to output the task decomposition steps corresponding to the target query request.

[0146] Optionally, when the determination module 74 determines the level of each slot value in the database organizational structure, it is specifically used to: if the slot value is different from the description in the database, correct the slot value to the description in the database, and determine the level of the corrected slot value in the database organizational structure.

[0147] Optionally, when the second acquisition module 73 obtains the slot value corresponding to each slot from the first sub-query statement corresponding to the number acquisition subtask based on the multiple slots corresponding to the number acquisition subtask, it is specifically used to: input the first sub-query statement corresponding to the number acquisition subtask and the knowledge data corresponding to the first sub-query statement into a first slot model, and the first slot model is used to output the slot values ​​of the multiple slots corresponding to the number acquisition subtask.

[0148] Optionally, when the determination module 74 determines the level of each slot value in the database organizational structure, it is specifically used to: input the slot values ​​of multiple slots corresponding to the data acquisition subtask into an entity disambiguation model, the entity disambiguation model is used to align each slot value with the description in the database, and output the level of each slot value in the database organizational structure.

[0149] Optionally, when the third acquisition module 75 acquires the target data from the database according to the level of each slot value in the database organizational structure, it is specifically used to: generate a structured query language statement according to the level of each slot value in the database organizational structure; and acquire the target data from the database according to the structured query language statement.

[0150] Optionally, the task decomposition step also includes a data processing subtask; the data query device 70 also includes: an input module 76, used to input a second sub-query statement corresponding to the data processing subtask, the level of each slot value in the database organizational structure, and the target data into a second slot model, and the second slot model is used to output operations for the level.

[0151] Optionally, the task decomposition step also includes a data visualization subtask; the input module 76 is also used to: input a third sub-query statement corresponding to the data visualization subtask and the target data into a third slot model, and the third slot model is used to output a visualization chart type.

[0152] The device provided in the embodiment of the present disclosure can execute the method steps provided in the method embodiment of the present disclosure, and the beneficial effects thereof are not described in detail here.

[0153] Figure 8 Schematic diagram of the structure of an electronic device in the embodiment of the present disclosure. Figure 8 , which shows a schematic diagram of the structure of an electronic device 800 suitable for implementing the embodiment of the present disclosure. The electronic device 800 in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), wearable electronic devices, etc., and fixed terminals such as digital TVs, desktop computers, smart home devices, etc. Figure 8 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0154] like Figure 8 As shown, the electronic device 800 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes to implement the method of the embodiment described in the present disclosure according to the program stored in the read-only memory (ROM) 802 or the program loaded from the storage device 808 to the random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 are also stored. The processing device 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0155] Typically, the following devices may be connected to the I / O interface 805: input devices 806 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 808 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 809. The communication device 809 may allow the electronic device 800 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 8 The electronic device 800 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0156] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart, thereby implementing the method as described above. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 809, or installed from a storage device 808, or installed from a ROM 802. When the computer program is executed by the processing device 801, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0157] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0158] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0159] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0160] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:

[0161] Get the target query request;

[0162] According to the target query request and the knowledge data corresponding to the target query request, a task decomposition step corresponding to the target query request is generated, wherein the task decomposition step includes a data acquisition subtask;

[0163] According to the multiple slots corresponding to the data acquisition subtask, a slot value corresponding to each slot is obtained from the first sub-query statement corresponding to the data acquisition subtask;

[0164] Determine the level of each slot value in the database organization structure;

[0165] According to the level of each slot value in the database organizational structure, target data is obtained from the database.

[0166] Optionally, when the above one or more programs are executed by the electronic device, the electronic device may also execute other steps described in the above embodiments.

[0167] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0168] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0169] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.

[0170] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.

[0171] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0172] The present disclosure provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, any method provided in the present disclosure is implemented.

[0173] The embodiments of the present disclosure further provide a computer program product, which includes a computer program or instructions. When the computer program or instructions are executed by a processor, the method described above is implemented.

[0174] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0175] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0176] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.< / tool> < / tool> < / line> < / line> < / qpl> < / query> < / tool> < / tool> < / integer> < / line> < / line> < / qpl>

Claims

1. A data query method, characterized in that: The method comprises: Get the target query request; According to the target query request and the knowledge data corresponding to the target query request, a task decomposition step corresponding to the target query request is generated, wherein the task decomposition step includes a data acquisition subtask; According to the multiple slots corresponding to the data acquisition subtask, a slot value corresponding to each slot is obtained from the first sub-query statement corresponding to the data acquisition subtask; Determine the level of each slot value in the database organization structure; According to the level of each slot value in the database organizational structure, target data is acquired from the database.

2. The method according to claim 1, characterized in that The task decomposition step is described using an intermediate language between natural language and structured query language; According to the target query request and the knowledge data corresponding to the target query request, a task decomposition step corresponding to the target query request is generated, including: The target query request, the knowledge data corresponding to the target query request, and the data processing capability supported by the intermediate language are input into a task decomposition model, and the task decomposition model is used to output the task decomposition steps corresponding to the target query request.

3. The method according to claim 1, characterized in that According to the multiple slots corresponding to the data acquisition subtask, obtaining a slot value corresponding to each slot from a first subquery statement corresponding to the data acquisition subtask includes: The first sub-query statement corresponding to the data acquisition sub-task and the knowledge data corresponding to the first sub-query statement are input into a first slot model, and the first slot model is used to output slot values ​​of multiple slots corresponding to the data acquisition sub-task.

4. The method according to claim 3, characterized in that Determine the level at which each slot value resides in the database organizational structure, including: The slot values ​​of multiple slots corresponding to the data acquisition subtask are input into the entity disambiguation model, and the entity disambiguation model is used to align each slot value with the description in the database, and output the level of each slot value in the database organizational structure.

5. The method according to claim 1, characterized in that: According to the level of each slot value in the database organization structure, target data is obtained from the database, including: Generate a structured query language statement according to the level of each slot value in the database organization structure; The target data is acquired from the database according to the structured query language statement.

6. The method according to claim 1, characterized in that The task decomposition step also includes a data processing subtask; After acquiring the target data from the database, the method further includes: The second sub-query statement corresponding to the data processing sub-task, the level of each slot value in the database organizational structure, and the target data are input into a second slot model, and the second slot model is used to output operations for the level.

7. The method according to claim 1, characterized in that The task decomposition step also includes a data visualization subtask; After acquiring the target data from the database, the method further includes: The third sub-query statement corresponding to the data visualization sub-task and the target data are input into a third slot model, and the third slot model is used to output a visualized chart type.

8. An electronic device, characterized in that: The electronic device comprises: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

10. A computer program product, comprising computer program instructions, wherein when the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.