Data table query method and device, readable medium, electronic equipment and program product
Data table recall and filter through natural language input content, and use large language models to determine the highest matching data table, which solves the problem that users need to accurately enter data fields in the existing technology, and realizes flexible and highly accurate data table query.
Patent Information
- Application Number
- CN202510128586.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-27
- Publication Date
- 2025-04-29
AI Technical Summary
The existing data table query method requires users to accurately enter data fields, which cannot meet users' flexible and changeable data table query needs. The data characteristics of different business scenarios are different, making it difficult to ensure the accuracy of data table query.
By obtaining the target content input by the user's natural language, keyword extraction is performed, multiple data tables are recalled, and prompt words are constructed based on the meta information and target content of the data table through a large language model, thereby determining the data table with the highest matching degree and displaying the corresponding data table information to the user.
It realizes data table recall based on user input content in natural language form, meets users' flexible and changeable data table query needs, and improves the freedom and accuracy of data table query.
Smart Images

Figure CN119903075A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the fields of large language models, large models, intelligent agents and artificial intelligence technology, and in particular, to a data table query method, device, readable medium, electronic device and program product. Background Art
[0002] In the data table query platform, data table query is mainly performed by field retrieval. For example, a user enters the data field to be queried in the data table query platform, and then searches to obtain a data table including the data field, and then normalizes the data table to return a data table with a higher score. This method requires the user to enter accurate data fields, and cannot meet the user's flexible and changeable data table query needs. Summary of the invention
[0003] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0004] In a first aspect, the present disclosure provides a data table query method, the data table query method comprising: Obtain target content input by the user in natural language; Perform keyword extraction on the target content to obtain target keywords, and perform data table recall based on the target keywords to obtain multiple first data tables; constructing a prompt word according to the meta information of each first data table and the target content, and determining a first preset number of second data tables from the multiple first data tables according to the prompt word through a first large language model, wherein the prompt word is used to instruct the first large language model to determine the first preset number of second data tables having the highest matching degree with the target content from the multiple first data tables; The information of the second data table is displayed to the user.
[0005] In a second aspect, the present disclosure provides a data table query device, the data table query device comprising: An acquisition module, used to acquire target content input by a user in natural language; A recall module, configured to extract keywords from the target content to obtain target keywords, and to recall data tables based on the target keywords to obtain a plurality of first data tables; a determination module, configured to construct a prompt word according to the meta information of each first data table and the target content, and determine a first preset number of second data tables from the multiple first data tables according to the prompt word through a first large language model, wherein the prompt word is used to instruct the first large language model to determine the first preset number of second data tables having the highest matching degree with the target content from the multiple first data tables; A display module is used to display the information of the second data table to the user.
[0006] In a third aspect, the present disclosure provides a computer-readable medium having a computer program stored thereon, which implements the steps of the method described in the first aspect when the program is executed by a processing device.
[0007] In a fourth aspect, the present disclosure provides an electronic device, including: a storage device having a computer program stored thereon; A processing device is used to execute the computer program in the storage device to implement the steps of the method in the first aspect.
[0008] In a fifth aspect, the present disclosure provides a computer program product, comprising a computer program, which implements the steps of the method described in the first aspect when executed by a processor.
[0009] Through the above technical solution, the target content input by the user in natural language can be keyword extracted to obtain the target keyword, and then multiple first data tables can be recalled based on the target keyword, and the second data table can be determined from the multiple first data tables by the first large language model according to the prompt words constructed based on the meta information of each first data table and the target content, and finally the information of the second data table can be displayed to the user. With this method, data tables can be recalled based on the user input content in natural language form, thereby meeting the user's flexible and changeable data table query needs, improving the degree of freedom of data table query, and further screening out the data table with the highest matching degree from the recalled data table through the large language model, which can improve the accuracy of data table query.
[0010] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] 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 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. In the drawings: Figure 1 is a flowchart of a data table query method according to an exemplary embodiment of the present disclosure; Figure 2 is a schematic diagram of a dialog interaction page according to an exemplary embodiment of the present disclosure; Figure 3 is a process schematic diagram showing a data table query method according to an exemplary embodiment of the present disclosure; Figure 4 is a schematic diagram of a process of data table recall and model screening according to an exemplary embodiment of the present disclosure; Figure 5 is a structural block diagram of a data table query device according to an exemplary embodiment of the present disclosure; Figure 6 It is a schematic structural diagram of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0012] 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.
[0013] 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.
[0014] 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.
[0015] 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.
[0016] 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".
[0017] 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.
[0018] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0019] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0020] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0021] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0022] At the same time, it is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0023] In the related art, data table query can be performed by combining field search with normalized sorting. This method requires users to input accurate data fields and cannot meet users' flexible and changeable data table query needs. In addition, the data characteristics of different business scenarios are different, and the accuracy of the normalized score of the data table cannot be guaranteed, so the accuracy of the data table query cannot be guaranteed.
[0024] In view of this, the present disclosure provides a data table query method, device, readable medium, electronic device and program product to solve the above technical problems.
[0025] The embodiments of the present disclosure are further explained below with reference to the accompanying drawings.
[0026] Figure 1 is a flowchart of a data table query method according to an exemplary embodiment of the present disclosure, referring to Figure 1 , the data table query method may include the following steps: S101: Acquire target content input by a user in natural language.
[0027] For example, you can access the intelligent dialogue robot on the data table query platform, and trigger the intelligent dialogue robot to display Figure 2 The dialog interaction page shown can be specifically set according to the actual business scenario, and the present disclosure does not limit this. Furthermore, the user can perform natural language input on the dialog interaction page, which can be text input or voice input, and the present disclosure does not limit this.
[0028] S102: extracting keywords from the target content to obtain target keywords, and recalling data tables based on the target keywords to obtain a plurality of first data tables.
[0029] For example, keyword extraction can be performed using a large language model or other forms of machine learning models, which can be achieved specifically by performing targeted training on the model, and the present disclosure does not limit this.
[0030] S103: Construct prompt words according to the meta-information of each first data table and the target content, and determine a first preset number of second data tables from the multiple first data tables according to the prompt words through the first large language model, where the prompt words are used to instruct the first large language model to determine a first preset number of second data tables with the highest matching degree with the target content from the multiple first data tables.
[0031] For example, multiple data tables can be recalled through the target keyword, and then further screened through the first language model to obtain a preset number of data tables with the highest matching degree with the target content. The first preset number can be set according to demand, and the present disclosure does not impose any restrictions on this.
[0032] S104: Displaying information of the second data table to the user.
[0033] For example, Figure 2 As shown, the data table name and other information of the data table can be displayed on the dialogue interaction page, and a jump control can be provided for the user to view the data table details. Of course, the data table can also be displayed directly on the dialogue interaction page. The specific settings can be based on the needs, and this disclosure does not limit this.
[0034] By adopting the above method, data tables can be recalled based on user input content in natural language form, thereby meeting users' flexible and changeable data table query needs, improving the freedom of data table query, and further screening out the data tables with the highest matching degree from the recalled data tables through a large language model, thereby improving the accuracy of data table query.
[0035] In a possible manner, a data table is recalled based on a target keyword to obtain multiple first data tables, including: performing content recognition on the target content through a third language model, and when a result of the content recognition represents that the target content is used to query the data table, the data table is recalled based on the target keyword to obtain multiple first data tables.
[0036] For example, Figure 3 As shown, content recognition can be performed on the user input content based on the large language model, and data table recall can be performed when the result of content recognition represents that the input content is used to query the data table. The large language model can perform content recognition on the user input content to determine the user needs according to the result of content recognition and then execute different workflows, such as querying data tables, business consultation, etc., which can be achieved by conducting targeted training on the model, and the present disclosure does not limit this.
[0037] In a possible manner, the method further includes: extracting information from the target content through a second language model to obtain a data range label and / or data source type of the target content. Recalling a data table based on a target keyword to obtain multiple first data tables includes: determining multiple third data tables from a second database based on the data range label and / or data source type, the second database being used to store data tables for user query, the multiple third data tables including at least one of a data table in the second database marked with a data range label, a data table in the third database corresponding to the data source type in the second database, and a data table in the third database marked with a data range label; recalling a data table in multiple third data tables based on the target keyword to obtain multiple first data tables.
[0038] For example, Figure 3 As shown, information extraction can be performed through a large language model, including extracting keywords, data range labels, data source types, etc., which can be achieved by targeted training of the model, and the present disclosure does not limit this. The large language model for information extraction and the large language model for content recognition can be the same model or different models, and the present disclosure does not limit this.
[0039] It should be noted that different data range labels can be pre-labeled for data tables. For example, if Table 1 is a data table for xx, the label "xx" is labeled. The specific data range can be determined according to the needs, and the present disclosure does not limit this. The data source type is used to characterize the source and format of data storage or generation, such as ClickHouse table, Hive table, etc., and the present disclosure does not limit this.
[0040] For example, when the large language model extracts a data range label from the input content, a data table marked with the data range label is screened out from multiple databases, and a data table recall is performed in the screened data table. Since multiple different databases may be involved when performing a data table query, when the large language model extracts a data source type from the input content, a database corresponding to the data source type is screened out from multiple databases, and a data table recall is performed in the screened database. Alternatively, when the large language model extracts a data range label and a data source type from the input content, a data table marked with the data range label is screened out from a database corresponding to the data source type, and a data table recall is performed in the screened data table. The specific details can be determined according to the actual scenario, and the present disclosure does not limit this. The scope of data table recall can be narrowed by using data range labels and data source types, further improving the efficiency and accuracy of data table recall.
[0041] In a possible manner, data table recall based on a target keyword to obtain multiple first data tables may include: based on the target keyword, recalling from a first database data tables whose data fields, enumeration values of data fields, and at least one of data table names match the target keyword to obtain multiple first data tables, wherein the first database is used to store the data tables for user query.
[0042] For example, Figure 3 As shown, after keyword extraction, a table search request can be sent to the table search plug-in for the following Figure 4 Of course, when the data range label and / or data source type are extracted, the scope of the data table recall can be narrowed by the data range label and / or data source type, and then the following steps can be performed: Figure 4 The keyword-based data table recall process shown can be determined according to actual conditions, and the present disclosure does not limit this.
[0043] For example, the target keyword can be matched with the data field of the data table in the database, the enumeration value of the data field, and the data table name, and the corresponding data table can be recalled according to the matching result. In addition, the target keyword can also be matched with other data table information such as the asset description of the data table, and the data table whose asset description matches the target keyword can be recalled. The specific details can be determined according to the needs, and the present disclosure does not limit this. In this way, the data table can be recalled in multiple ways from multiple dimensions, which improves the flexibility of data table recall.
[0044] In a possible manner, based on a target keyword, data tables whose data fields, enumeration values of data fields, and data table names at least one of which matches the target keyword are recalled from a first database to obtain multiple first data tables, including: semantically matching the semantic vector corresponding to the target keyword with the semantic vector corresponding to the data field of each data table in the first database to obtain the first semantic similarity corresponding to each data table, and determining a second preset number of data tables with the highest first semantic similarity from each data table; semantically matching the semantic vector corresponding to the target keyword with the semantic vector corresponding to the enumeration value of the data field of each data table in the first database to obtain the second semantic similarity corresponding to each data table, and determining a third preset number of data tables with the highest semantic similarity from each data table; textually matching the target keyword with the data table name of each data table in the first database to obtain the textual similarity corresponding to each data table, and determining a fourth preset number of data tables with the highest textual similarity from each data table.
[0045] For example, since different data table information has different characteristics, different recall methods can be used for different data table information to improve the accuracy of data table recall. Figure 4 As shown, semantic recall can be performed for data fields and enumeration values of data fields, for example, the semantic similarity between the semantic vectors of data fields in each data table and the semantic vectors of target keywords can be determined, and the semantic similarity can be represented by a normalized score, for example, 0 represents the least similar, and 1 represents the most similar. If a data table hits multiple data fields, multiple normalized scores can also be accumulated to obtain a final score, and finally the data tables with the highest scores are selected. The specific settings can be based on the needs, and the present disclosure does not limit this. The matching process based on the enumeration values of the data fields is similar, and the present disclosure will not repeat it here.
[0046] For example, text recall can be performed on data table names, such as determining the text similarity between the data table names in each data table and the target keyword. The text similarity can be represented by a normalized score, for example, 0 represents the least similar, 1 represents the most similar, and finally the data tables with the highest scores are selected. The specific settings can be based on needs, and the present disclosure does not impose any restrictions on this.
[0047] Of course, in other possible implementation methods, other matching methods can be used for data fields, enumeration values of data fields, and data table names, such as semantic matching. The specific settings can be made according to requirements, and the present disclosure does not limit this.
[0048] It should be noted that the first preset number, the second preset number, the third preset number and the fourth preset number can be set according to the requirements, and the present disclosure does not limit this. Figure 4As shown, after multi-way recall, data tables can also be deduplicated, and then after sorting the deduplicated data tables, model selection is performed on a preset number of data tables with the highest scores, further narrowing the range of data tables selected by the model and improving the efficiency of data table query.
[0049] In a possible manner, the data table is recalled based on the target keyword to obtain multiple first data tables, including: determining a synonymous keyword with similar semantics to the target keyword; and the data table is recalled based on the target keyword and the synonymous keyword to obtain multiple first data tables.
[0050] For example, Figure 3 As shown, the synonyms corresponding to the target keyword can also be determined to obtain the synonymous keywords, so as to recall the data table based on the target keyword and the semantic keyword. The recall process based on the synonymous keywords can be similar to the following. Figure 4 The process of recalling the target keyword shown is similar, and the disclosure will not repeat it here. Based on the synonymous keywords, the recall range of the data table can be expanded, the format freedom of the user input content can be improved, and it is suitable for different business scenarios.
[0051] In a possible manner, the method further includes: obtaining recall configuration information, the recall configuration information being used to indicate that the data table is recalled according to at least one of a data field, an enumeration value of the data field, and a data table name; and determining a data table recall strategy according to the recall configuration information. Recalling the data table based on the target keyword to obtain multiple first data tables includes: recalling the data table according to the data table recall strategy and the target keyword to obtain multiple first data tables.
[0052] For example, the embodiments of the present disclosure can perform multi-way recall of data tables from multiple dimensions. Based on this, the recall configuration information can be pre-configured so that users can flexibly select one or more recall strategies according to their needs. For example, data recall can be performed based on data fields, data recall can be performed based on data table names, etc. The specific settings can be made according to the needs, and the present disclosure does not limit this. The specific recall process of different recall strategies can be referred to Figure 4 The corresponding embodiments are described in detail and will not be described in detail in this disclosure.
[0053] In a possible manner, the meta-information of the first data table includes a data table name, an asset description, and at least one of a target data field of the first data table, where the target data field is a data field in the first data table that matches a target keyword; a first preset number of second data tables are determined from multiple first data tables according to a prompt word through a first large language model, including: for each first data table, determining a matching degree between the target content in the prompt word and the data table name, the asset description, and at least one of the target data fields of the first data table through the first large language model; and determining a first preset number of second data tables with the highest matching degree with the target content from multiple first data tables according to the matching degree corresponding to each first data table.
[0054] For example, Figure 4 As shown, after the data tables are recalled, the recalled data tables can be further screened based on the large language model. For example, prompt words can be constructed based on the meta information of each data table and the user input content, and the prompt words can be input into the large language model so that the large language model can determine the matching degree between each data table and the user input content, for example, the matching degree between the target content and one or more of the data table name, asset description, and hit field can be determined, and a preset number of data tables with the highest matching degree are used as the final queried data tables.
[0055] Among them, the matching degree can be represented by features such as semantic similarity and text similarity, which can be achieved by targeted training of the model, and the present disclosure does not impose any restrictions on this.
[0056] In a possible manner, the method also includes: generating a recommendation description of the second data table according to the meta-information and target content of the second data table through the first large language model, the recommendation description including a data field in the second data table that matches the target keyword, the description content of the second data table, and at least one of the reasons for recommendation; and displaying the recommendation description of the second data table to the user.
[0057] For example, the meta-information and target content of the data table selected by the large language model can be re-input into the large language model, or the corresponding recommendation instructions can be directly generated together during the screening process of the large language model. This can be achieved by inputting different prompt words and conducting targeted training on the model. For example, if the prompt word "Please filter out the top N data tables that match the input content from the following data tables" is input, the large language model only needs to output the information of the N data tables. If the prompt word "Please filter out the top N data tables that match the input content from the following data tables, and give corresponding recommendation instructions" is input, the large language model needs to output the information of the N data tables and the corresponding recommendation instructions.
[0058] For example, Figure 2As shown, the recommendation description may include the data field of the data table hit by the user input content, the description content used to describe the data table, and the recommended reason for the model to select the data table, etc., which can be set according to needs, and the present disclosure does not limit this. In this way, the recall logic of the model recall data table can be intuitively displayed to the user, improving the readability of the data table recall.
[0059] By adopting the above method, users do not need to accurately select or enter the data fields they want to query, and can query the desired data table through natural language dialogue. The content format of the user input is not restricted, and the method can be applied to different business scenarios to meet the user's flexible and changeable data table query needs, improve the freedom of data table query, and further screen out the data table with the highest matching degree from the recalled data table through the large language model, thereby improving the accuracy of data table query.
[0060] Based on the same concept, the present disclosure provides a data table query device, such as Figure 5 As shown, the data table query device 500 includes: An acquisition module 501 is used to acquire target content input by a user in a natural language; A recall module 502 is used to extract keywords from the target content to obtain target keywords, and to recall data tables based on the target keywords to obtain multiple first data tables; A determination module 503 is configured to construct a prompt word according to the meta information of each first data table and the target content, and determine a first preset number of second data tables from the multiple first data tables according to the prompt word through a first large language model, wherein the prompt word is used to instruct the first large language model to determine the first preset number of second data tables having the highest matching degree with the target content from the multiple first data tables; The display module 504 is configured to display the information of the second data table to the user.
[0061] Optionally, the recall module 502 is used to: Based on the target keyword, data tables whose data fields, enumerated values of data fields and at least one data table information in data table names match the target keyword are recalled from a first database to obtain the multiple first data tables, wherein the first database is used to store data tables for user query.
[0062] Optionally, the recall module 502 is used to: semantically matching the semantic vector corresponding to the target keyword with the semantic vector corresponding to the data field of each data table in the first database to obtain a first semantic similarity corresponding to each data table, and determining a second preset number of data tables having the highest first semantic similarity from each data table; semantically matching the semantic vector corresponding to the target keyword with the semantic vector corresponding to the enumeration value of the data field of each data table in the first database to obtain a second semantic similarity corresponding to each data table, and determining a third preset number of data tables with the highest semantic similarity from each data table; The target keyword is text-matched with the data table names of each data table in the first database to obtain text similarities corresponding to each data table, and a fourth preset number of data tables having the highest text similarities are determined from the data tables.
[0063] Optionally, the data table query device 500 further includes a configuration module, and the configuration module is used to: Acquire recall configuration information, where the recall configuration information is used to represent the data table recall according to at least one of a data field, an enumeration value of a data field, and a data table name; Determine a data table recall strategy according to the recall configuration information; The recall module 502 is used to: Data tables are recalled according to the data table recall strategy and the target keyword to obtain the multiple first data tables.
[0064] Optionally, the data table query device 500 further includes an extraction module, and the extraction module is used to: Extracting information from the target content using a second language model to obtain a data range label and / or a data source type of the target content; The recall module 502 is used to: Based on the data range label and / or the data source type, a plurality of third data tables are determined from a second database, the second database being used to store data tables for user query, the plurality of third data tables comprising at least one of a data table in the second database labeled with the data range label, a data table in the third database corresponding to the data source type in the second database, and a data table in the third database labeled with the data range label; Data tables are recalled from the plurality of third data tables based on the target keyword to obtain the plurality of first data tables.
[0065] Optionally, the recall module 502 is used to: Determine a synonymous keyword that is semantically similar to the target keyword; Data tables are recalled based on the target keyword and the synonymous keywords to obtain the multiple first data tables.
[0066] Optionally, the recall module 502 is used to: The target content is identified by using a third language model. When a result of the content identification indicates that the target content is used to query a data table, a data table is recalled based on the target keyword to obtain the multiple first data tables.
[0067] Optionally, the determining module 503 is used to: For each first data table, determining, by using the first large language model, a matching degree between the target content in the prompt word and at least one of a data table name, an asset description, and a target data field of the first data table; According to the matching degree corresponding to each first data table, the first preset number of second data tables having the highest matching degree with the target content are determined from the multiple first data tables.
[0068] Optionally, the data table query device 500 further includes a generation module, and the generation module is used to: generating, by the first language model, a recommendation description of the second data table according to the meta information of the second data table and the target content, the recommendation description including at least one of a data field in the second data table that matches the target keyword, a description content of the second data table, and a recommendation reason; A recommended description of the second data table is displayed to the user.
[0069] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0070] Based on the same concept, an embodiment of the present disclosure further provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processing device, the steps of the above-mentioned data table query method are implemented.
[0071] Based on the same concept, the present disclosure also provides an electronic device, which may include: a storage device having a computer program stored thereon; A processing device is used to execute the computer program in the storage device to implement the steps of the above-mentioned data table query method.
[0072] Based on the same concept, an embodiment of the present disclosure further provides a computer program product, including a computer program, which implements the steps of the above-mentioned data table query method when executed by a processor.
[0073] Reference below Figure 6, which shows a schematic diagram of the structure of an electronic device 600 suitable for implementing the embodiment of the present disclosure. The terminal device 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), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 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.
[0074] like Figure 6 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0075] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 600 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.
[0076] 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 contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0077] It should be noted that the computer-readable medium mentioned above in the present disclosure 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 can 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, which carries a computer-readable program code. 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. Computer readable signal media may also be any computer readable medium other than computer readable storage media, 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 appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0078] In some embodiments, any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol) can be used for communication, and can 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.
[0079] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0080] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: obtains target content input by a user in a natural language; performs keyword extraction on the target content to obtain target keywords, and recalls data tables based on the target keywords to obtain multiple first data tables; constructs prompt words according to the meta-information of each first data table and the target content, and determines a first preset number of second data tables from the multiple first data tables according to the prompt words through a first large language model, wherein the prompt words are used to instruct the first large language model to determine the first preset number of second data tables with the highest matching degree with the target content from the multiple first data tables; and displays information of the second data tables to the user.
[0081] 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 the case of 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).
[0082] 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.
[0083] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a module does not, in some cases, limit the module itself.
[0084] 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 chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0085] 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 device, 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.
[0086] 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.
[0087] 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.
[0088] Although the subject matter has been described in language specific to structural features and / or method logic 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. Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Claims
1. A data table query method, characterized in that: The data table query method comprises: Obtain target content input by the user in natural language; Perform keyword extraction on the target content to obtain target keywords, and perform data table recall based on the target keywords to obtain multiple first data tables; constructing a prompt word according to the meta information of each first data table and the target content, and determining a first preset number of second data tables from the multiple first data tables according to the prompt word through a first large language model, wherein the prompt word is used to instruct the first large language model to determine the first preset number of second data tables having the highest matching degree with the target content from the multiple first data tables; The information of the second data table is displayed to the user.
2. The data table query method according to claim 1, characterized in that: The data table is recalled based on the target keyword to obtain multiple first data tables, including: Based on the target keyword, data tables whose data fields, enumeration values of data fields and data table names at least one of which matches the target keyword are recalled from a first database to obtain the multiple first data tables, wherein the first database is used to store data tables for user query.
3. The data table query method according to claim 2, characterized in that: The step of retrieving, based on the target keyword, from the first database data tables whose at least one of a data field, an enumeration value of a data field, and a data table name matches the target keyword to obtain the plurality of first data tables comprises: semantically matching the semantic vector corresponding to the target keyword with the semantic vector corresponding to the data field of each data table in the first database to obtain a first semantic similarity corresponding to each data table, and determining a second preset number of data tables having the highest first semantic similarity from each data table; semantically matching the semantic vector corresponding to the target keyword with the semantic vector corresponding to the enumeration value of the data field of each data table in the first database to obtain a second semantic similarity corresponding to each data table, and determining a third preset number of data tables with the highest semantic similarity from each data table; The target keyword is text-matched with the data table names of each data table in the first database to obtain text similarities corresponding to each data table, and a fourth preset number of data tables having the highest text similarities are determined from the data tables.
4. The data table query method according to claim 1, characterized in that: The method further comprises: Acquire recall configuration information, where the recall configuration information is used to represent recall of a data table according to at least one of a data field, an enumeration value of a data field, and a data table name; Determine a data table recall strategy according to the recall configuration information; The data table is recalled based on the target keyword to obtain multiple first data tables, including: Data tables are recalled according to the data table recall strategy and the target keyword to obtain the multiple first data tables.
5. The data table query method according to any one of claims 1 to 4, characterized in that: The method further comprises: Extracting information from the target content using a second language model to obtain a data range label and / or a data source type of the target content; The data table is recalled based on the target keyword to obtain multiple first data tables, including: Based on the data range label and / or the data source type, a plurality of third data tables are determined from a second database, the second database being used to store data tables for user query, the plurality of third data tables comprising at least one of a data table in the second database labeled with the data range label, a data table in the third database corresponding to the data source type in the second database, and a data table in the third database labeled with the data range label; Data tables are recalled from the plurality of third data tables based on the target keyword to obtain the plurality of first data tables.
6. The data table query method according to any one of claims 1 to 4, characterized in that: The data table is recalled based on the target keyword to obtain multiple first data tables, including: Determine a synonymous keyword that is semantically similar to the target keyword; Data tables are recalled based on the target keyword and the synonymous keywords to obtain the multiple first data tables.
7. The data table query method according to any one of claims 1 to 4, characterized in that: The data table is recalled based on the target keyword to obtain multiple first data tables, including: The target content is identified by using a third language model. When a result of the content identification indicates that the target content is used to query a data table, a data table is recalled based on the target keyword to obtain the multiple first data tables.
8. The data table query method according to any one of claims 1 to 4, characterized in that: The meta information of the first data table includes at least one of a data table name, an asset description, and a target data field of the first data table, wherein the target data field is a data field in the first data table that matches the target keyword; The determining a first preset number of second data tables from the plurality of first data tables according to the prompt word by using the first large language model includes: For each first data table, determining, by using the first large language model, a matching degree between the target content in the prompt word and at least one of a data table name, an asset description, and a target data field of the first data table; According to the matching degree corresponding to each first data table, the first preset number of second data tables having the highest matching degree with the target content are determined from the multiple first data tables.
9. The data table query method according to any one of claims 1 to 4, characterized in that: The method further comprises: generating, by the first language model, a recommendation description of the second data table according to the meta information of the second data table and the target content, the recommendation description including at least one of a data field in the second data table that matches the target keyword, a description content of the second data table, and a recommendation reason; A recommended description of the second data table is displayed to the user.
10. A data table query device, characterized in that: The data table query device comprises: An acquisition module, used to acquire target content input by a user in natural language; A recall module, configured to extract keywords from the target content to obtain target keywords, and to recall data tables based on the target keywords to obtain a plurality of first data tables; a determination module, configured to construct a prompt word according to the meta information of each first data table and the target content, and determine a first preset number of second data tables from the multiple first data tables according to the prompt word through a first large language model, wherein the prompt word is used to instruct the first large language model to determine the first preset number of second data tables having the highest matching degree with the target content from the multiple first data tables; A display module is used to display the information of the second data table to the user.
11. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processing device, the steps of the method according to any one of claims 1 to 9 are implemented.
12. An electronic device, characterized in that: include: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 9.
13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.
Citation Information
Cited By
Database table retrieval method and device, storage medium, product and electronic equipment
CN121166696A